Friday, January 27, 2012

rename git commits with git filter-branch

This how you could change the committer / author email / names:

Or for more control

      
Thank you SO.

Adding Eclipse to Unity bar

Once you install your own custom Eclipse (Ubuntu repos are few versions behind) try this recipe to put the Eclipse start icon on your bar:
1. Create/edit sudo emacs /usr/share/applications/eclipse.desktop


## Add following content to file and save ##
[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse SDK 3.7.1
Exec=/path/to/eclipse/folder/eclipse
Icon=/path/to/eclipse/folder/icon.xpm
Terminal=false
Type=Application
Categories=Unity;GNOME;Application;Development;
StartupNotify=true

NOTE: absolute paths must, shortcuts like ~ do not get expanded. If you find the secret to the expansion of these common system variables - let me know in comments.

2. Drag and drop the new .desktop file onto your Unity bar.
nautilus /usr/share/applications/

Optional test: To make sure everything worked double click on the shortcut and your eclipse should launch. (if you favorite editor launches .desktop file, don't worry)

Drag the eclipse.desktop onto the Unity bar. If you unity bar is on auto hide, might want to make it revealed for this on.

Done.

Rescuing disk MBR with Ubuntu

I was very pleasantly surprised with a tool called Boot-Repair provided by Ubuntu. If you end up hosing up the MBR of your drive, Boot-Repair will come to the rescue:

http://help.ubuntu.com/community/Boot-Repair

Will re-install grub for you on your Linux partition. It really saved me hours of researching and troubleshooting. Thank you Ubuntu developers and Canonical for making such great contributions to open source.

Saturday, January 21, 2012

?????? in Devices on Eclipse

Attaching new devices on your Ubuntu Linux can be annoying because the system does not give you permission to access. Simply put, you have to let udev know about special permission to your device.

First we have to grab vendor id from lsusb or android developers site.

lsusb method:
Run

lsusb

look for a your device (phone manufacturer), the listing looks like formatted like this vendorId:modelId, i.e.:
...
Bus 001 Device 006: ID 22b8:7090 Motorola PCS
...

now make sure permission get set on every usb plug event:
add/create new to /etc/udev/rules.d/51-android.rules:

SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev"

set the right permissions on 51-android.rules (if just created the file):

-rw-r--r-- 1 root root  213 2008-12-04 22:45 51-android.rules

or

chmod a+r 51-android.rules

Done.

Credit: Android developer site

Tuesday, January 17, 2012

Upgrade to PAE kernel on Ubuntu 11.04

In case you got some new ram installed and now your total ram is more than 4GB, upgrading your Ubuntu kernel (PAE) to support that higher memory is a breeze.

sudo apt-get install linux-generic-pae linux-headers-generic-pae


Credits: Ubuntu PAE Wiki.

Thank you Ubuntu developers and community for making your best work available for free.