Links To Free Tools
Foundstone</a>. Provides the best tools I found so far to interprete Microsoft Windows' Internet Explorer index.dat (with Pasco) and cookie files (with Galleta), and many more... Sources can be downloaded from the ODESSA project (the open digital evidence search and seizure architecture) which can be found at http://sourceforge.net/projects/odessa/ Foundstone. Provides the best tools I found so far to interprete Microsoft Windows' Internet Explorer index.dat (with Pasco) and cookie files (with Galleta), and many more... Sources can be downloaded from the ODESSA project (the open digital evidence search and seizure architecture) which can be found at http://sourceforge.net/projects/odessa/

----

Useful Helper Programs And Tools
  1. # the most useful and userfriendly introductory to unix commands, both for beginners and advanced users can be found at http://linux.about.com/?once=true&
  2. # flip can be used to convert text files in the current directory and below from unix format (linefeed, 0x0a, LF) to windows format (carriage return + linefeed, 0x0d0a, CRLF):
     find . -type f -exec flip -d {} \; 
    
  3. # flip can be used to convert text files in the current directory and below from windows format (carriage return + linefeed, 0x0d0a, CRLF) to unix format (linefeed, 0x0a, LF):
     find . -type f -exec flip -u {} \; 
    
  4. # clean up an html page:
     tidy 
    
  5. # reformat paragraphs in a text file:
     par 
    
  6. # reformat a text file:
     fmt 
    
  7. # what the fuck decodes acronyms:
     wtf wtf; wtf afaik 
    
  8. # one-line information on many commands and programs:
     whatis whatis 
    
  9. # more extensive information on a particular commands or item:
     man whatis 
    
  10. # helpful information on built-in commands of the current shell (most probably bash):
     help help 
    
  11. # fun with ascii art:
     for a in /usr/share/cowsay/cows/*cow;do fortune -s|cowsay -f $a;done|less
    
  12. # And -- the auto nice daemon: automatically renices cpu-demanding processes
     sudo apt-get install and 
    
  13. # Dictionary lookup:
     dict term 
    
  14. # Fortune cookies matching a specific pattern:
     fortune -i -m pattern 
    
  15. # Gnome-based hex editor
     ghex2 
    
  16. # List information on all open files that belong to all active processes, the status of the modules currently available to the kernel, a quick overview (interrupts, ioports, dma) on the currently installed hardware, the currently installed pci devices, and the currently active usb devices:
    lsof; lsmod; lsdev; lspci; lsusb 
    
  17. # Network load overview:
     netload eth0 -t 5 
    
  18. # finding out which type of machine you are working on:
     uname -a 
    
  19. # finding out some interesting information on a particular host or machine:
     nslookup -querytype=any hostname.domain.org
     whois --verbose ipaddress
     host -a hostname.domain.org nameserver.org
    
  20. the following link provides very useful information on various frequently used unix commands: introduction to various unix tools

----

image Processing Tips
  1. # create a nice webpage with all your thumbnails:
     webmagick --recurse --forcehtml --forcemontage --srcdir ~/pictures --columns 4 
    
  2. # from tiff to eps (useful to include, e.g., a powerpoint slide in a LaTeX document):
     convert slide.tiff slide.eps 
    

----

Tips To Manipulate Jar Files
  1. # unjar all jar files found in $JARFILES into $CLASSES:
     export CLASSES=~/unjarred;
     export JARFILES=.;
     mkdir -p $CLASSES;
     cd $CLASSES;
     find $JARFILES -name \*jar -exec jar -xf {} \; 
    
  2. # recursive decompilation of all class files in $CLASSES, storing their decompiled version in $DECOMPILED:
     export CLASSES=~/unjarred;
     export DECOMPILED=~/decompiled;
     cd $CLASSES;
     mkdir -p $DECOMPILED;
     find -name \*class -exec jad -b -dead -o -s java -safe -ff -lnc -r -d $DECOMPILED {} \; 
    

----

Tips To Repair A Broken Master Boot Record Or Lilo Configuration File
  1. # running lilo on a machine on which the lilo.conf or (master) boot record have become inconsitent or have been overwritten:
    1. # boot from the Knoppix cd and open a terminal window
    2. # specify on which partition your crippled /etc/lilo.conf can be found, and mount it:
       export PARTIT=/hda7
       sudo mount /dev/$PARTIT /mnt/$PARTIT 
      
    3. # copy the crippled file to a writeable location:
       sudo cp /mnt/$PARTIT/etc/lilo.conf ~/ 
      
    4. # edit the erroneous lilo.conf to fix the problem:
       sudo joe ~/lilo.conf 
      
    5. # make sure to change each occurrence of `=/boot` to `=/mnt/hda7/boot` (given that your unix operating system is stored on /dev/hda7)
    6. # execute lilo:
       sudo ln -sf /mnt/$PARTIT/boot/ /
       sudo lilo -C ~/lilo.conf 
      
    7. # reboot the machine without the Knoppix cd
       sudo shutdown -r now 
      
    8. # remember to repair the lilo.conf again once your machine boots again...

----

Tips For Nfs
  1. # a nice introduction to configuring nfs can be found at http://www.metaconsultancy.com/whitepapers/nfs.htm
  2. # figuring out what nfs version some host uses:
     rpcinfo -p hostname |grep nfs 
    

----

Tips To Mount Your ntfs Read/write
  1. # with the following command you prepare your knoppix 3.4 (and higher) machine to mount an NTFS partition readwrite. This command has to be executed only once:
     sudo captive-install-acquire
    
  2. Press the ``forward'' button twice to start scanning your harddisk for native ntfs drivers. After a few minutes, the program may crash (i.e., the program crashes on my machine), but this does not seem to have an impact at all...
  3. # once captive-install-acquire has finished, you can prepare the /etc/fstab to include a specific item for your ntfs partition in rw mode:
     sudo captive-install-fstab -v --add 
    
  4. # you can now mount the partition in readwrite mode with:
     sudo mount /mnt/captive-noname 
    

----

Tips To Set Up An OSGi Framework
  1. # download the excellent and open-source OSGi gateway framework of http://www.knopflerfish.org/index.html, and store it in /tmp:
     cd /tmp
     wget http://www.knopflerfish.org/releases/1.0.2/knopflerfish_osgi_1.0.2.jar
     export KNOPFLERFISH_BIN=/tmp/knopflerfish_osgi_1.0.2.jar 
    
  2. # specify where the installation should go:
     export KNOPFLERFISH=~/osgi
     mkdir -p $KNOPFLERFISH 
    
  3. # launch the installation program:
     cd $KNOPFLERFISH;java -jar $KNOPFLERFISH_BIN -batch 
    
  4. # running the framework:
     cd $KNOPFLERFISH/knopflerfish_osgi_1.0.2/knopflerfish.org/osgi;java -jar framework.jar 
    

----

Tips To Manage Your Partitions
  1. # GRUB mini HowTo, boot loader which is even more powerfull than lilo
  2. # enumerate all the partitions which are currently known to /proc/partitions:
     fdisk -l 
    
  3. # add ext3 journalling information to some ext2 partition:
     tune2fs -j /dev/hda2 
    
  4. # remove ext3 journalling information from an ext3 partition other than the root partition (have a look at http://www.troubleshooters.com/linux/ext2toext3.htm if you wish to remove ext3 journalling data from the root device):
     tune2fs -O ^has_journal /dev/hda2;e2fsck /dev/hda2 
    
  5. # creating a large vfat partition on your unix box:
     mkfs.vfat -F 32 /dev/hda8 
    
  6. # undelete a file on a vfat partition:
     dosfsck -r -u path/file /dev/hdaXX 
    

----

Tips For Ramdisk
  1. # Ramdisk creation:
    • # determine the number of megabytes of the ramdisk, its location and its mount point:
      export RAMDISKSIZE=128000
      export RAMDISK=/dev/ram
      export RAMMOUNTPOINT=/mnt/ram
    • # create the ramdisk (using dd makes sure it does not have holes):
      sudo dd if=/dev/zero of=$RAMDISK bs=1k count=$RAMDISKSIZE
    • # initialize the ramdisk with a filesystem:
      sudo mke2fs -vm0 $RAMDISK $RAMDISKSIZE
    • # activate the new ramdisk:
      sudo mkdir -p $RAMMOUNTPOINT
      sudo mount $RAMDISK $RAMMOUNTPOINT
    • # change the ramdisk permissions:
      sudo chmod a+rwx /mnt/ram
  2. # Swap file creation:
    • # determine the number of megabytes of the swapfile and its location (make sure to specify a target location with enough free space to accomodate the swap file!! Creating a swap file on the root filesystem is not recommended...):
      export SWAPSIZE=512
      export SWAPFILE=/var/run/swapfile.$SWAPSIZE
    • # create the swap file (using dd makes sure the swap file does not have holes):
      sudo dd if=/dev/zero of=$SWAPFILE bs=1M count=$SWAPSIZE && sync && sync
    • # initialize the swap file:
      sudo mkswap -c $SWAPFILE
    • # check the current swap settings:
      cat /proc/swaps
    • # activate the new swap space:
      sudo swapon $SWAPFILE
    • # compare the new swap settings with the previous ones:
      cat /proc/swaps
    • # if you wish to use this swap file permanently, you should add it to the /etc/fstab:
      echo $SWAPFILE swap swap default 0 0|sudo bash -c "cat >> /etc/fstab"

----

Tips For System Recovery
  1. # bootdisk: provides various boot disks and utilities for both unix and windows system recovery and maintenance
  2. # Mounting disks with Linux' loopback device, e.g.. mounting the first partition found in a raw disk dump $Dump:
    1. # assume $Dump points at the hard disk dump (this dump may have been obtained using a command like `dd if=/dev/hda of=$Dump conv=noerror`):
       export Dump=/tmp/dump.img 
      
    2. # have a look at the partition table:
       sudo fdisk -u -l $Dump 
      
    3. # compute the partition offset of the desired partition:
       export StartSector=63     # fdisk shows the start sector for each partition it finds
       export BytesPerSector=512 # fdisk reports this as the unit size (in bytes)
       export Offset=$[$StartSector*$BytesPerSector] 
      
    4. # mount the partition (e.g., assuming fdisk reported an ntfs or vfat partition, have a look at `cat /proc/filesystems` to know which filesystems your kernel recognizes, and extend the list of partition types to try accordingly):
       export MountPoint=/tmp/dump
       sudo mkdir -p $MountPoint
       for PartitionType in ntfs vfat;do
         sudo mount -o loop,ro,offset=$Offset -t $PartitionType $Dump $MountPoint;
         done
       sudo ls -aRl $MountPoint 
      
  3. # shell script to create a lilo boot floppy
  4. # IBM's excellent system recovery page
  5. # An entry point to *a lot* `how do I...?'-items can be found at http://www.williamaford.com

----

Tips To Mirror Web Pages
  1. # recursively fetching all links referred to in a url without including the url's `upper' links and retrieving only files if they are newer than the local version:
     wget -r -N --retr-symlinks -np http://url 
    
  2. # recursively fetching all links referred to in a url without including the url's `upper' links:
     wget -r -np http://url 
    

----

Wiping Data
wipe</a>, a unix tool for secure data deletion wipe, a unix tool for secure data deletion

----

Tips For X11
  1. # usb mouse troubleshooting: It may happen that the automatically generated file /etc/X11/XF86Config-4 does not include correct settings for your usb mouse. If the command
    cat /dev/input/mice|hexdump|timeout 30 head -5
    outputs some data in hexadecimal format when moving your usb mouse, you may try to configure the mouse-specific sections of /etc/X11/XF86Config-4 by hand, e.g., given the following:
     Section "ServerLayout"
             Identifier     "XFree86 Configured"
             Screen      0  "Screen0" 0 0
             InputDevice    "Keyboard0" "CoreKeyboard"
     # PS/2 Mouse not detected
     # Serial Mouse not detected
             InputDevice    "USB Mouse" "CorePointer"
     EndSection
     
     Section "InputDevice"
             Identifier      "USB Mouse"
             Driver          "mouse"
             Option          "Device"                "/dev/input/mice"
             Option          "SendCoreEvents"        "true"
             Option          "Protocol"              "IMPS/2"
             Option          "ZAxisMapping"          "4 5"
             Option          "Buttons"               "5"
     EndSection
    
  2. # nice X11 configuration tool for Knoppix:
    sudo kxconfig
  3. # nice /etc/X11/XF86Config generation tool used by Knoppix:
    mkxf86config
  4. # if you wish to specify an additional X display which can be accessed through ctrl+alt+8, you could add the following line to /etc/X11/xdm/Xservers:
    :1 local /usr/X11R6/bin/X vt8 -dpi 100 -nolisten tcp
  5. # installing the xv.rpm:
  6. # you could also give it a try compiling and installing xv yourself:
    • # fetch and unpack the sources:
      cd /tmp
      wget ftp://ftp.cis.upenn.edu/pub/xv/xv-3.10a.tar.gz
      tar -xzvf xv-3.10a.tar.gz
      cd xv-3.10a
    • # read the README and INSTALL files, and pay the registration fee of 25 dollar
    • # replace 'extern char *sys_errlist[]; /* this too... */' by 'extern __const char *__const sys_errlist[];':
      cat xv.h|sed s/"extern char \*sys_errlist\[\]; \/\* this too... \*\/"/"extern __const char \*__const sys_errlist\[\];"/ > xv.h.tmp;
      mv xv.h.tmp xv.h
    • # make sure that the X11 libraries are found:
      cat Makefile|sed s/"LIBS = -lX11 \$(JPEGLIB) \$(TIFFLIB) -lm"/"LIBS = -L\/usr\/X11R6\/lib -lX11 \$(JPEGLIB) \$(TIFFLIB) -lm"/ > Makefile.tmp
      mv Makefile.tmp Makefile
    • # execute the make file and install the stuff if successful:
      if make;then
      sudo mkdir -p /usr/local/man/man1;
      sudo make install;
      fi

----