Commands to decompress .deb files :mkdir /tmp/fooContents will be extracted in the current directory. Use the binaries and/or configuration files at your disposal.
cd /tmp/foo
ar vx /home/user/foo.deb
tar vxf data.tar.gz
Tuesday, August 26, 2008
Extracting contents of .deb packages
Sunday, August 17, 2008
A simple IRC Logger-bot in Bash
The script :
## Bot.sh - begin
Make Bot.sh executable:
Now all that's left is to run it.
Enjoy!
## Bot.sh - begin
#!/bin/bash## EOF
config=/tmp/ircbot
echo NICK ircbot > $config
echo USER username +iw ircbot :$0 >> $config
echo JOIN #orkut_linux >> $config
tail -f $config | telnet irc.freenode.net 6667 | while true
do read MESSAGE || break
echo $MESSAGE >> irclog.txt
done
rm $config
Make Bot.sh executable:
chmod +x Bot.sh
Now all that's left is to run it.
Enjoy!
Saturday, August 16, 2008
ACPI Suspend/Resume
Suspend to RAM or Suspend to disk on GNU/Linux with an ACPI enabled kernel:
First, we find out what sleep state the system supports by running
mem / standby - Suspend to RAM (standby)
disk - Suspend to Disk (hibernate)
Example : ( '#' prompt denotes that i'm root already)
NOTE : For suspend to disk to work correctly, pass the resume kernel parameter at boot.
First, we find out what sleep state the system supports by running
echo /sys/power/stateAnd we finally put the system to sleep by doing (as root) :
echo -n "X" > /sys/power/stateWhere X is one of the sleep states obtained from the before mentioned command.
mem / standby - Suspend to RAM (standby)
disk - Suspend to Disk (hibernate)
Example : ( '#' prompt denotes that i'm root already)
# cat /sys/power/state
# mem standby disk
# echo -n disk > /sys/power/state # for suspend to disk (a.k.a 'hibernate')
NOTE : For suspend to disk to work correctly, pass the resume kernel parameter at boot.
kernel /vmlinuz-2.6.25-custom root=/dev/hda1 ro resume=/dev/hda4Keep in mind that this resume partition must be a valid swap partition.
Subscribe to:
Posts (Atom)