Thursday, January 3, 2013

Disk space usage

Use df command to get disk space usage:
df -H
Output:
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda1        33G  1.7G   29G   6% /
udev            910M  8.2k  910M   1% /dev
tmpfs           366M  246k  366M   1% /run
none            5.3M     0  5.3M   0% /run/lock
none            914M     0  914M   0% /run/shm
/dev/sdc1       172G  4.8G  159G   3% /home/git/repositories
/dev/sdb1        76G  1.3G   71G   2% /mnt/resource

Saturday, December 15, 2012

Installing PhantomJS on Ubuntu

PhantomJS is a headless WebKit with JavaScript API. It has fast and native support for various web standards: DOM handling, CSS selector, JSON, Canvas, and SVG.

I have a virtual machine in which Ubuntu 12.04 (32-bit) version is installed. After a few attempts, I found the way how to install PhantomJS 1.7 to my virtual machine.

Steps are bellow:
cd ~
get http://phantomjs.googlecode.com/files/phantomjs-1.7.0-linux-i686.tar.bz2
sudo tar xvf phantomjs-1.7.0-linux-i686.tar.bz2
sudo mv phantomjs-1.7.0-linux-i686 /usr/local/share/phantomjs
phantomjs --version

Saturday, December 8, 2012

Create your Own Git Server on Azure Cloud

I wrote a blog post 'Create your Own Git Server on Azure Cloud'. This blog post can be found here.

Saturday, October 20, 2012

Meet the Raspberry Pi

A few weeks ago I got my Raspberry Pi from element14. It's time to wipe away the dust from it:


If you don't know what Raspberry Pi is,  visit http://www.raspberrypi.org website.

I wanted to install raspberry by myself. I took an empty SD card and loaded to it Raspbian installer. Raspbian is OS dedicated to Raspberry Pi. You can find a manual how to install Raspbian here.

After long waiting and thew crashes I understood that installation failed.

I decided to choose different approach. I downloaded Raspbian image from here and  used Win32DiskImager tool to write this image to SD card.

Finally, Raspbian started.


Sunday, August 26, 2012

Create a npm package

npm is package manager for nodejs.

If you want to create and publish npm package you must complete theses steps:

1. Create a profile

Go to npm website and create a profile.

2. Create package.json file

Create a folder for your package and change the current directory to it:
mkdir my_package
cd my_package
Create package.json file:
{ 
  "name" : "my_package",
  "description": "package description goes here",
  "version": "1.0.0",
  "author": "Firstname Lastname <firstname.lastname@mail.com>",
  "keywords": ["my_keyword1", "my_keyword2"], 
  "repository": {
    "type": "git",
    "url": "https://github.com/myuser/my_package.git"
  },
  "main" : "./lib/my_package.js",
  "engines": {
    "node": ">=0.8.8"
  }
}
3. Link with npm

Link your package with npm:
npm link
4. Publish the package

Add a user:
npm adduser
Publish a package:
npm publish
If you want to override published package you can user --force parameter:
npm publish --force

Monday, August 13, 2012

Say 'Hello world' using Node.js

Install node.js on Ubuntu

Install the dependencies:
sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core
Download source code of version 0.8.8 from github:
git clone -b v0.8.8-release git://github.com/joyent/node.git
Build and install node.js:
cd node
sudo ./configure
sudo make
sudo make install
To get node.js version type:
node --version
Create Hello world application

Create my-script.js file:
console.log("Hello world!!!")
Run the code:
node my-script.js
Output:
Hello world!!!

Wednesday, July 18, 2012

MarkDown files viewer

MDPad is a free MarkDown files viewer and editor for Windows. It can be donwloaded from here.

Features:
  • Edit markdown file
  • Preview markdown file
  • Expor it as HTML file
  • Print it
  • Open it directly from explorer

Markdown is a text-to-HTML conversion tool for web writers. Markdown allows you to write using an easy-to-read, easy-to-write plain text format, then convert it to structurally valid XHTML (or HTML). To read more go here.