misc

Quick Tips

$ asciidoc -a theme=gnu filename.txt

# cdrecord dev=/dev/cdroms/cdrom0 -scanbus

To write an ISO image use the following (as root):

# cdrecord -v -eject speed=24 dev=/dev/cdroms/cdrom0 -multi file.iso

For DVD (as root):

# cdrecord -v -dao speed=4 dev=/dev/dvd file.iso

$ cflow --tree file.c

checklink -vH filename.html > results.html

Prepend C-c s for all:

s - Find symbol
d - Find global definition
g - Find global definition (alternate binding)
G - Find global definition without prompting.
c - Find functions calling this function.
C - Find functions called from this function.
t - Find text string.
e - Find egrep pattern.
f - Find file.
i - Find files including this file.

In search results:

b - Display cscope buffer.
B - Auto display *cscope* buffer toggle.
n - Next symbol.
N - Next file.
p - Previous symbol.
P - Previous file.
u - Pop mark (go to previous search entry mark).

a - Set initial directory.
A - Unset initial directory.

L - Create list of files toindex.
I - Create list and index.

darcs get http://www.kollektiv-hamburg.de/~forcer/darcs/emms

Add the following to ~/.emacs.

(add-to-list 'load-path "~/installs/emacs/elisp/emms/")
(require 'emms-setup)
(emms-standard)
(emms-default-players)

Basic commands are here: http://www.gnu.org/software/emms/manual/Basic-Commands.html.

find . -type f -name '*.[ch]' | xargs etags -a

find . -name Makefile -exec rm -f {} \;

find . -type f -exec sed 's/catherine/katie/g' {} \;

0-15 * * * * shaks DISPLAY=:0.0 PATH=$PATH:/usr/X11R6/bin fbsetbg -r /home/shaks/docs/wallpaper

Esetroot /path/to/wallpaper

xset m 10

[submenu] (Keyboard) {}
    [exec] (ta) {/usr/bin/setxkbmap -layout in -variant tam} <>
    [exec] (us) {/usr/bin/setxkbmap us} <>
[end]

$ gphoto2 --camera "Sony DSC-P92 (PTP mode)" --port "usb:"
$ gphoto2 --get-all-files

$ xlsfonts | less

http://www.di.fm

Country music and other genre are available from shoutcast.com!

http://www.shoutcast.com

Just download the .pls file and open it with xmms.

/msg NickServ REGISTER <password>

linkchecker -ohtml -v http://www.shakthimaan.com/links/ > test.html

$ ./configure  --with-codecsdir=/path/to/essential-codecs 
$ make

As root do:

# make install

To play a dvd:

$ mplayer -dvd-device /dev/cdrom  dvd://1

To play a movie through external VGA port to projector:

$ mplayer -vo gl2 -vop rgb2bgr filename.avi
$ mplayer -vo gl2 rgb2bgr=swap filename.avi
$ mplayer -vo x11 rgb2bgr=swap filename.avi

To rip a dvd:

$ mencoder -dvd-device /dev/cdrom dvd://1 -o file.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1800 -oac copy

$ psql -l -U postgres

To initialize a database:

# service postgresql initdb

To start the server:

# service postgresql start

To give local users trust access to postgresql server, update /var/lib/pgsql/data/pg_hba.conf:

...
# TYPE DATABASE USER CIDR-ADDRESS METHOD

# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
...

To become postgres user do:

$ su - postgres
Password:
-bash-4.0$

To select a database and enter postgresql prompt do:

$ psql -U postgres database_development
database_development=#

To list databases:

database_development=# \l

To list tables:

database_development=# \d

To list table values:

database_development=# select * from table;

To quit:

database_development=# \q

To connect to a different database do:

tumble_development=# \c database

export PS1='\[\e[1;32m\][\u@\h \[\e[0;34m\]\W \$\[\e[0m\] '
export PS1='\[\e[1;31m\][\u@\h \[\e[0;34m\]\W \$\[\e[0m\] '

$ asx8051 -losg first.asm
$ sdcc first.rel
$ packihx first.ihx > first.hex

From C:

$ sdcc first.c
$ packihx first.ihx > first.hex

If you have multiple .c files, say one.c, two.c, and one main.c that contains the main() function, then you compile using:

$ sdcc -c one.c
$ sdcc -c two.c
$ sdcc main.c one.rel two.rel

$ ssh-keygen -R neo

$ wget -r l1 http://www.foo.com/path/to/directory/

$ xhost +