Showing posts with label useful. Show all posts
Showing posts with label useful. Show all posts

Sunday, July 08, 2018

Why some HTML tags disappear in Wordpress?

Do you have Wordpress powered website, and HTML tags like <form></form>, <input />, <script></script> disappear when you are updating the existing post or page?

Congratulation! You also have found a bug in the security of Wordpress CMS...

Change the author of page/post to the current user or just re-login with a proper Wordpress account.


Friday, May 04, 2018

Online tests for Google Analytics and Tag Manager

I've spent a lot of time setting up and testing different actions using Google Global Site Tag.

Moreover there are at least 3 different versions of installation codes for Google Analytics plus Google Tag Manager.

So I've gathered all these codes in one website and added some testing tools there. For example, you can generate any event on the fly.

Installation Codes and On-line Tests for Google Analytics and Google Tag Manager.


Saturday, September 23, 2017

PIN stop working on Windows login. Cannot change or reset the PIN.

I was using PIN to unlock my Windows 10 computers for years. But one day my laptop requested Password instead of PIN. Moreover the PIN option disappeared from the Welcome screen completely :(

Finally, I've remembered my password, get logged and decided to set the PIN again.

But System Settings worked weird: "Add New PIN" button was available, but when I clicked it, the system asked for the PIN instead of Password! Moreover, there was no "Reset PIN" or "Forgot PIN" option :(

I've been Googling this bug for about 30 minutes but none of the solutions worked for me… Then I tried to remove the PIN settings manually and solve the problem :)

Here is a step by step instruction:

You need a file manager with Administrator access level and enabled view for "hidden files". You can use Windows Explorer but you have to add permissions for some folders manually.

Go to "[Windows]\ServiceProfiles\LocalService\AppData\Local\Microsoft\Ngc" folder:

Delete or rename "{xyz}" sub-folder.

Open "System Settings > Accounts > Sign-in Options", press "Add" button and create a new PIN code for your account.

After that the PIN will work on the Login screen. "Remove" button and "I forgot my PIN" options are also available:

Let me know if you have any issues with PIN on Windows login. Just write a comment to describe how and when the problem appeared. Thank you.


Tuesday, March 28, 2017

Tic Tac Toe game made with Unity3D

Few years ago I was trying to get a job as a game developer. My test task was to make the Tic Tac Toe game using Unity3D game engine.

I didn't get the job but the game worked and looked good. Moreover my C# source code of Tic Tac Toe game is simple and well commented.

So I decided to publish the Tic-Tac-Toe project on GitHub.

Hope the sources of this game project for Unity3D will be a useful tutorial for some game developer or other person who want to learn the programming. Enjoy :)


Sunday, May 01, 2016

PHP scripts inside HTML on webserver with FCGId

There are lots of articles how to enable PHP scripts inside .html files using AddType and/or AddHandler directives in the Apache web-server configuration file.

But if you have the hosting with PHP engine is running as FCGId module, all these tutorials will not work or will issued downloading of the binary file instead of opening the HTML content in the web-browser :(

Here is a workaround that works for me, just modify .conf file of your website in the following way:


DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory /home/xyz/public_html>
...
RemoveHandler .html
AddType application/x-httpd-php .html
AddHandler fcgid-script .html
FCGIWrapper /home/xyz/fcgi-bin/php7.2.fcgi .html
...
</Directory>

The "magic" comes in AddHandler + FCGIWrapper detectives. Enjoy :)

P.S. If you have HTTP and HTTPS websites, don't forget to configure both Apache .conf files!


Friday, January 29, 2016

No Sound from Speaker but Headphones Work?

Some notebooks manufactured by ASUS (maybe by other vendors too) have strange issue with sound output. When all required drivers are installed and everything is properly set, you can not hear any sound from the internal speakers. Only plugged headphones or external audio works...

I was trying different tricks. Even soldered new audio jack connector to the motherboard of my ASUS U36SD notebook. I've spent lots of time, but found the solution! It is not a hardware issue. It is software/driver glitch :)

So if you have the same issue with your notebook: no sound from speakers, but headphones works. Here is the solution:

  1. Restart computer.
  2. Open BIOS/Setup console, by pressing F1, F2, F10 or Del key depending on your notebook model.
  3. Choose "Load Default Settings" option at the beginning.
  4. Then search for "Ring on Boot" or "Boot Sound Volume" option(s) and TURN IT OFF or set the volume level to ZERO!
  5. Save BIOS/Setup settings and restart computer again.

Now you can hear sound from the internal speaker of your notebook, laptop or tablet :)

Option to disable to get sound on ASUS notebook

Let me know if this workaround helps you and please specify the model of your notebook in comments. Thank you.

BTW, do you know about my Auto Mute software utility to make computer silent by default? :)

Wednesday, October 14, 2015

Skype freezes and hangs your system?

The best solution is uninstall the Skype and never use it again!

But if you still need Skype application to contact your siblings and co-workers, here is a useful trick

Screenshot of Task Manager how to set low priority for Skype.exe process

Sunday, August 09, 2015

Wrap Headphones in the Right Way


Here is a lifehack to wrap headphones and earphones quickly, without any twisting:




Also you can use "devices" like this:





Friday, July 31, 2015

Touchpad Scrolling doesn't work on Windows 10?

If two or even single finger scrolling doesn't work after update to Windows 10 and your touchpad is manufactured by Synaptics company, download and install driver for touchpad version 16.2.x. Everything will work like a charm.

Synaptics driver for Touchpad that Scroll on Windows 10

Open this link Synaptic Touchpad Driver 16.2, supports scrolling on Windows 10, check "I agree" options on the bottom of page and press "Submit" button. The driver will be downloaded.



Wednesday, April 15, 2015

How to assign reserved IP to existing Virtual Machine in Microsoft Azure Cloud


I don't know why Microsoft cannot offer a single click tool to add a permanent static IP to any Azure resource. Moreover I don't understand why it is not possible to assign a reserved IP address to an existing Virtual Machine :(

The only way (as of April 2015) to assign a permanent public IP address (reserved IP) to Virtual Machine in Microsoft Azure Cloud is the following:

  1. Stop Virtual Machine
  2. Make captured image with a custom name ("image-of-virtual-machine" for example)
  3. Manually write out all Endpoints (insane!)
  4. Delete VM and associated Cloud Service
  5. Create Reserved IP using Azure PowerShell
  6. Create a new Virtual Machine from the saved disk image
  7. Set back all Endpoints manually (insane again!)

If you have finished deleting of Virtual Machine at step 4, start Microsoft Azure PowerShell. Creating of Reserved IP is easy, just a single command call:


New-AzureReservedIP -ReservedIPName "reserved-ip-address-for-your-vm" -Label "SomeTextHere" -Location "North Europe"

To verify that Reserved IP was successfully created, call:


Get-AzureReservedIP

We've got Reserved IP, so it's time to create a new "old" Virtual Machine.

First of all call this command in Microsoft Azure PowerShell:


Get-AzureSubscription

You'll get something like that:


SubscriptionId : 123456-e123-1234-a123-1234567890
SubscriptionName : BizSpark
Environment : AzureCloud
SupportedModes : AzureServiceManagement,AzureResourceManager
DefaultAccount : some@some.com
Accounts : { some@some.com }
IsDefault : True
IsCurrent : True
CurrentStorageAccountName :
TenantId : 00000000-0000-0000-0000-000000000000

If CurrentStorageAccountName is empty set it to the value you can find in Azure Management -> Storage.


Set-AzureSubscription -CurrentStorageAccountName "get_id_from_web_panel_something_like_portal23423ns43" -SubscriptionName "BizSpark"

Otherwise you've got strange errors on next steps, for example:


New-AzureVMConfig : Must specify MediaLocation or set a current storage account using Set-AzureSubscription.

Now we can create a new virtual machine from the saved image with reserved ip address. Lots of tutorials offer to call the following command (don't do it):


New-AzureVMConfig -Name "your-virtual-machine-name" -InstanceSize "Small" -ImageName "image-of-virtual-machine" | New-AzureVM -ServiceName "could-be-same-as-vm-name" -ReservedIPName "reserved-ip-address-for-your-vm" -Location "North Europe"

But in 99% you'll get error:


New-AzureVM : BadRequest: A ProvisioningConfigurationSet was not found in the ConfigurationSet collection of the virtual machine with name your-virtual-machine-name. When creating a virtual machine from an image, ProvisioningConfiguration Set must be specified.

So add Add-AzureProvisioningConfig section into the command (call this):


New-AzureVMConfig -Name "your-virtual-machine-name" -InstanceSize "Small" -ImageName "image-of-virtual-machine" | Add-AzureProvisioningConfig -Linux | New-AzureVM -ServiceName "could-be-same-as-vm-name" -ReservedIPName "reserved-ip-address-for-your-vm" -Location "North Europe"

BTW, don't set any LinuxUser/AdminUsername or Password if you are creating Virtual Machine from disk image, otherwise you've got an error:


New-AzureVM : BadRequest: No Configuration Set should be specified while using a VMImage with a specialized OS Disk Configuration.

Almost done, you'll get a new virtual machine with the permanent public IP running in a few minutes.

Don't forget to add all endpoints! I prefer to do that using web interface. Also update internal IP address for all services on the Virtual Machine. New VM has a different IP address, either public or internal one.

Hope that helps and there were no problems on the Azure side while you are following these instructions :)

Why is it so hard?!




Friday, February 13, 2015

Microsoft Remote Desktop on Mac OS X


Quick guide (in a single picture) how to properly setup remote desktop connection using Microsoft Remote Desktop software on Mac OS X:


How to setup Microsoft Remote Desktop on Apple computer under Mac OS X


Text variant:

  • Don't use old Remote Desktop Connection software Mac OS X version 10.10.x and higher! Use Microsoft Remote Desktop from App Store instead.
  • Don't add domain or PC name with back slash into username! Put just a login name, official instruction is wrong.
  • Specify the port number in the connection filed! Different RDC protocols uses different port numbers by default.


Wednesday, August 27, 2014

Need cool art for website or presentation?

Absolutely amazing online service with hundreds templates of different hardware devices (phone, tablets, laptops, etc.) where you can upload own picture of the screen to get the perfect art for website, presentation or brand-book.

This picture is created using Place.To:

P.S. Why I didn't do such service few years ago? :)


Monday, May 05, 2014

Bad Key Hash for Facebook Apps


When you are creating application for Facebook on Android platform, Developer Website requires the Key Hash for every development device.

This secret stroke is automatically generated by Eclipse or other dev studio in "debug.keystore" storage.

You can obtain Key Hash via command line:

keytool -exportcert -alias androiddebugkey -keystore debug.keystore | openssl sha1 -binary | openssl base64

or sample code:

...
   @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Temporary code to print out the key hash
        try {
            PackageInfo info = getPackageManager().getPackageInfo(
                    "com.Your.Application.Package.Name", PackageManager.GET_SIGNATURES);
            for (Signature signature : info.signatures) {
                MessageDigest md = MessageDigest.getInstance("SHA");
                md.update(signature.toByteArray());
                Log.d("KeyHash:", Base64.encodeToString(md.digest(), Base64.DEFAULT));
            }
        } catch (NameNotFoundException e) {
        } catch (NoSuchAlgorithmException e) {
        }
...

You have to add all you developer and release key hashes into Web panel of your Facebook Application. Everything looks simply enough.

But, if your hash key contains / (slash) or + (plus) symbol Facebook integration will not work! You'll get error message, something like that: "Key hash Fj2DQ/kUxqHuaTq1jy9iTejN2Uk= does not match any stored key hashes".

I've spent few hours to understand the problem and find a workaround :( Here is an easiest way:

  1. Delete "debug.keystore" file in your "[%USERNAME%]/.android" folder.
  2. Rebuild project to get new "debug.keystore" file with new key hash.
  3. If new hash contains any symbol (= at the end is OK :)) repeat again

Hope this tip helps other developers! Sometimes, development for Android and Facebook is a pain...


Thursday, March 20, 2014

How to detect Internet Explorer 10 and higher?

For a long time detecting of Internet Explorer browser was easy using Conditional Comments, something like:

<!--[if IE]>
 <script type="text/javascript">
  var isIE = true;
 </script>
<![endif]-->

Starting version 10, Internet Explorer doesn't support conditional comments feature :(

Here is the JavaScript code to detect IE of any version since 5 till 11:

var isIE = (function(){
    var undef,rv = -1; // Return value assumes failure.
    var ua = window.navigator.userAgent;
    var msie = ua.indexOf('MSIE ');
    var trident = ua.indexOf('Trident/');

    if (msie > 0) {
        // IE 10 or older => return version number
        rv = parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
    } else if (trident > 0) {
        // IE 11 (or newer) => return version number
        var rvNum = ua.indexOf('rv:');
        rv = parseInt(ua.substring(rvNum + 3, ua.indexOf('.', rvNum)), 10);
    }

    return ((rv > -1) ? rv : undef);
}());
 

Hope Internet Explorer 12 and higher will work the same way :)


Tuesday, November 19, 2013

Cannot format flash drive or delete partition from SD card? I will help you.


Sometimes Flash drives, storage sticks and cards become useless even if they are not physically damaged. Such drive is recognized by operating system, but the size is wrong (less than should be) and very often the user cannot even format the disk.

Yesterday I've got 2 such devices at once! I was trying to install Chrome OS on my netbook, so wrote the image of Chromium bootable drive to 4GB flash stick and 16GB SD card…

As I understand Google developers think (can they?) that having many partitions on disk is a cool true hackers way! They use 10 (Ten!) partitions on a small 4GB drive!!!

Partitions on Chrome/Chromium OS boot drive, how to delete them?

The biggest problem is that you cannot delete all these strange partitions and unallocated spaces using standard programs. Even Disk manager administrative tool will not help :( So here is a step by step instruction on how to clear unnecessary partitions on the disk and get flash drive or memory card back to normal life.

  • Press Win+R.
  • Type DiskPart and press OK or Enter.
  • Push Yes button in UAC warning window.

DiskPart.exe console should appear, next steps could damage your computer data, so be very careful!

  • list disk - shows the list of all disks in the system.
  • select disk X - where X is a number of disk you want to fix.
  • list disk - call this command again, to make sure you've selected the right disk! You'll see * mark near the selected disk.

Next steps will destroy all data on the disk! Do you want to continue?

  • clean - cleans the disk in 90% of cases.

If clean command fails, you have to delete each partition on the disk manually, by repeating the following 2-3 commands until all partitions are gone.

  • list partition - shows the list of all partitions on the disk.
  • select partition 1 - selects the currently first partition.
  • delete partition override - override parameter allows deleting a locked partition.

When the disk is cleaned, you should create a primary active partition, then format the drive and assign some letter to it. Follow these commands:

  • create partition primary - creates a partition for the whole disk.
  • select partition 1 - choose current partition to perform other operation.
  • active - makes partition active, so it could be a bootable one.
  • format quick fs=fat32 - formats the disk, FAT32 is a standard file system for Flash Drives and SD cards.
  • assign - sets some letter name for the logical drive.

That's all. Now you can close DiskPart.exe console, in a hacker style, by typing exit command or by clicking common x button on the right top corner of the Window :)

Hope this tutorial will help people to get disappeared megabytes back from memory cards and even fix some of "dead" flash drives.




Monday, September 02, 2013

Micro USB 3.0 connector pinout

I was spending about 15 minutes googling until I've found the electric pinout of Micro USB connector ver 3.0 (a doubled one)

Also I was not able to get an electric scheme of USB 3.0 that specifies color of each wire inside the cable.

So after some research I've made a paper note for myself. Also I didn't forget to take a photo and share it to everybody:

Micro USB 3.0 pinout and color of wire

Hope this saves time for other people :)

Tuesday, August 13, 2013

Websites at Different Screen Resolutions

If you are creating a lot of web pages, or have a bunch of own websites, you know how important it is to make the HTML documents are looking good for each user. Different formats of monitors (4x3, 16x9, 16x10), lots of screen resolutions (1366x768, 1920x1080, etc), the variety of mobile devices, half of them with automatic rotation of the screen ... What the hell?

So I've created a simple online web service to view any web page at different sizes and resolutions.

By the way, it's free :)

Friday, September 07, 2012

Landing pages in 5 minutes!


New web service RocketStart.Me allows anybody to create cool looking landing pages for any product, person, event, and so on.

It works as SaaS (Software as a Service), so you do all tasks right in the browser, no software downloads required!

Everything you need is just create account, choose the page template and put some text, media, links, social buttons or other "blocks you want" there. It took less than 5 minutes to create such page:

KARPOLAN at RocketStart.Me

Cool service indeed, I'm planning to make landing pages for every my software product!


Friday, August 24, 2012

What to do if Caps Lock stuck?


If you CapsLock button doesn't work, try to download software that can toggle Caps Lock with a mouse!

Monday, June 25, 2012

Random Color Generator and Preview


I've created the online color viewer.

Everybody can preview any color using this base URL: http://karpolan.com/services/color/

Want to see a green color? Here it is: http://karpolan.com/services/color/008000/

A dark blue one? No problem: http://karpolan.com/services/color/000060/

Also, there is the Online Random Color Generator there.