Unix admin | bitPrison.net up

Unix admin

How to disable chrome caching on Ubuntu?

I bought SSD drive to my laptop, so I decided to minimize write I/O on my system. The less writing is a good idea even you have a HDD. Your system become faster in this way.

There are some good starting point:

The best linux copy and backup method: Rsync vs cp

I need a method I can make a backup from my laptop. I used a USB HDD for that and linux prompt.

1. step: Make an initial copy of your data

So, after i mount my USB HDD I used first time the cp command of course.

Blog categories:  Linux  Unix admin

How to convert your real system to virtual machine?

I had a real Linux server system that I need to convert into virtual server, because I wanted to sell my old hardware, but I needed the system as backup. This backup is able to run as virtual server. This is a very useful backup method. This tutorial show you how you can convert your whole system into virtualbox system. Virtualbox is a free opensource virtual computer solution from Oracle.

1. Backup your system disk

If you can, put your system disk to another computer. But if you can't do it you can do it the original system.

SATA HotPlug and HostSwap in Ubuntu Linux

Check active scsi devices:

ubuntu@ubuntu:~$ lsscsi
[1:0:1:0]    disk    ATA      SAMSUNG HD103SJ  1AJ1  /dev/sda
[2:0:0:0]    disk    ATA      SAMSUNG HD103SJ  1AJ1  /dev/sdb
[3:0:0:0]    cd/dvd  HL-DT-ST DVDRAM GH22NS90  HN00  /dev/sr0
[5:0:0:0]    disk    Generic  STORAGE DEVICE   9451  /dev/sdd
[6:0:0:0]    disk    GT-I5700  - Card                /dev/sdc

Now refresh SCSI devices. Use this command to refresh host0 (or host1, host2, host3):

ubuntu@ubuntu:~$ echo "- - -" | sudo tee -a /sys/class/scsi_host/host0/scan 

Check the result:

SSH port forwarding in nutshell

My goal:
I want to see the intranet website from home with my linux laptop. I can connect over SSH to the intranet web server. But I want to see the webpage in a browser of my laptop.

The solution is SSH port forwarding. From my Linux laptop. Here is the syntax:

ssh -L <myPortNumber>:<RemoteIP>:<RemotePort>  <host> [other ssh options like port and user]

I used this:

ssh -L 8088:127.0.0.1:80  intranetserver.example.com

Now I can click to http://localhost:8088/ on my favorite browser and I can browse the intranet.

Blog categories:  Linux  Unix admin

My new JustCloud storage account

I found a very fast and easy to use online storage solution. My free dropbox account was too small for backing up my files. I mostly backup my most important files with dropbox online storage, but the 2Gb too small for me. I saw the dropbox pro pricing that was almost $10 for 100GB. When I found the it was less than $10 for unlimited storage. I think it is good offer to me.

Blog categories:  Unix admin  Hardware

Deploy rack applciaton

Make config.ru with following content:

require 'rubygems'
require 'sinatra'
require './my_sinatra_application.rb'

run Sinatra::Application

You have to run bundle command. This will be install all necessary gems that listed in Gemfile.

You find debug log in default apache 2 error log files. This is /var/log/apache2/error.log in my case.

RMagick install on Ubuntu 10.10 and 10.04

This small tutorial work on Ubuntu Hardy (8.04), Lucid 10.04 and Maverick (10.10)

Install Imagemagick and GraphicsMagick

apt-get install imagemagick graphicsmagick

Install Image Magick development files

apt-get install libmagickcore-dev libmagickwand-dev
gem install rmagick

On Hardy:
Install imagemagick from source and after it install development files:

Blog categories:  Linux  Unix admin

How to install Phusion Passenger for ruby 1.9.2

There are some easy steps to install for ruby 1.9.2 and apache2 on Ubuntu Linux.

1. Install rvm system wide

sudo bash < <( curl -L http://bit.ly/rvm-install-system-wide )

2. Install ruby 1.9.2

rvm install 1.9.2

3. add new line in /etc/bash.bashrc

[[ -s /usr/local/lib/rvm ]] && . /usr/local/lib/rvm

4. install passenger

sudo -i # you need root shell
rvm use 1.9.2-p0@global # or your version, use: rvm list