How to convert PuttyGen SSH-2 key-pairs to standard OpenSSH format

December 28th, 2012

Today I generated SSH-2 RSA key pairs using PuttyGen under Windows. It is a handy utility for creating RSA/DSA public/private keys for authentication. These key files can’t be used in Linux directly. I will try to explain how to convert Putty’s private key (.ppk) to Linux OpenSSH format.

  1. Open PuttyGen
  2. Click Load
  3. Load your private key (.ppk)
  4. Go to Conversions->Export OpenSSH and export your private key
  5. Copy your private key to ~/.ssh/id_rsa
  6. Next step is to convert your public key from SSH2 format to OpenSSH using:
    ssh-keygen -i -f ~/rsa_ssh2.pub > ~/.ssh/id_rsa.pub

And of course you need to set the right permission to your private key file (chmod 600). Now you should be able to log into an SSH server using your private key. To install your public key simply copy from ~/.ssh/id_rsa.pub on your local machine to ~/.ssh/authorized_keys on the remote server.

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Spinning textured box in WebGL

December 26th, 2012

WebGL brings 3D graphics to the Web by introducing an API that closely conforms to OpenGL ES 2.0 that can be used in HTML5 canvas elements. Here is my simple example.

Sample spinning textured box in WebGL - click to start

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

HTML5′s canvas and image animation

December 24th, 2012

With HTML5 canvas we can create nice image animation. Here is my example where I change opacity, scale and rotate images. I used Raphael JS library.

Sample image transformation - click to start

Here’s the HTML code:











http://www.black-sun.com.pl/portfolio/images/ja1.jpg

Sample JavaScript image transformation

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

How to make a pie chart with HTML5′s canvas

December 12th, 2012

With HTML5 canvas element we can implement pie chart.

Sample pie chart

Sample pie chart


Here’s the HTML code:




 Your browser does not support the canvas element. 

 



Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Wieliczka Salt Mine

July 28th, 2012

The Wieliczka Salt Mine in Poland had been producing salt for as long as 700 years until it was opened to tourism in 1996. This incredible salt mine has intricate sculptures and astounding carvings and was named a UNESCO World Heritage Site because of its “outstanding universal value to mankind”.

The Weimar Chamber

The Weimar Chamber


The carvings of the Wieliczka Salt Mine include historic figures, mythic creatures, large carved chambers and chapels. The mine even boasts an underground lake which lights up with the placement of colored lights. Ornate salt-crystal chandeliers hang from the ceilings of the larger parts of the mine. Amazingly, many of sculptures seen here were carved by the miners themselves.
Józef Haller monument

Józef Haller monument


Wieliczka Salt MineThe Wieliczka Salt Mine is 9 levels deep and contains more than 2,000 chambers.
me in Wieliczka Salt Mine

me in Wieliczka Salt Mine

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Trip to Trapani

June 30th, 2012

Trapani is a medium-sized city near the North-West corner of Sicily.

mount Erice

mount Erice


Trapani is the perfect port, and fishing village, being set on a low peninsula stretching in an arc into the sea, the housing of the city melting into plains of salt pans, valuable to the regions economy. Beyond, the solitary plains dotted with windmills dating from the medieval era, lies the open sea stretching to the horizon, punctuated only by the beautiful peak of mount Erice and the Egadi Islands. Erice offers an incredible panorama which enfolds a millenary history as testified by the section of Punic walls which still surrounds it.
mount Erice

mount Erice


In Trapani and surroundings there are many nice beaches to visit.
Trapani has a small airport (Trapani-Birgi Airport). The airport is served by Ryanair, Meridiana and Air One.

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Update all records in a MongoDB collection

May 16th, 2012

One way to fast update all records in a MongoDB collection is to send an update with multi flag true. Example:

db.my_collection.update({},{ $set: { "Price" : 100 } }, false, true );

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Get the current module, controller and action name in Zend Framework view

April 12th, 2012

I use below script to show current module, controller, action name in Zend view.

$request = Zend_Controller_Front::getInstance()->getRequest();
echo 'Module: '.$request->getModuleName().' ';
echo 'Controller: '.$request->getControllerName().' ';
echo 'Action: '.$request->getActionName().' ';

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

Trip to Sicily

March 27th, 2012

Mount Etna is an active stratovolcano on the east coast of Sicily, close to Messina and Catania. It is the tallest active volcano in Europe, currently standing 3329m high, though this varies with summit eruptions.

Mount Etna, view from greek theatre of Taormina

Mount Etna, view from greek theatre of Taormina


Mount Etna is one of the most active volcanoes in the world and is in an almost constant state of activity. The fertile volcanic soils support extensive agriculture, with vineyards and orchards spread across the lower slopes of the mountain and the broad Plain of Catania to the south.
Mount Etna, view from Catania

Mount Etna, view from Catania

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS

National Railway Museum in York

March 13th, 2012

I visited very nice museum in York – The National Railway Museum. It is the home of the national collection of British railway vehicles. Displays a collection of over 100 locomotives and nearly 200 other items of rolling stock, virtually all of which either ran on the railways of Great Britain or were built there. It is the largest museum of its type in Britain.

Harry Potter Steam Train

Harry Potter Steam Train

Share this article

  • Facebook
  • Twitter
  • Delicious
  • Digg
  • Google Buzz
  • LinkedIn
  • NK
  • StumbleUpon
  • Add to favorites
  • Email
  • RSS