miércoles, octubre 19, 2011

Gnome Shell 3: tips and tricks. Clean & fast!

*. Auto login into Gnome 3, and set it as default window manager
1. sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-shell
*. Install classic Gnome and set it as default window manager
1. sudo apt-get install gnome-session-fallback
2. sudo /usr/lib/lightdm/lightdm-set-defaults -s gnome-classic
*. Restore the old-style scrollbars
1. sudo apt-get autoremove --purge liboverlay-scrollbar-*

0. First of all...
1. sudo apt-get install gnome-shell
2. sudo apt-get install gnome-tweak-tool
3. sudo add-apt-repository ppa:webupd8team/gnome3
4. sudo apt-get update

a. Alternative status menu:
sudo apt-get install gnome-shell-extensions-alternative-status-menu

b. Add new themes:
sudo apt-get install gnome-shell-extensions-user-theme

c. Add the workspace indicator:
sudo apt-get install gnome-shell-extensions-workspace-indicator

d. Classic Gnome menu:
sudo apt-get install gnome-shell-extensions-apps-menu

e. Removable drive menu:
sudo apt-get install gnome-shell-extensions-drive-menu

f. Enable system monitor:
sudo apt-get install gnome-shell-extensions-system-monitor

f2. Alternative (even better) system monitor:

sudo add-apt-repository ppa:webupd8team/gnome3
sudo apt-get update
sudo apt-get install gnome-shell-system-monitor
via: http://www.webupd8.org/2011/10/gnome-shell-system-monitor-extension.html

g. Places status indicator:
sudo apt-get install gnome-shell-extensions-places-menu

h. Dock extension:
sudo apt-get install gnome-shell-extensions-dock

i. Enable native window placement:
sudo apt-get install gnome-shell-extensions-native-window-placement

j. Xrandr indicator:
sudo apt-get install gnome-shell-extensions-xrandr-indicator

k. Enable "Auto Move Windows":
sudo apt-get install gnome-shell-extensions-auto-move-windows

l. Gajim extension:
sudo apt-get install gnome-shell-extensions-gajim

m. Enable "Windows Navigator":
sudo apt-get install gnome-shell-extensions-windows-navigator


martes, junio 14, 2011

Read a text file line by line in Java

/// read the file line by line
try {
 BufferedReader in = new BufferedReader(new FileReader(args[0]));
 String str;
 while ((str = in.readLine()) != null) {
} catch (IOException e) {

jueves, junio 09, 2011

Write a text file in Android using the emulator in Eclipse

/// check read/write permissions

boolean mExternalStorageAvailable = false;
boolean mExternalStorageWriteable = false;
String state = Environment.getExternalStorageState();

if (Environment.MEDIA_MOUNTED.equals(state)) {
// We can read and write the media
mExternalStorageAvailable = mExternalStorageWriteable = true;
Log.i(TAG,"read + write");
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) {
// We can only read the media
mExternalStorageAvailable = true;
mExternalStorageWriteable = false;
} else {
// Something else is wrong. It may be one of many other states, but all we need
//  to know is we can neither read nor write
mExternalStorageAvailable = mExternalStorageWriteable = false;

/// write text file

File testFile = new File(Environment.getExternalStorageDirectory()+"/test.txt");
}catch(IOException e){
Log.e("IOException", "exception in createNewFile() method");
//we have to bind the new file with a FileOutputStream
FileOutputStream os = null;        
os = new FileOutputStream(testFile);
}catch(FileNotFoundException e){
Log.e("FileNotFoundException", "can't create FileOutputStream");

PrintWriter pw = new PrintWriter(os);


Log.i(TAG,"wrote in: " + Environment.getExternalStorageDirectory()+ "/test.txt");

viernes, mayo 27, 2011

Install subclipse (subversion) in Eclipse in a few steps

To install Subclipse (subversion) repository plugin in Eclipse, do the following:
  • 1. Open Eclipse
  • 2. Help -> Install new software...
  • 3. Click "Add.."
  • 4. Add this repository (the name does not matter; the URL does):


  • 5. Type "subclipse" in the blank caption to search the plugin
  • 6. Select it and install it

Note that you need internet connection :)

martes, marzo 15, 2011