For future reference. http://www.pdflabs.com/docs/pdftk-cli-examples/
Linux Tools
Stop people listing home directories on a Linux Host
If you issue ls -al /home on a Linux computer as a standard user. You will normally get a list of users on the system. This is because the permissions to /home/ are 755 which equates to drwxr-xr-x However if you as root run chmod 751 /home giving permissions of...
OpenVPN – Make Routing Mode behave like Bridging Mode
Note: This post isn't complete. I have this configuration working for myself, but the IPTables rules are taken from a very big script and may not be complete. Email me if you have a question or if you can explain this better. Anyway hopefully there is enough here to...
Sendmail from the command line
echo -e To: 'The Persons Name ' \\n\\n Body of mail \ | /usr/sbin/sendmail -F "From Name" \ -f [email protected] -t [email protected] Where -e says I want to interpret \\n as a newline. -F is the from description -f is the from address -t is the to address Example:...
Linux /tmp size for DVD burning
I was just trying to burn the Fedora 11 Preview DVD in XUbuntu and the default burning application logically uses /tmp as the location for temporary image files. However my /tmp only had about 2.9 GB free space The DVD is 3.8G and so the DVD burn failed due to lack of...
Finding out when your DNS delegation has propogated
If you have delegated your DNS to another hosting provider you may want to send yourself an email when your DNS domain delegation has propogated (so you can notify people after the change and not have everyone saying "I can't get to your site"). Create a script as...
Using find & xargs to create an empty index.html file in every directory
If you have global indexing turned on for Apache: Options Indexes You may wish to leave it enabled but still stop indexes being displayed. Using find and xargs you can create an empty index.html in each directory and Apache will serve it instead of the list of files...
Getting the HTML Tidy External Command working on Bluefish for Windows
Bluefish is a really cool "Web Development Studio" I find it's side pane CSS and HTML reference invaluable when trying to code HTML. It has recently been ported to Windows As it installs, everything pretty much works out of the box, but it's Linux heritage shows when...
XML Format Test
A string of XML: Text Node Send it through xmllint: echo 'Text Node' | xmllint --format - Output from xmllint: Text Node
/usr/bin/which equals bash builtin type -p
Just playing with wine-1.1.14 and found a font smoothing script that enables font smoothing on Wine >= 1.1.13. Anyway in the script I noticed a command: type -p wine Which after a little investigation is similar to which wine I like to make note of these sorts of...
Formatting Perl’s XML::DOM output
I have been taking some output from our ERP system into a webform destined ultimately for resubmission to the ERP. XML and it's relationship to HTML makes it perfect for the job. Therefore I have been using Perls XML::DOM to read and write some XML. One issue I have...
Clear Squid Cache CentOS 5.x
How: service squid stop rm -rf /var/spool/squid/* (removes cached files and directory structure) rm -rf /var/log/squid/* (removes the logs) squid -z (recreates the cache_dir structure) service squid start Why: Doing the above can be helpful if you want to claw back...
Running Cron Every X Minutes
I keep forgetting the correct format of cron entries to have a command run every three minutes To do it every three minutes you need to make the syntax */3 not simply 3 (which means on the 3rd minute of every hour) # m h dom mon dow command */3 * * * *...
Putting the I in Idiot – or I just deleted my External USB Drive Partition
The Problem: Doing a Windows XP Pro install at work... Boot Install CD Delete partitions Delete C: Hmm didn't know there was a D: but hey it's got to go.... Delete D: ... Oh No! That was my 250GB External USB drive holding a heap of backups.... Argggh The Fix: I have...
Tesseract gotcha – tif works, tiff doesn’t
Problem tesseract mytiff.tiff myout Tesseract Open Source OCR Engine name_to_image_type:Error:Unrecognized image type:mytiff.tiff IMAGE::read_header:Error:Can't read this image type:mytiff.tiff tesseract:Error:Read of file failed:mytiff.tiff Signal_exit 31 ABORT....
PopTop PPTP Server + Linux Gateways
Suppose you have the following configuration Priv Network A---Windows XP Clients | Linux gateway (iptables NAT etc) | [Internet] | Linux gateway (iptables GRE and PPTP port 1723 NAT'd and forwarded to internal PPTP server) | Priv Network B---<linux PPTP Server>...
How not to choke your internet connection while downloading with wget
wget has a cool feature known as limit-rate. If you want to leave a bit of bandwidth for other things then use it with double u get. wget -c -t 100 --limit-rate=80k http://ftp.iinet.net.au/pub/ubuntu-releases/8.10/ubuntu-8.10-beta-desktop-i386.iso The above means -c...
How long should dd take to zero a partition
I had a virus infested computer and I wanted to zero the partition and restore from a partimage file but first I thought I would zero out the data on the partition using dd so: dd if=/dev/zero of=/dev/hda1 This took absolutely ages... and I was wondering when it was...