Copy and pack your files into an ISO
To create the iso file do:
mkisofs -o /storage/myfiles.iso -J -R -r -V -v /dir/path/
Replace /dir/path/ with the full path to whatever directory contains the files you wish burned to CD.
How to use octave to generate png images of equations
octave
a=0:0.1:5
plot(a,kernelGauss(a,2))
xlabel(’r')
ylabel(’W(r)’)
title(’Gaussian Smoothing Kernel - h=2′)
print(’kernel.png’,'-dpng’)
Making movies with mencoder from png images
mencoder “mf://*.png” -mf fps=10 -o output.avi -ovc lavc -lavcopts vcodec=mpeg4
News feed reader in Opera browser
Here are some tips & tricks for Opera browser:
News feed reader
* to mark all messages inside a feed as read: CTRL + SHIFT + a
* show the news only for current week and the new posts at the top. For this you have to edit .opera/mail/index.ini, is necessary to do this modifications for every feed :
Model Age=1
Sort Type=4
Sort Ascending=0
* the update frequency at every 30 minutes:
Update Frequency=1800
How to install a Perl module
1. Download, extract, cd into directory
2. Compile & Install
perl Makefile.PL
make
make install
the second method can be:
perl -MCPAN -e shell
install modulename
Protect a web directory with password
vim /path/of/your/dir/.htaccess
Paste this into:
AuthType Basic
AuthName "Private Dir"
AuthUserFile /path/of/your/dir/.htpasswd
require valid-user
Then we must create the password file /path/of/your/dir/.htpasswd.
We want to log in with the username "user", so we do this:
htpasswd -c /path/of/your/dir/.htpasswd user
Enter a password for "user", and you're done!
Nice and useful commands
To capture the running state of the system. Start with the running processes on the system. Enter the following:
(ps -aux; ps -auxeww; lsof) > current_procs.txt
Grab the contents of the /proc directory. Enter the following:
tar -cvpf proc_directory.tar /proc/[0-9]*
Take a snapshot of the network state of the system. Enter the following:
(date; uname -a; netstat -p; netstat -rn; arp -v) > network_status.txt
Take a snapshot of the currently active and kernel memory.
dd bs=1024 < /dev/mem > mem
dd bs=1024 < /dev/kmem > kmem
Taking a Disk Snapshot:
dd if=/dev/hda1 bs=1024 > hda1
Install XFCE in OpenBSD
$ cd /usr/ports/x11/xfce4
$ make show=PKGNAME | awk '$1 !~ /===>/' > foo
# pkg_add `cat foo`
# cd
# Xorg -configure
# cp xorg.conf.new /etc/X11/xorg.conf
$ echo "exec startxfce4" > ~user/.xinitrc
$ startx
Install ports collection in OpenBSD
$ cd /tmp
$ ftp ftp://ftp.openbsd.org/pub/OpenBSD/4.0/ports.tar.gz
$ cd /usr
$ sudo tar xzf /tmp/ports.tar.gz
To install a package for the 4.1 release on an i386 machine off the ftp site (including dependencies), do:
# export PKG_PATH=ftp://openbsd.ftp.fu-berlin.de/pub/OpenBSD/4.1/packages/i386
# pkg_add name.tgz
Ports and Packages Update for an OpenBSD Release
To grab the stable branch for the 4.1 release:
$ cd /usr/ports
$ cvs -q -d anoncvs@openbsd.spline.de:/cvs up -r OPENBSD_4_1 -Pd
Generating passwords with Perl
DES:
mkpasswd
perl -e 'printf "%s\n", crypt("pass", "two-letter-salt")'
MD5:
mkpasswd --hash=md5
perl -e 'printf "%s\n", crypt("pass", "\$1\$6-8-letter-salt\$")'
PLAIN-MD5:
perl -MDigest::MD5 -e 'printf "{PLAIN-MD5}%s\n", Digest::MD5::md5_hex("pass")'
DIGEST-MD5:
perl -MDigest::MD5 -e 'printf "{DIGEST-MD5}%s\n", Digest::MD5::md5_hex("user:realm:pass")'