Linux | bitPrison.net up

Linux

3gp or 3ga to mp3

We have already learned how to convert jpeg files to pdf on Linux. Now I am going to show you how you can convert .3ga or .3gp audio files to mp3 or ogg. Of course I use Ubuntu.

If you type in Google that "3gp to mp3 linux" thing, you found the ffmpeg command. That's OK. But somehow I cannot make this ffmpeg wokr on my Ubuntu. So I found another way to converting 3gp to mp3.

Gnac

is an audio file converter application. You can install with

Blog categories:  Linux
Blog tags:  linux

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 git branch operations and remote cheat sheet

Some useful git command with branches and remote repositories.

Remote operations

List remotes:

git remote -v

Add remote gitosis server:

git remote add <remote_name> git@myhostname.com:my_project_name.git
git push <remote_name> master

Where master is your branch name

Main git branch orperations

list branches:

git branch -v

-v is optional, you use it to get more verbose output

Create new branch:

git checkout -b <new_branch_name>
Blog categories:  Programming  Linux

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