Favourite Quote: “Complexity has nothing to do with intelligence. Simplicity does.”

This excellent phrase was coined by Lawrence “Larry” Bossidy, the retired CEO of Allied Signal. What I find particularly interesting about this quote is that it’s so eloquently structured and an example of what it’s stating; the statement is simple yet intelligent. Here it is in all its wonderful, quoted glory:

“Complexity has nothing to do with intelligence. Simplicity does.”
- Larry Bossidy, CEO Allied Signal

Configure Log4j To Disable Specific Package (Java)

I came across the need to disable logging (debug) for a specific package in Apache Log4j today whilst coding. It’s simple. All you need to do is precede the package name, e.g. net.beplacid, with log4j.logger and follow that with “=LEVEL”, where ‘level’ is one of TRACE, DEBUG, INFO, WARN, ERROR and FATAL – the standard Log4j logging levels. To demonstrate:

log4j.logger.net.beplacid=DEBUG

Would set the logging level to DEBUG for all registered loggers in classes net.beplacid. Similarly:

log4j.logger.net.beplacid=FATAL

Would disable all but FATAL logging calls.

Hope that helps someone, I couldn’t find an ‘easy fix’ page when searching…

Xbox 360 Debian/Ubuntu Linux – Media (video, music) Streaming

Being both a Linux and Xbox fan makes for an interesting time. One of the best features of the Xbox is its streaming from a PC on your LAN. There are various features that the Xbox provides for seamless media streaming (be it videos, music or pictures) but it’s not as straightforward as it may seem (at least from what I’ve seen from various searches).

Xbox media streaming uses the DNLA protocol to receive content from a peer on a network. Using ushare, you can setup streaming to your Xbox on any Linux machine quite easily. All that’s needed is libupnp2 (if you’re running Debian, you may have to install libupnp via the Ubuntu deb as only version 3 is available and the uShare package depends on it explicitly), a minor configuration change and a quick hack to the init script. All of which I’ll explain now.

Installation (for Debian Sid)

Note: for Ubuntu, you’ll just need to run ‘sudo apt-get install ushare’ in a shell.  Then skip to the configuration section below.

uShare depends on libupnp2 and unfortunately only version 3 is available (at least in sid). Therefore, you’ll need to obtain a deb for version 2 (I got the Ubunutu equivalent from here and it works fine). Once you’ve downloaded a .deb for your architecture, fire up a shell (or ‘terminal’) and enter the following (filenames will differ depending on your arch):

sudo dpkg -i libupnp2_1.4.3-2_amd64.deb

Now that libupnp2 is installed, you’ll need to get a deb for uShare or alternatively (and best, because you’ll get updates via apt) is to add the uShare apt repository to your sources.list. Open /etc/apt/sources.list as root (using sudo):

sudo vi /etc/apt/sources.list

Now add the following line at the bottom of sources.list:

deb http://www.geexbox.org/debian/ unstable main

Save and close sources.list. Finally, update your package list:

sudo apt-get update

Now you’ll have uShare available via apt. To install it, run the following:

sudo apt-get install ushare

Configuration

Once finished, you’ll have uShare installed and ready for configuration. Out of the box, it won’t provide much apart from a daemon listening on a random port (defined as part of IANA Dynamic Ports range). You’ll need to edit /etc/ushare.conf to enable Xbox compatibility as well as define the standard port – 49200. Open /etc/ushare.conf as root and change the following lines:

USHARE_PORT=49200
USHARE_DIR=/path/to/your/media
ENABLE_XBOX=YES

Before these changes will take effect, you’ll need to restart ushare using its init script. However, an issue I’ve noticed is that the last line (‘ENABLE_XBOX=YES’) does not always work. So before we restart uShare, we’ll need to make a small change to the init script that resides under /etc/init.d/ to force Xbox compatibility:

sudo vi /etc/init.d/ushare

and add the following line at the beginning of the script:

USHARE_OPTIONS=-x

This tells uShare to start with Xbox compatibility. Now restart uShare using the init script:

invoke-rc.d ushare restart

And you’re done. Almost. :) You may need to restart your Xbox for it to recognise your Linux machine (although the use of UPnP – Universal Plug ‘n’ Play – would suggest otherwise). Once you’ve done that (or if you’re brave), navigate to ‘My Xbox’ and then select ‘Videos’ and finally you should see ‘uShare’ at the bottom (computer icon). Selecting that will connect to your Linux box and you’ll be able to browse your media just as you would on your PC. Awesome!

Most Inappropriate Name for a Packet of Cigarettes

Whilst on holiday in Kenya, the need for smokes was abundant. Amused we were when we stumbled across these:

Sportsman Cigarette Packets

Ubuntu Intrepid Ibex/8.10 Is Ruining My Hardware

I’m a long time user, advocate and all-round fan of Linux. In particular, I’ve used Debian or variant distributions and have never had any major issues (well none that weren’t PEBKAC). I’ve been running Debian Sid on my Thinkpad X31 for around three years now, and out of curiosity I thought I’d try out Ubuntu Intrepid Ibex for good measure – it’s apparently a very good update. Having also been using Ubuntu on-and-off on my various laptops over the years (since ‘Warty’ – version 4.10), I knew I had to expect the best.

I docked myself at my Workstation and started downloading an ISO. Once finished, I burnt it and rebooted my Thinkpad. One of the great things about Ubuntu’s installation (which has existed for a while) is the Live CD – you get to boot into Ubuntu without having to install anything. It works well and is a great feature for new users who aren’t sure what they’re doing, or whether they want to risk installing Linux. What’s great is that the hardware issues of old are long gone: . Unforunately I found the boot-up process to be volatile: it was taking a long time and things didn’t look great. I eventually got into X and played around. Amazingly I had all my Thinkpad buttons working; suspend, hibernate (suspend-to-disk) and even the back & forward buttons for the browser. It worked flawlessly.

Naturally I decided to install as I was very impressed. So I fire up the installation procedure by clicking ‘Install’ on the Live CD’s desktop and go through the motions. Clicking ‘Forward’ after the username setup freezes, and my laptop performs a hard-shutdown…WTF?? I try again – the same thing happens. What’s going on? I decided to get an alternate ISO and try that. Thankfully it installed, but I was a little concerned that nothing was going to work…

After finally booting into X after my little ordeal, I decide to run `apt-get update && apt-get upgrade` in a shell. To my surprise, as soon as it starts upgrading packages (a Kernel upgrade) my shell gets spammed with “The system is going down for a reboot NOW!” and Ubuntu shuts down. Ouch. This isn’t good.

I’ve had overheating issues in the past, but this is beginning to worry me. Anything even remotely CPU intensive (scrolling the wireless network list, apt-get upgrade, etc etc) causes Ubuntu to force shutdown, and I’m left looking very cross at my X31.

Some googling produces thread after thread on the Ubuntu forums about this, but things seem to be getting ignored. There’s no issues, and people are talking about the exact same problems in Gutsy and Feisty – that’s three or more major releases ago. I’ve tried these things:

  • Adding the following to /etc/rc.local:
    echo -n “90:80:60:75:70:65″ > /proc/acpi/thermal_zone/THM0/trip_points
    echo 2 > /proc/acpi/thermal_zone/THM0/polling_frequency
  •  Appending these modules to /etc/modules:
    battery
    ac
    thermal
    processor
    acpi-cpufreq
    cpufreq-userspace

No luck. Furthermore, with each futile attempt, I get hard-rebooted or even worse: no init 0, just a hard shutdown. It’s frustrating and furthermore it is very likely that this is damaging my hardware. I’ve been monitoring `acpi -t` output, top and more but nothing’s helping. Even running /etc/init.d/gdm stop and trying the apt-get upgrade in a shell doesn’t help: same old hard shutdown.

I don’t know what to do. I’m a big fan of Ubuntu as it’s bringing Linux to the masses, but I can’t keep doing this to my poor old Thinkpad X31 – it won’t last much longer.

Anyone out there have any ideas?

Update: I’ve filed a bug report here

Gears of War (Xbox 360) Is Awesome, but..

So I got Gears of War 2 on Friday for my Xbox 360. It’s an astonishing game: the graphics are second to none, the animation is very realistic, and the intensity of some of the gameplay is just awesome. The online play is also very well done. You get your regular deathmatch, but what’s brilliant about this GOW release is that there’s also cooperative play. You can go through the campaign/story side of the game with a mate, or team up with 4 of your friends and take wave after wave of Horde monsters on for up to 50 levels. It’s intense and a lot of fun.

I’m not sure what demographic it’s pandering to, because although the game’s very impressive and it’s got a huge fanbase, it is all very scripted. There’s no open-ended outcome. You’re just going through the motions, doing as you’re told. You have no real affect on the overall outcome. Perhaps I’ve been playing too much Fallout 3 for my opinion to remain neutral. It does feel however that some parts just don’t require any thought whatsoever. You can’t play intelligently or manipulate your environment to better your situation. That said though, it’s still very fun.

The longevity of the game comes from its online offerings. The co-op and deathmatch side of things cannot be knocked, and I hope to see online co-op play emerge in other games too.

Gears Of War 2 XBox 360 – Can’t Select Difficulty

I got the much anticipated Gears of War 2 today. Annoyingly though, when trying to start the Solo campaign and select difficulty, I was stuck. Hammering the A button meant nothing and it wouldn’t allow me to progress or start the game. The solution’s simple: just sign out of xbox live and then select difficulty. This should allow you to start the game. Remember to sign back in, though…