How to add SSH key to existing DigitalOcean droplet

Logging in to your DigitalOcean droplets is more secure if you use SSH keys compared to using root password. Today, I had to add my key to existing droplet (running over 3 years now) and to a droplet I have just created and setup everything on it but forgot to add a SSH Key to it. And just for the record I’m using Windows computer at the moment and the key is generated by PuttyGen. You should already have your SSH key pair: private and public SSH key before you proceed with this guide. I know that doing the same thing on Mac (or Linux) is much easier and all you would have to do is just execute one line of code in Terminal, but again I’m currently using Windows and this tutorial is intended for Windows users. Also note that this same guide will also work in case you have a dedicated server or a VPS at any other provider.

So, how do you add a SSH key after creating a droplet? I went to numerous replays on DO community but haven’t found the correct answer. To make this work first you need to open your favorite text editor: Notepad++, Sublime, Atom any of these editors is just fine (as long you don’t use MS Word). Now copy/paste your public key text in it.

So here is how a Public Key looks like:

Comment: "rsa-key-20161012

Please note that this is not my actual public key and I have generated this one just for the purpose of creating this post. So it’s useless and don’t use it for anything.

Now you need to get rid of first two lines (—- BEGIN SSH2… and Comment …) and the last line (—- END SSH2…) and that will give us just our key but still that key is divided into 6 lines and we need it in one single line. So go now and make that a single line. If you don’t know how to do it in Notepad++ open Search and Replace by pressing CTRL+H and set search for \n, replace that with nothing, set search mode to Extended and click on Replace All. Here’s an screenshot to help you out with that:


The result should be a single line of code (if word wrapping is not turned on). Now before that just add rsa-ssh and one space after that word. The resulting key should look something like this:

rsa-ssh AAAAB3NzaC1yc2EAAAABJQAAAQEAkBUbfyu0amE+uld7dk9LJnJytmVf8qx4TBvT0jCYKfNKJj2io8Jh3gB5Lyqhk2xMmPfthn2d/uRbIESmxN3DNE8NbD5Wubr0Q15iihAkn0qpxV8HodTONiwGP5GhFJqEe0ThHVa8w13oah/UYqH/a40/N/LaOaTcMaC/V6hGQhCE+mCz5tmVsQm2CarNdWZffIYhHLDiSgd4DY609UKnA5LQAV1/cHK1FYVEqiKISpoNZBJ8a0ZOn/a98fVqv7BnxHwvszDJ7Kwusx3ejJVDN2EykfT+SMXSjehXLy7ytRW8a7xSHwxa8yR+7lAcdgyrQryWUfBvDce1hdpk1M4sOQ==

Now you need to copy that line of code into your ~/.ssh/authorized_keys. The absolute path is /root/.ssh/authorized_keys and you can edit that in any editor you like and just add that line below existing lines (or replacing some of your old/previous keys). You need to save the changes and you’re done! Now you can login to your droplet or your webserver with your private SSH Key.

This post helped you out?
Why not buy me a coffee?

Your message for me

How to open Sublime Text in command line with subl on Mac OS?

I have tried to setup Sublime Text 3 so I could run it on my new Mac from terminal just typing subl . but all the when I wanted to make the symlink I was getting this error: ln: /usr/local/bin/subl: No such file or directory  all the time.

The problem is that I had no bin directory on that path. So to fix that you need to do the following:

cd /usr/local
sudo mkdir bin

Now we have that bin folder on /usr/local/bin path and now we can create the link using:

Sublime Text 3

sudo ln -s /Applications/Sublime\ /usr/local/bin/subl

Sublime Text 2

sudo ln -s /Applications/Sublime\ Text\ /bin/local/bin/subl

Exit the terminal and start it again and you should be able to use subl . to open all files in current folder in sublime text for editing.

This post helped you out?
Why not buy me a coffee?

Your message for me

How to fix 0x0000007b blue screen (BSOD) ?

Are you getting that blue screen (BSOD) with error message 0x0000007b when booting your computer or trying to install a new Windows operating system (on a computer with SSD drive)?

0x0000007b blue screen BSOD

The problem is that in BIOS your SATA is set to AHCI instead of ATA. To fix this problem you’ll have to enter the BIOS and change it back and your system will function normally. This can happen if your BIOS data is lost or in some cases the BIOS batter is empty, or if you cleared bios by hand. Don’t worry none of your data is damaged in any of these cases.

Here’s how to fix this problem:

  1. Reboot your computer and keep pressing F12 to enter BIOS. On some laptops  it’s F2 or F8 (it should be shown on your screen)
  2. Go to Advanced tab and change ACHI to ATA option under SATA Operation (it might have a different name depending on your BIOS).
  3. Save the changes and reboot.

That’s it!


This post helped you out?
Why not buy me a coffee?

Your message for me

Download Offline Installer for Microsoft .NET Framework 4.6, 4.5, 4.0, 3.5, 2.0 and 1.0

Microsoft Windows applications developed using .NET Framework require Microsoft .NET Framework to be installed on computer that will run the application. Microsoft provides installer for .NET Framewework but by default it’s an online installer. That means that you basically download a small installer file that after it’s executed automatically connects to Microsoft servers and downloads the required components and completes the installation.

The online installers work great as long as you have internet conection. But some users don’t have an internet connection and that can be a problem. Sometimes developers require offline installer so they can ship it with the software inside software installation or on CD/DVD

I have gathered a set of links of Microsoft .NET Framework offline installers and you can download full installation files from the following links:

.NET Framework 4.6 Setup

.NET Framework 4.5 Setup

.NET Framework 4.0 Setup

.NET Framework 3.5 Setup Service Pack 1

.NET Framework 3.5 Setup

.NET Framework 2.0 Setup

.NET Framework 1.0 Setup

.NET Framework Client Profile Offline Installer


This post helped you out?
Why not buy me a coffee?

Your message for me

How to get rid of Windows 10 upgrade nag screen?

If you run Windows 7, Windows 8 or Windows 8.1 you probably got an offer to upgrade to Windows 10 and you noticed that upgrade icon in task bar to your clock.

Windows 10 Free Upgrade Icon

Windows 10 Free Upgrade App GWX

If you don’t want to upgrade to Windows 10 and you want to keep your current Windows and you’d like to get rid of that GWX.exe nag screen and taskbar icon run cmd as administrator by typing in cmd in start menu search and right clicking the Command Prompt result and clicking on Run as administrator and confirming that you want to run command prompt as admin.

Run command prompt as administrator

When you get that black command prompt window just type (copy/paste) the following command and once it’s executed reboot your computer and Windows 10 upgrade will be gone. Out of many this is the only solution that actually worked for me!

reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Gwx" /v DisableGwx /t REG_DWORD /d 00000001 /f


One more thing I also noticed is that even if you’re not interested in upgrade Microsoft still downloads entire Windows 10 installation and stores it in c:/$windows.~BT folder just in case you say “yes” to their upgrade offer. That folder can take from 2 to 3 GB of your disk space and it’s especially valuable if you have (a smaller) SSD as your primary hard drive. Removing the folder frees up the space but quickly (after a reboot) it starts downloading it again so it doesn’t just take your disk space but also uses your internet bandwidth. To stop it from doing that after you delete folder $windows.~BT create a new empty one with the same name and then right-click it and in folder properties make it Read Only. That way it will remain empty as Windows will not be able to download Windows 10 files and store them in it.


This post helped you out?
Why not buy me a coffee?

Your message for me

How to safely install git on cPanel/WHM?

GIT is popular version control system for software development and it’s really common today. Installation on servers without cPanel is pretty simple but on servers that do have cPanel can be tricky because git installs it’s own Perl libraries and that can cause many problems and conflicts and often results in unusable WHM server in the end.

So whatever you do – do not install GIT!

Because it’s already installed 🙂
It’s just not in path and you can’t use it.

There are two ways of doing this:
1. WHM/root way that will make git available to all users on the system
2. cPanel way that will make git available only for the current account

Hot to enable it in WHM?
To make git usable to all users (with ssh access) just execute this single line of code as root:

ln -s /usr/local/cpanel/3rdparty/bin/git /usr/local/bin/git

How to enable it in cPanel?
If you are using a shared (or reseller) hosting powered by cPanel (and you don’t have WHM access) than you need to login using SSH and locate your .bashrc file. It should be in your home directory. Open that file for editing and add git to your path by adding following two lines of code at the end of your .bashrc file:

export PATH

To edit that file enter: nano .bashrc
After you add these two lines your .bashrc file should look like this:


To save the changes press CTRL+X , then press Y and Enter. In order for changes to be accepted it will be necessary to re-log in to your SSH command prompt.

How to check if git now works on cPanel?
Well, that’s really simple. Just login to SSH and execute: git –version
and that should return git version (currently cPanel git is version 2.6.1)

That’s it!
Nice and simple.
Happy giting…

This post helped you out?
Why not buy me a coffee?

Your message for me

How to disable FileZilla update nag screen?

I use FileZilla a lot and I start it like ten times a day or even more. Every time it starts I get that screen that asks me to update FileZilla to latest version, but since I’m using portable version of it it’s almost impossible to do so since portable versions are often delayed etc. The same nag screen is there with the non-portable version of FileZilla and sometimes you simply don’t want to upgrade.

Disabling updates in settings simply doesn’t work and will remind you that there is an update even if this is disabled every time you start it.


To solve the problem first make sure that FileZilla is closed. Then locate it’s config file at:
..\appdata\roaming\filezilla\filezilla.xml or for portable version located at: ..\data\settings\filezilla.xml.

Open that file for editing (use some advanced editor like Notepad++ or Sublime) locate the line with value starting with: <Setting name=”Update Check New Version”>
and delete that entire line.


Save the changes. And that’s it. Now you can use your FileZilla or FileZilla Portable without that update nag screen and you can choose whether you want to update it and when.


This post helped you out?
Why not buy me a coffee?

Your message for me

How to solve wp-cron.php high CPU usage?

It is known that wp-cron.php file can cause high CPU usage on high traffic WordPress sites. This can also occur on sites hosted on shared or VPS hosting when they receive more traffic than usual at short period of time (traffic spikes).

Typically, every page load calls wp-cron.php to be executed and to run any tasks that are scheduled to be executed (like posting scheduled posts, plugin or theme updates, clearing caches on various caching plugins, sending email notifications etc). This basically asks WordPress: Is it time do do anything now? And then WordPress checks for pending tasks and if there’s nothing to do typically answers with: sorry, but there’s nothing to to at this moment… Try a bit later… and this probably happens in 99% cases. So this wp-cron.php literally nags WordPress all the time with those requests. On low traffic sites, this is perfectly fine but on high traffic sites (or sites with traffic spikes) this can cause higher resource usage, make problems with your hosting (vps/server) and decrease your site performance.

Best way to prevent this wp-cron.php activity is to stop it from running the default way (on every site visit) and then just run it using cron when according your needs.

To stop WordPress from executing wp-cron.php after every page visit, simply add this single line to the end of your wp-config.php file:

define('DISABLE_WP_CRON', 'true');

That’s it! This will lower the CPU/resource usage instantly. But it’s not recommended to never execute wp-cron.php since your WordPress plugins and themes won’t be updated and your scheduled posts won’t be posted etc.

Here is the commands that you can use to run wp-cron.php using a real cron:

/usr/bin/wget -q -O - >/dev/null 2>&1

There’s no general rule as for the frequency of this cronjob since every site and setup is different. Everything from once per day to every minute is fine but it really depends on your system. If you have tasks that run every 10 or 15 minutes you should probably setup cron to run every 5 minutes. It’s still quite frequent but it won’t happen that you get several cron runs in couple of seconds.

To setup cron at cPanel hosted site login at cPanel, click on Cron Jobs icons and there add a new cronjob like this:


This post helped you out?
Why not buy me a coffee?

Your message for me

How to enable mod_deflate on Apache 2.4?

Compressing data like html, js, css before transmitting them to the visitors can speed up your sites and save you bandwidth. Recently I have updated Apache on one server from version 2.2 to 2.4 but my mod_deflate rules won’t work any more (because of changes in the new version of Apache).

Here are my old mod_deflate rules I used on Apache 2.2:

<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding

<IfModule filter_module>
FilterDeclare COMPRESS
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/html
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/css
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/plain
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $text/x-component
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/javascript
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/json
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/xhtml+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/rss+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/atom+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/
FilterProvider COMPRESS DEFLATE resp=Content-Type $image/svg+xml
FilterProvider COMPRESS DEFLATE resp=Content-Type $application/x-font-ttf
FilterProvider COMPRESS DEFLATE resp=Content-Type $font/opentype
FilterChain COMPRESS
FilterProtocol COMPRESS DEFLATE change=yes;byteranges=no

<IfModule !mod_filter.c>
# Legacy versions of Apache
AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
AddOutputFilterByType DEFLATE image/svg+xml application/ application/x-font-ttf font/opentype

And here’s my new Apache 2.4 code that enables mod_deflate compression:

<IfModule mod_deflate.c> 
SetOutputFilter DEFLATE 
SetEnvIfNoCase Request_URI \.(?:gif|jpg|png|ico|zip|gz|mp4|flv)$ no-gzip 

Nice and easy! You can add other extensions you do not want to compress to the list above and that should be it!

cPanel/WHM users should login to WHM then go to Service Configuration -> Apache Configuration -> Include Editor then locate Pre VirtualHost Include on the page and select All Versions from the list (or current version of the Apache in my case 2.4.10).


Then simply copy paste the code above into the box, save and restart the Apache service.


Note: The process is same for Apache 2.2 just use the appropriate code from above.

This post helped you out?
Why not buy me a coffee?

Your message for me

MP4 streaming using Apache + WHM/cPanel

Streaming MP4 files with Apache + h264_streaming has never been easier. Setup your web server to stream MP4 files using Apache in just 3 minutes.

cd /usr/local/src
cd mod_h264_streaming-2.2.7
./configure --with-apxs='which apxs'
make && make install

Non WHM/cPanel users
Should now add those two lines into httpd.conf:

LoadModule h264_streaming_module /usr/local/apache/modules/
AddHandler h264-streaming.extensions .mp4

and simply restart Apache using:

service httpd restart

WHM/cPanel users
Should use Include Editor since any changes made to httpd.conf will be lost in case of rebuilding apache.
So login to WHM and go to Apache Configuration -> Include Editor -> Pre Main Include -> All Versions and in the box that appears copy/paste following two lines and after saving that confirm Apache restart.

LoadModule flvx_module modules/
AddHandler flv-stream .flv

Here are a few pictures for newbies so they can find their way trough more easily:

1. Apache Configuration
2. Include Editor
apache include editor whm cpanel

3. Locate PreMain Include – select All Versions
4. Copy/paste those two lines and press Update (then confirm Apache reload)

That’s it!

FLV Streaming using Apache
To learn how to setup FLV streaming using Apache click here

This post helped you out?
Why not buy me a coffee?

Your message for me