cro's place

Presario F500, Wireless and Ubuntu 8.04 (Hardy Heron)

Posted in Ubuntu by cro. Monday March 31, 2008.

The recent release of the Ubuntu 8.04 Hardy Heron beta prompted me to investigate, and run the dist-upgrade. The Gutsy Gibbon beta release and subsequent upgrades was a relatively painless process, and Ubuntu gets better with every release.

Two things that did concern me, as they seem to impact every time I upgrade, were the proprietary NVIDIA drivers, and the Broadcom wireless. Luckily, the upgrade took care of the NVIDIA drivers fine (although I haven’t tested out World of Warcraft yet), but as expected the wireless totally failed to work.

A little investigation threw up instructions (also enumerated on other sites) on how to use fw-cutter to install new drivers.

In the interest of documentation, here’s the process I used to re-enable wireless on my Compaq Presario F500 laptop:

Starting in my /home/ directory, I created a Drivers/wireless directory - I always hang on to old drivers just in case.

sudo apt-get install build-essential
mkdir Drivers/wireless
cd Drivers/wireless/
wget http://bu3sch.de/b43/fwcutter/b43-fwcutter-011.tar.bz2
tar xjf b43-fwcutter-011.tar.bz2
cd b43-fwcutter-011
make
cd ..
export FIRMWARE_INSTALL_DIR="/lib/firmware"
wget http://downloads.openwrt.org/sources/broadcom-wl-4.80.53.0.tar.bz2
tar xjf broadcom-wl-4.80.53.0.tar.bz2
cd broadcom-wl-4.80.53.0/kmod
../../b43-fwcutter-011/b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" wl_apsta.o

A quick reboot, all was well!

I’m still investigating all the new things in Hardy Heron - so far Firefox 3 is the only thing I’ve really used, and I’m not entirely convinced yet…

Update
Seems that the B43 driver isn’t the best yet, and a rollback to ndiswrapper was in order.

Social Network: Friends

Posted in Social Networking, Articles by cro. Friday January 4, 2008.

We all like friends, and having the ability to add and remove friends within a social network is critical. How you deal with managing friends from a design point of view is an interesting one.

There are many approaches, depending on the type of information you want to store about the relationships that are created, whether you want to know who initiated the friendship, when it was created, when it was accepted (or rejected even), the type of friendship and so on.

For my little mobile social network, I’m going to use a simplified form of friend relationship tracking, as all I’m interested in is whether or not a relationship exists between two people. To do this, I’m going to use a simple keyless table that holds two values: userID and friendID.

What I am interested in here is whether or not there is a relationship within the table between two user IDs. This tells me whether or not two users are potential friends, or whether a friend request has been made. To do this, I simply enter a row in the database containing a person’s userID, and the userID of the person they wish to befriend. This sets up a one-way relationship in the friends table, indicating that a friendship request has been made. The actual mechanic of processing the friend request I’m going to pass off to the messaging subsystem (which I’ll be covering in another post).

Now that we have a single row in the database, a simple query against a userID will tell me how many ‘friends’ this person has. Of course, this will include all unaccepted friendships, which is not necessarily something we want.

However, this approach works both ways: once a friendship is accepted, a second row is entered in the database with the friend’s userID listed first, and the requestor’s userID listed second. This allows us to write very simple queries to return a complete list of a particular userID’s accepted friends, or a list of a particular userID’s friend requests, since our ‘key’ is the first column in our two column table.

And rejecting a friend request is as simple as removing the original row from the table.

This schema can obviously be expanded to include timestamping should this be needed, or friend type, or anything else really - they key concept here is that what’s of interest is whether or not there is a relationship in the database, not the content of the returned rows (i.e. rowcount = 0, 1 or 2 - this is the information I want).

Customising the “Pictures folder” screensaver in Ubuntu Gutsy

Posted in Ubuntu, General by cro. Friday January 4, 2008.

One of the default screensavers included with Ubuntu 7.10 is one that will display whatever pictures you have saved in your ‘Pictures’ folder (/home/<username>/Pictures). The screensaver will randomly display a picture from this and any subfolders.

However, there’s no way of customsing which folder the screensaver reads if you want to use your Pictures folder to store pictures, but manage which of these images is used.

A workaround is as follows:

  • Create a new folder somewhere (it doesn’t have to be under the ‘Pictures’ folder)
  • Open a terminal window (select Terminal under Accessories)
  • enter the following:
    gksu gedit /usr/share/applications/screensavers/personal-slideshow.desktop

    (enter your password if prompted)

  • Scroll down to the line (near the end) that begins
    Exec=slideshow
  • Add the following after this command:
    --location=<your pictures path>

    (You will have to use standard escape sequences if you have spaces in the path.)

  • Here’s an example:
    Exec=slideshow --location=/home/myusername/Pictures/My\ Screensaver

And that’s it. Save the file, and restart your screensaver. It will now only search for pictures in your chosen folder.

Laptop Hardware Upgrade: Part 2

Posted in Ubuntu by cro. Sunday December 9, 2007.

After fiddling about all last night trying to get the laptop to boot, I gave up around 1am and went and played some World of Warcraft. Then just before bed I checked the Ubuntu forums again. A bit of searching for my laptop name and model led me to a thread with some helpful hint, including the suggestion to add

noapic

to the end of the boot command.

This solved all my problems, and let me resolve the issue I had with having to re-compile the NVIDIA driver every time, let me install the restricted drivers and the necessary bits to get the laptop working properly.

Laptop Hardware Upgrade

Posted in Ubuntu by cro. Saturday December 8, 2007.

There comes a time when the 20Gb partition you set aside on a dual-boot system to run Ubuntu just isn’t big enough, so the idea of upgrading to a spanky new hard drive with a little more room becomes very attractive.

This is a path I started down this afternoon on my Compaq Presario F500, which has proven to not be painless, even with the strides Gutsy has taken in hardware compatibility. However, I’m getting ahead of myself.

To do the upgrade, I went out and bought a nice new 120Gb SATA drive, and downloaded a copy of the Gutsy desktop ISO. After installing the new HDD, I rebooted with the Live CD, which promptly failed to load GDM, with the old ‘freeze when switching graphic modes’ bug from Feisty (and Debian 4). Unfortunately, no amount of fiddling about with boot time settings (including the work-around for Feisty, adding ‘vga=792′ to the end of the boot command) resolved this issue.

I managed to boot the Gutsy live CD in safe mode, and also managed to install Gutsy on the new hard drive. However, I still could not boot into GNOME. I rewrote the xorg.conf to match a known, working one (the one posted elsewhere here), and it still wouldn’t boot, insisting on freezing when switching modes, or inly running in low graphics mode. When I did finally manage to get GDM running, networking wasn’t working at all, and I kept getting a strange bug that I eventually tracked down to being something to do with DBUS.

So I took the easy way out and started again, using an Ubuntu 6.10 Desktop CD I had lying around. I used this quite by accident, but it’s proven to be a good thing, as I also had a 7.04 Alternate CD lying around, so once 6.10 was installed, I could do a straight package upgrade from the 7.04 Alternate CD.

This left me with a (mostly!) working system that I’m still twiddling with, although as you can see from this post I am connected to the Internet again. The bcm43xx drivers still blow goats, so I followed a guide on the Ubuntu forums to download and install ndiswrapper and the wireless drivers from Dell (even though I have a Compaq, the wireless chip reports itself as a Dell chip…). Following the instructions step by step, rebooting where indicated, and everythign was up and running and I am now, once more, wireless on the Compaq.

However I still have a major issue with the graphics settings. This laptop has a NVIDIA chip in it, so one of the first things to do is download the latest NVIDIA drivers, and install them. The only problem I have at the moment is that I have to re-compile them every time I want to run X… For some reason, I can compile the drivers, boot into GDM and work properly, but when I reboot, I have to recompile the same driver, overwriting it with the same version. More investigation is needed.

Now, however it’s time to remove this brand new hard drive and put the old one back in. It wasn’t until I went rummaging that I realised my USB harddrive adaptor only wotks with PATA hard drives, not SATA. So to get sll my settings and configuration files from the old hard drive means re-installing it and copying everything to a DVD. Wish me luck!

Social Network: Fundamentals

Posted in Social Networking by cro. Wednesday November 28, 2007.

When looking at the development of a social networking site, there are a number of fundamentals that I think need to be implemented before you can consider that you have the basic framework for a social network.

Basic Information
The absolute basic building block of such a site is the user account, or user object. The question then becomes, what do we need to store about this user? The actual requirements will vary between types of social network, but for my purposes I’m storing a small subset of common user data:

  • username
  • password
  • nickname
  • gender
  • msisdn
  • birth date
  • address details

I’m recording the MSISDN since this will also be a mobile social network, and if we want to deliver services to the user via their phone, we need to know the number. This is also going to be the route we use for registration (text to a number to register) so we have some form of user verification.

This list is the basic information we need, but we also need some specific information that we’ll use internally, some of which the user will be able to change, some which we’ll use for identification purposes. So to this basic list I’ve added the following as well:

  • registration date
  • last visit
  • is adult
  • registered

We’ll use the two dates for some stuff as we go along (such as presence), and for redundancy (and because reading a field is quicker than calculating a date - here’s some thinking ahead going into the design), we’ll set a flag at registration time related to the user’s age. The last field, registered is a tracking field which is set to ‘true’ once registration is complete, since a user record is created for a new user as soon as they begin the registration process, not when they finish it.

Basics of Personalisation
Everyone likes to personalise their social networking accounts, but not all personalised information is always needed on every displayed page. Since we’re building up a basic user object that we’ll load for the user every time they visit, we only need some small additional information (initially at least), so we’ll add a couple of extra fields to the basic user object:

  • avatar
  • about me

Avatar is, as you would expect, related to a user’s picture. We’ll talk about how we deal with this information later, as there’s much more to a user avatar than just storing a picture. After all, if you have 25,000,000 users, where do you store all the pictures? You certainly don’t want every user to have their avatar stored as a blob field in the database…

The about me field is a little throwaway item I’ve put in as a quick way of letting peopel write a little about themselves, which is automatically displayed on their account. This and the avatar field are user changeable (as is the password, of course!).

The User Object
Now that we’ve determined a basic set of fields with information about a user, we can start setting up the database tables, and the underlying back-end code for loading, updating and using this object to deliver the social network itself. The manipulation of this object will be the subject of a later post.

Writing a Social Network

Posted in Social Networking by cro. Wednesday November 28, 2007.

Social Networking is something of a pehnomenon at the moment, with Facebook, MySpace and Bebo (amogn others) leading the public perception of what social networking is all about, although there are many, many others - including the one I wrote for Pitch and launched a little over a year ago.

It’s now been more than six months since I stopped working on the Pitch Social Network, and in the interim I’ve been working on developing a new social networking application. Speaking to some people I work with, I mentioned that I’d been thinking about writing a series of blog posts about Social Networking development, to discuss some of the ideas I have on how such applications should be architected, not just from a software point of view, but from the whole service architecture, including infrastructure, service design and software design.

Everyone I spoke to told me to go ahead, and now that I’m back from a few weeks away in Australia, it seemed like a good time to start.

So, what am I going to be talking about? I’m going to talk about what I see as the basics of the actual design and implementation of a Social Networking website, covering software design, service design, infrastructure thoughts, technical architecture, database design and the like. Whilst I may at times post code, this won’t be a series where I post the entire codebase for a social network, and it’s quite likely that whilst I’ll talk about certain architecture or design decisions, I may not necessarily use them in the site I’m building.

And alongside all this discussion will be an actual social networking site, which already exists on one of my servers. Or rather, there are two versions, a mobile one and a web one, with the only difference between the two being the way the underlying data is accessed. My intention is to write both versions side by side, ensuring that each version is functionally the same, and provides roughly the same experience regardless of device used to access.

Obviously there will be some fundmental differences between the two sites, at least in the plumbing. For example, mobile devices don’t normally support cookies, so the basic concept of a server-side session needs to be forgotten about, which leads on to discussions on how to deal with persistence of information between pages for a single user. And on the web, this type of discussion is moot as there are session-based services that can be used for persistence.

But I’ll try not to get ahead of myself too much in this introductory post, and leave off with a quick rundown of the tools I’ll be using:
For the site development itself: Object oriented PHP (4.3+)
For the database: MySQL 4
Development Tools: Eclipse IDE, Firefox, Opera.

And yes, an early version of the site is already available and running - links coming in a future post :)

Followup! Opens

Posted in Articles, General by cro. Wednesday October 31, 2007.

For those following along, on occasion I’ve mentioned a little side project I’ve been working on called Followup!, an anti-social social bookmarking application.

I’ve not done any real work on it recently, but over the past couple of days I had another look at it, and squashed a couple of annoying bugs (the double-login bug for one), as well as laying out some of the plans for future expansion.

With this, and following an earlier small post, I’m throwing Followup! open to everyone to use. Just sign up and get going - that’s it. Oh, and expect the obligatory Google ads to be installed soon too…

xorg.conf for Compaq Presario F500

Posted in Ubuntu by cro. Wednesday October 17, 2007.

I saw on the Ubuntu forums a comment about getting the NVIDIA drivers working with the Compaq Presario F500, so I thought it might be wortwhile posting my entire xorg.conf - since I know it works :) This configuration also supports compiz fusion, albeit slowly but you can, if you want, have the cube, wobbly windows and all the other bits and pieces. Add some extra RAM if you’re going to do this though :)

Section "ServerLayout"
    Identifier     "Default Layout"
    Screen         "Default Screen" 0 0
    InputDevice    "Generic Keyboard"
    InputDevice    "Configured Mouse"
    InputDevice    "stylus" "SendCoreEvents"
    InputDevice    "cursor" "SendCoreEvents"
    InputDevice    "eraser" "SendCoreEvents"
    InputDevice    "Synaptics Touchpad"
EndSection

Section "Files"
    FontPath        "/usr/share/fonts/X11/misc"
    FontPath        "/usr/share/fonts/X11/cyrillic"
    FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"
    FontPath        "/usr/share/fonts/X11/Type1"
    FontPath        "/usr/share/fonts/X11/100dpi"
    FontPath        "/usr/share/fonts/X11/75dpi"
    FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
    Load           "i2c"
    Load           "bitmap"
    Load           "ddc"
    Load           "extmod"
    Load           "freetype"
    Load           "glx"
    Load           "int10"
    Load           "vbe"
EndSection

Section "InputDevice"
    Identifier     "Generic Keyboard"
    Driver         "kbd"
    Option         "CoreKeyboard"
    Option         "XkbRules" "xorg"
    Option         "XkbModel" "pc105"
    Option         "XkbLayout" "gb"
EndSection

Section "InputDevice"
    Identifier     "Configured Mouse"
    Driver         "mouse"
    Option         "CorePointer"
    Option         "Device" "/dev/input/mice"
    Option         "Protocol" "ImPS/2"
    Option         "ZAxisMapping" "4 5"
    Option         "Buttons" "7"
    Option         "ButtonMapping" "1 2 3 6 7"
    Option         "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
    Identifier     "Synaptics Touchpad"
    Driver         "synaptics"
    Option         "SendCoreEvents" "true"
    Option         "Device" "/dev/psaux"
    Option         "Protocol" "auto-dev"
    Option         "HorizScrollDelta" "0"
EndSection

Section "InputDevice"
    Identifier     "stylus"
    Driver         "wacom"
    Option         "Device" "/dev/input/wacom"
    Option         "Type" "stylus"
    Option         "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"
    Identifier     "eraser"
    Driver         "wacom"
    Option         "Device" "/dev/input/wacom"
    Option         "Type" "eraser"
    Option         "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "InputDevice"
    Identifier     "cursor"
    Driver         "wacom"
    Option         "Device" "/dev/input/wacom"
    Option         "Type" "cursor"
    Option         "ForceDevice" "ISDV4"# Tablet PC ONLY
EndSection

Section "Monitor"
    Identifier     "Generic Monitor"
    HorizSync       28.0 - 64.0
    VertRefresh     43.0 - 60.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "nVidia Corporation MCP51 PCI-X GeForce Go 6100"
    Driver         "nvidia"
EndSection

Section "Screen"
    Identifier     "Default Screen"
    Device         "nVidia Corporation MCP51 PCI-X GeForce Go 6100"
    Monitor        "Generic Monitor"
    DefaultDepth    24
    Option         "AddARGBVisuals" "True"
    Option         "AddARGBGLXVisuals" "True"
    Option         "NoLogo" "True"
    SubSection     "Display"
        Depth       1
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       4
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       8
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       15
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       16
        Modes      "1280x800"
    EndSubSection
    SubSection     "Display"
        Depth       24
        Modes      "1280x800"
    EndSubSection
EndSection

Section "Extensions"
Option "Composite" "Enable"
EndSection

A Month 6 Months of Ubuntu

Posted in Ubuntu, Articles, General by cro. Wednesday October 17, 2007.

Time flies when you’re having fun, and I’ve certainly been having fun with Ubuntu recently. Looking back through my (not very frequent) posts, I see it’s been about 6 weeks 6 months! since I posted about installing Ubuntu as a test on my new laptop.

Since then, I can, quite literally, count on the fingers of one hand how many times I’ve booted back into Windows Vista. At the moment the Vista partition (all 20Gb of it!) serves to provide me with printing capabilities (My printer is an old Dell USB one that only barely works under Vista), and to update my iPod with some purchased music (Teeny Shiny and Bambi’s Dilemma by Melt Banana)

I have no reason or need to run Windows Vista on my laptop, and has been proven over the past four months, there is no reason I need to run Windows for work either. It’s turning out that the only reason I actually have a Windows desktop at all is to act as my games machine, since this is the one area that Linux is deficient. Whilst I know that a lot of games can run quite happily under WINE or through Cedega’s service, not all do. So for now, I have one Windows machine running XP (which will never have Vista installed on it), and one laptop running Ubuntu.

Going back to the work comment, for the past 4 months I’ve been working for as Head of Web Development for Hachette Filipacchi, the publisher of Elle Magazine, Red Magazine and Ideal Home amongst others. During that entire period I’ve been running a dual monitor desktop running Ubuntu Feisty Fawn (well, until recently when I did a dist-upgrade to Gutsy Gibbon). The only time I’ve had some trouble is with project management software, which I rarely need anyway. There was nothing I needed that was Windows only. As a quick rundown, here’s the most common software in use in the office, and what I replaced it with.

Microsoft Exchange
Replaced with Evolution (through a webmail connection). Whilst it’s possible to connect to an Exchange server through IMAP, the IT department weren’t comfortable with that.

Microsoft Word, Microsoft Excel, Microsoft Powerpoint, Microsoft Visio
Replaced with Open Office, and no-one noticed. I now use Open Office exclusively.

Tortiose SVN+PSPad
Replaced with Eclipse+Subclipse+PHPEclipse. I’m finding the move to an IDE to have been beneficial, rather than just using a text editor. Combining Eclipse with a local copy of Apache+PHP+MySQL means I can do all my web development on my local machine, and use Subversion to store the code, and later publish to the live webserver in a managed way. Very handy.

MSN Messenger
Replaced with Pidgin, although there was also the option of Meebo, and to deal with some firewall issues I also wrote my own web-based chat app.

Photoshop
Replaced with The Gimp. This is perhaps the most contentious issue for some people, since whilst The Gimp isa good piece of software, it is certainly not in the same league as Photoshop when it comes to image manipulation. That said, since I’m not a designer and only use The Gimp to resize images, and perhaps create some spot graphics, it’s not an issue for me.

Winamp
Replaced with Amarok.

Filezilla
Replaced with… Filezilla. Yep, there’s a native port of Filezilla available for Linux, and recent releases have made it as stable as the Windows version of the software.

The Bat
Replaced with Firebird. I think Firebird still a little ways to go to be as useful as The Bat, but I find it quite suitable as a mail client.

That pretty much covers everythign I need on a day to day basis. Having direct access to a command shell also helps tremendously when developing websites, and I can connect to the webserver very quickly. Running Ubuntu also makes it extremely easy to install and maintain a local web development environment, so I actually do all my development directly on my desktop under Apache 2, PHP5 and MySQL5. Once I’ve done my coding, I can simply commit to my SVN repository and then check out the code directly to the live webserver. Makes developing complex websites very easy!

One perhaps under mentioned aspect of running Ubuntu (or many other Linux distributions for that matter) that I have found remakably useful - and something I actively miss when using a Windows machine - is multiple workspaces. For example, on my laptop I have four workspaces arranged in a 2×2 grid, and I can place windows within a particular workspace to organise them into logical work groups.

On my work machine, whilst I had two monitors, I retained the four workspaces (although I also ran Compiz Fusion, so I had the 3D cube rather than a 2×2 grid), again allowing me to group windows together into logical workspaces. So I would have one workspace for email clients, one for research, one for development (Eclipse, local web browser, editors etc) and so on.

The new version of Ubuntu is due for release tomorrow, and having been using it for the past few weeks, I think this is the next major step forward for Linux - it does just work.

As a last note, a lot of people I have spoken to claim that it’s almost impossible to get support for Linux, which is why they don’t use it. I did some checking, and Canonical, the company behind Ubuntu, provides commercial support for Ubuntu via email and telephone - and you can buy support for an entire YEAR for £150…


Copyright 1998-2005 Tom Gordon
22 queries. 1.906 seconds.
Powered by Wordpress
based on a theme by evil.bert