Linux tips and tricks
Linux disk space usage 1-liner (January 9, 2019)
Get the size of the files and folders in the current directory including their children...
Get the size of the files and folders in the current directory including their children...
Conditionally sum up response sizes in Apache logs (January 3, 2019)
Linux command line for summing response sizes...
Linux command line for summing response sizes...
Backup lvs snapshots and scp to remote server (January 2, 2019)
Create backups of your xen guest VM lvs volumes to a remote server over ssh...
Create backups of your xen guest VM lvs volumes to a remote server over ssh...
Xen hypervisor reset guest root password from host (November 19, 2015)
How to reset the guest root password by mounting the guest disk image on loopback...
How to reset the guest root password by mounting the guest disk image on loopback...
Claw back netbook performance after upgrading to Debian Jessie (November 17, 2015)
Debian Jessie feels quite a bit slower than Wheezy on my Samsung N220. Here's how to get some performance back...
Debian Jessie feels quite a bit slower than Wheezy on my Samsung N220. Here's how to get some performance back...
Recover lost form posts in Firefox (November 11, 2015)
Use gcore to dump Firefox's memory and you can recover the post data...
Use gcore to dump Firefox's memory and you can recover the post data...
Linux find and replace in files (November 4, 2015)
Use find, grep, and sed to replace text in files...
Use find, grep, and sed to replace text in files...
Copy Debian installed packages (May 28, 2015)
How to install the same software on a second Debian server...
How to install the same software on a second Debian server...
Clear Linux buffers, cache when benchmarking filesystem (March 12, 2013)
If you are trying to optimise a filesystem operation, remember to clear Linux buffers and cache between benchmarks or some of the file reads will be served from memory!...
If you are trying to optimise a filesystem operation, remember to clear Linux buffers and cache between benchmarks or some of the file reads will be served from memory!...
Linux increase console resolution (March 6, 2013)
How to increase the text console resolution in Linux...
How to increase the text console resolution in Linux...
Linux high load when writing to slow block devices (SD cards, USB hard drives) (January 18, 2013)
Explanation for why some SD card writes send the system load soaring...
Explanation for why some SD card writes send the system load soaring...
Linux reset root password using GRUB (November 20, 2012)
How to reset the root password of a Linux box if you have physical access...
How to reset the root password of a Linux box if you have physical access...
Linux wipe SD card partition table (September 25, 2012)
[SOLVED] How to fix a corrupted partition table and fdisk is giving the error: You must set cylinders...
[SOLVED] How to fix a corrupted partition table and fdisk is giving the error: You must set cylinders...
Concatenate 2 files in Linux with cat (July 18, 2012)
How do you concatenate (append) 2 files together in Linux?...
How do you concatenate (append) 2 files together in Linux?...
Debian Linux netbook / laptop / Raspberry Pi power saving with acpitool (June 6, 2012)
Find out the discharge rate of your battery in Debian using acpitool...
Find out the discharge rate of your battery in Debian using acpitool...
java.io.IOException: Too many open files (March 20, 2012)
If your Java program throws this exception then you have run out of file handles / pipes / domain sockets (depending on how your OS represents files). Here is how to debug the error on Linux...
If your Java program throws this exception then you have run out of file handles / pipes / domain sockets (depending on how your OS represents files). Here is how to debug the error on Linux...
ls sort by date and time (March 20, 2012)
Quick tip for sorting the results of the ls command by age...
Quick tip for sorting the results of the ls command by age...
init.d script to create essential dirs (apache, postgresql, debconf) when mounting /var on tmpfs (February 22, 2012)
If you are mounting log, cache, and tmp directories on a tmpfs filesystem then you may encounter problems with programs failing to start or work correctly due to missing folders. By using a simple ini...
If you are mounting log, cache, and tmp directories on a tmpfs filesystem then you may encounter problems with programs failing to start or work correctly due to missing folders. By using a simple ini...
qmail alias for email address with dot (February 9, 2012)
How do you set up a .qmail email alias for an email with a dot in it?...
How do you set up a .qmail email alias for an email with a dot in it?...
Debian dist-upgrade lenny to squeeze (February 9, 2012)
How to update Debian from lenny (5.0) to squeeze (6.0)...
How to update Debian from lenny (5.0) to squeeze (6.0)...
Find open ssh servers on a network using nmap on Linux (February 3, 2012)
How do you find open ssh servers on a network using nmap?...
How do you find open ssh servers on a network using nmap?...
Using Linux tmpfs to reduce disk writes for power saving and longer CF lifespan (February 3, 2012)
How to reduce disk writes for power saving or increasing compact flash lifetime using tmpfs...
How to reduce disk writes for power saving or increasing compact flash lifetime using tmpfs...
Linux find and move old files (December 30, 2011)
How do you find and move files older than a certain age in Linux?...
How do you find and move files older than a certain age in Linux?...
bash rename files using a for loop (December 23, 2011)
How do you rename a set of files using a single command in Linux using bash?...
How do you rename a set of files using a single command in Linux using bash?...
Linux show routing table without being root (November 24, 2011)
How do you show the Linux IP routing table without being root and running the route command...
How do you show the Linux IP routing table without being root and running the route command...
Debian bash can auto-complete program switches (November 2, 2011)
Today I discovered by accident that bash can auto-complete command line switches to certain programs...
Today I discovered by accident that bash can auto-complete command line switches to certain programs...
tar: time stamp is in the future (October 31, 2011)
How to solve the time stamp is in the future error when you unpack a tar file on a system where the clock is behind the system clock on which you created the tar archive...
How to solve the time stamp is in the future error when you unpack a tar file on a system where the clock is behind the system clock on which you created the tar archive...
Change the hostname on a Linux system (October 28, 2011)
How do you change the hostname of a Linux PC?...
How do you change the hostname of a Linux PC?...
tar list contents of file (October 28, 2011)
How do you get a list of the files inside a tar archive?...
How do you get a list of the files inside a tar archive?...
svnserve start on boot using update-rc.d on Debian Squeeze (October 24, 2011)
How can you get svnserve to start on boot by creating an init.d script and linking using update-rc.d...
How can you get svnserve to start on boot by creating an init.d script and linking using update-rc.d...
Binary file (standard input) matches when grepping tail (October 21, 2011)
You are tailing a growing log file using 'tail' and piping the output into grep and you get the error Binary file (standard input) matches when grepping tail and the command exits. ...
You are tailing a growing log file using 'tail' and piping the output into grep and you get the error Binary file (standard input) matches when grepping tail and the command exits. ...
Java return code in Linux shell script (September 13, 2011)
How do you get the return code from a Java program in a Linux shell script?...
How do you get the return code from a Java program in a Linux shell script?...
Debian Linux 2-NIC router (September 1, 2011)
How to make a router from a Debian Linux PC with 2 network cards...
How to make a router from a Debian Linux PC with 2 network cards...
Debian N220 netbook power saving script (August 31, 2011)
Power saving script for Samsung N220 netbook on Debian squeeze...
Power saving script for Samsung N220 netbook on Debian squeeze...
Linux find grep and rm with a massive number of files (July 22, 2011)
Got a directory with a bazillion files and need to delete the ones containing a certain text string? Here is how you can do it with a simple one-liner....
Got a directory with a bazillion files and need to delete the ones containing a certain text string? Here is how you can do it with a simple one-liner....
Sort files by size in Debian (July 22, 2011)
Trying to find the big files clogging up your filesystem?...
Trying to find the big files clogging up your filesystem?...
Linux redirect standard out and standard err to dev null (July 18, 2011)
If you don't care about any stderr and stdout output from a process (e.g. you are running a script from cron and don't want to be bombarded by emails containing the process debug) use these redirects ...
If you don't care about any stderr and stdout output from a process (e.g. you are running a script from cron and don't want to be bombarded by emails containing the process debug) use these redirects ...
/etc/apt/sources.list for dist-upgrade lenny to squeeze (July 4, 2011)
Volatile no longer exists starting with Debian Squeeze so here are the apt sources.list lines you need to dist-upgrade from Lenny....
Volatile no longer exists starting with Debian Squeeze so here are the apt sources.list lines you need to dist-upgrade from Lenny....
Samsung SyncMaster 913N 1280x1024 resolution in Debian and Ubuntu (July 1, 2011)
My Samsung SyncMaster 913N only detects modes up to 1024x768 in Debian and Ubuntu, here is how to add the 1280x1024 native resolution using xrandr....
My Samsung SyncMaster 913N only detects modes up to 1024x768 in Debian and Ubuntu, here is how to add the 1280x1024 native resolution using xrandr....
Linux remove duplicate lines from file (June 28, 2011)
3 different ways to remove duplicate lines from a file at the command line....
3 different ways to remove duplicate lines from a file at the command line....
Disable exim4 MTA startup on Debian squeeze (May 26, 2011)
Don't need an MTA running on port 25?Disable exim4 like this....
Don't need an MTA running on port 25?Disable exim4 like this....
Remove .svn folders on Linux (March 31, 2011)
How to remove .svn hidden directories with a single Linux command....
How to remove .svn hidden directories with a single Linux command....
Which process is using port with lsof or netstat (solve bind errors) (February 1, 2011)
You've got a bind error because a process is already listening on your port. Here are two different ways to find the offending process (Linux/UNIX/etc)...
You've got a bind error because a process is already listening on your port. Here are two different ways to find the offending process (Linux/UNIX/etc)...
[SOLVED] Linux route command takes a long time to complete (January 26, 2011)
If your routing table takes a long time to display then you may have a DNS resolution issue causing the slowdown. Here is the solution:...
If your routing table takes a long time to display then you may have a DNS resolution issue causing the slowdown. Here is the solution:...
Debian software RAID 1 on non boot disk (October 12, 2010)
How to create a software RAID1 array on your non-boot drive using fdisk and mdadm...
How to create a software RAID1 array on your non-boot drive using fdisk and mdadm...
Find and Replace with nano (September 3, 2010)
nano is a simple text editor for Linux and UNIX systems and I've been using it for years but only discovered the search and replace function today....
nano is a simple text editor for Linux and UNIX systems and I've been using it for years but only discovered the search and replace function today....
Create ISO from CD or DVD in Linux (April 30, 2010)
If you are using VirtualBox or another virtualisation system and need to make some ISO images from your installation media for quick VM creation then use this command to easily create an ISO image fro...
If you are using VirtualBox or another virtualisation system and need to make some ISO images from your installation media for quick VM creation then use this command to easily create an ISO image fro...
Ask me about
AdSense Android ant Apache Applet Artigo C++ CI codec console CSS Debian DemoScene deployJava.js diff DIY Eclipse Excel fdisk find Firefox FixPC Flash fuse GC git GPG grep HotSpot hsdis HTML Icedove icedove Iceweasel ImageMagick iOS iPhone iSCSI ISO JarScan Java JavaFX JavaScript JCrete JDBC JDK Jenkins Jessie JIT JITWatch JVM lambdas lame Linux linux low latency LVM Mac MacPorts maven Microsoft mkfs mp3 MySQL Networking networking NFS Obj-C OpenJDK OpenJFX openSSL openssl optimisation OSX Patterns PHP PIX PostgreSQL powersaving PS3 Puzzle qmail Raspberry Pi RaspberryPi Safari samba Samba Scala scp scponly SEO ssh sshfs stunnel svn SWT sysctl syslog-ng tcpkill Thunderbird tmpfs Tomcat tripwire Ubuntu Unity UTF-8 vi VirtualBox website Websites wget Windows Windows 8 Word Xcode xen ZTE Blade