Breathe New Life Into An Old Computer

My laptop is an Averatec 3260. 512MB of RAM, 80GB hard disk, and 1.6GHz processor. It’s had the front panel LCD and battery replaced, by me. It’s still missing the front bezel (I thought it looked cooler with it off.) Up until yesterday, the performance of the machine was just above what I’d consider to be “survivable” regardless of OS.

Then, everything changed.

While I was working with Cory Fowler at Red Brick Cafe and then later at my apartment, I was updating my copy of Mandriva Linux from 2009.1 to 2010.0. During installation something must have gone wrong because KDE4 no longer started properly. It kept bringing me back to the login screen. So, instead of using KDE4 I used IceWM.

I haven’t gone back to KDE4 since yesterday. And I’m the hugest KDE4 fan there is.

If you’ve got an old laptop or an old desktop that’s struggling under the weight of Windows XP or KDE4, grab a copy of Mandriva Linux for free and install the IceWM packages. Give it a go. I’m sure you’ll be impressed with the performance of your machine. I know I was! I remember running IceWM a few times when I first started using Linux quite a number of years ago but it has really come a long way since then.

IceWM runs all of the KDE4 programs I care about and even the Gnome programs, too. Watching a video on YouTube is made much easier with the lighter-weight desktop, as is just general browsing.

IceWM offers a lot of customization but some of it is complicated to configure. The easiest thing to do is to replace the God-awful default theme with something way cooler and easier on the eyes. The theme I’m using now is psicopoire.

The Box-Look.org website includes hundreds of awesome themes you can try out. And installing them is actually pretty simple. To install a new theme in IceWM, try this:

  1. Download the tarball
  2. Untar the tarball into the ~/.icewm/themes directory (if it does not exist, create it)
  3. Right-click on the desktop and go to Settings->Themes->Your New Theme’s Name

Does anyone else know any other neat, lightweight software to replace large-scale, heavy applications? I’d love to give them a try.

Google Chrome for Linux Now Available

The world’s fastest web browser, Google Chrome, has recently been released on the Linux platform. This is big news since it will greatly improve the web browsing performance of many of the world’s netbooks.

I’ve been a huge fan of Google Chrome since it appeared in the summer of last year, but haven’t used it heavily simply because of the lack of Linux support. It is installed on my Windows 7 virtualization, however.

Word on the street is that Google Chrome is also available for Macs, so if that’s your platform, take a look!

One thing that I think is important to note that I haven’t seen anyone pick up on is this line on the Official Google Blog post about Chrome being available for Linux and Mac:

“At Google, most engineers use Linux machines …”

Hmm.. No wonder they’re winning! ;)

Go for it -> Download Google Chrome for Linux

Develop Locally With Linux, Apache, MySQL, and PHP

If you’d like to develop PHP and MySQL web apps in Linux but you’re not sure how to get started then feel free to follow along with this blog post. For the most part, installation and configuration is simple and straightforward.

Though this article is directed toward users of Mandriva Linux (my Linux distribution of choice for a desktop / web-development PC), the same instructions can apply to many of the different Linux distributions including Fedora, Red Hat Enterprise Linux, Ubuntu, and Eeebuntu. For a huge list and up-to-date news of Linux distributions available to you, take a look at the Distrowatch news site.

The easiest way to install all of the software in the LAMP stack (Linux Apache MySQL and PHP) quickly is to do it using the command-line (also known as the console). Since many new users are uncomfortable with the command-line, feel free to do all of these installations graphically using the software installer from your respective distribution.

If you’d like to proceed using the graphical installer built into Mandriva Linux, use the “Install & Remove Software” icon located in the main menu.

To install apache, mysql, and php using the Mandriva command-line, follow these instructions:

  • Open up a terminal by clicking on the Mandriva star and clicking on Terminal
  • Type “su” and press enter (this will log you in as the administrator or “root” user)
  • Enter your root password
  • Type “urpmi apache php mysql phpmyadmin nano”
  • If asked which version of apache, select a stable version to install (likely the first choice)
  • If asked which version of php, select the apache module version (not CGI or CLI)
  • If asked for permission to install extra software that is required for proper operation of the LAMP stack, select “yes” and proceed

Once the software has been installed, you should be able to open up Firefox and navigate to http://localhost . This should bring up a screen that says “It works!”, meaning that apache has been properly installed.

For reference, Mandriva Linux puts your web files in the directory /var/www/html . Straight away you may not be able to access those folders with your regular user so feel free to change the permissions of the directory recursively by using the command

chown -R yourusername:yourusername /var/www/html

Note that this operation is definitely not secure if you plan on actually hosting your website on the live Internet using this computer, but for local development you should be okay. :) To learn more about file and directory permissions in Linux, take a look at the official documentation.

Before you are able to access your databases through phpmyadmin, you will need to set your MySQL root password using the following command (being sure to change NEWPASSWORD to a password of your choice):

 mysqladmin -u root password NEWPASSWORD

Using Firefox (or whatever browser you normally use) navigate to http://localhost/phpmyadmin . Log into MySQL with your “root” user and the password you just entered into the command-line. This should give you access to your MySQL databases. For more information on how to use phpmyadmin, take a look at the official website.

Let’s create a small Hello World PHP web application by navigating to our web directory and creating it. Use the following commands to achieve this:

cd /var/www/html
nano test.php

In the editor screen that appears, enter

<?php echo "Hello World!"; ?>

Press CTRL-X and save the file before quitting. You should now be able to navigate to http://localhost/test.php and see your hello world application :)

Hopefully this has given you enough information to get you up and running. Please feel free to post comments if you’ve run into problems and hopefully I or another person in the community will be able to help you out.

Have fun with PHP on Linux!

A Month With Mandriva

Well, it’s been just over a month since I made the switch to Linux from Windows. My distribution of choice for desktop PCs has always been the fantastic Mandriva Linux. Available for free with plenty of included software (Open Office suite, the Firefox web browser, Kopete messenger, Amarok media player, and much more), it’s always done the trick and looks wonderful doing so.

I have two physical hard drives in my PC. The first one is mounted ‘/’ for all my system files and programs. The second drive is my ‘/home’ directory, where all of my documents are kept. All of the system files are kept entirely separate from my documents.This sort of division is done even with one single hard drive automatically by Mandriva so that if I ever need to format or upgrade the operating system I don’t lose any of my pictures, movies, or music, ever.

Me playing Morrowind in Linux
Me playing Morrowind in Linux

Life without Windows is certainly possible. I’m living proof. And the stuff I use my computer for is likely more intense than your average Joe since I’m a web developer. All of the required software that I use on a daily basis is available and runs great in Linux.

All of my games worked out-of-the-box using the Windows games and software emulator* (Read more about the Wine project). I’ve included a screenshot of me playing Morrowind. It runs great. My girlfriend and I played through Max Payne on this PC, as well, and we’re a quarter of the way through the Quest for Glory 2 remake (which is a lot of fun, by the way) on my other Mandriva Linux PC (our media center).

If you’re considering running Linux or if you’ve heard about it and are curious, give Mandriva Linux One a try. It’s pretty simple: You download it and burn it onto a blank CDR. Reboot with the disc in the drive and you can use it right off the disc without actually installing it. If you like it, go ahead and install it. Otherwise, just take the disc out and reboot — nothing has been changed on your computer.

For more information about Linux, try reading some of these sites:

* I realize Wine is technically not an emulator, but when explaining what it does it helps to use that term.

Well, I’ve officially made the switch to Mandriva Linux.

After years of dual-booting between Windows XP and Mandriva, I made the decision to bring the hammer down and get rid of the former. My original intention was to make the switch when I bought a new PC but my hand was forced as I came home from work on Friday to a locked-up Windows XP desktop that never came back.

Fear not: no data was lost as Mandriva can read Windows drives. I backed up my things onto my /home partition and waved goodbye.

It’s been a roller-coaster past with Windows XP: When it first came out, I irrationally hated it. Once I got used to it, I found it actually worked pretty well. Mostly. Sure, it lacked some of the neat features Mandriva had (rotating cube desktop, wallpaper playlists, etc.) and you never quite knew when the next time it would fail was, but it got the job done. Facing a crashed system and being forced to format was always a wonderful experience. Windows doesn’t have separate partitions for your personal files and system files, meaning that when you begin again, you lose everything. Hope you made a backup! Going through the hassle of calling a Microsoft person in India to promise them you only had one copy of Windows installed was always a treat, as well.

When Vista came out I was put off by even more Digital Restriction Management (DRM) but wanted to see how it performed nonetheless. I can honestly say after using it at work for the past year and a half that it will never come close to being installed on my machines. So, that leaves us the little engine that could: Mandriva.

It’s been just over 2 days since breaking up with Windows XP and I have to say, I don’t miss a thing.

Unlimited Awesome: Linux script to convert mods to mp3

Listening to Purple Motion in iTunes :)
Listening to Purple Motion in iTunes :)

One day, Philipp Keller got fed up with installing sound libraries to listen to old-skool music files, so he decided to write a script that takes the hassle out of it and convert any mod to an mp3 file. Now you can download his script for free and use it on your own Linux box to convert your precious mod collection to mp3 for on-the-go listening.

Last.fm Integration

Playing your music modules as mp3 files has the added effect of allowing you to scrobble your music to Last.fm. Typically, playing anything but an mp3 causes Last.fm to disregard your tune. I know that if Last.fm or the WinAmp Audioscrobbler plugin took my mod playing seriously, I’d have a way different collection. Now I can.

Open source rules. Long live music modules!

Mandriva 2009.0 Is Almost Here!

The newest version of Mandriva is almost here! Released just a few days ago, the second release candidate of Mandriva includes the long awaited switch to KDE4. A release candidate, for those not aware, is the versions of Mandriva (and other software) that are considered nearest to the final cut. Once these final few versions pass with a minimum of bug reports, the software is released in full.

If you’re interested in trying out Mandriva Linux, you should try last season’s stable 2008.1 version. If you’re a current Mandriva user and want to see the latest and greatest (at the risk of system stability), check out 2009.0 RC2.

For more information, check out the DistroWatch page for Mandriva Linux.

linuX-gamers – Boot n’Play Linux Games Disc

This thing is really, really cool.

I saw on Distro Watch today the announcement of a new development version of the “boot n’play” Linux games DVD available for download and was instantly enthralled with the idea. It’s like having a free games console on your PC. You put the disc in, reboot, and play. Right off the DVD. You can save your savegame on your USB memory card. There are quite a few high-quality games included with this thing and a lot of them provide multiplayer fun. Check out the games list for further info.

If you’re looking for a change from the normal PC game scene, download the DVD torrent and start playing! Also, don’t forget to submit all the bugs you find in the bugtracker!

Have fun!

Source Control – svn + ssh (subversion to the rescue!)

There comes a point in any developer’s life where he/she must work with one or more people on the same project. What’s the correct procedure? How is this done? There are a number of different ways. Some good, some bad.

The Bad: You may have a method in place where only one person can be working on a file at one time. You have to notify the other developers that the file is free when you’re done with it. They download the latest copy every time and so do you so as to not overwrite the work that was just completed.

Some of you may say “Well, why is this bad? We’ve done this for months! It’s worked out pretty well so far!” There are a number of different answers to this question, which I’m going to deal with right now.

This is a bad method because time is money and this method is much, much slower. What is a programmer to do while he or she is waiting for the file to be free for editing? Read blogs?

Time is money.

If the company had source control, both programmers could essentially be working on the same file at the same time. I say essentially because technically they both have their own versions of it and the source control program (Subversion is the one I would like to write about today) will merge their changes together intelligently. Oh wait, this isn’t good. Now you won’t have time to read my blog because you’ll be working!

The second reason the “one person, one file, one time” method is bad is because it’s extremely risky for accidentally deleting work and wasting hours of productivity. As a developer, you should be constantly using and building work methods that prevent failure at any level you are involved with.

How would you feel if you worked on a function for two hours, then because someone overwrote the file with their copy all your work was lost? The reverse is also true: How would you feel if when you saved your work you accidentally overwrote a day’s worth of work and changes?

Time is money. Again.

“But before you save your file you can make a backup of the original file!” I hear you saying, way in the back. Of course you could, but how far do you want to take that methodology? Will you remember every time? Will everyone who works on the project remember, every time? What if it’s a one-line fix? “Oh, I’ll just log in quickly and fix that typo.” and the like are sentences that run shivers down my spine when thinking about using this method.

So the person logs in and fixes the typo. Because it was a small fix, they never checked to see if anyone was working on the file. So now we’ve got two changes that need to be merged somehow. I’m sure that person will be wondering the next day why the typo has reappeared after you save your file!

Okay. So what’s the solution then, smarty-pants?

The good: The solution is source control. It’s not new. It’s been tested and proven multiple times in the computing industry and there are some big players that use it. There are a multitude of different kinds that do some different things, but to the layman the simplest way to look at it is to use a common source control program called Subversion. Everyone’s heard of it, a ton of people use it. Nerds of different flavors will tell you there are better ones out there, and that may be true, but Subversion works. For a lot of folks.

The concept is simple: A project is set up in the Subversion software. Two programmers “check out” (think of checking out at a grocery store) a copy of the project on their computer or development server and work completely independently.

Programmer “Jane” and “Jack” are both working on the same project. Jane is building a module not related to Jack but in a few cases they may modify the same files. That’s no cause for concern, deliberation, or communication. They happily keep on working until their particular task is complete.

Jane finishes first and “checks in” her work by “committing” her work to the Subversion server. Everything goes as planned and her work is then “committed” to the main project files. Jack finishes his work a few minutes later and attempts to check in his work. Uh-oh! Jack’s copy of the project is slightly out-of-date! No big deal, he issues the “svn update” command and all of the files Jane edited are updated on Jack’s computer. Any changes to the files that they both worked on are merged automatically.

After he has updated his copy of the project he commits his files and goes home for the day.

Wow! Sounds great. But what happens if Jack deletes parts of the source code that Jane edited?

This sort of thing is called a conflict. They’re pretty rare and in most cases you can resolve the conflict in a few minutes. When you edit a file that is marked “in conflict” by Subversion, it shows the added and removed portions. You can make adjustments based on which is correct and issue the “svn resolve” command to consider the issue resolved then commit the correct version.

Cool beans. How do I start?

First, you install Subversion on your server. Programmers will connect to this machine, “check out” a copy of the project, and begin work. In most cases, installing Subversion takes less than 10 minutes. You should check with your particular Operating System documentation to see how to install Subversion, but in Mandriva Linux you can do it through the command-line with this command (logged in as root):

# urpmi subversion

After installing Subversion, you will need to pick a spot on your hard drive where you want your project files to be located. For me, that’s almost always /home/svn. Change directory to your project directory and type:

# svnadmin create <projectname>

This will create a directory and place the important Subversion bits inside it for this all to function. Make sure the directory (and all subdirectories) are writeable by the group of users that will be working on the project by first first changing the ownership to a particular user and group with this command (run as root):

# chown -R user:devgroup <projectname>

This command makes the project directory and any directory inside of it owned by user and associated with the devgroup group. After this you will need to set the permissions on the directory so that the devgroup has read, write, and execute access to this directory. We do that by executing this command (run as root):

# chmod -R 775 <projectname>

Great! Our project is ready to roll. Note that this assumes you have ssh enabled on this server (very likely by in Linux, FreeBSD, and in fact most others *nix variants).

Next, we’ll need to check out a copy of our project. Stay tuned for that tutorial, coming soon!

Linux/Unix: Using split and cat to split large files for transfer

I learned about a really handy command-line tool today that you can use in Linux, Unix, or FreeBSD to split any large file to any size that you like. These two commands, split and cat, can work together to split your files for easy transfer or storage. Then, you can concatenate them back together again to make one file.

If you’ve got a small maximum filesize to your E-Mail attachments or your backups take up slightly more than a DVD or CD, then you can definitely use this. And, it’s really, really simple.

First, split the file using the command “split”, specifying how many megabytes you want to split your file into.

# split -b 1024m <filename>

This will split your file into as many parts as needed, in 1024MB chunks, typically with the name starting as xaa, xab, xac, and so on. You can then burn these files to a disc or E-Mail them (though if you’re E-Mailing it might be better to specify a smaller chunk size. For example, you’d use “-b 1m” for 1MB chunks).

Keep in mind that once you’ve split your files, in order to put them back together again you’ll need all of the files. If you’re missing one of the files, this operation will not work. But that makes sense, doesn’t it? :)

Once you’ve split your files you can easily put them back together again using the command “cat”.

This is even simpler.

# cat xa* > <filename>

This command tells cat to concatenate all the files starting with “xa” and put them into one new file.

Many zip, rar, or other archiving tools will allow you to split the file you’re zipping across multiple volumes, but the benefit of this is that you can split any file you like, even MP3 or jpg files. Split to your heart’s content!

Crossover Games, PlayOnLinux, Wine, and Cedega

If I had a lot of money…

I’d buy PlayOnLinux and Cedega and Crossover Games (while maintaining a great working relationship with the good folks still at Crossover working on apps) and put together (with some hefty funds behind them) a crack team of DirectX hackers and previous Microsoft DirectX programmers to put together a fully-functional, working DirectX emulator for Mac and Linux. Then, port all those changes back into the Wine trunk while promoting an off-the-shelf Windows games player.

I truly believe that if games worked on Linux flawlessly there would be a greater adoption of Linux on desktops worldwide. I know locally it is a huge hurdle to jump. All of my friends are interested in Linux, two of them have the ISO sitting on their desktop. Why are they not making the switch? One: Games. The other: Sony Vegas. People want to use it but they want their games too!

Game development and publishing companies wouldn’t have to write games to be cross platform if the emulator worked perfectly. They would go on making Windows games while Linux continues to grow in installed user base.

Making games for Linux is not the answer, making Linux work for games is!