Archive for May, 2010

Miscellaneous Stuff I’m Working On and My Site

May 30, 2010

Well, you may have noticed that I have as yet failed to post today, and it is rather late.  This is because I spent all day at a festival and had no time on my computer.  Yes, believe it or not, I don’t always live behind the screen.  Seeing as that it is beginning to become morning and I have a day of work with my robotics team ahead of me, I dont really have the time or energy to write a detailed post on some piece of technology, so I’ll just start out by giving you a rundown on a bunch of problems I’ve been working on and then go on to talk about the content on my web site.

  • For starters, my laptop has this issue where it takes a long time to start applications the first time after booting, and some of the other applications fail to start properly or have weird pauses.  I’ve been working on this intermittently for weeks now and have so far been unable to figure it out (which is a really rare occurence for me).  If anyone can give me a hand, I’m running fluxbox on arch linux on a thinkpad t60p
  • It occured to me yesterday that I would like to run linux on that old ipod I don’t use.  I looked it up, and sure enough there is a project to get linux on the ipod.  Unfortunately, the ipod I have is unsupported due to changes in apples encryption stuff.  There is a project to get linux working on my device, but it has not progressed too far yet.  If you have an old ipod, try it out and tell me how it goes.
  • I’m trying to move my printer from being connected to my desktop to my server box.  I’m having trouble with this.  I think a post I plan to do later on will explain why this is being an issue for me, focusing on the nature of the server.
  • Inverted Productions has made some decent web games that are definitely worth checking out.  It’s all the more impressive when you know that their entire team is made up of high schoolers.

Well, that’s enough of that.  The last thing I’d like to talk about is my own personal web site, (previously known as  I’ve just recently restarted it after a hiatus of a few years, and it is not yet at 100%.  That said, I’m putting up more content all the time, so please check back on it often.  Currently, there are sections for tutorials and then ‘my stuff’, an incredibly vague category which presently encompasses the two scripts I’ve featured on this blog.  I would now like to share with you some of my plans for expansion on the site.

I need to finish the Java tutorials.  I’m making these tutorials to benefit the computer science students at my school who are stuck working with a very bad textbook.  Part 1 of 5 is currently complete, but I’ll get to the rest soon.  The super quick-start guide for BASH scripting that I promised last week is also in the works, with part 1 of 2 completed.  My linux getting started guide is actually completely empty, largely because it is such a wide subject area that I don’t really know where to start.  One simple howto that I have completed is my guide on how to save a game in nethack even if your character dies.  Although they are mostly incomplete, I’ve put what I have up for now.  Future tutorials will include an introduction to programming for the FIRST robotics competition for the benefit of my school’s robotics team programmers, a getting started guide for nethack, and a basic tutorial on the vim text editor, among other things.  In the ‘My Stuff’ page, I’m going to add a personal info page for you to get to know me better.  I also intend to put up essays and other pieces of writing that I compose, in addition to screenshots or pictures of adventures that I may have (after all, it is a personal site).

Now that I’ve written the last bit of my energy into this task, its time for some sleep.  Or maybe not.  I have some interesting reading to do (and a website to work on).


My Indispensable USB Toolkit

May 28, 2010

Many people carry around a USB stick to store and transfer files from place to place.  It is a crying shame that most of them are not aware of the incredible powers latent within their USB sticks.  The worst part is that much of this power is sitting right under their noses, untapped and wasted.  Lucky for you, I plan to give a quick description of what I do with my thumb drives, hopefully inspiring you to push the limits of your own flash drive.

The first, incredibly obvious, thing that you can do with a flash drive is to put small programs on it that you can take with you.  For example, I keep nethack (a game that features prominently in my post on gaming in linux) on my flash drives for use any time I’m stuck with a computer and not  much to do.  This happens an awful lot at school.  Others with more modern taste in games keep halo or starcraft handy (on a related note, I would really recommend the computer science classes at my school).

Although carrying around games in your pocket is fun, it’s not always really useful.  A much more useful tool to have around is a Putty client.  Putty is an ssh client, meaning that it allows you to connect to a secure shell (ssh) server on any computer, anywhere.  This means that if you’ve got an ssh server running on your computer (I do, makes life a lot easier), you can simply remotely log in from anywhere.  Need some obscure tool that you’ve only got on your home machine? Got it.  Forgot some important file? Found it.  Not only does this method give you a great deal of peace of mind, but it also causes everybody around you to ask you if you are hacking.  For some reason there is an unbreakable connection in the public mind between terminals, like the remote command prompt putty gives you,  and malicious computer use.

It is a distinct possibility that at this point you’re thinking that you a) already knew this, or b) have no use for it because you may not have an ssh server or don’t know how to operate a computer remotely from a command prompt.  Don’t give up on me yet, I’ve saved the best part for last.  You may or may not be aware that most newish computers and USBs give you the option to boot from a USB drive in much the same way as you could boot from a CD, Floppy disk (remember those?), or even a typical Hard Drive.  This means that you can install a whole operating system to your USB stick and boot it up anywhere you find a computer!  You can configure the operating system on the USB as much as you like and always boot into a familiar environment with all of your programs and settings already loaded, no matter where you go.

Personally, I have an 8gb usb  with BackTrack 4 (a Linux distribution dedicated to providing a platform for penetration testing) installed on it.  You can find an easy tutorial on how to do this here.  For brave souls who are undaunted by gentoo linux (the most configurable and therefore most difficult to set up linux distribution out there), my friend Jeff installed gentoo to his USB drive when his laptop’s hard disk gave out.  He now uses that as his primary operating system.  Although I haven’t tried them all myself, I believe you could install any Linux distribution to a USB drive.  In fact, I plan to set one up sometime soon with a basic arch linux configuration — I’ll let you know how that goes.  Another option, if you don’t have a massive USB stick available, is to go with Damn Small Linux (DSL).  DSL is a distribution that is commited to providing a functional environment that takes less than 50MB of space.  For a slightly larger variant, try DSL-N, DSL’s big brother.  I also plan to get myself a DSL usb stick, so I can have a different linux distro ready for any situation.  In fact, the options for installing Linux to a USB drive are so plentiful that there is a whole website dedicated to it.

As a final housekeeping note, you’ll note that the URL of my website has changed from to  Although still works for now, it is going to be phased out, so you should update your bookmarks.  I’m having some trouble getting my email and blog addresses changed, but I’ll make sure to let you know when I finally figure that out.

Gaming in Linux

May 25, 2010

Although I’m not a big gamer, I feel that I should write a post about gaming in Linux because that is one of the main reasons why people choose not to switch over from other operating systems.  Of course, this is not actually too much of a problem.  There is an excellent thing called WINE (which stands for ‘wine is not an emulator’) that acts as a windows compatibility layer for Linux computers.  This means that many games built for windows computers can actually be played on Linux as well.  Unfortunately, there are a few games that do not work or only work after lots of suffering and configuration-changing that seem to ruin Linux’s reputation as a platform for gaming.

Windows compatibility aside, there are a host of games that run natively on Linux.  Although they are not all as elaborate as the expensive PC games people buy, they are still fun and free.  I figure I’ll share a few of the games that I enjoy having around as well as a couple others that may hold some appeal.  First off, there is nethack.  Nethack is perhaps the original role-playing game.  It allows for expansive gameplay and hours of suffering (it is notorious for the infinitely many ways you can die).  It is played in the terminal and everything is represented by different characters, an indication of how old it is.  It has something of a learning curve getting started, but once you learn how to use it, nethack becomes one of the most fun and addicting games around.  Did I mention that if you die, you actually die?  Yup, no restoring save files without cheating (maybe I’ll briefly explain how to keep nethack progress in a later post, it’s rather simple).

Another game, and the one that most sources will designate as the best game available for Linux, is the Battle for Wesnoth.  This is a turn based RPG based in a fantasy world, but you can download many additional campaigns and themes, allowing for phenomenal replay value.  Another strategy game you could try is Freeciv, an excellent clone of civilization II (build an empire, conquer others, etc).  If you are a fan of shooter games, the US government (that’s right) has developed a game called America’s Army.  I’ve never played it, but I hear its pretty good.  It appears right behind Wesnoth on many top 10 linux game lists.  A more lighthearted RPG game is FreeDroidRPG, a game in which you play as a member of a penguin-esque species tasked with saving the world from evil robots.  The game is still under heavy development, but what they have so far allows for a couple hours of fun.

Some other notable linux games include SuperTux, a super mario bros imitation featuring tux, the linux penguin.  On that same theme there is Supertuxkart, a mario-cartish game featuring tux and his other open source mascot friends.  On a distinctly non-mario-poser line, there is LiquidWars, a unique game in which you control a big blob of what looks like colored sand, and you try to conquer all of the other sand.  It’s very difficult to explain, but quite a bit of fun to play, especially with friends.  Finally, Neverball and Neverputt are worth trying.  The first is a game in which you roll a ball and try to pick up coins without falling off a platform (like Mojo, if you ever played that on the PS2), and the second is a mini-golf game.

There are many, many more Linux games, but that’s all I have time for right now.  Granted, these are not quite as complex as some PC games, they are definitely satisfactory for me (I don’t play much video games, although I do keep an old PS1 attached to my desktop monitor for whenever I get bored).  If you are simply unwilling to begin using Linux but still want to try out the Linux games I’ve mentioned, don’t despair.  Most of these games are also available for windows and sometimes mac users as well.  Happy gaming!

Of Backups and BASH

May 23, 2010

Anybody can save backup copies of all their files somewhere for later retrieval, but when I planned to backup my files, I would not settle for a simple run-of-the-mill backup plan.  I would come up with a new and innovative system full of hack value goodness.  I had the idea of setting up an old computer with a large hard disk and writing a script to execute when the computer booted.  This script would download all of my important files from my other computers and save them in a compressed file identified by the date of the backup.  It would then wait ten or fifteen minutes, time for me to remotely log in and kill the script if I need to make configuration changes on the computer (or retrieve one of the past backups), and shutdown.  In essence, I planned to create a magical box on which I could push a button and have all of my documents backed up without any effort on my part.  It was a great idea, and I couldn’t wait to try it.

Unfortunately, the poor resources at my disposal prevented me from succeeding.  The computer that I wanted to use for this project was very, very old and, as it turns out, unreliable.  I couldn’t get anything to work on it.  In fact, it was such a rotten machine that I just took out the dvd drive (I always seem to have a shortage of those) and threw out the rest of it (and I’m not one to throw out computers at a whim).  It was a sad evening for me, but I did not give up all hope of having my files properly backed up.

The decision was made that I would write a backup script that would run on my desktop  (the one with the largest hard drive).  I finally got around to doing it last night around midnight.  My final product:


now=`date '+%F'`
mkdir "$now" #make a folder for the date
cd "$now"

echo 'making backup directory'
for places in laptop desktop server #make direcoties for each machine
mkdir $places

#now we have to pick out the important directories in each computer
#we'll copy those directories here, and then we'll compress the whole thing
#include command line options to include the desktop

echo 'copying server files'
scp -r server:/var/www/ server/
echo 'copying files from laptop'
scp -r laptop:/home/saba laptop/

if [ $# == "1" ]
if [ $1 == "-d" ]
echo '-d option enabled'
echo 'copying files from desktop'
scp -r desktop:/home/saba desktop/
cd ../

tar -cf "$now.tar" "$now"
gzip -r "$now.tar"
rm -r "$now"

exit 0

The script is available for download on my website at  There is also a short description of what the script does and how to make it work for you at the aforementioned link.

As you can probably see, I’ve gotten better at scripting since my updater script last week.  I owe it to a long series of web searches and the reading of many documents last night.  In order to help others who are trying to write a real script for the first time, I’m going to make a BASH scripting super quickstart guide and publish it on the tutorials section of my website.  Expect that to be up in a few days.

The Great Big Rolling Ball of Releases

May 21, 2010

New versions of software and operating systems are a pain.  Sure, they have new features, but each time a new operating system is released, you need to go buy it (for those who haven’t realized they can get better products for free), maybe reinstall your OS, transfer all your data, and at the very least have to wait for a long, long time as your computer upgrades to the new version of your product.  What if there were a way to escape the dreaded release cycle?  What if you didn’t have to subject yourself to this systematic torture but could still have a computer that is as current, if not even more up-to-date, than other computers?  Enter the rolling release cycle.

A rolling release cycle is one in which the operating system is constantly being updated without being separated into different versions.  There is never any need to do a major upgrade.  All that is required is a short periodic update that takes a few moments and can usually be done in the background.  You can run updates as often or as sporadically as you like; you can even write scripts to simplify the process of updating multiple computers (see my previous post).  With a rolling release system, new stuff can be added to your machine as soon as it is ready, instead of waiting for the next scheduled release date.  This means that people working on rolling release operating systems have more time to work on the important stuff that matters rather than troubleshooting compatibility problems with older releases.  More exciting for the user, having cool new stuff as soon as it is ready means having systems that run newer and better technologies.

Before we get too excited, there is one drawback.  Always having the newest version of software means that you are likely to end up with some stuff that is essentially ready, but whose developers are still working out the kinks.  There are occasions where a user can end up having to deal with an annoying bug for a while. Fortunately, there is a massive online community using the new software, so there are almost always workarounds available on the web.  As an example, I’ll talk about Namoroka, the next version of firefox.  I’m running Namoroka right now, and it generally works great.  However, there is a thing where the facebook chat doesn’t work because it doesn’t recognize the browser (after all, it is brand new).  Although I was initially very unhappy about this, I quickly found a fix that had my browser back on facebook chat in under a minute.

Now, are you ready to embark on the rolling advenure?  Excellent!  I have three computers running in this room, and each is running a different rolling release linux distribution.  These are Arch, Gentoo, and Sabayon.  Each has its own features and ups/downs, so you’ll have to pick one that suits your needs (or find another good distro with rolling releases).  I plan to talk more about my favorite linux distributions at a later date, but for now I’ll recommend Sabayon to anyone who wants a working rolling release system and doesn’t have the experience needed for the Arch or Gentoo installation process.

Enjoy your new rolling release distribution!  Maybe you can use the time you’ve saved to go laugh at the peoplewho haven’t learned they can get free operating systems that are better than the ones they pay money for.  Better yet, you could tell your friends to read this and other linux-related posts so that they too can get in on the fun.

A Universal Updater Script for Lazy Linux Users

May 19, 2010

Being who I am, I have multiple computers running different services, and I always want them to be up to date.  However, I’ve got a big problem: I’m Lazy.  Lazy people don’t like routinely running updates on several computers, and we like it even less when the computer takes hours to update (and then breaks) whenever we do get around to it.  Luckily, there is a solution.

The other day, while waiting for my bus home in the rain, I had an idea.  I realized that if I didn’t have to move from computer to computer and do stuff on each, I would be much more willing to do updates.  Thinking in this vein, I decided that I could write a script that would simply go through each computer and run its update commands, keeping everything current and saving me a handful of keystrokes.  Now I’m no master of scripting, but anyone can string a few commands together.  Here’s what I came up with:

#run updates on laptop, desktop, and server
#runs on laptop
#add updates for backup box when that is ready

echo 'note: give root passwords for each machine when prompted'
echo 'laptop: pacman -Syyu'
su -c - root 'pacman -Syyu'
echo 'desktop: equo update && equo upgrade'
ssh root@desktop equo update && ssh root@desktop equo upgrade
echo 'desktop: emerge --sync && layman -S'
ssh root@desktop emerge --sync && ssh root@desktop layman -S
echo 'server: emerge --sync'
ssh root@tux emerge --sync
echo 'server: emerge --update --deep world'
ssh root@tux emerge --update --deep world

Now this may need a bit of explanation.  The commands pacman, equo, and emerge are the different commands used to update each distribution I’m running.  They are Arch, Sabayon, and Gentoo Linux.  I’ve named them based on their function, with the exception of my server, tux.

You’ve probably noticed the reference to a backup box in the comments that start my script; I’ll have more details on that project as soon as I get started with it.  It’s one of the more exciting plans I have lined up to complete before summer.

A bit more information and a link to download this script is available on my website at

The saga begins…

May 18, 2010


A couple years ago, I began an experiment in blogging on WordPress under the designation of ‘sabalicious.’  various constraints caused me to abort this effort, but I am finally back to tell everyone about the abstruse technical dilemmas which I so zealously throw myself in to (and whatever else is on my mind).  For starters, I’d like to direct you to my personal website,, (also back after a long hiatus), and invite you to look around despite there being not much to see.  I promise I’ll fix that soon; I have a lot planned.

Well, I look forward to sharing my world with you,