Ubuntu tips and tricks

Here’s a small selection of tips and tricks I’ve collected in Ubuntu linux – and probably might help in other Linuses (is that the plural of Linux?!) too.


X11 forwarding problems

When setting up an SSH connection to forward X11 applications back to your client, you can connect with:
ssh -X user@host

This will use standard X11 forwarding; you can also
ssh -Y user@host

to get authenticated forwarding. Once this is done, if everything is working, doing:
echo $DISPLAY

on the host should print something like :0.0

How to fix it if it doesn’t work…

Sometimes, $DISPLAY doesn’t get set. There are a couple of reasons.

  1. Make sure /etc/ssh/sshd_config contains X11Forwarding yes
  2. Make sure you haven’t got any scripts overwriting the $DISPLAY variable
  3. (this is the one that always catches me out) Make sure you have xauth package installed on the target host!

Back to top


Window button order in Ubuntu

Or otherwise know as How to put the window close/maximize/minimize buttons back on the right. An infuriating change if you ask me…

In gconf-editor find
/apps/metacity/general/button_layout
The : is where the large space will be, and the buttons are quite self-explanatory 🙂

If you haven’t got gconf-editor (like in recent Ubuntu’s) you can do this from the command line:

gconftool-2 --set "/apps/metacity/general/button_layout" --type string ":minimize,maximize,close"

Back to top


Customizable menu shortcuts in Ubuntu

How to bind a keyboard shortcut to almost anything in almost any Gnome app

Old versions of Ubuntu

In older versions of Ubuntu, on the main menu, under preferences, on the Appearance dialog, there was an “Interface” tab with various tweaks and things… one of which was customisable keyboard shortcuts for menu items. Just tick the appropriate one, and away you go…

Ubuntu 10 and on

In Ubuntu 10, the team removed the “interface” tab from the Gnome Appearance preferences dialog, so the option to enable “custom keyboard shortcuts” (which let you hover over any menu item, press a new keyboard shortcut and bind it immediately) was hidden away…

You can turn this behaviour on by opening up gconf-editor (either in run (alt+f2) or in a command line) and finding and ticking the key: /desktop/gnome/interface/can_change_accels

Back to top


How to fix “Setting locale failed” in Ubuntu

For when you see errors like…
perl: warning: Falling back to the standard locale ("C").
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings

Just reinstall the packages by:
apt-get install --reinstall language-pack-en
(Stolen shamelessly from http://bit.ly/nlug9c)

Back to top


Refresh user group permissions without rebooting/logging out

Add yourself to a group:
usermod -a -G www-data myuser

If you type groups now though, you’ll notice the list doesn’t show your new group, so you wouldn’t be able to use these new group powers without rebooting or logging out. To get around this, just do:

su -l myuser

The -l parameter (according to the man page) will Provide an environment similar to what the user would expect had the user logged in directly so your groups are updated accordingly for the lifetime of that shell.

Back to top


Posted

in

,

by

Tags:

Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.