Archive for the 'System Administration' Category

“Fixing” an old laptop

Dell Inspiron 1545

Dell Inspiron 1545

A few years ago when I was in the market for a new laptop I picked up one of the then wildly popular and cheap Dell Inspiron 1545. There are gobs of these running around now and you can find them cheap if you look (click the pic for links to Amazon). I used this for for, it seems, forever. I only ever had one problem with it – a small plastic chip in one of the corners that I repaired with superglue (you would never notice). Lately, though, it has been running noticeably slow. I don’t know if it’s because it’s actually getting slower, the software is just getting fatter, my work computer is blazing fast in comparison, or a combination of any/all of those. Either way, it’s really been bugging me so much lately that I had considered just getting a new lappy. Before I did, I decided to look over the specs to see what I actually had here. Mine is a core duo 2.2Ghz with 4Gb ram and a 320gb HDD. Running Linux this thing *should* run like it was on fire. So why so freaking slow? A quick look at “top” revealed what had to be the problem. I was at almost 0% CPU and only 1.5Gb ram. It HAD to be the slow as pencil and paper hard drive writes and reads. A quick search says that somewhere in between now and the last time I came up from air at work SSD drive prices dramatically reduced, so I stopped by a bigbox store and picked up a 240Gb SSD for <$100 and screwed it in and WHAMO! It’s like I have a brand new laptop! Seriously! Not only is the difference noticeable, it’s amazing, so much so that I needed to break my blogging silence to tell you about it. If any of you have an aging laptop like me that runs but is “meh”, it’s totally worth it to spend the 15 minutes it takes to do this upgrade. It certainly just saved me $500 and I am now, once again, perfectly happy with my trusty old (but well kept) Dell Inspiron 1545.

Review: Penetration Testing with the Bash shell by Keith Makan – Packt Pub.

Penetration Testing with the Bash shell

I’ll have to say that, for some reason, I thought this book was going to be some kind of guide to using only bash itself to do penetration testing. It’s not that at all. It’s really more like doing penetration testing FROM the bash shell, or command line of you like.

Your first 2 chapters take you through a solid amount of background bash shell information. You cover topics like directory manipulation, grep, find, understanding some regular expressions, all the sorts of things you will appreciate knowing if you are going to be spending some time at the command line, or at least a good topical smattering. There is also some time spent on customization of your environment, like prompts and colorization and that sort of thing. I am not sure it’s really terribly relevant to the book topic, but still, as I mentioned before if you are going to be spending time at the command line, this is stuff that’s nice to know. I’ll admit that I got a little charge out of it because my foray into the command line was long ago on an amber phosphorous serial terminal. We’ve come a long way, Baby :)

The remainder of the book deals with some command line utilities and how to use them in penetration testing. At this point I really need to mention that you should be using Kali Linux or BackTrack Linux because some of the utilities they reference are not immediately available as packages in other distributions. If you are into this topic, then you probably already know that, but I just happened to be reviewing this book while using a Mint system while away from my test machine and could not immediately find a package for dnsmap.

The book gets topically heavier as you go through, which is a good thing IMHO, and by the time you are nearing the end you have covered standard bash arsenal commands like dig and nmap. You have spent some significant time with metasploit and you end up with the really technical subjects of disassembly (reverse engineering code) and debugging. Once you are through that you dive right into network monitoring, attacks and spoofs. I think the networking info should have come before the code hacking but I can also see their logic in this roadmap as well. Either way, the information is solid and sensical, it’s well written and the examples work. You are also given plenty of topical reference information should you care to continue your research, and this is something I think people will really appreciate.

To sum it up, I like the book. Again, it wasn’t what I thought it was going to be, but it surely will prove to be a valuable reference, especially combined with some of Packt’s other fine books like those on BackTrack. Buy your copy today!

BackTrack 5 Cookbook: Quick answers to common problems

BackTrack 5 Cookbook

BackTrack 5 Cookbook

You know, sometimes, just sometimes something fortuitous happens to me. This was one of those times.

I was contacted by my friends over at Pakt Publishing to review their new book on BackTrack. Of course I said sure. Hey, I am a Linux junkie after all! It had actually been quite a while since I had played with BackTrack and this gave me *just* the incentive I needed, but let me tell you a bit about the book…

The book is a “cookbook” style book which gives you “recipes” or guided examples of common problems/scenarios and their fixes. The book is well written, a good reference for a pro, and a great tutorial for the beginner, and by beginner I am assuming that the person *does* have Linux experience, just not BackTrack experience as some command line comfort is pretty much a necessity for this kind of work. The first 2 chapters start you out exactly the way they should, by installing and customizing the distribution. What they don’t tell you is it takes a good while to actually download the distro, but that is beside the point.

Once you actually get things running well, you can follow the book through some really decent examples from Information Gathering all the way through Forensics. The book covers all matter of subject matter and applications in between such as using NMAP, Nessus, Metaspolit, UCSniff and more. I mentioned that this was fortuitous for me and that was because one of the things the book covered was the Hydra program, and, as it turns out, that was the perfect tool for me to use in remediating some password synchronization issues across several hundred servers.

Anyone using a computer should have at least a basic understanding about keeping their valuable data safe, whether that data is for a multi-million dollar company or your own invaluable family photographs. This book goes to great efforts to not only explain how to detect, analyze and remedy such issues, but also gives important background about just how systems become vulnerable to begin with. If only for that reason alone, it’s worth the read. If you are actually a sysadmin, this information is a must. For $23 for the ebook version, it’s a no brainer. Good book. It helped me out and I’ll wager that if you give it a read it’ll do the same for you!


I have long been fascinated by different peoples computing environments. Somehow I believe it shows a little glimpse into someone’s mind. With that in mind, I thought it might be interesting to other people as well so I polled a group of my friends who are some of the most influential computing buddies I have. Here is what they sent:

Name: A.W.
What do you do?:
I’m a NetApp Wrangler and Windows Sysadmin by trade. Looking to add storage admin as well (EMC/Cisco).
Tell me about your DE?:
My main workstation is my MacBook. I identify with this machine the most and my desktop environments tend to show my personality and style choices. I like IBM style green on black terminals which I have been addicted to ever since I installed my first AIX machine (a POWERStation 320 that I got for free from my ex-girlfriend’s office). The desktop is a stylized Sylvanas the Banshee Queen of the Undead from World of Warcraft. I don’t currently play the game but I’m into zombies and undead stuff as art and game play (and hot pale powerful gothy women). My Windows 7 machine is a gaming machine and also used to do my work as it’s the best machine to log into our VPN with. It’s an Alienware with the Phobos Red theme and the LEDs are currently all set to red with a pulsating skull on the front. It’s kind of Darth Vader. Alienware does nice themes and some of the nicest pre-installs I’ve ever seen (yes, the first time I didn’t wipe the OS that came with the system)… It has no shovelware. I’ve owned the Powermac G5 Quad for years and bought it to be the last and best PowerPC machine. Eventually I was no longer using it as I supplanted its use with my MBP which I can carry all over the house and use wireless N with. Wanting to breathe new life into it, it became a PPC Linux test box and I’ve found the best environment with Fedora Core 17 Beefy Miracle. I’ve replaced the desktop graphic with something nicer than the default fireworks that is still Fedora themed. The Firefox window is a shot of my home file server control panel. It’s a red aluminum cased custom AMD A4 build with 8 GB of RAM, 6 x 2TB Seagates (SATA3)ZFS RAID6 and a memory stick to hold FREENAS 8.0.4 x64 MULTIMEDIA. Since it’s red I named it after my favorite Motts discontinued beverage: Beefamato.

Name: D.C.
What do you do?:
Programmer and professional Bearded Curmudgeon.
Tell me about your DE?:
vim is my IDE, and I have a window open full screen, split into up to eight or so buffers on my main screen. On a second screen I have terminals for running my code’s tests, viewing logs, and for talking to colleagues who work all over the world – my team is split between Utah, the UK, Moscow, and anywhere else that we can find good people. My windows are all slightly transparent when inactive, as it makes it easier to find stuff if I can see it when it’s behind something else. I do, of course, use focus-follows-pointer and click to bring to front, but almost all my navigation is via the keyboard. When I do need to move the pointer,I use a trackball. Desktop? Yeah, there’s one under there somewhere, but I hardly ever see it. It’s a plain neutral colour with no icons on it so it doesn’t interfere with window transparency.

Name: J.B.
What do you do?:
Senior Software Engineer working on cloud managed digital media systems for the retail environment.
Tell me about your DE?:
Windows 7. I run Linux on my desktop, but I never felt like having the distribution to work to change what’s on my laptop, and I use the laptop the vast majority of the time.

Name: J.F.
What do you do?:
Solutions Architect, Enterprise Services, HP.
Tell me about your DE?:
I alternate between a black desktop and this photo of my favorite car. A friend collects vintage gas station equipment and provided the setting when I took this picture. I try to keep my desktop clean and maintain a folder called “desktop-stuff” for all the junk that would normally accumulate.

Name: J.S.
What do you do?:
Retired network engineer now part time Asterisk/VOIP and wireless consultant.
Tell me about your DE?:
Windows 7 for the most part, but I have a Ubuntu 12 VM running X11RDP so I use Remote Desktop rather than VNC. That’s where I do the majority of my compiling & code editing in Xemacs.

Name: K.H.
What do you do?:
I’m a senior engineer on the Enterprise Infrastructure Team for a state government. I wrangle Tivoli Storage Manager, VMWARE, DNS, Linux/Apache/MySQL/PHP, legacy and modern UNIX/Linux, SANs, some LAN/WAN, provide support to the CISO in all areas of infosec as needed, and function as troubleshooter of last resort for any given problem.
Tell me about your DE?:
Windows 7 would not be my first choice, but since I have to use Windows-only apps in the execution of my duties, it is the best for the job. I run two monitors, which have different resolutions, but this is the best that can be managed on a restricted budget. Ideally there would be two 23″ monitors, but if we’re dealing in ideals, I would have an Alienware laptop instead of a Dell. The theme is a transparent space-based theme courtesy of NASA, but the background is an image from Stickman featuring some of my favorite tools. Rather than hide the start bar, I leave it up all the time for quick access.

Name: L.F.
What do you do?:
I.T.Manager and Senior Linux Admin, LAMP developer, scripter and all miscellaneous duties as assigned.
Tell me about your DE?:
Mint #newest_version running my usual slew of apps and xterms on 2 dual monitor machines. Dark wallpaper is currently a “black leather”. I like dark unobtrusive wallpapers best to avoid distraction. Windows running in a vm, where it belongs. Just can’t have enough desktop real estate you know! And, yes, that’s mutt for email – best client out there.

Name: M.H.
What do you do?:
I’m an I/T support specialist and dispatcher.
Tell me about your DE?:
I have quite a number of different desktops really. In fact I always have had. When they get cluttered I throw things into folders and eventually archive them if I don’t want to delete them. (My folder structures in my home directories is horrible.) Each system I use has a different purpose. The desktop here is my home daily driver. Multiple screens often dictate what wallpaper I use though frustratingly it’s hard to span wallpaper across multiple monitors. At home I usually use single displays but at the office I use four screens total. Working on adding another one. ;-) As for colors I prefer a darker theme with light lettering. For terminals I prefer a black background with amber text or as close as I can get using a color picker. Green if I don’t have amber as a choice. Translucent terminals look nice initially but are a pain for me to focus on.

PHP and stuff

Lately I have been working so hard that I haven’t even had any desire to do any fun computering at home. Today that changed a bit.

I decided this morning that it was high time I upgraded my all time favorite rss feed reader, tiny tiny rss. Well, wouldn’t you know it, after I did the install I found it required a version of php higher than I had available on my server. Time to upgrade.

I run Centos 5 on my main server and, by default, that carries a php 5.1.x. I needed 5.2 or greater. As it happens, php 5.3 is available in the repos, so I did the upgrade. For the uninitiated, that entails doing a “yum list installed | grep php”, which gives you a list of what you *have* installed. Next you remove php by doing “yum remove <and name all the packages in the prior list here>”. This, followed by “yum install <list of files for php 5.3>”. For example, I had php-common.i386 and php.i386 installed, so I did a “yum remove php-common php” and then “yum install php53-common php53″ to get all my php 5.3 packages on there. This was followed by a quick “service httpd restart” to make sure my webserver was using the new version.

Murphy’s law states that “something will go wrong if it can”. Well, *MY* law states that “something will go wrong”, and it did. As it turns out, I had built a whole bunch of php applications maybe 7 years ago that my wife uses almost daily. In the olden days of php, you could declare a php script at the top by doing a “<?”. NOW, you need to declare it by doing “<?php”. Consequently, nothing I had written worked. It only took me a minute or two to identify why the problem was occurring, but fixing it was another story.

So, how do you find all the files you have to fix? Well, I used the “grep” command. More specifically, egrep. I went to my html root directory and searched by doing “egrep -r “<\?” * | egrep -vi “<\?php” | egrep -vi “<\?xml” | grep -v inary”. What does all that do? The first stanza looks recursively through the directory structure at every file and outputs the ones that have any “<?”‘s in them. The second takes that output but does NOT pass through any that are “<?php”. Why, because they would already be ok! The third takes the results and doesn’t pass through any that contain “<?xml”. The last one doesn’t pass through results from binary files. The end result is I had a list of directory / file / line information of all the files I had to change / update. A few minutes later, after using vim, the best text editor around, I was back up and running!

My aching butt? No more!

Knoll Generation

Knoll Generation

I have long held the opinion that you should not skimp on the things that you use professionally and frequently. For instance I often tell my peers to make sure they buy decent computers and not just bargain basement models. For some reason it never occurred to me to apply this reasoning to my posterior. That is, until recently.

I have been using a most uncomfortable office chair for the longest time, in fact, for the last 5 years. It’s one of those “conference room” models, which, although built plenty rugged, are not necessarily built for comfort. The real problem with this is I sit in the thing almost 8 hours a day. I even had to buy a pillow for it because I have what I like to refer to as “sysadmin’s butt”, which is essentially the lack of a posterior portion of your anatomy, due mostly to parking it in a chair 8 hours a day for many years.

A few days ago, a friend of mine who just happens to work for a great company called Knoll, got me hooked up with a review unit of the Knoll Generation chair. Let me just say I don’t know why I waited so long for a good chair!

This chair is the epitome of office comfort and has so many options to aid you in that regard it’s difficult to mention them all. Of course it offers the standard amenities such as height adjustment and a reclining back, but wait, there is more! It has these cool adjustable arms that not only raise and lower but they also have arm pads that adjust in depth, width and pivot. The back of the seat has this comfort type netting which is flexible, cool and very comfortable. The top of the back flexes almost over backwards and it a great place to rest your arm while sitting sideways in high comfort. I think the feature that threw me the most is the flex seat. Unlike most chairs with a solid unyielding seat, this seat has some degree of movement or side to side pivot. I almost thought that my chair was broken until I realized that this was intentional! This pivot to the seat allows comfort and support for how people sit. What I mean by that is people sit different ways and on different angles with their feet up, legs crossed and what have you, and this seat allows some motion in that regard to keep even support and pressure where it should be, fully on your posterior instead of on your legs when you are not seated “flat”. In addition to that, the seat depth adjusts as well.

Although this chair may be on the expensive side, I believe it’s well worth it, especially for people who are confined to such devices for much of their day. I wish they had a travel version available, I would buy it in a minute ;) I think the best testimony is that every person in my office has now sampled the chair and ALL of them want one! If you are in need, you can’t go wrong with one of these. It’d most likely be the last office chair you would ever need to buy.

My only hope and wish is that the Knoll folks see this review and decide to send me one of their other products to test as well! Other than that, I’ll be happy to hang out in my own Genertion!

Lost your Mint password?

First time this happened! A coworker asked me today how to get into his Linux Mint box after he forgot his password. Of course I rattled off the old GRUB way to get things done, but, what?? This is GRUB 2! No so fast there! Turns out it’s quite different.

You hold down the shift key while booting to get to the grub menu.
You hit ‘e’ to edit your boot options.
You change the kernel line options on the very end of the kernel line to read “rw init=/bin/bash”.
You press F10 to boot.

Once booted you are dropped immediately into a shell prompt where you can change your password with the “passwd username” command. Reboot and you’re home free!

Rsync bug



Bitten by the rsync bug? I was. Apparently in the new RHEL 5.7, and I am sure the RH clones like CentOS, Scientific Linux and ClearOS(?) as well, there is a bug in rsync when you use it with ssh transport like so:

rsync -avz -e ssh remotehost:/data /data

The fix is to make sure to append a username to your host and then it magically starts working properly again.

rsync -avz -e ssh username@remotehost:/data /data


Mint 11 Boot Splash

I have seen a lot of commenting on the decision to use a black screen as the boot splash on Linux Mint 11. One person summed it up well when they said that that black screen is indicative in many other operating systems as something going wrong and it tends to scare people. Well, that being the case, if you are scared or if you just like to see what’s going on behind the scenes like I do sometimes this is how you can fix that fairly easily.

Open up a terminal and do a:
vi /etc/defaults/grub

scroll down to the line that says:
and change it to:
and save the file.

After that do a:

When that is finished, reboot your machine and enjoy watching the text based boot process as it occurs. Pay close attention, though, ’cause it sure doesn’t last long! ;)

Linux Shell Scripting Cookbook

Linux Shell Scripting Cookbook

Linux Shell Scripting Cookbook

   As a full time Senior Linux System Administrator in real life I was quite interested to get my fingers on this book for a review. After all, the job of a smart sysadmin pretty much dictates scripting away as much of your work as possible. We are a lazy bunch and we call that being efficient :)

   This is the first book I have reviewed by Packt Publishing or the author, Sarath Lackshman, I wasn’t really sure what I was in for. In fact I was slightly put off by the price, which I initially thought overly hefty at $45 US. For that kind of scratch I am used to seeing a much more substantial sized book from the sort of publishers I normally review for. I started making my way through the book anyway, and I am glad I did.

   What makes this book really cool is the premise behind it. Inside, as a “cookbook” should, you have these “recipes” for scripts. These are not what I have normally seen in many scripting books before, which are generally theoretical and sometimes lengthy examples, but these recipes are pretty straight forward, real world examples of things you might want to do, and how to handle those efficiently. The recipes are also small enough that you could easily piece meal things out to compose another script and I am certain that would be a great help to novice scripters.

   As nice as I think this book would be for novice scripters, there is a lot of smart stuff in there, stuff that had never occurred to me through my years of command line use. I actually got really excited to try some of the examples in there and to put them into practice. I particularly liked the little tricks here and there, like the “subshell trick” and I was absolutely thrilled that this book used modern syntax and variable manipulation, dropping the deprecated stuff like putting commands into back ticks. Good form!

   This book is certainly a keeper and I would recommend it highly to anyone who wants to become proficient on the command line. Some days you actually *do* get what you pay for, and I believe people will find this book to be a good example of that. This book was truly fun for me to work my way through and I sure hope they have more like it in store for the future. Go buy yourself a copy. I know I will be hanging on to this one for a while :)

Next Page »