Random useful things
Your IP address is: 3.147.82.108
To start a daemon from a shell: ./command > /dev/null 2>&1 &
To create a patch: diff -u file1 file2 > update.patch
Or for a smaller set of changes: diff -udw file1 file2 > update.patch
Or for a kernel type patch: diff -bBdNrw -U5 dir.old dir.new > update.patch
Use SSH to rsync some files:rsync -az --progress -e ssh SOURCE DEST
Allow ctrl-d to exit a bash shellAdd "set +o ignoreeof" into your profile.
To get an interactive CPAN shell in Perl run: perl -MCPAN -e shell
To create *real* bootable Windows2000 cd's (remember sector 21) look
here.
To find all suid programs on a Linux system
find / -type f \( -perm -04000 -o -perm -02000 \) \-exec ls -lg {} \;
To test if your shell is interactive in bash do this:
if [[ $- = *i* ]]; then
echo "Do something here"
fi
How to make Slackware packages (quick synopsis)
tar -jxvf something-v1.20.tar.bz2
cd something-v1.20
./configure
make
make install DESTDIR=/tmp/package
cd /tmp/package
makepkg -l y -c n ../package.tgz
Now you can install the package, or do whatever you want with it.
How to install Java
- Download jre from sun/ibm/blackdown
- Extract it to a directory
- Move directory to /usr/local (mv j2re1.3.1 /usr/local/)
- cd /usr/local
- ln -s j2re1.3.1 jre
- Edit your profile (/etc/profile?) and add /usr/local/jre/bin into your PATH
- Reboot (or something equivalent)
RPM Usage Info
rpm -qa show all installed packages
rpm -qf <file> show which package owns <file>
rpm -qlp <rpm> show all files in <rpm>
rpm -q --scripts -p <rpm> show shell scripts executed by rpm
rpm -qip <rpm> show info about <rpm>
rpm -i -vv /mnt/cdrom/redhat/redhat-4.1/SRPMS/<package>.rpm install package
Installing True Type Fonts in XFree4
(This was copied from: http://cloud13.com/ppc/pretty.html)
Installing true type fonts in XFree86 4 is easy because it has true type support built in.
So all you have to do is make a directory for your fonts, i used /usr/X11R6/lib/X11/fonts/local/.
Copy your fonts to that directory, and make sure that they are all lowercase. Then you need
to download ttmkfdir from
here, and run
these commands in your true type font directory:
ttmkfdir -o fonts.scale
mkfontdir
Now remove any lines in XF86Config which reference /usr/X11R6/lib/X11/fonts/local/
and add this line to your /var/X11R6/lib/XftConfig:
dir "/usr/X11R6/lib/X11/fonts/local/"
Now restart X, and you will have access to all your true type fonts.