• Home
  • Blogger
  • Github
  • Travel
  • The Tank Project
skip to main | skip to sidebar

Steven Occhipinti

A braindump.

XBMC Eden + Ubuntu

Back when I started uni, I bought a new Asus A6J laptop. It was one of the first laptops available with a dual core CPU (Core Duo, not Core 2 Duo) and decently powerful graphics (ATI X1600).
The A6J is very dated now and weighing in at 2.85kg, its not very portable by today's standard (considering my Toshiba Portege weighs just 1.13kg).
A couple of years after I bought it, I got sick of carrying it around, so I bought an Asus EeePc as a replacement for uni, so the A6J stayed at home and was rarely used - it was just a spare for a long time.

Up until recently, I was using I used it as a (stationary) desktop replacement at work but I now have a new job where I am provided a Macbook Pro so this old machine is now spare once again. This with the recent release of XBMC 11 Eden, I thought I may as well re-purpose it as a permanent HTPC.

I considered quite a few options, such as running Arch Linux, OpenElec or Ubuntu with XBMC installed, or going with the recently improved XBMCbuntu (formerly known as XBMC Live).

XBMCbuntu

I downloaded the iso and had a bit of a play. I love how it boots directly into XBMC without the need to startup Unity or anything like that, although it does let you exit to the login screen and select either "XBMCbuntu" (LXDE) or "OpenBox" which is nice.

Once it had booted, it behaved so slow! I figured it mustn't have the correct drivers installed, so I tried to use the restricted drivers from the repo and after hitting quite a few problems I consulted the AMD site.
The AMD site explains that my ATI X1600 is now "legacy" and is supported by the ATI Catalyst 9.3 proprietary linux driver.
So I downloaded that and yet again hit a bunch of other issues.

I spent a fair portion of the day battling with this and couldn't help but think back to how easy Ubuntu Desktop handled all this, so I thought I'd just give that another go.

Ubuntu Desktop + XBMC

I downloaded the Ubuntu 11.10 iso and installed that over the top of XBMCbuntu and configured the user account as 'xbmc' and to automatically login at startup.
I then followed the instructions to install XBMC from their PPA. I did a quick update, installed SSH, reconfigured grub to auto-boot in 1 second (instead of 10) and rebooted the machine.

When I launched XBMC, it was perfect! It was very snappy and there was no lag whatsoever. 
I noticed that the power menu was missing the shutdown options that were in XBMCbuntu and that the suspend option did not work.
After a bit if research, I found a wiki page that explains how to modify policykit to allow xbmc access to all the power functions.
With this change, shutdown, suspend and hibernate were all working great.

I had already configured Wake-On-Lan in the past, so all that I needed to do was setup the Android XBMC remote app on my phone. After configuring the app with the laptops IP address, MAC address, etc. I was now able to use the "Turn your XBMC's Power On" button from the mobile app to fire up the laptop.
Of course to actually allow control of XBMC I needed to go into the settings screen and enable control via HTTP, etc.

So now I can power up the laptop and shut it down from my phone, but when it boots, I am brought into a Unity environment. In the past I would add XBMC to the startup applications, but with XBMC Eden, there is a better way.
XBMC Eden adds it self to the choice of desktop environments from the login screen (in other words, you get a choice: Unity or straight into XBMC like the live cd).
Unfortunately it doesn't remember the last choice with XBMC, so if I boot straight into it and then shut it down, next time it will still automatically boot in to Unity.

I then came across an Ubuntu community page that pointed in the direction the the LightDM config file. (LightDM is the thing that manages the login screen).
I opened '/etc/lightdm/lightdm.conf' and saw this line:
user-session=ubuntu

I replaced the 'ubuntu' part of this line with 'XBMC', rebooted and low and behold, it booted straight into XBMC!

I now have a fully functional HTPC that I can completely control from my phone.
The only things left to do now are configure my media sources, install some plugins and maybe play with some new skins.
Posted by Steve at 20:23 3 comments
Labels: ubuntu , xbmc Email This BlogThis! Share to X Share to Facebook

Rooting the HTC Desire HD & Cyanogenmod 7

At the end of last year my HTC Desire HD got its firmware upgrade to the new version of HTC Sense - the same version that the HTC Sensation is running.
At the time I thought it was quite cool, having shortcuts on the lock screen is great and the new eye candy looks pretty nice too.

But there were some very unwelcome changes with this new version too... lag and poor battery life!
I generally keep my phone on charge at work, so I didn't think this would bother me, but it got so bad that if I went out after work, by the time I got home it was flat (from 6pm to later that night). Even swiping between home screens would lag! So I figured it was time for a new phone, but in the meantime I thought I may as well experiment with rooting and other OS's.

To root the Desire HD is quite simple. The first thing to do is go get the "Advanced Ace Hack Kit" from the XDA Forums. In the zip file is all the tools you need to run the hack and most importantly, the aptly named "effen-manual.html", which is very important!

The manual explains everything you need to know, but the first step is checking that the version of android that you are running can be exploited.
I had software version 3.12.405.1, which judging by the effen manual, the hack tool can automatically downgrade to version 2.50.405.2 where there exists a flaw that can be exploited to give you root access.
Keep in mind that doing this will wipe your phone, so backup everything.

The effen manual also explains how to setup your computer to enable the hack tool to work properly. There are very few steps for linux which was great!

If you follow the instructions correctly, you will then have a stock standard install of an older version of HTC Sense. There are some advantages to having root access such as apps like titanium backup, ad blockers, etc. but the real fun comes from installing new Android ROMs.

I looked at 2 third party ROMs, the first was Cyanogen Mod and the second was Android Revolution.

Android Revolution looks pretty good. Visually it looks and behaves just like HTC Sense but they have made lots of improvements under the hood which in turn increases performance and battery life. As good as this looked, I haven't actually tried this option yet. Instead, I opted to go for a bigger change of scenery and give Cyanogen Mod a go.


Cyanogen Mod does not look like HTC Sense at all. Instead it is based on stock standard Android 2.3. They have then implemented a slew of changes that come as default, such as an audio equaliser, ADWLauncher, the super-user app, a completely customisable button widget in the notification bar, customizable lock screens and a pretty cool torch app that lets you over charge the LEDs for super brightness!
This mod also lets you overclock the hardware, put limiters in place and lots of other options I was not used to seeing in the HTC Sense ROM.

The 2 most important advantages of this change are that the UI is now quick and responsive again, I now have complete control over which effects are used and things like how long the animations should last, etc. and I have the best battery life I've ever had with this phone - I can now use the phone pretty heavily all day without needing a charge until I go to bed!

Very happy with it now and it should keep me tied over until the Samsung Galaxy SIII is released :)
Posted by Steve at 18:10 0 comments
Labels: android , hacking Email This BlogThis! Share to X Share to Facebook

Spam defence

For quite a long time I used to use Yahoo! Mail.
Even though I was lucky enough to get an invite for Gmail in its early stages, Yahoo! Mail had (IMO) one killer feature: Address Guard

The idea behind Address Guard was simple, you make your primary email address, say john.smith@yahoo.com, and then a secondary "base name", such as johno007.
This base name was not just another email address, infact all mail sent to johno007@yahoo.com would get dropped.
Instead, use that base name to create an unlimited number of "disposable addresses", such as johno007-facebook@yahoo.com, etc.

The idea was that if you follow the simple 3 click process (settings -> addressGaurd -> add new address!) to create a new disposable email address every time you signed up for a new website, if ever they spammed you, you simply delete that address and they wont be able to bother you any more - brilliant!

I avoided Gmail because they didn't have the same "whitelist" approach to email addresses, but when I bought my domain name and started using Google Apps for email, I decided to use Gmail as my primary email provider.
Naturally this forced me to look for a similar way to defend again spam (albeit Gmails spam filtering is quite good).

Google Apps provides "nicknames", which works in much the same way, you can have an unlimited number of aliases for an account, except the process was a bit longer (settings -> manage domain -> users -> Your user -> Add a nickname) and I got too lazy for that after a little while.
I still use nicknames for certain things, but not for every website I sign up for.

That's when I discovered the + symbol in Gmail. Unlike Yahoo! Mail that uses the "whitelist" approach (only addresses you created will accept mail), you can use Gmail with a "blacklist" approach (all addresses accept mail unless you block them).

Assume your email address is john.smith@gmail.com, you can append a + and then any (valid) characters you like to the end, such as john.smith+facebook@gmail.com and it will still get delivered.

If some rogue website starts sending spam to john.smith+dodgysite@gmail.com, then you can go into the Gmail settings and setup a filter to delete all mail that is sent to: john.smith+dodgysite@gmail.com.

I don't think it's quite as nice as Address Guard, but it is a bit more convenient because there is no set up. The biggest downside is that quite a few websites consider an email address to be invalid if it has a + symbol in it, but most are fine.
Posted by Steve at 22:14 0 comments
Labels: email Email This BlogThis! Share to X Share to Facebook

XKCD + BeyondPod

On my Android phone, I use an app called "BeyondPod".

BeyondPod is great because unlike Google Reader and Pulse (which are other great RSS readers), BeyondPod will download video and audio podcasts on a schedule.

What this means for me, is that at 2:30 AM, my phone will use my home ADSL2's off-peak downloads and fetch a bunch of regular podcasts so when I wake up and make my way into work, I will have all the latest episodes of my favourite shows to watch and listen to on the train.

One of the feeds that I'm subscribed to is XKCD. If you look at the comics online, you probably already know that if hover your mouse over the image, you get to see an extra message about the comic.

On Google Reader, you can tap and hold the image and use the menu to get to the tooltip, but with BeyondPod, there is no such option.

This means that the tooltip is actually included in the feed, so I thought it would be pretty easy to write a little proxy that pulls out the "title=" attribute and appends it to the body.

Before I started coding, I thought that surely someone would have already done this, so after a quick Google search I came across a Yahoo! Pipe from "Benjamin Cook" that does exactly that.

Ben's Pipe appends a "<br />" and then the tooltip, but the "<br />" seems to be getting escaped, so I copied the pipe and removed the "<br />" and the end result was exactly what I wanted.

If you have a similar problem, you can add my version of the pipe to your reader and here's what it'll look like:


Posted by Steve at 15:10 0 comments
Labels: android Email This BlogThis! Share to X Share to Facebook

Git + Hub = GitHub

As mentioned in a previous post, we use GitHub-Flow at work and I really like it.
In essence, it involves doing work in feature branches, while maintaining an always deployable master branch, then opening a pull request to merge a new feature / bugfix into master, which provides a great mechanism for code review / sign-off.

So a fairly typical situation would be as follows:
  • Bug found in app
  • Create an issue on GitHub with description, assignee, etc.
  • Create a new branch off master for the fix
  • Code it up, test locally, etc.
  • Push branch to GitHub
  • Open pull request to merge back into master
  • Get review / sign-off inside of the pull request
  • Deploy
When a pull request is opened on GitHub, it automatically creates an issue for that pull request, which would normally be helpful, but we already created an issue when the bug was discovered.
So now we have 2 issues and 1 pull request. What's nice is that if I push more commits to that branch, it will appear in the pull request automatically, but not the initial issue.

After looking into this, it seems (AFAIK) GitHub do not provide a way of attaching a pull request to an existing issue via the site, but they do provide that functionality via their API.

That is when I discovered Hub.
Hub is a wrapper for git and while it adds more power to alot of the standard git commands, hub adds one command that is really useful for me:

git pull-request -i 49

This basically means "Open a pull request to merge the current branch into master and attach the pull request to issue 49".

This means that the initial bug description, the commits, the review conversation and the merge are all encapsulated in a single issue - fantastic!
I don't know why this isn't built in to the web interface (or maybe it is and I just don't know how).
Posted by Steve at 13:37 0 comments
Labels: git , github Email This BlogThis! Share to X Share to Facebook

Copy and Paste over SSH with Xclip

Have you ever SSH'ed to a server and found you need to copy some data back where a simple selection copy and paste just doesn't seem practical?
When this happens to me, I normally dump that data to a temp file, start up another terminal and SCP the file back before going back to delete the temp file, but I recently found a better way.

I discovered xclip. Using the -X option of SSH to enable X11 forwarding, xclip allows you to interact with the "X selections" clipboard.

To use it, log on to a remote server via ssh -X and ensure xclip is installed, then simply pipe data to xclip and you will be able to paste it anywhere locally with the usual X selection paste (mouse wheel click, shift-insert, etc.).

Here is an example:

ssh -X steve@example.com
sudo apt-get install xclip
ps -ef | xclip

Now anywhere on your local linux machine, you can press <shift>-<insert> (or mouse wheel click) to paste the content.
If you need to pipe this data to another process locally, you can retrieve the clipboard from the command like with xclip like this:

xclip -o | less
Posted by Steve at 23:59 0 comments
Labels: linux , xclip Email This BlogThis! Share to X Share to Facebook

Minecraft exception in linux


I finally decided to install Minecraft on my new shiny Toshiba Portege z830.
Ubuntu ships with an open-source version of Java, which did run Minecraft, but the graphics were terrible, even on the lowest settings. There were artefacts everywhere!

So as recommended, I switched to the official JRE, but now the login screen works, but that's about it. After logging in, I just got a black screen and the following exception in the console:


Exception in thread "Minecraft main thread" java.lang.ExceptionInInitializerError at net.minecraft.client.Minecraft.a(SourceFile:180) at net.minecraft.client.Minecraft.run(SourceFile:648) at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0 at org.lwjgl.opengl.XRandR$Screen.<init>(XRandR.java:234) at org.lwjgl.opengl.XRandR$Screen.<init>(XRandR.java:196) at org.lwjgl.opengl.XRandR.populate(XRandR.java:87) at org.lwjgl.opengl.XRandR.access$100(XRandR.java:52)at org.lwjgl.opengl.XRandR$1.run(XRandR.java:110) at java.security.AccessController.doPrivileged(Native Method) at org.lwjgl.opengl.XRandR.getConfiguration(XRandR.java:108) at org.lwjgl.opengl.LinuxDisplay.init(LinuxDisplay.java:618) at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
... 3 more

After discussing the problem in IRC, the solution was quite simple. It turns out "lwjgl" is a "Light Weight Java Game Library" and the version I had wasn't behaving.
On the advice of the helpful IRC'ers, I downloaded the latest "lwjgl" from here (which at time of writing is 2.8.3) to get it all to work nicely.

To install it, I downloaded the zip file, extracted it to a temporary directory, then copied across these files:
cp lwjgl-2.8.3/jar/lwjgl.jar ~/.minecraft/bin
cp lwjgl-2.8.3/native/linux/* ~/.minecraft/bin/natives
Done! Now it works nicely.
Posted by Steve at 23:25 20 comments
Labels: java , linux , minecraft , ubuntu Email This BlogThis! Share to X Share to Facebook
Newer Posts Older Posts Home

Blog Archive

  • ▼  2013 (4)
    • ▼  June (1)
      • Printing over previously printed characters and lines
    • ►  May (1)
    • ►  March (1)
    • ►  January (1)
  • ►  2012 (17)
    • ►  December (1)
    • ►  October (1)
    • ►  September (2)
    • ►  August (2)
    • ►  July (1)
    • ►  May (2)
    • ►  April (2)
    • ►  March (3)
    • ►  February (3)
  • ►  2011 (33)
    • ►  December (1)
    • ►  November (3)
    • ►  October (3)
    • ►  September (4)
    • ►  August (3)
    • ►  July (4)
    • ►  June (6)
    • ►  May (6)
    • ►  April (3)

Labels

android (5) apache (1) arch linux (1) arduino (1) bash (11) calendar (1) compiz (1) design (1) diff (1) email (1) gimp (1) git (3) github (2) gnome3 (1) Google (2) hacking (1) hardware (4) howto (1) htpc (1) java (1) lamp (1) linux (28) Mac (2) minecraft (2) mysql (1) netduino (1) nfs (1) parallel port (1) patch (1) photography (4) php (1) pidgin (2) printer (1) programming (6) python (1) rails (1) regex (5) review (3) ruby (3) Samsung Galaxy S3 (2) Samsung Series 9 (1) security (1) sed (3) ssh (1) sudo (1) tank (2) Toshiba Portege (1) troubleshooting (1) ubuntu (16) ui (2) unity (2) vim (5) webcam (1) websites (3) xbmc (1) xclip (1) xul (1)

Total Pageviews

Sparkline
 
Copyright (c) 2010 Steven Occhipinti. Designed by Conveyancing
High Deductible Health Insurance, Purchase Beats