Category: Shell
Linux Command Line, Generating a Random File
It is very easy to create a random file using the linux command line. Much like the command to fill a file with all zeros, for example a 1 Meg file: dd if=/dev/zero of=zero.filename bs=1024 count=1000 You do the same using /dev/urandom: dd if=/dev/urandom of=random.filename bs=1024 count=1000 Resulting in a 1MB file: 1000+0 records in [...]
How to Install SNMP on Tomato Router Firmware and Graph Traffic with Cacti
You’ve flashed your old WRT54G or other vanilla router with the Tomato firmware. This itself turns your router into a lean, mean routing machine with QOS, SSH and more, but let’s say we want to take it a bit further. What it we want to get some more stats out of it? In order to [...]
Command Line Packet Sniff Existing Running Process in Linux
Have you ever come across a server that is doing a lot of traffic? Maybe you have logged in to see a process running at 100% CPU, so you know the culprit, but instead of kill -9ing it, wouldn’t it be great to see what exactly it is up to? Or even if you see [...]
Error While Mounting an ISO Image in Linux: ioctl: LOOP_SET_FD: Invalid argument
I recently received this error while mounting an iso image in a CentOS 5.3 install: 12[root@host ~]# mount -t iso9660 -o loop /mnt/glusterfs/ecp-spe-4867.iso /mnt/iso/ ioctl: LOOP_SET_FD: Invalid argument For more detail: 1234[root@host ~]# mount -v -t iso9660 -o loop /mnt/glusterfs/ecp-spe-4867.iso /mnt/iso/ mount: going to use the loop device /dev/loop0 ioctl: LOOP_SET_FD: Invalid argument mount: failed [...]
Ubuntu Server in Place Network Upgrade From 8.10 to 9.04
It is easy to do an in-place upgrade of Ubuntu Server from 8.10 ‘Intrepid Ibex‘ to 9.04 ‘Jaunty Jackalope‘. You can do this remotely over ssh or whatever you use to control your server. Best practices say to make sure to backup your server before doing the upgrade. I’ve done several servers this way with [...]
Easy Search and Replace in Multiple Files on Linux Command Line
I recently came across a typo that existed in a bunch of html files on my web server. I thought it should be easy enough to change, but since it was in a number of files, editing it by hand would be time consuming. Fortunately, there is an easy, one liner command to replace the [...]
How To Turn Off Your Monitor Via Command Line in Ubuntu
As previously written on this blog, I have set up a display in our lobby at work to display the day’s current events and meetings using Ubuntu and a tiny PC. Since this is a display which is on all day, the screensaver and monitor blanking (and other Energy Star features) are all turned off. [...]
Some Rights Reserved 2012