August 10, 2009
Suppose you want to burn the content of /my/directory/datas at the root of the DVD, you need to type:
$ growisofs -dvd-compat -input-charset=ISO-8859-1 -Z /dev/hda -R -J -pad “/my/directory/datas”
Remember that input-charset is setted to the right value. If you do not define it, your default system charset will be used.
References
www.debuntu.org
Leave a Comment » |
BASH |
Permalink
Posted by /\/\ @ /\/ U
July 27, 2009
wget as all knows is a downloader for the CLI. It has all the features to be proclaimed as a wonderful download manager. hope anyone has encountered a situation where you want to download a set of files. Just create a file with all the download links and give it to wget.
Create the file
In FireFox use the copy link location command from the context menu (the menu you get while doing a right click. Please correct me if i am wrong
) and paste it into a file.
WGET IN ACTION
$ wget -cvvv -i download.txt
This will download all the files specified in download.txt to the current location.
Options Explained.
-c – resume support if the server supports the same
-v – verbose mode, displays activity
Leave a Comment » |
BASH | Tagged: download, manager, wget |
Permalink
Posted by chickooiyer
July 19, 2009
Useful for..
- Scripts
- Checking IP Address Often
Command
lenny-dhabba:/home/sameer# ifconfig eth1 | awk '/dr:/{gsub(/.*:/,"",$2);print$2}'
169.254.167.101
lenny-dhabba:/home/sameer# ifconfig | awk '/dr:/{gsub(/.*:/,"",$2);print$2}'
192.168.1.8
169.254.167.101
127.0.0.1
|
Tools
Explanation
The command used for finding IP Address is ifconfig, it produces lot of output, what we need is the IP Address of any interface or of all interfaces, for this, we send the output of ifconfig to another command line tool called awk. Awk’s job is to remove the unnecessary things from ifconfig’s output, for this we tell awk using a language it understands. From this language awk interprets it as:
- Find a line containing the string “dr” . As we know the second line in ifconfig output contains the IP Address.
- Next get the string near to inet addr
- Finally print that string
. Hence we get the desired output.
Disadvantages
- Prints unnecessary new line characters in between
- There are better ways to print the characters using perl
References
Leave a Comment » |
BASH | Tagged: awk, ifconfig, ip, networking |
Permalink
Posted by sameerthahir
July 19, 2009
To view the history of commands of a user.
history
The history of commands are stored in the file .bash_history of user home directory.
To clear complete command line history of a user temporarily for a session.
history -c
Or use space ie.” ” before a command to skip it from being in the history.
Leave a Comment » |
BASH | Tagged: .bash_history, history |
Permalink
Posted by harikris2000
July 18, 2009
If you want to know the total number of lines of files in a directory, execute the following line of script in your terminal. You can also save this command in a file and execute.
lines=0; for i in `find . -name “*.php”`; do line=`cat $i | wc -l`; let lines=$lines+$line; done; echo $lines
lines=0; for i in `find /var/www/wordpress -name “*.php”`; do line=`cat $i | wc -l`; let lines=$lines+$line; done; echo $lines
OR
find . -name “*.php” -print0 | xargs -0 wc -l | tail -n1
Leave a Comment » |
BASH | Tagged: count, echo, find, for, lines, total, wc, wordpress |
Permalink
Posted by $ŕêëñ@ďĥ
July 18, 2009
To know the count of files of a particular type in a directory
find . -name “*.png” | wc -l
find /usr/share/images/ “*.jpg” | wc -l
Leave a Comment » |
BASH | Tagged: find, wc |
Permalink
Posted by $ŕêëñ@ďĥ
July 17, 2009
To retrieve gnome-panel to default if deleted (in etch) or from a customized one (in lenny atleast one panel remains).
gnome-session-remove gnome-panel
gconftool-2 --recursive-unset /apps/panel
gnome-panel &
Note : Commands should be executed in terminal of Gnome.
Leave a Comment » |
BASH | Tagged: debian, etch, gconftool, gnome, gnome panel, lenny, panel, remove |
Permalink
Posted by harikris2000
July 14, 2009
Steps to migrate SVN repository.
svnadmin dump <location_of_old_repo> > dump_filename
svnadmin load <location_of_new_repo> < dump_filename
Eg:
svnadmin dump /var/svn/myproject > /tmp/myproject.dump
svnadmin create /var/svn/mynewproject
svnadmin load /var/svn/mynewproject < /tmp/myproject.dump
To check everything is okay.
svnadmin verify /var/svn/myproject
svnadmin verify /var/svn/mynewproject
Leave a Comment » |
BASH | Tagged: dump, migrate, svn |
Permalink
Posted by $ŕêëñ@ďĥ
July 14, 2009
To rebuild Debian package (.deb) from an installation
apt-get install dpkg-repack
dpkg-repack <package_name>
Eg:
dpkg-repack <apache>
Leave a Comment » |
BASH | Tagged: deb, debian, dpkg, dpkg-repack |
Permalink
Posted by $ŕêëñ@ďĥ
July 14, 2009
To remove a service (daemon) from all runlevels.
update-rc.d -f remove <service_name>
Eg:
update-rc.d -f remove exim4
Leave a Comment » |
BASH | Tagged: debian, update-rc.d |
Permalink
Posted by $ŕêëñ@ďĥ