Update PHP to 5.6 @ debian wheezy

I’ve just updated PHP version to 5.6. Check the migration guide for incompatibilities (no big thing there). You will get slightly better performance and some new features.

# sudo nano /etc/apt/sources.list.d/dotdeb.list

And insert these two lines:

deb http://packages.dotdeb.org wheezy-php56 all
deb-src http://packages.dotdeb.org wheezy-php56 all

And add the key:

# wget http://www.dotdeb.org/dotdeb.gpg -O- |apt-key add -

You are ready to go, just update & upgrade your system.

# apt-get update && apt-get upgrade

If you get The following packages have been kept back: you have to run:

# apt-get dist-upgrade


How to fix Android Studio which doesn’t start

Have you installed Android Studio and it doesn’t start after clicking the program icon? The fix is simple. Firstly, you should download (update to) the latest Java Development Kit (current version is 7u21).

One of my Java friends told me not to install Java (and anything Java related) to the default installation path because of spaces in the path (there’s a space in the Program Files) and have a special directory for Java like C:/Java/… Spaces in the path might cause errors.

I am punk so I am using the default paths anyway

Setting system variable – PATH

Notice: I will be working with Java path C:\Program Files\Java\jdk1.7.0_21\, it could be something else in your case, just check the path and if you have installed Java somewhere else, change it to desired destination.


Type SET PATH in commnad prompt, you should have something like C:\Program Files\Java\jdk1.7.0_21\bin in there. If not, open Control Panel -> System -> Advanced System Settings -> Advanced -> Environment Variables and in System variables modify the PATH variable. Add C:\Program Files\Java\jdk1.7.0_21\bin to the end. Be sure there’s no space at the end of the line. See screenshots below.

Save the changes, you don’t need to restart computer, but you have to reload command prompt.

There might be a problem, check if you don’t have java.exe in the C:/Windows/System32/. If the file is in this location, you should rename (or delete if you are brave) it. Reload command prompt ant type java -version to check if everything is allright.

Set JAVA_HOME and JDK_HOME variables

JDK_HOME should be enough but someone experienced a problem without JAVA_HOME, so set them both for sure.

We are going to continue. Type SET JAVA and SET JDK to command prompt to check if the variables are set up. Are they not? Ok, you should add them to the system variables. Once again – Control Panel -> System -> Advanced System Settings -> Advanced -> Environment Variables.

Add JDK_HOME and JAVA_HOME with value C:\Program Files\Java\jdk1.7.0_21\. Do you see the screenshot below? It won’t work because there’s a space left at the end of value line! Check it and save it.android-studio-fix-05

And that’s it, you are ready to go, everything should be set up and Android Studio should start right after you click the icon.



Backup your WordPress to Google Drive

WordPress is a great open source CMS, even this site is running on it. And since there is a Google Drive – cloud solution with a free 5GiB, why not to use this space for backups? Of course there is a lot of alternatives but I will start with this combination because I really like GMail and that’s the reason why I use Google Apps instead of other email solutions.

First of all, it’s not completely trivial. Let’s start with installing wordpress plugin called Google Drive for WordPress. I assumed that you have an google account with google drive activated. Sign up for one, if you don’t. And let’s start with some google magic. Google API’s console sounds scary, right? Ok, just clict the big blue button create project.

In the list of services look for Drive API and turn it on. Accept Terms of Service. Then click on the Drive API (not the swith).

Choose tab API Access and click big blue button Create an OAuth 2.0 client ID.

Fill in Product name a click Next.

Firstly click more options, you will get the screen similar to image below. Do you have the Google Drive for WordPress plugin installed and activated? Good. Sign in to your wordpress and co to configure google. Copy the Authorized Redirect URL to the form, the Authorized Javascript Origins is url of your website. Done? Click Create client ID.

And again, copy & paste the Client ID and Clients secret from Google Apis to settings of the plugin (sign in to the wordpress, go configure google).

You will be asked to grant a permissions, just click Allow access.

And it’s done. Now you should select what you want to backup and what’s your desired interval. Congratulations.

How to install Linux using USB stick

Do you wonder how to install linux on your computer if you doesn’t have an DVD drive? Use USB stick! It’s really simple. You will need USB stick and UNetBootin (Mac, Windows or Linux version).

You should format (erase all data) your USB stick before you are going any further.

Download UNetBootin, install & run it. You should see something like this:

Now you’ve got two choices. If you choose (top part of the window) linux distribution, the UNetBootin will download the chosen version. If you have the ISO file downloaded, you should check Diskimage in the bottom part of the window and choose your ISO file. Choose the destination (should be the USB stick) and you are ready to go. Hit OK. And let the software makes magic:

After the software finishes the operation, you just try to restart your computer and boot the system from USB stick (if there is an error, try it again and don’t forget to format USB stick before).

How to install Windows 7 using USB stick

Our computer doesn’t have a DVD drive and you need to install Windows 7 on it? There is no problem, at least if you are the proud owner of 4GB+ USB stick, just follow instructions below.

You are going to need an ISO file with install disc of Windows 7. If you own DVD with Windows 7, use some software for creating ISO files (in case you have an access to a computer with DVD drive, of course). In case you don’t have install disc with Windows 7 on it, the easiest way to get it is to buy it.

You are going to need another piece of software – Windows 7 USB download tool. Download, install  & run it. You should see something like this:

Let’s begin. Take you USB stick, check if you don’t have important data on it and format it (the windows 7 USB download tool is able to format USB stick itself, so you’re eligible to skip this step). Choose your (browse button) iso file and hit thenext button.

Still very simple, in this step just hit USB device button.

In step 3 you should choose your USB stick from the list and hit Begin copying.

And wait till the tool finish copying the files. You are ready to go, you have the bootable usb stick with installation of Windows 7 on it. Restart your computer, choose boot from USB and install your Windows 7. Enjoy.