Assorted Linux/Ubuntu Gotchas!!

To customise Vi Editor
copy /usr/share/vim/vimrc to ~/.vimrc
:syntax on for color highlighting
:set incsearch for incremental search in vi editor

to clear and redraw the screen ^L

To get network info
netstat -lneap | grep tcp
5900 for vnc
21 for ftp

To mount Windows partitions (NTFS) on boot-up, and allow users read and write access

sudo apt-get install ntfs-3g

sudo vi /etc/fstab and add the following

/dev/hda5 /media/windows ntfs-3g defaults,locale=en_US.utf8 0 0

To mount network folder
//192.168.151.97/freeware /media/freesoft smbfs credentials=/root/.smbcredentials 0 0

To list all ips in a network
nmap -v -sP 192.168.185.1/24 | grep "appears to be up" | cut -d ' ' -f 2

Install FLash editor for linux
wget http://www.sonsuzdongu.com/paketler/f4lm_0.1-1_i386.deb

sudo dpkg -i f4lm_0.1-1_i386.deb

Postgresql
If you want to allow other(s) network system to access your
database, you need to make changes in two files : postgresql.conf and
pg_hba.conf.

in postgresql.conf file you need to specify IP address(es) to listen on,
with comma seperated. OR ‘*’ for ALL.

listen_addresses = ‘*’
And in pg_hba.conf you need to add the following line at end :
host all all 192.168.185.1/8 trust


Java 5 doc

wget http://javadocs.planetmirror.com/dist/jdk150-hh.zip

#To convert a wav to a mp3 file
sudo apt-get install lame
lame -h -v -b 128 music.wav music.mp3

#To convert all .wav files in a directory
#converts music.wav to music.wav.mp3
ls *.wav | xargs -i lame -h '{}' '{}'.mp3
or to find all files from current dir and subdirs
find . -iname "*.wav" | xargs -i lame -h '{}' '{}'.mp3

#to move files to a new directory
ls |xargs mv --target-directory=../somedir

About Ajo Paul

A Monk who's yet buy his Ferrari!
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.

2 Responses to Assorted Linux/Ubuntu Gotchas!!

  1. Vinay Aradhya says:

    sudo apt-get install mplayer -y –force-yes
    sudo apt-get install lame -y –force-yes
    ls *.wav | xargs -i lame -h ‘{}’ ‘{}’.mp3
    or to find all files from current dir and subdirs
    find . -iname “*.wav” | xargs -i lame -h ‘{}’ ‘{}’.mp3

  2. Noma Trull says:

    I was suggested this blog by my cousin. I am not sure whether this post is written by him as no one else know such detailed about my difficulty. You are amazing! Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre user="" computer="" escaped="">