Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Apr 18, 2011

Fixing a Dead MySQL Server on Ubuntu

I'm doing some freelance work for a company and unfortunately the other day their DB server crapped out. On top of that, there was some issues with the backup script, so the last backup done was quite some time ago.

Fortunately though, the hard drive was still intact. Here is a little guide to restoring your MySQL DB in the case that your DB server dies and you have no backups. This is a guide for Ubuntu server 10.04, but it shouldn't be too different with other versions of Ubuntu or other Linux distributions.

There is one requirement here: the hard drive still needs to work. If the hard drive is toast, then you're in trouble.

1) We had another computer that wasn't being used that had been purchased to be set up as a backup server. It wasn't set up yet, so I just stuck Ubuntu Server on it and plugged the old hard drive in.
2) Make sure MySQL is installed: sudo apt-get install mysql-server
3) Stop the MySQL server: sudo /etc/init.d/mysql stop
4) MySQL keeps the database files in /var/lib/mysql. Copy these from the old hard drive to the new hard drive. It might be a good idea to not copy over /var/lib/mysql/mysql, however I didn't have any problems after copying that over (yet). Try it and if the database doesn't work, copy that folder too. Also, don't copy over any .pid files.
5) Set permissions: sudo chown mysql:mysql -R /var/lib/mysql/*
6) Restart the MySQL server: sudo /etc/init.d/mysql start

Now the MySQL server should be just like it was before the system died. If you didn't copy over the /var/lib/mysql/mysql folder then you'll have to recreate any users that you had. If the whole thing just doesn't work then just copy that folder too.

Hopefully this saves some people some pain! I was particularly annoyed since I forgot step 5, so the MySQL server was able to list the other databases but kept saying that there were no tables in any of them. Not good! In the end it just turned out to be a permissions issue which is no big deal.

Anyway the more important thing to take out of all this is to make sure that your backup scripts work.

Mar 16, 2011

Controlling Rhythmbox with your Wiimote

I've been fiddling with one of my Wiimotes tonight to try and get it to control Rhythmbox. Turns out it's actually really easy! You can do it via the cwiid library for Python, and with a Rhythmbox plugin.

For this to work, you need a Wiimote and some sort of Bluetooth device for your computer that works with Ubuntu. You'll also need the correct package:
sudo apt-get install python-cwiid
Here's the step-by-step guide to getting it to work:
  1. Create a folder at ~/.gnome2/rhythmbox/plugins if it doesn't already exist.
  2. Create a file in there called WiimoteControl.rb-plugin, and put the following in it:
    [RB Plugin]
    Loader=python
    Module=WiimoteControl
    IAge=1
    Name=Wiimote Control
    Description=A way to control Rhythmbox with your Wiimote
    Authors=Rob Britton 
    Copyright=Copyright (c) 2011 Rob Britton
    Website=http://lovehateubuntu.blogspot.com/
    You can replace my name with yours if you want, I won't mind ;)
  3. Create a file called __init__.py, and put the following in it:
    import rb
    import cwiid
    
    rbshell = None
    
    def callback(mesg_list, time):
      # Called whenever a button is pushed on the Wiimote
      global rbshell
      for mesg in mesg_list:
        if mesg[0] == cwiid.MESG_BTN:
          if mesg[1] == cwiid.BTN_A:
            rbshell.props.shell_player.playpause()
          if mesg[1] == cwiid.BTN_LEFT:
            rbshell.props.shell_player.do_previous()
          if mesg[1] == cwiid.BTN_RIGHT:
            rbshell.props.shell_player.do_next()
    
    
    class WiimoteControlPlugin (rb.Plugin):
      def __init__(self):
        rb.Plugin.__init__(self)
    
      def activate(self, shell):
        # called when Rhythmbox starts
        global rbshell, bus
        self.shell = shell
        rbshell = self.shell
        self.wiimote = None
    
        print "looking for wiimote..."
        self.wiimote = cwiid.Wiimote()
    
        print "found wiimote"
        self.wiimote.enable(cwiid.FLAG_MESG_IFC)
        self.wiimote.mesg_callback = callback
        self.wiimote.rpt_mode = cwiid.RPT_BTN
    
      def deactivate(self, shell):
        # called when Rhythmbox closes
        self.wiimote.close()
    This code sets up the Wiimote and binds left/right to previous/next song, and the A button to Play/Pause.
  4. Open Rhythmbox, and while it is opening push the 1 and 2 buttons on the Wiimote. It will take a sec for Rhythmbox to open since it is looking for the Wiimote.
All this should make it so that your Wiimote can connect and control Rhythmbox. To get debug messages, you can run Rhythmbox from the command line:
rhythmbox -D WiimoteControl
The program isn't ideal, since if you don't connect the Wiimote in time it will not properly set everything. It might be better to put some sort of timer that goes periodically to check to see if the Wiimote is there and if it is not, attempts to connect it. Also I think it would be neat to be able to control the volume using the up and down buttons, but I'm not quite sure how to do that yet. It doesn't seem to be in the Rhythmbox plugin guide, and the other plugins don't really do that sort of thing.

Dec 3, 2010

Getting Your Files

I suppose I'm talking to the wrong group of people here, but I decided to write a quick post about how to access anybody's files without needing their username/password for their computer.

It's quite simple:
1) Put in an Ubuntu LiveCD/LiveUSB
2) Boot off it
3) Access their files by going to Places -> X GB/TB Volume

This doesn't work if they have any sort of encryption on their drives or a BIOS password, but otherwise you can do whatever you feel like! So if you have a laptop or a machine that is easily reachable by random people, then you should probably secure your files from something like this if there are things on there that you don't really want people getting to.

Nov 11, 2010

Why I Prefer Linux Servers

Say what you will about the quality of Linux servers vs. Windows servers, etc. etc. but here is one huge reason why Linux servers are better (all prices in USD):

Windows Server 2008 Licence with 5 users (not accessible through Remote Desktop): $1 029
To enable 5 users with Remote Desktop: $749
To add 5 more users: $199
To allow those 5 more to use Remote Desktop: $749

Ouch.

May 15, 2010

Linux Schematic Software - gEDA

I recently had a need to do up a basic schematic on the computer, and just save it. The first thing I attempted was Dia, which I've used before for basic software diagrams. It's half-decent, and when I did the software diagrams it pretty much did what I wanted it. However for schematics I find it isn't so great and I thought there might be a better alternative.

I did a quick search in Synaptic for "schematic" to see what it would come up with. There are a whole bunch, and I went through a few of them. The best one that I found in there was gEDA, for the following reasons:
1) Massive library of components. I had a specific IC for the circuit I wanted to draw, and it was in the library. I was expecting to have to create some generic IC with a certain number of pins, but they had the one I wanted. Also, the library has a search feature, so you don't have to scan through to find the one you want.
2) Wires can be drawn easily, and as you want them. They also will snap to other wires and components. If the components have certain pins (like ICs) you can easily choose which pin you want to connect to.
3) Interface isn't too unwieldy. I would have a few suggestions (maybe I can add them as a little project) but other than that it is very functional and stays out of your way.

There might be some better features you might want, but these are the ones that I like and needed for this specific case.

May 11, 2010

A Quick Look at Lucid

Alright, it's that time again! A new version of Ubuntu has been recently released, and I'm going to do a quick write-up about it.

I just installed it today and have been using it a bit to see how things go.

First thing to note is the new look. While I don't like the purple splash screen (purple isn't really my colour) I think everything else looks really good. Everything looks much more slick than before. I'm not really sure why they moved the window controls to the top-left corner to the top-right, but meh. If you want to change it back to the top-right, it's not hard.
The only issue with the new colour scheme is the interaction with Firefox's autocomplete - when you start typing a URL, I find that the drop-down that comes out is a bit difficult to read since it is a dark background and light writing on top of a white screen. I'd prefer a white background with dark writing, but that's just me.

Rhythmbox updates - I don't really like the new system-tray interface. I prefer the old one where you left-click and it opens the Rhythmbox window, and right-click gives you the context menu. Now it is left-click to get a context menu, and right-click doesn't do anything. My main problem is the inconsistency (right-click is context menu for everything else still) and that it now requires two clicks to do something that I do all the time. A little detail, but something that bugs me - I love efficiency.
Also the music toolbar applet (now known as Panflute) appears to be gone, which is a bit disappointing.
Finally, I think the Ubuntu Music Store is a good initiative, but I don't really have any other comments about it.

Other than that, I'm happy that it seems to be fast and stable. Good job Ubuntu devs!

Apr 13, 2010

Mac Fonts in Ubuntu

Back when I was working with a bunch of Mac guys, they would always complain about looking at my screen because the fonts were bad. I do believe in the importance of aesthetics, so I decided to just put the same ones they had on my computer. You can get this fairly easily, just open Applications->Accessories->Terminal and copy-paste this:
wget http://ubuntu-debs.googlecode.com/files/macfonts.tar.gz
tar zxvf macfonts.tar.gz
sudo mv macfonts /usr/share/fonts/
sudo fc-cache -f -v
One issue with this is that it messes up how Firefox renders input tags. Supposedly this is because the Lucida Grande font included in this macfonts bundle are not correct, so you can get the real ones here. Just download the file there, and put the font files into your /usr/share/fonts/macfonts folder and all will be well!

Apr 9, 2010

Ubuntu for Web Development, Revisited

I was reading a post I made a couple years ago, it strikes me as amazing how much I've learned and changed in those years! So I'm revisiting this post with the way that I see things now.

The question is, "Can you use Ubuntu for web development?" The answer is yes, since that's what I've been using since I left Mansef in the summer of 2008. I've discovered it works really well, since everything is right there for you. It is quick and easy to set everything up, and there are a number of great tools available for you to use for coding.

A quick disclaimer before I get too into this, I am not trying to say that Ubuntu is better than other platforms for web development, I'm saying that if you want to use Ubuntu for development then it is quite possible and you're not really going to hurt yourself by trying - except for maybe the little hiccups in the beginning when you're still getting used to the system, but this is true for any software.

I'll talk about various different platforms:
  • Java/JVM Languages - I haven't really done any Java development under Ubuntu, so I can't really give a good answer about it. I've done a fair bit of JRuby which uses a lot of the same tools and software, but they aren't all the same. Anyway I'm assuming that since Java stuff is all cross-platform, you can use all the same tools that you're used to using. Eclipse and Netbeans work fine under Linux, as do servers like Tomcat and Glassfish.
  • Ruby - I don't really need to say much here, since most Ruby developers seem to view Linux as a suitable development platform anyway. From my experience with Ruby development you usually just use a text editor and a command line for everything, which Linux is ideal at. The only reason not to use it is if you're married to Textmate.
  • Others - I'm not too well versed with other development like with .NET or Python, so I can't really give a good analysis here. I'm going to assume that if you're using .NET then you're pretty screwed with anything that isn't Windows, although Mono seems to be doing fairly well. As for Python I can't think of any reason why using Ubuntu would be bad, but since I haven't done too much Python I can't really say. Maybe if there is a Python expert in the audience they can shed some light on this one.
The big one I want to talk about is PHP, mainly due to it's popularity and also because it's the one web language that I've worked with extensively under both Windows and Ubuntu. So let's dive in!

Setup


Setting up PHP under Windows is a pain. Where I worked we used a Linux server and mounted a network share as our dev drive. This is not a bad solution, however to me it seems a bit inefficient to have to use another computer to do your development when you can just do it all on your own machine. This gets even more problematic when you don't have admin rights to the dev server and can't fiddle with things (this gets really bad when files/folders are owned by www-data, so you can't modify them without executing some PHP code from the server).
If you want to install everything on your own computer, you have to go out and download all the software manually and install it. I'm not sure how much configuring you have to do for this either, but it is still a pain.
After a bit of research I discovered PHP Triad, which supposedly solves a lot of these problems. I'll have to check this out later on.

Setting up PHP under Ubuntu on the other hand is trivial. From a terminal (you can also install these via System->Administration->Synaptic Package Manager, it's just usually faster to use a terminal) you can just do:
sudo apt-get install apache2 php5 mysql-server php5-mysql
This will install the web server, PHP, and the DB server; it will also come pre-configured for Ubuntu so that you don't really have to tinker with anything. If you go to your browser after doing this and browse to http://localhost/, you should see something that says "It works!" This means that Apache is installed properly. Now you can do everything you need to do without worrying about network shares or any of that. The nice thing about this is that you don't have to worry about the network going down, permissions, other people messing with your stuff, etc.
The default folder for Apache is /var/www. Typically what I do since I'm usually working on different sites is make sub-folders in here for each project and then give myself write access to them:
sudo mkdir /var/www/my_project
sudo chown rob:rob /var/www/my_project
You would then access this project by going to http://localhost/my_project. Make sure to use your username instead of "rob".

Tools


Of course, the system wouldn't be very good without any development tools. Let's talk about a few of these:
  • IDEs/Text Editors - I've found that there are plenty more IDEs available for Windows than for Ubuntu. I've used Dreamweaver and PhpEd under Windows, and Quanta Plus for Linux. Of these, PhpEd is by far the best since it is an actual PHP editor rather than an HTML-editor-turned-PHP-editor and it comes with nice things for profiling and debugging. On the other hand it is not free in any sense of the word, so be prepared to shell out some cash if you want it.
    Ones that I haven't tried include PHP Triad which is Windows only, Bluefish which is Linux only, and Eclipse and Netbeans which are cross-platform.
    From this you'd say that Windows has the better editors, and I'm not sure if I'll argue against that - although if you're one of those folks who swear by Eclipse or Netbeans (and there are a lot of them out there!), then you're really not constrained by the operating system.
    These days though, I do all my development using Vim. I'd argue that it is important to know how to use Vim at least a basic level, since so many of the *nix/BSD servers out there might only have Vim installed on them - although once I used a Linux server that had pico as the only editor installed, which was odd.
    Since this is an article about the merits of Ubuntu, not Vim, I'll save the Vim argument for another day. However since it (and its popular alternative, Emacs) are available for most desktop operating systems, there isn't really a reason to use one OS over another.
    So who wins here? I'd say Windows if you're in love with a specific Windows-only editor, however if you're willing to learn something else then there are plenty of good programs available in Ubuntu.
  • Databases - Most PHP apps use some kind of database, whether it is MySQL, PostgreSQL, etc. If you're using a database that doesn't work under Linux (like MS SQL) then you're probably better off not using Ubuntu, but pretty much everything else will work fine. If you're using MySQL or PostgreSQL it is nice and easy to install phpmyadmin or phppgadmin via Synaptic or apt-get to give you a database interface that is slightly easier to use than the command line. Who wins here? Nobody really, since databases other than MS SQL are available for most operating systems.
  • Command-line Tools - Here is where Linux wins. I know many people hate the command line (I used to as well) because it has a steeper learning curve and/or feels archaic, but it is an extremely efficient way to get things done sometimes. When you couple it with simple tools like grep, or bash scripting, or with specific programs like ffmpeg/mencoder/ImageMagick you can get your PHP app to do a lot of interesting things.
Anyway in conclusion I feel that Ubuntu is quite well suited to web development in most languages - the exception being any Microsoft languages. You have a large variety of tools available to you (probably not quite as large as with Windows, but the nice thing about Linux tools is they're usually free) many of which are well proven in the market. There is a bit of a learning curve to Ubuntu if you've never used it before (although I think that if you're reading this blog, chances are you know your way around Ubuntu) and that might deter a few folks, but if you're wanting to use Ubuntu for web development then you can go for it and you're not putting yourself at a disadvantage.

Feb 9, 2010

On Converting People to Ubuntu

Personally I don't care too much if others like Ubuntu or not, so I don't really attempt to push it on any of my friends - back when I was still a Windows guy I absolutely hated Linux fanboys always trying to force it on me, citing irrelevant reasons like "it's free!" or something like that (my response was "yes, but does it work?", although that leads into a complicated discussion of the definition of "working" and we won't go there today). These days freedom is a lot more important, but I still don't think that it should be forced on them - "you have to understand, most of these people are not ready to be unplugged":

I guess this video isn't completely relevant to what I'm saying, I just like the message in that scene :) also the ending of that clip is good.

Anyway getting to my main point here, I think that many of the Linux geeks who preach about Linux would do well to read Ubuntu's guidelines on converting users: https://wiki.ubuntu.com/ConvertFriends.

Now I'll make a playful jab at my Mac user friends ;) scroll up a bit and read my sentence that says "freedom is a lot more important." That's one of my main reasons for not going with Apple - I feel bad enough owning an iPod Shuffle.

Back to Jaunty

I manage to brick my Ubuntu install today by switching the home partition from XFS to ext3. Don't ask why I had my home partition as XFS, it was one of those "it seemed like a good idea at the time" things and I really don't have much of a reason other than that. Why did I switch it back? Well, I like having the ability to shrink a partition and since my Windows one is full of games, the home partition is really the only one left. I was thinking of sticking the Lucid alpha in there to see what happens. Second, I couldn't seem to find an easy-to-install XFS driver for Windows, and sometimes it is handy to be able to access your home folder from Windows - read-only of course, I have some kind of paranoia about Windows and I'm afraid that if I allow the Windows partition to have write-access to my Ubuntu partitions then all hell will break loose.

Then I switched back to Jaunty because my Karmic LiveCD wouldn't boot.

How do I feel now that I'm back to Jaunty? This is probably because it's a brand new install (or maybe ext3 is just that much faster than XFS), but it's speedy. It boots way faster than Karmic did. Things are much more snappy, Firefox starts right away, and things actually respond when I click on them and not 5-10 seconds later. It's nice. Oh, and my webcam works again since I'm back on a 2.6.28 kernel.
What's bad? Old versions of things - I'm back on Firefox 3.0 which is a bit slower than 3.5. I can probably upgrade, but that is something for later. I've also noticed some slight rendering differences on pages that I had open before and after the reinstall, which is interesting. I didn't think that there was that much of a difference. Other than that, I don't really have a problem with going back, and I might just hang out until Lucid comes out to give that a shot!

Feb 6, 2010

Programming the Wiimote in Ubuntu

This post has been a long time in coming, but I finally got up off my ass and decided to figure out how to code using a Wiimote in Ubuntu.

First, you need a Wiimote (obviously). Note that you don't actually need a Wii to do this, you can just head on down to Future Shop or whatever and grab a Wiimote. It should still work.
Second you need a Bluetooth adapter. I've got a RocketFish micro-dongle thing which works just fine, I'll leave it to you to find something for your machine.
Third, I'm going to assume you have Bluetooth working on your computer, otherwise there isn't much hope for you since the Wiimote is a Bluetooth device.

Let's start by grabbing the required libraries. In Ubuntu you can go:
sudo apt-get install lswm libcwiid1-dev libbluetooth-dev wmgui
To test to see if your adapter can detect the Wiimote, just run this command and press the 1 and 2 buttons:
lswm
If it displays a bunch of hex characters, then your Wiimote has been detected and you're set to go. If it doesn't display it right away and the LEDs are still flashing on the Wiimote, run it again since lswm doesn't wait very long and you might have missed it.

You can also test it out using wmgui, which basically shows you all the various sensors the Wiimote has in it. This includes the buttons, accelerometer and IR sensor. It's pretty easy to get it going, the only issue comes when you want to start using the IR. Since Wii sensor bar is actually just a bunch of infrared LEDs, you just need an IR light source. Unfortunately since the Wii bar doesn't plug into my computer (it has some weird plug that connects to the Wii), I went with something simpler - a candle. If you actually start programming using the IR it'd probably work better if you used two candles so that you can detect the orientation of the Wiimote, but it still works fine with one.

Now let's get to some code! I'll be using C with gcc. There's a Python version of this library but I haven't tested it and don't know how it works.
First, we include the needed libraries:
#include <bluetooth/bluetooth.h>
#include <cwiid.h>
We then set up the various structs we need to interact with the Wiimote:
bdaddr_t bdaddr = *BDADDR_ANY;
cwiid_wiimote_t * wiimote = NULL;
We obviously need a cwiid_wiimote_t struct in order to call functions on it, we also need the bdaddr_t struct to give us the Bluetooth code for the Wiimote (remember those hex digits that lswm printed out?).

Next we set up the Wiimote. Normally you would wrap these up in if statements for error checking, but I'm going to leave those out for clarity:
/* Connect to the Wiimote - the CWIID_FLAG_MESG_IFC
means that we want to use a callback method for
interacting with the device */
wiimote = cwiid_open(&bdaddr, CWIID_FLAG_MESG_IFC);

/* Now we register a callback. I'll define this later. */
cwiid_set_mesg_callback(wiimote, &wii_callback);

/* Set the reporting mode. This says which messages we want
to receive in our callback. Let's only get buttons for now. */
cwiid_set_rpt_mode(wiimote, CWIID_RPT_BTN);
Then we define our callback function. I'll just make it so that when you press B the program will quit:

void wii_callback(cwiid_wiimote_t * wiimote, /* The Wiimote struct */
int msg_count, /* The number of messages received */
union cwiid_mesg msgs[], /* The messages themselves */
struct timespec * timestamp /* The timestamp of the callback */){
int i;
for (i = 0; i < msg_count; i++){
if (msgs[i].type == CWIID_MESG_BTN){
if (msgs[i].btn_mesg.buttons & CWIID_BTN_B){
printf("B button pushed!\n");

/* Close the connection to the Wiimote and quit */
cwiid_close(wiimote);
exit(0);
}
}
}
}
The way the callback works is that it sends you an array of messages that happened. The message is a union of different types of messages, determined by the type field. For the button message, it includes an integer that for each bit it says whether or not each button is pushed. There are many other types of events, you can check it all out by browsing the cwiid source code (in Ubuntu it installs to /usr/include/cwiid.h) and by looking at the cwiid docs. Have fun playing with the Wiimote!

If you want to enable other functions, you just use a binary OR for the reporting mode:
/* Enable the buttons, accelerometer, and nunchuk */
cwiid_set_rpt_mode(wiimote, CWIID_RPT_BTN | CWIID_RPT_ACC | CWIID_RPT_NUNCHUK);

Jan 31, 2010

Chrome In Linux

For those that care, Chrome is available for Linux now. You can grab it here. It seems to work alright, although I don't use it very much so you're probably better off just trying it for a while on your own.

Jan 28, 2010

The Touch Book

I figured with all this hubbub about the iPad, I'll give my bit overdue comment about the Touch Book, which is a netbook/tablet from a small company called Always Innovating.

I've had this little gadget for a few weeks now, although I ordered it last June. Which is fine, because I haven't had a strong need for it until now (convenient the way things happen!) It's a pretty good deal, although for netbooks it's a bit on the steep range. It starts at $399 if you buy the complete deal, but you're going to end up paying about $460-470 after exchange rates, shipping and customs. Not a problem though, we'd be paying that much in taxes anyway if we went out to Future Shop or Best Buy.

What are the good aspects?
  • Tablet Mode - The screen comes off. Every part of the computer is actually inside the screen, the only parts inside the lower half are the keyboard, touch pad, and an extra battery (which means if you get the keyboard too, you'll have double the battery life). After the screen is off, it becomes a touch screen and you do everything you normally would with the machine - read an eBook, write notes, etc. It comes with software that is great for this thing; the program called "Note Taker" by default gives you a ruled piece of paper that you can draw on to your heart's content, and it even opens up PDFs for you to draw on - keep in mind it does not copy the PDF (which is a good thing, since it won't alter the PDF) so you can't delete the PDF.
    Anyway, when you're in tablet mode it will automatically pop up an onscreen keyboard for you to use
  • Battery Life - You can get about 7 hours of actually usage out of it before needing a recharge. Why/how? It uses an ARM CPU, which has a lower power consumption than Intel/AMD CPUs. This also means that you can't run anything x86 on it, so don't think about using Windows. You're limited to anything that runs on an ARM (the built-in Touch Book OS is pretty good, and Ubuntu has an ARM port so we don't really have a problem here!)
  • Solid State - the hard drive for this is actually an SD card, so there's no hard drive noise. Combine this with the fact that - as far as I can tell - there are no fans in this thing, so there isn't really any noise that comes from it.
  • Tinkerable - the back panel of the screen comes off, revealing the SD card slot and several internal USB ports. This means that if you have a USB drive that you want to keep in the computer for a while but don't want it poking out the side, you can just stick it inside and it is nice and out of the way.
  • It's a small company - as an economist-in-training, I naturally dislike monopolies and small oligopolies. It is good to see a small company marketing a product so that we don't always have to go with Apple or HP or whatever for a laptop.
Anyway there are still some drawbacks, and this wouldn't be a good review if I didn't go over them a bit.
  • Software - while I do like Linux, I've been a bit spoiled by how bug-free and smooth things go in Ubuntu. You can put Ubuntu onto this machine, although I think I'd rather keep the niftier features that come with the Touch Book OS. There are a few UI problems and other bugs, like for example when I double-click the title bar of a window, the window decorator seems to crash. All my windows are still there open, they just don't have title bars or borders (UPDATE: This bug has been fixed in the latest version, I will try and update). Another problem is that the only way to check free space (that I can find) is through the 'df' command line utility, since at the bottom of the file browser it says "check the Storage Control Panel", which unfortunately does not exist - or if it does, I can't find it. Finally, to upgrade the thing the upgrader that it comes with doesn't work, so you need to grab the image of the new OS off their website and copy it to the flash drive. I'm not sure how to do that yet (it will be my project for the next little while) but it definitely won't be happening on another computer since the only things in my house that can read an SD card other than this laptop are my printer and my camera.
  • A bit sluggish - I know that it is a netbook and it's not supposed to be blazing fast, but one of the main things I'd like to use this for is an eBook reader and when it takes 20-30 seconds to go to the next page of an 11MB PDF it interrupts the flow a bit (good thing I haven't tried Russell & Norvig yet, that thing clocks in at 36MB!).
  • Tablet UI - this is not in the special UI they have, but for the regular one in tablet mode. While the screen is quite precise when you're pressing in the centre of the screen, you can't quite reach the edge. This is really bad for scroll bars and close buttons, so when reading a PDF that doesn't fit on the page you can't actually read the bottom of the page, because you can't scroll down. It would be nice if when you dragged your finger along the screen it would scroll it, but the only app that really does that is Midori (the browser that comes with it) and the Note Taker - although now that I think about it I can probably just try opening the PDF in the Note Taker and just not writing on it...
  • A bit flimsy - one issue with the flap on the cover is that it doesn't fit back on perfectly and you can actually fit your fingernail underneath and lift it up without unlocking it. I think this is a disaster waiting to happen, a piece of paper slips in there or something gets caught and pulls up on the flap, etc. Another is that it doesn't quite stay closed after you close it, if you bump something the cover sorta bounces up and down. A simple fix would be to put some kind of latch there, although I'm not sure how that would fit in with the tablet idea so maybe it isn't a great fix.
  • Not quite as advertised - I think that the pictures and statements on the site aren't quite as accurate as they seem. As I mentioned before, the battery life is definitely not 10 hours, despite them plastering that on their site.
    Second, it is not always on, it turns on and off like a regular computer. You can put it into standby by pushing the power button and it will be instant-on/off, but that drains the battery life big-time. If you used this like a phone you would be recharging the battery on a daily basis.
    Third, although they say 7 USB ports, 2 of those are mini-USB ports, and while there are three internal regular USB ports two of them are already in use by what I am guessing to be the wireless adapter and the Bluetooth adapter. It's not a huge issue, I just think they're hiding a bit of the details from the front page.
    Fourth, the screen does not bend all the way back and around (or maybe it does and mine just made bad noises when I tried which scared me), instead you take the screen off, turn it around, and put it back on.
    Finally, I wish they'd say on the front page that it is still beta software - it might not be officially beta software, but it certainly feels like it.
So what is my general opinion of the Touch Book? It is very, very Linux. It is very customizable and has pretty cool gadgets, but the UI is a little weird and broken in places, and there are a few bugs. There is a small community around it who populate the IRC channel #touchbook and fill up the wiki, which is pretty cool, but it is mainly technical users. So while I am happy with the Touch Book, at the moment I don't think it is really ready for the prime-time.

Jan 27, 2010

Firebug 1.5.0 in 64-bit Ubuntu

Looks like the latest version of Firebug (as of today, Jan. 27, 2010) crashes Firefox in 64-bit Ubuntu when you try to open it. This is unfortunate, so to fix it you have to install an older version of Firebug:

1) Uninstall Firebug from the addons menu.
2) Go here: http://getfirebug.com/releases/firebug/1.4/
3) Grab firebug-1.4.5.xpi from the bottom, and install it.

Jan 23, 2010

Rhythmbox Auto-Add Files

There's a feature in Rhythmbox that I discovered a while back that's pretty handy. If you go to Edit -> Preferences and choose the Music tab, there is a checkbox there that says "Watch my library for new files" which when you check it, it will automatically add any new files that you put into your music folder. I really like it because I can just download a song, and then not have to add it myself to the music collection.

Dec 14, 2009

GIMP - White Face Outline

A couple people asked me how I created the picture for my current Facebook profile, which looks something like this:


I did it with the GIMP, and it was actually really easy. There's a few steps to follow:
1) Open up your picture in the GIMP (this is an easy step)
2) Go to Filters -> Edge-Detect -> Sobel - I use this one because it generates a lot less noise than the other ones, and it is mostly black and white. The issue is that some features which should be brighter aren't, like lips. You can experiment with some of the other Edge-Detect filters they have in there if you like.
3) Go to Colours -> Threshold. Drag the little arrow around in the histogram (which will appear on a dialog called "Threshold") until you get something you like. At this point as I mentioned in the last step certain features might not stand out, so you might have to do some tinkering with a white pencil to get those features to stand out a bit more (unfortunately I'm not an amazing artist, so the lips in that picture above look kinda wonky).
4) Remove noise. You can do this with the pencil tool to draw black over the noise, or you can use the select tool(s) to select and delete stuff (make sure to set your background colour to black). Do this until you have removed the stuff you don't want.

And tada! You should have an image that looks something like the one above.

Dec 12, 2009

Resetting Your Keyring

For those of you who have forgotten your keyring password and are annoyed at the apps like Empathy and Ubuntu one who insist on using it, you can reset it by deleting your keyrings folder:
1) Go to your Home Folder
2) In the address bar type ~/.gnome2/ (if you don't see the address bar, click the little icon with the paper and pencil that has a tooltip like "Toggle between ...")
3) Delete the folder called keyrings

Next time you run a program that wants to use the keyring you will be asked to type a password. This password doesn't have to be the same as your regular password.

If you are comfortable with a terminal, the command is:
rm -r ~/.gnome2/keyrings

Dec 10, 2009

Folder Bar in Nautilus

I just learned something today. If you go into Nautilus (the file browser for Ubuntu), you can see on the left there is a bar with your home folder, Desktop, Trash, etc. on it. Below that are a list of folders, probably Documents, Music, Ubuntu One (if you're running Karmic). You can drag and drop folders onto that list in order to access them quicker! The random little things you discover.

Nov 15, 2009

Welcome to Karmic

Last year around this time I did a a little review of Intrepid. I forgot to do one in May about Jaunty, so I'll make up for it by doing one now about Karmic.

There's been some negative press about Karmic, saying it is really buggy and incomplete. Others haven't had too many problems, and say that the negative press is unfair.

One small note: there are bugs with every new operating system release that I have used. Ever since I installed Windows 95, I have seen issues with new operating systems. They don't always work the same as before, they change things, or introduce new bugs, etc. This is normal. Surprisingly enough, I have been impressed with past Ubuntu releases (Feisty and Jaunty come to mind) where things actually upgraded really smoothly - in fact the move from Edgy to Feisty is what really sold me on Ubuntu, it was a really great upgrade. Before that I was still using XP as a primary with Edgy for messing around.

My issues with Karmic haven't been terrible. My network still works, so does my sound. The issues are more with papercut-like things. There are little things that come up that are not giant failures (I remember back in Gutsy when you wanted to install the Nvidia drivers you had to kill the X server - see my post about it) but are annoying little things that you kinda go, "well that's annoying." A small list of them:
  • Flash doesn't recognize mouse clicks - annoying for watching non-autoplay Youtube embeds, or using Google Analytics. A fix can be found here.
  • Suspend/resume and compiz - sometimes when I come back from suspend compiz crashes. Slightly annoying since I'm using Avant Window Navigator which depends on compiz's livelihood. It's not a big deal, it's just annoying to have to go to Preferences->Appearance and start compiz again.
  • Empathy - I posted about this here already so I won't go into details again, I just find that Empathy doesn't really offer anything over Pidgin. This is not a papercut, more just a "why did they do that?"
  • System Tray Icons - sometimes system tray icons look really weird, and there's a bunch that don't make sense. I have one that says my network cable is unplugged, even though it is quite obvious that it's not since I am on the Internet as we speak. Also some of the icons are messed up, they show a solid grey square behind them instead of the gradient image I have for my GNOME panels. Again this one isn't a huge issue, just ugly.
  • Bluetooth Applet - my fix no longer works since they changed the Bluetooth applet. It's nice that they show a system tray icon for Bluetooth, unfortunately there's a bit of confusion. When I right-click, it says "Bluetooth: On" and has a menu item to disable Bluetooth, but when I go into the Preferences panel it says Bluetooth is disabled and has a giant button to turn it on that doesn't actually work for me, when I click it the button goes grey and nothing else happens. Unfortunately the dialog has nothing else than that except an option to stop displaying the system tray icon. So I'm not really sure what to do here, if I fix it at some point then I will blog about it.
  • Wine is weird to install. See my fix to install it.
I'm sure there's more (boot time isn't slower, but feels slower since GNOME seems to take longer to start), but I don't really want to bore people with a list of my problems.

What has gone right with Karmic? Well, not a whole lot I think. It isn't horribly broken, which is nice. Ubuntu One is really useful, and I think the Ubuntu Software Centre is a lot cleaner than the Add/Remove programs that used to be there. Also it upgrades to Firefox 3.5, which is a bit speedier than Firefox 3.0.

All-in-all, I wouldn't say Karmic is a bad release, I just don't really see much point in using it. If you really want Ubuntu One then it is good, but other than that if Jaunty is working for you then you should probably just stick with that.

Nov 14, 2009

Installing Wine in Karmic

Each time you upgrade Ubuntu you have to tweak your Wine repo for the newer version. This is not a huge problem, you can just follow the instructions on Wine's site which are nice and clear.

Karmic seems to be a little weird with this. The issue comes when you want to actually install wine through Synaptic. You can't install the package "wine" anymore, you get an error like this: "wine: Depends: wine1.2 but it is not going to be installed". You can fix this easily by just installing the wine1.2 package, but it is kinda weird that they did not set up the dependencies properly. Oh well.

So in short, to install wine:
1) Follow the instructions to add the Wine repository.
2) Go to System->Administration->Synaptic Package Manager
3) Search for wine1.2
4) Install the wine1.2 package by double clicking it. Accept any dependencies it asks for.
5) Click Apply.