2014/04/07

Taking screenshot on Samusung Galaxy S4

It wasn't too obivius so i had to search for it.

Classical way for taking screenshot in Samsung Galaxy S4 is to press:

power/lock screen button + home button at the same time for 1 second.

After this screenshot will be taken and saved into your gallery. You could also use Samusing motion sensor and swipe your hand across the screen. This has to be somehow enabled from the menus, but since i find this feature useless anyway, i didn't even bother to try it out.

2014/03/06

Enable password authentication for Google Compute Engine instance.

By default Compute Engine instance uses key pairs to authenticate you into your instance. This is very much recommended for security reasons. When you are first time connecting your instance through gcutil ssh, you will be asked to create a pass phrase for your ssh keys. Gcutil will create key pair in your local machine and copy it over to your project.

However if you want to authenticate ssh from outside world using password, here is a simple step what to do:

Edit file /etc/ssh/sshd_config

Find this line from your sshd_config and change it to PasswordAuthentication yes:
 # Change to no to disable tunnelled clear text passwords  
 PasswordAuthentication no  
Then just reload your OpenBSD Secure Shell server (Debian).
  sudo /etc/init.d/ssh reload  
In a CentOS init.d name is bit different, since it uses OpenSSH server.
 sudo /etc/init.d/sshd reload  
Of course also remember to add firewall rule for TCP port 22. This can be done through Developers Console.


2014/02/28

Add quick print button for Google Chrome

My friend was recently wondering that why doesn't chrome have quick print button. Back in the days i also got used to that quick print icon in Internet Explorer. And i do remember using it many times.

In chrome, normally you could print by opening Chrome settings tab from right hand side and select "Print...". Alternatively you can print by using keyboard shortcut Ctrl+P (Windows) or ⌘-P (mac).

Since my IE days are long gone, i would still like to have quick print icon in Google chrome. This is how you can get it.

Select "Customize and control Google chrome", from the top right corner next to the address bar.








Note that Show Bookmarks Bar must be enabled. Select Bookmarks -> Bookmark Manager.















While Bookmarks Bar selected, right click anywhere on the window right hand side and select "Add Page".



Left textbox is the name of the bookmark, i made it "Print". Right side is the bookmark URL, we are going to place small javascript to it: javascript:window.print(). Then hit enter and you are done.

Now you should have nice small quick print icon on your bookmarks bar. I wonder if you could actually have cool printer icon on it as well. Need to research that later.