Android Simulator/Emulator: Delete directory

One thing maybe (or maybe not) you’ve noticed is that you can’t delete an entire directory using DDMS on eclipse.

To be able to delete a directory on simulator sd card you can use the ADB command and connect to device via shell.

The first thing to do, is to go to “<android-sdk-PATH>/platform-tools” and from there type:

./adb devices

Then connect via shell to the device that you want:

./adb -s emulator-5554 shell

Now you’ve connected to the device “emulator-5554″  and now you can remove the files or directories that you want!

Use Fatsort to order MP3 files (Linux)

Fatsort (http://fatsort.sourceforge.net/) is a very useful tool to order your MP3s so you can listen in your MP3 hardware player.

Fatsort is command line tool that allow you to order your files in a USB stick. It’s usage is very simple:

1) First get the device location by typing “sudo mount”. There you should find something like “/dev/sdb1″.

2) Unmount this device: “sudo eject /dev/sdb1″

3) Apply the fatsort to that unmounted device: “sudo fatsort /dev/sdb1″

And it’s done :)

Ubuntu 10.10 gnome-power-manager shutsdown bug

Actually I don’t know in which version this bug has started, but “gnome-power-manager” just indicates that my laptop battery is charging even though I unplug the AC power supply.

Since I upgraded to the new version, the problem is even worst, since now when I unplug the AC power supply  a message pops up saying that I have less than 1% battery power and Ubuntu just shuts down.

Actually if you have this same problem, you can go to “gconf-editor” and where it says “/apps/gnome-power-manager/actions/critical_battery”, set it to “nothing”

Screenshot-Configuration Editor - actionsThis actually doesn’t solve this bug, but at least you can use Ubuntu!

How to add a new user to a vsftpd server

Assuming that you already have the vsftpd installed and configured, to create a new ftp user with an home directory you just need to use this commands.

The first thing you need  to do is to create an FTP root directory:

# mkdir <path_directory>

Then you should create an user and make the <path_directory> the user’s home directory:

# useradd -d <path_directory> <ftp_new_user>

Then add a password to the newly created user

# passwd <ftp_new_user>

Add <path_directory> permissions:

# chown <ftp_new_user> <path_directory>

# chmod 0744 <path_directory>

Restart the server:

# /etc/init.d/vsftpd restart

And it’s done!

Now you can access to this ftp account using the <ftp_new_user>

Revert modifications from a git project in Eclipse IDE

Something that I’ve missed when I switch from SVN to git was subeclipse:(

I’m using eGit, but it lacks support for doing a simple task like reverting modifications from a specific file.

eGit without reverting
eGit without reverting

Even though I’m getting use to those simple command line scripts a simple thing like reverting modifications from a specific file is kind of tedious, and this is something that I could handle in the IDE.

To simplify this procedure I’ve created a simple bash script (revert.sh):

#!/bin/bash
# @author Daniel Botelho <botelho.daniel@gmail.com>
# @date 2010-05-19
workspace_loc=$1
project_name=$2
selected_resource_path=$3
git=/usr/bin/git
cd $workspace_loc/$project_name
#echo $git status

#$git status

length=”${#project_name}”+2;
echo $git checkout ${selected_resource_path:length}
$git checkout ${selected_resource_path:length}
echo “completed.”

Then I’ve created a new External Tool Configuration to call this simple script (Run>External Tools> External Tools Configurations…>)

new_ext

Screenshot-External Tools ConfigurationsHere you should change your “Location” to the location where you have your “revert.sh” script.

Ok, and it’s done! :)

Now I can choose the file that I want to revert and click on “Run revert modifications (git)” right from the eclipse IDE.

run

Upgrade to kernel-2.6.27-11-generic on LG-500

Today I’ve upgraded my kernel to 2.6.27-11-generic, and some fixes were necessary to get my Ubuntu to work again.

I tried to open VirtualBox but I get this error:

VirtualBox error
VirtualBox error

Executing the command that they suggest worked like a sharm:

sudo /etc/init.d/vboxdrv setup

The other problem was due to wireless. Again I needed to recompile the madwifi so I could get it to work for the new kernel. I’ve Followed the post Re: Atheros Communications Inc. AR242x 802.11abg Wireless PCI Express Adapter (rev 01) and it’s working again! :)

VirtualBox 2.1.2 in Ubuntu 8.10

VirtualBox is an application that allows you to have several virtual machines inside your operative system.

Unfortunately the VirtualBox version 2.1.2 still isn’t on Ubuntu repository, but if you go to Download VirtualBox for Linux Hosts there you find a version that will run on Ubuntu!

Installing and running is really straight forward, but I had a problem when I tried to start a virtual machine:

VirtualBox can’t operate in VMX root mode. Please disable the KVM kernel extension, recompile your kernel and reboot (VERR_VMX_IN_VMX_ROOT_MODE).

To fix this I’ve just followed the indications in VirtualBox can’t operate in VMX root mode.

Here is VirtualBox 2.1.2 running Windows XP inside Ubuntu in Seamless mode

VirtualBox
VirtualBox

Subclipse 1.4.7 in Eclipse 3.4 (Ganymede) using Ubuntu 8.10

Since I’ve made a Fresh Ubuntu install in my laptop, now I’ve to setup the environment so I can do some working in the laptop ;)

The company that I’m working now only uses PHP, so the production IDE that I use is Eclipse PDT. The great thing about Eclipse, is it’s huge plugin repository, and the one that’ll be talking here is the Subclipse.

Subeclipse is on 1.4.7 version and it’s a great SVN plugin (the only one I know ;)).

Installation Instructions

This installation instructions are based on Download and Install with the difference that here I’ll be showing Subclipse installation process for Eclipse 3.4 (Ganymede) and screens were captured in Eclipse 3.4.0 running on Ubuntu 8.10.

Step 1:

Begin the installation from the Eclipse Help menu item.

Software Updates
Software Updates

Step 2:

This screen will vary depending on the features you have installed already. You want to click on the New Remote Site button. If you are behind a proxy and the Eclipse install mechanism does not work, then you can download a zipped version of the update site and then click the New Local Site button instead.

Software Updates and Add-ons
Software Updates and Add-ons

Step 3:

This screen is showing the Add Site dialog, filled in with the correct information to install Subclipse 1.4.7 (url: http://subclipse.tigris.org/update_1.4.x)

Add Site
Add Site

Step 4:

When you first come back to this screen, the site you added will NOT be selected. Be sure to select it before clicking Next.

Install
Install

Step 5:

This next screen shows all of the features that are available to install.

Confirm Install
Confirm Install

Step 6:

Click the button to accept the license agreement.

Confirm
Confirm

Step 7:

Eclipse needs to be restarted after installing Subclipse.

Restart
Restart

Step 8:

Finally, after restarting Eclipse, you can do Import and checkout a Project from SVN

Import
Import