terça-feira, 16 de agosto de 2011

Contribute code to an Ubuntu defect with Launchpad and bzr in the RIGHT way

I am writing this post because I had to read some manuals and (wrongly) send a patch email to a mailing list to learn how to actually be able to contribute with code to an Ubuntu package. If you need detailed information, please google some official documentation. But if you just want to start coding, this is your place, here you'll find the cake recipe to do it.
  1. Sign up to a Launchpad account.
    1. The only really needed information is your username and your ssh key
  2. Choose a project. Ensemble, for example.
  3. Download the source code:
    1. mkdir ensemble
    2. cd ensemble
    3. bzr init
    4. bzr branch lp:ensemble master
    5. bzr branch master bug-whatever
    6. cd bug-whatever
    7. CODE! Those bugs won't get fixed itself!
    8. bzr commit #goto step 6, if needed
    9. bzr push
  4. Make your branch public
  5. Make a merge proposal
  6. Done!
Now go for it!

[update] another interesting documentation shared by rsalveti today: Ubuntu Packaging Guide

terça-feira, 9 de agosto de 2011

Enjoy old SNES games on your Xoom using PS3 controller

(image from eu, android)

Yes, that exactly what you read. Now you can play SNES games on your Motorola Xoom using your PS3 controller over bluetooth. Also, this tutorial is an adaptation from an article at Eu, Android and it's intended to be used on Ubuntu only, if you need to use the other OS, please check the original. The Linux specific information is from a cached ubuntu wiki, so I'll copy & paste the relevant part here in case it expire in the future. Right, so cut the crap and let's play! :-)


Needless to say, you must have proper root access on your device - details for brazilians here.

  1. Install Sixaxis Compatibility Checker, open the application, give root permissions and then a popup message will be shown telling you if your device is supported or not (hopefully yes).

  2. Install required libs:
    $ sudo apt-get install libusb-dev libusb-0.1-4

  3. Download sixpair.c (original also hosted at the ubuntu wiki, I did a copy on my github)

  4. Compile it:
    $ gcc -o sixpair sixpair.c -lusb

    Before running sixpair, you'll need the bluetooth mac addr of your Xoom. The easy way to get it is installing Sixaxis Controller - don't worry, you'll need the app anyway to use the controller. The app will display a message "Local Bluetooth Adderss" with the bluetooth mac addr you'll need.

  5. Run sixpair with the Motorola Xoom bluetooth mac addrs you just got as a parameter:
    $ ./sixpair 41:f4:89:6d:41:73

  6. Open the Sixaxis Controller and follow the onscreen instructions - important note: You'll might need to reboot your Xoom to make it work (I had to)
 NOW I WANNA PLAY!
easy... almost there

Install a neat SNES emulator, I choosed Snes9x EX. Now you have to configure your controller to map the keys the emulator uses: Go to Sixaxis Controller -> Menu -> Preferences -> Input Mapping -> 1st Controller mappings. Since I am using Snes9x EX, I set my mapping like this:
  • square: A
  • triangle: S
  • circle: X
  • cross: Z
  • left: Q
  • right: W
  • select: SPACE
  • start: ENTER
  • power: HOME
This way, for example, Snes9x EX will understand that when you press square you're actually pressing A which means the Y button on a normal SNES controller. Yes, I know, confusing as hell, but works.

Now go and have fun :-D