Category Archives: Ubuntu

How to change the default operating system to boot with Ubuntu Linux and Windows

In Ubuntu, the boot order is controlled with GRUB. Do the following:

  1. sudo cp /etc/default/grub /etc/default/grub.bak (backup of the conf file, only superuser can do it)
  2. sudo gedit /etc/default/grub (edit the conf file, only superuser can do it)
  3. Replace GRUB_DEFAULT=0 with GRUB_DEFAULT=saved
  4. Save and close the file in gedit.
  5. sudo update-grub
  6. sudo grub-set-default xx, where xx is the number of the boot menu item you want to start be default. The first item has number 0. After doing update-grub, you’ll see a list of all OS’s that will be included in the menu, so you can count them (start with 0 and count all lines starting with found).

Note: memtest, if you have it in the menu, takes two lines in the menu, while update-grub shows only one. Windows is the last item. So add one to the number to start with Windows.

This solution is taken here.


Install TortoiseHg (Mercurial GUI) in Ubuntu

Mercurial is provided (even if old) for Ubuntu, it can be installed with Ubuntu Software Center or using sudo apt-get install mercurial. TortoiseHg, the graphical user interface or the front-end for Mercurial is not.

To install it

  1. sudo add-apt-repository ppa:mercurial-ppa/releases
  2. sudo add-apt-repository ppa:tortoisehg-ppa/releases
  3. sudo apt-get update
  4. sudo apt-get install mercurial
  5. sudo apt-get install tortoisehg*

After this, commands hg and thg are available.

Note that in Ubuntu 10.04 (LTS) thg exits with segmentation error, see here.

Cross-platform dropboxing

I’ve recently had a problem covered here. Basically, the files put to Dropbox on my Mac wouldn’t appear in Linux. Without any warning from Dropbox. Without any visible reason. After many months of successful use of Dropbox on Mac, Windows and Linux. I was hopeless, but was helped by the Dropbox team. The thing was actually mentioned in FAQ, but under such a topic that I have never found it.

The solution was to turn on the extended attributes in Linux. For this, I’ve edited the /etc/fstab file to add the user_xattr attribute to the root partition options.

Of course, this was a Dropbox fault. If it cannot sync some files, it should issue a warning.

Gnome: How to change the sequence of the window control buttons

After changing the theme in Ubuntu, I’ve got the window control buttons (maximize, minimize, close) in the order different from the previous theme and also from the Mac OS I have to live with at home. This is inconvenient, but we’re in Linux, aren’t we? So:

  1. Run gconf-editor (configuration editor).
  2. Go to apps > metacity > general.
  3. Edit button_layout according to your needs.

(Tip found here.)

Wacom Bamboo with Ubuntu 11.04

I’ve borrowed a Wacom Bamboo Fun tablet from a colleague. Connected it. And started searching for how to install the drivers. Took me quite some time to realise, that the tablet was already working! Just like a mouse. Both touch and pen. A few remarks:

  • Multi-touch is not supported as of now.
  • The program to control the device is called xsetwacom, it was installed by default in my Ubuntu distribution.
  • xsetwacom --list devices lists all available devices’ names
  • In my case, xsetwacom --set "Wacom Bamboo 2FG 6x8 Finger pad" touch off switches touch off
  • xsetwacom --get "Wacom Bamboo 2FG 6x8 Finger pad" touch shows the touch status

Update 2011-08: Bought a Wacom Bamboo Pen & Touch (CTH-460). Works without problems as well. I find its size more suitable for drawing small sketches.

Install Matlab in Ubuntu

  1. Download Matlab without JRE.
  2. Unzip MATLAB_R*, e.g.: unzip
  3. Run sudo ./install.
  4. Do not activate, you’re in superuser mode!
  5. If the link is not created (on 2011-05-16 it didn’t create it though, according to this, it should have), create it yourself: sudo ln -s /usr/local/MATLAB/R2011a/bin/matlab /usr/local/bin/matlab (correct for your Matlab version)
  6. Matlab can be run from the terminal: matlab or from GNOME (Alt+F2): setsid matlab -desktop.
  7. If you like, get icon: sudo wget -O /usr/share/icons/matlab.png. An SVG icon is available heresudo wget -O /usr/share/icons/matlab.svg. This icon is used, e.g. in the Run Application dialogue (Alt+F2).

Ubuntu beginner’s tricks

  • Automatic layout switcher: x neural switcher
  • Disable Pidgin’s pop-ups on user login: Pidgin > Tools > Plug-ins > Libnotify Popups > Configure Plug-in > Disable ‘Buddy signs on’
  • Nice screen effects: compiz
  • Install additional plugins for Compiz: sudo apt-get install compiz-fusion-plugins-extra
    • This also provides additional animation window effects (maximize, close, minimize)
  • Terminal transparency: run gnome-terminal > Edit > Profile preferences > Background > Transparent background > Adjust the position of the slider.
  • Run file manager: nautilus
  • Install smth. from a command line: sudo apt-get install application_name.
  • Uninstall smth. from a command line: sudo apt-get purge application_name.
  • Remove packages which are no longer needed: sudo apt-get autoremove
  • Install LaTeX: sudo apt-get install texlive
  • Shortcuts: System > Preferences > Keyboard shortcuts
  • After installing Octave, I don’t have documentation installed, upon typing doc, Octave says that the file is missing. Install it with sudo apt-get install
  • Add volume control to Ubuntu notification area: description
  • Access additional characters (em-dash, en-dash, French quotation marks, degree etc.): System > Preferences > Keyboard > Layouts > Options > Compose key position > Right alt (for example). Then
    • Right Alt, –. gives en-dash
    • Right Alt, — gives em-dash
    • Right Alt, oo gives the degree sign
    • Full list of symbols and key combinations is here
  • Enable the Window Screenshot on Alt+PrtScr: sudo sysctl -w kernel.sysrq=0 or assign another key combination (like Win+PrtScr). See here and here and here and here for explanation and solutions.
  • How to disable top applications menu in Ubuntu Unity: according to this link, login with Ubuntu Classic desktop, “right click the panel, deselect “Lock the panel”, then right click the AppMenu and remove it. The menu will then instantly be available in the application window.” There is also a description of how to do it with Unity in that link.