There is a bunch of Linux Server Monitoring software available. The problem is sifting through it all. The first thing to do is identify what it is you want to monitor then you can find what software will work best for your needs. As far as system monitoring goes there is old school and new school. Any combination of tools could be used and there are also a number of ways you can home brew some monitoring solutions. Click for the large version of the Linux Server Monitoring Image. (Read on …)
History is great. How does the saying go?
“Those who forget about history are doomed to repeat it?”
If that’s the saying I think it is more fitting to say that for those who forget the Linux History Command are doomed to repeat typing. A lot. Seriously, the history command can help you remember the exact Linux find command with the intricate search options you typed a while ago. It could help you open up your x2x or x2vnc sessions after a reboot. Who knows what you’ll use it for. All this comes at a little cost, you’ll have to know how to use it.
Video completely unrelated.
Ever tunneled or used tunneling for mobile Internet? Perhaps you have needed to otherwise tunnel to bypass a restrictive firewall or for a secure channel on an insecure wireless network. It seems that everyone knows how to tunnel using the ssh socks support and how to use Firefox’s about:config screen to set it to use a socks and remote DNS. While this is great for occasional web browsing it only takes you so far.
tsocks is a great application to let you tunnel other programs over socks. Its easy to install on most distributions and allows you to use many command line applications. I’ve used it on a number of occasions successfully and while it does its job its not the the best solution. This is because it was last updated in 2002 and doesn’t perform DNS lookups. I found myself using it to SSH to an IP address (memorized, or looked up through another SSH session) and using applications on the remote server.
proxychains is a bit of a better tunneling solution, it works the similarly to tsocks but It also resolves DNS and can chain multiple proxies. I’ve used it on numerous occasions with great success. ssh, lynx, lftp, irssi and a whole bunch of others work without any problems. Another plus is it has also been updated in the last 5 years (but not by much.)
One application I haven’t yet had the pleasure of trying on the desktop is 3proxy. I have used it on the iPhone but ended up using the ssh socks method more often. From its yum description and feature list, it sounds very promising and one definitely worth looking into.
Speaking from experience I know its kind of difficult to browse your distributions web repositories to find the files you need and install them (I had to do this since I didn’t have them) so I recommend you download these applications and save yourself some time before you need them on the road.
Mind mapping is a great way to get all of your thoughts out. There are two major competitors when it comes to mind mapping on Linux.
In the blue corner we have reigning champion FreeMind and in the red corner we have a new contender for the best mind mapping software kkkkkkkkkkkdissert.
FreeMind Vs kdissert…. Fight. (Read on …)
With the upcoming release of Tron Legacy I can’t help but play this game. Now if only a 3D version got released and a certain some one would stand inline to get me 3D television on Black Friday. Better yet, code the 3D version WHILE waiting in line for Black Friday sale. Odds are I’ll probably get a leaf blower, ladder or something with lesser or equal buzz killing potential.
Check out my GLTron skills. Make sure to watch it in 480p and take no notice of the number of “Player 1″ crashes in the top left hand corner, that obviously wasn’t me. There also is NO sound, but you can install it, play the soundtrack at the same time and get the same effect. I think the only time I’ve ever been more 1337 was when I hacked that Gibson, but that’s a-whole-nother story. Also take note of the length of this video, a total accident.
Emanuele gave me the heads up of a new release of Vatlator which is a live CD for anonymous browsing. This is the first I’ve heard of Vatlator so naturally I downloaded it to see what it was all about. After setting up a new virtual machine and disk it had no problems booting up and did it fast. From testing Firefox, tor is enabled by default and works well, although a little slower but thats expected from using Tor. You may want to note that that not all traffic is routed through Tor, it would be best test to make sure that what you need is before you need to use it.
I installed the Virtual Box add-ons, and after restarting X by logging out, then logging back in (took me a while to figure this out) the resolution was much better. By the way, the sudo root password is vatlator. Since it is based on Ubuntu installing software works with apt-get and has a great range of packages.
One thing that baffles me is the “F… the censorship” slogan, it just seems a little hypocritical, but I can relate to reasons behind it. I’m definitely going to keep it handy since it runs great in Virtual Box, boots up quickly and performs really well. Kudo’s Emanuele!
Did you remember to backup the files…?
All of them?
What do you mean *MOST* of them?
Well, you should have used one of these flippin’ utilities.
Off with his head!
(Read on …)
A few weeks ago a new version of RSSTail came out. After reading the RSSTail page I found out that you can use RSSTail as a plugin to a fantastic application called multitaill. That is when I realized that multitail is actually written by the same person.
If you rely on tail, or have ever used tail you’ll probably enjoy this one. As the name implies it is a pager like tail except that it supports for more than one stream. Now, I know some of you have probably used some wizardry do get your favorite pager to show multiple streams, either in the same output or by using screen / splitvt but multitail really simplifies the process. It has all kinds of settings (such as color) and allows you to manage your tail’d files on the fly and even save the current view for later use. It does have a little bit of a learning curve but I think it is well worth it, especially if one of your hobbies includes log watching.
I’ve come across a number of programs in the past and thought to myself,
“Why didn’t they script this, it would be so much easier.”
After thinking about it for a while it all makes sense now. It seems that I had the shell script bug, everything must be done in the shell! In reality while the shell is great and all, it is not without its flaws. There are somethings the shell is great at and should be used for, then there others it shouldn’t.
Don’t get me wrong, I like to script as much as the next guy, but sometimes I think people get lost in its simplicity. Some people use it for everything without fail. Perhaps this is because they don’t know otherwise, or maybe because they too have the shell script bug.
There are many reasons to use the shell and I’m not against using it by any means. This is simply a list of when it may not be suitable to whip out the shell and start scripting. If there is any I missed, please add them in the comments and they may eventually make it into a revised post. I’ll do the same if I come up with any more. Onto the list!
Distribution / Portability – Ever try to distribute a script? Well, most of the time its not a problem, but sometimes you’ll get bit in the ass. Not all systems are created equal. Some have missing packages, or something doesn’t work the EXACT same way.
Simplicity – Sometimes bash is elegant. Well, it depends on your definition I guess. Some argue that scripting is simple, where as others that have to support or maintain it will be ready to cut you. I know I’m sharpening my shanks right now for some revenge. Seriously though, choose a language that makes it easy to K.I.S.S (keep it simple, stupid.)
Performance – Lets kick in the after burners. This is one I don’t have much experience in although I should probably look into it. The shell is sort of like a glider, it gets the jobs done, but I wouldn’t want to race it against a jet or anything. If you’re considering scripting, just time the process to make sure it meets your performance needs. Most of the time, if it is for you, you’ll be fine right? I mean you’ve got all of the time in the world and can wait overnight if you have to. I’d rather not, but have been known to wait on a slow script out of laziness.
Maintenance – Nightmare code. Dependency Hell. Some may have seen the t-shirt or heard the phrase,
“Programming is like sex; one mistake, and you’ll support it forever”
Yea scripting this is sort of like that, except you can always abandon and upgrade your scripts :)
Security – Keep it secure, there are many issues with security in shell scripts. We wont get into them now but if you wear a tinfoil hat when using a computer, you may not want to rely on shell scripts to do your top secret stuff.
Here are some tips for working in the shell that I use on a daily basis. These may be known to most veterans, please contribute your favorite shortcuts to the comments. But for the most part this is not for the uber leet Linux geek, this is for those new to the terminal.
- Gives you suggestions / completes stuff for you. Type a, Press it twice, it will make your life a lot easier.
- Remove word behind cursor.
- Undo / Erase everything from cursor to beginning of the line
- Type out whatever you typed out last, can be combined with tools like sudo
- Go forward to the end of the previous word
- Move cursor back to the beginning of the previous word
- You’re done? Press ctrl+d to logout. If you’re in a virtual terminal, it may also close the window.
- Stop the current process. Say you run gvim, and then you want to spawn another process. Press ctrl+z, then type bg. Once you’re done with the “other” process, you may type fg to bring it back into the foreground.
So, this morning, when I got to work and booted up, I noticed something was wrong. My machine was not running as usual. It turns out, packagekit was sitting there being a general pain. I just wanted to look busy, so I killed the process. Turns out that wasn’t such a good idea, since it didn’t finish doing whatever it was doing and caused an ugly error like this:
rpmdb: Thread/process 28373/3077981888 failed: Thread died in Berkeley DB library error: db4 error(-30975) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 - (-30975) error: cannot open Packages database in /var/lib/rpm CRITICAL:yum.main: Error: rpmdb open failed rpmdb: Thread/process 28373/3077981888 failed: Thread died in Berkeley DB library error: db4 error(-30975) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 - (-30975)
Naturally, I tried using rpm, do try and fix things, since it indicated something to do with a database I tried:
[owen@linuxblog ~]$ sudo rpm --justdb
rpm: –justdb may only be specified during package installation and erasure
[owen@linuxblog ~]$ sudo rpm --rebuilddb rpmdb: Thread/process 28373/3077981888 failed: Thread died in Berkeley DB library error: db4 error(-30975) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery error: cannot open Packages index using db3 - (-30975)
Well, it turns out that those options don’t work, and the rebuilddb gave an error about the db4 being corrupt. Well, I decided to go into /var/lib/rpm as the other error had that directory and found the db4 files. Running db45_recover sounded like it might work, so I gave it a shot.
[owen@linuxblog rpm]$ db45_recover -h /var/lib/rpm/ db45_recover: unlink: /var/lib/rpm/__db.003: Permission denied db45_recover: unlink: /var/lib/rpm/__db.004: Permission denied db45_recover: unlink: /var/lib/rpm/__db.000: Permission denied db45_recover: unlink: /var/lib/rpm/__db.002: Permission denied db45_recover: unlink: /var/lib/rpm/__db.001: Permission denied db45_recover: /var/lib/rpm/log.0000000001: log file unreadable: Permission denied db45_recover: PANIC: Permission denied db45_recover: DB_ENV->log_newfh: 1: DB_RUNRECOVERY: Fatal error, run database recovery db45_recover: dbenv->close: DB_RUNRECOVERY: Fatal error, run database recovery
That’s right,you need to be root for this bad boy:
[owen@linuxblog rpm]$ sudo db45_recover -h /var/lib/rpm/
The above seemed to fix it for now. I guess next time I’ll think about it more before I start slaying processes on a Monday morning.