- Published:
- August 5, 2009 – 9:16 pm
- Author:
- By Dave
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 do this, we first need to set up a way to pull this information from the router. The best way to do this is to install an SNMP (Simple Network Management Protocol) daemon on the system. The main roadblock we face here is that the system mainly runs in volatile system memory, meaning that every time the system is rebooted the filesystem is reset. Fortunately Tomato provides a way to get around this using CIFS shares. Follow the steps below (as modified from here) to install an SNMP server on a Tomato router. Create a….
Categories: Code Samples,Configurations,Hardware,Linux,Other Code,Other Technology,Programs,Shell,Software,System Administration
Tagged: cacti, firmware, network, router, SNMP, sysadmin
- Published:
- July 21, 2009 – 9:57 am
- Author:
- By Dave
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 a process and don’t know exactly what it is doing, and you are just curious what it is up to? As with most issues there are several ways to skin this cat. You can use tcpdump or wireshark to sniff the all of the network traffic on the device. If you know the port the program is running on (you can use lsof for that), you can restrict traffic to that port. But what if the program is jumping ports, or even uses a side-port for some sort of data transmission (UDP?). The main problem….
Categories: CentOS,Code Samples,Linux,Shell,System Administration
Tagged: command line, Linux, network, Security, system admin, traffic
- Published:
- June 16, 2009 – 9:18 pm
- Author:
- By Dave
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 setting up loop device So what could this mean? The confusing error message “ioctl: LOOP_SET_FD: Invalid argument” means that your ISO image is on a filesystem that is not supported for the loopback device on your system. In my case, that was a GlusterFS mount that was hosting the image. I copied it into another directory on my root ext3 filesystem and it mounted just fine!
Categories: Shell,System Administration
Tagged: cdrom, image, iso, Linux, loopback
- Published:
- May 21, 2009 – 7:22 pm
- Author:
- By Dave
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 no issues! Issue the command: 1sudo apt-get update; sudo apt-get upgrade; sudo apt-get install update-manager-core; sudo do-release-upgrade Follow any prompts to first upgrade the current distribution with the newest packages, then do the release upgrade.
Categories: Linux,Shell,System Administration,Ubuntu
Tagged: System Administration, Ubuntu
- Published:
- May 6, 2009 – 11:10 pm
- Author:
- By Dave
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 text in multiple files in a sub directory using recursion. grep -lr -e ‘<oldword>’ * | xargs sed -i ‘s/<oldword>/<newword>/g’ This command broken down: grep for the word in a files, use recursion (to find files in sub directories), and list only file matches | xargs passes the results from the grep command to sed sed -i uses a regular expression (regex) to evaluate the change: s (search) / search word / target word / g (global replace) For more information, see man pages for grep, sed, and xarg. Also it is very handy to….
Categories: CentOS,Other Code,Shell,System Administration,Ubuntu
Tagged: command line, Linux, tips
- Published:
- April 14, 2009 – 10:56 am
- Author:
- By Dave
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. Under the auspice of wanting to save energy and also extending the life of a new monitor, someone suggested that we turn off the monitor at night using an electrical timer. A lightbulb went off in my head, that there must be a better way to do this via command line and then run it in the cron. It turns out the solution is very simple. The xset command is the X server preferences command. It has a simple command to turn off the monitor: 1$ xset dpms force off and to turn the monitor….
Categories: Code Samples,Hardware,Linux,Shell,Software,System Administration,Ubuntu
Tagged: display, energy, energystar, lobby, monitor, power, saving
- Published:
- March 17, 2009 – 3:58 pm
- Author:
- By Dave
Running sudo apt-get upgrade, I started getting this error: 1Reading package lists… Done 1W: GPG error: http://ppa.launchpad.net intrepid Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 313D312748A22A95 1W: You may want to run apt-get update to correct these problems Ah ha! But apt-get update is the command causing this problem. The solution is to import this key from the gpg servers; I don’t know why this isn’t done automatically, but here is it: 1sudo apt-key adv –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95; gpg –export –armor 313D312748A22A95 | sudo apt-key add – Resulting in: 123456Executing: gpg –ignore-time-conflict –no-options –no-default-keyring –secret-keyring /etc/apt/secring.gpg –trustdb-name /etc/apt/trustdb.gpg –keyring /etc/apt/trusted.gpg –recv-keys –keyserver keyserver.ubuntu.com 313D312748A22A95 gpg: requesting key 48A22A95 from hkp server keyserver.ubuntu.com gpg: key 48A22A95: public key "Launchpad PPA for Filip Brcic" imported gpg: Total number processed: 1 gpg: unchanged: 1 OK Congrats! sudo apt-get….
Categories: Configurations,Shell,System Administration,Ubuntu
Tagged: apt-get, gpg, Ubuntu