StarCraft in Ubuntu? YES, Drink the WINE!

ubuntu_starcraft.jpg

In keeping in step with my new found love of StarCraft, I wanted to play it on my laptop. One problem… my laptop doesn’t run on windows or mac, its powered by UBUNTU!

I love running Ubuntu, and I have never found a reason why I would need windows on my laptop. Ubuntu does everything I need it to, that is until I wanted to play a PC based game on it.

I did a little google searching and I found out that WINE on Ubuntu will play StarCraft perfectly! I gave it a go, and was surprised at how easy it was, and how well it all worked together.

Here are the steps I took:

  • Open a terminal and run sudo apt-get install wine to get wine.
  • After that finishes, insert the StarCraft CD into the computer
  • In the terminal cd to whatever cdrom drive you put the cd in (under the /media/ directory). Mine was /media/cdrom0
  • Use Wine to setup StarCraft with wine setup.exe. You’ll get the install screen for SC – enter your CD key and install the software. StarCraft will be installed under the path of
    ~/.wine/drive_c/Program\ Files/Starcraft/starcraft.exe.
  • In the terminal, run winecfg and go to the Audio tab. Set Hardware Acceleration to Emulation.
  • What is StarcCaft without the Broodwar expantion? I eject the Starcraft CD and insert the Broodwar expantion CD.
    cd to the appropriate /media/ directory and run wine setup.exe.
  • To play StarCraft, run wine ~/.wine/drive_c/Program\ Files/Starcraft/starcraft.exe.
    I was also able to find a link to it from the Applications menu in Ubuntu.
  • Lastly, I downloaded the latest patch to BroodWar from blizzard.com, and ran that with no problem.

There it was, a fully patched and running copy of StarCraft on my Ubuntu laptop. Can life get sweeter? I submit that it can not!

Hacking an old iPod to get a new one

A guy I know, “dave”, had an iPod that was acting up. On top of that, his warranty was was almost up, and he was worried that the iPod would live just long enough to go out of warranty before fully breaking, leaving him with out an iPod.

He was looking for a way help to speed up the failure process of his iPod, so he could make use of the warranty. Knowing that I have a back ground in working on the inside of iPods he hit me up for advice… advice that got him a new iPod

Based on the experiments and hundreds of comments I have received on my previous blog posts (here and here), its clear to see that when an iPod hard drive comes loose, the entire iPod goes nuts, and doesnt work (it cant read the music, so there is no music to play!).

  1. I suggested to Dave that he take a guitar pick (This is an old photo I am reusing where I used a screw driver for my example.. DONT USE A SCREW DRIVER you will scratch the metal part of the case!), and force the pick between the metal and the plastic, being careful not to scratch either surface.

    dsc00228.jpg

  2. Once the guitar pick (NOT SCREWDRIVER) is in between the case halves, twist the pick and move it slowly along the seam to release the internal latches. Take your time, so you don’t mark up the case, or Apple will know you were up to something.

  3. Once you get the case apart, be careful and move the case halves a part, keeping the plastic side down. Be sure not to break the ribbon cable joining the halves.


  4. Next, find the hard drive, it should be easy to see. At the top, it is attached with a large ribbon connection. This is where the magic happens! We need to unplug this cable from the drive, but still leave it semi attached. Pull the cable straight out, unhooking it completely. gently push it back on. enough to hold it in place, but not make a complete connection.

    We are trying to simulate what happens when some ipods are dropped. In some cases, the hard drive shifts and the cable becomes unplugged, creating a messed up iPod.

    To test this, gently pick up the iPod and press the scroll wheel. If you can see your songs, you pushed the cable back in to far, unhook it and try again. If you get an error, you did everything just right!

  5. To put it back together, flip the metal side over the top and gently squeeze it all together. The case will snap back into place.

  6. Your iPod should not play, and it looks completely broken.

If you return it to Apple under warranty, they should give you a new one. If they wont replace it, open it back up, re attach the hard drive cable and enjoy the dying days of your old iPod.

I haven’t tried doing this this, and I don’t really suggest doing it. I’m posting this for educational purposes, and because it is both an interesting hardware and social hack. I’m guessing that Apple might change their policy if they see a lot of this happening. You probably should just buy a new one. (I hope that covers me legally!)

While we are talking about iPods, subscribe to my podcast!

Fixing my laptops display

repair_laptop.jpg

Last June, I got a new (used) Toshiba M55 laptop.

I got it for an awesome deal because the hard drive was broken, and the screen flickered a lot. I figured for the price it was worth the gamble, even if I had to replace the screen it was still a bargain price.

The hard drive was DOA, and was replaced immediately. I installed Ubuntu 7.04 Gusty as the main OS with windows as the second OS. Easy enough to do.

The screen flickered a bit, but if i messed with the lid enough, moving it back and forth, I could get a good picture. Over time the picture just got worse and worse. It was time to do something about it. I did a quick google search and found a Toshiba M55 LCD replacement guide.

I figured it had to be something with the connections on to the screen or board because when the screen was working, it was working good. The image was great, but it took a bit to get it there.

I followed the guide exactly. I powered it on when I had it torn apart and it worked! It seems that there was to much stress on the LCD cable connection, causing it to freak out when the lid was in specific positions.

I followed this guide to open up the keyboard. (steps 6 – 8 only). I was able to give the cable a bit more slack, and every thing started working like it should! I put it all together and it’s like I have a new laptop, and all it took was an hour of my time and the guts to do it. I should have cracked this thing open 6 months ago if i knew it was going to be this easy!

I hope this helps someone else with a similar problem.

Firefox: spell check any field

firefoxlogo.gif

I can’t spell. That no joke. If you have read my blog for any length of time, you will know this. One of my saving graces has been the built in spell checker in Firefox (I’ve already used it 5 times in this post!)

By default Firefox will only spell check large text areas. This is great for the bodies of forum and blog posts, but it doesn’t help when I am filling out a single line text box, like the subject of this blog, or a forum topic title.

There is a solution to this, so you can have Firefox’s spell check available to all fields in a browser:

In Firefox, do the following (ignore all quotes)

  1. type this in the browser address bar “about:config”
  2. look for “layout.spellcheckDefault”
  3. change the value to “2”
  4. restart firefox

cpanel broke mysqlhotcopy 1.22 but here is a fix!

mysql-logo.gif
Yesterday I logged into my server to back up my databases. I back up the mysql databases using a tool called “mysqlhotcoy”. It’s a handy perl application that copies the database files for easy restores, and it also works really quick when you run it.

I ran the mysqlhotcopy command as root, and was greeted with an error similar to this:
Invalid db.table name 'foo.foo`.`bar'

um, no…. this table exists

I have cpanel installed on my server, a lot of server do. cpanel does updates to many application, mysqlhotcopy is one of them. It looks like my version of mysqlhotcopy was updated to 1.22, and there is some major problems with mysqlhotcopy 1.22.

I did some googeling and I found some people talking about the problem. I even found a quick patch for the problem. The problem comes from a host adding the username and an underscore before a database name (example: “username_databasename.table“). mysqlhotcopy only looks for databasename.table

The following patch instructions will fix mysqlhotcopy 1.22

  • Open the perl script for editing. It is located at /usr/bin/mysqlhotcopy
  • find the following subroutine

    sub get_list_of_tables {
    my ( $db ) = @_;

    my $dbh = DBI->connect(“dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy”,
    $opt{user}, $opt{password},
    {
    RaiseError => 1,
    PrintError => 0,
    AutoCommit => 1,
    });

    my @dbh_tables = eval { $dbh->tables() };
    $dbh->disconnect();
    return @dbh_tables;
    }

  • look for this line (mine was link 821):

    my @dbh_tables = eval { $dbh->tables() };

  • immediately after that line add the following:

    map { s/^.*?\.//o } @dbh_tables

Here is my patched subroutine:

sub get_list_of_tables {
my ( $db ) = @_;

my $dbh = DBI->connect(“dbi:mysql:${db}${dsn};mysql_read_default_group=mysqlhotcopy”,
$opt{user}, $opt{password},
{
RaiseError => 1,
PrintError => 0,
AutoCommit => 1,
});

my @dbh_tables = eval { $dbh->tables() };
map { s/^.*?\.//o } @dbh_tables;
$dbh->disconnect();
return @dbh_tables;
}

After I applied the patch, everything was back to working order.

Some people have other approaches that would work also, like downgrading mysqlhotcopy all together.

Personally, I think adding one line of code wasn’t that big of a deal to fix the program