Change TAB behavior in Firefox
May 17th, 2009
Before I started using Linux as my default OS I used Mac OS for 5 years. In Mac OS the TAB key behaves different in Firefox than Ubuntu (my preferred distro). When using the TAB key in Mac OS it focuses on input fields only rather than every object (images, links, whatever) in a web page .
Today I finally took the time to find out what the difference between the Firefox in Mac OS and Ubuntu. I opened the about:config and searched for “tab”, and what do you know. I found an option called “accessibility.tabfocus” which was set to the value “7″.
A quick google search brought me to this site which tells you everything you want to know about accessibility.tabfocus.
If you want TAB behavior like the one in Mac OS you simply change the value of accessibility.tabfocus to “1″, et voilà, it works!
You can combine options. For example you can set the value “3″ to select any form element on a web page. Read more at http://kb.mozillazine.org/Accessibility.tabfocus.
edit:
For those who didn’t know; you can press Shift+TAB to focus the previous selected element.
How to FAIL twice in one day
March 2nd, 2009
Have you ever wondered how you could FAIL twice in one day? Sure you have!
Here are two tips to get you going:
Tip one: The ATI graphics driver install
When installing the ATI drivers for your graphic card in Ubuntu: Never ever check what graphic card you really have, take a guess and stick to it. Be sure to spent at least 2 hours trying everything from hacking with the aticonfig-tool to reinstalling the same driver. After two hours (or more) you’ll might find out that you have a X1600 card, instead of a X1300, then the solution becomes fairly obvious. Instead of using 2+ hours you could have done it in about 30 seconds with the correct drivers. But hey, whats the fun in that?! :_((
Tip two: The famous 5-minute WP installation
When you’re about to update WordPress from the 2.6.x to the 2.7.x be sure that you don’t have any backup what so ever! This is a key step to get this guide to work. If you have backup of your wp-config.php, theme files etc. there is no fun in doing this. Delete them right away!
Now, download then newest wordpress version. Before you continue with the actual install you have to make sure that some of the folders have some strange permissions (Why? I don’t know). If you don’t do this your FTP-client (I assume do use FTP) will just overwrite the files and all the fun is gone. Instead you will have a mix of new and old files side by side! Now you have to upload everything from the newly downloaded version of WP and check that the FTP-client is set to overwrite all files.
When the upload is finished you try visiting your blog page, and what do you know, the update has fucked up! At this point it’s important to get frustrated and just delete the whole shebang and try the good old reinstall. The reinstall seems to work, all the files is installing in the right way and everything is great! Now you go to you blog page. What do you see? “There doesn’t seem to be a wp-config.php file. [...]“. “wtf?!” might be your first response, but then you remember, you deleted all the WP-files a couple of minutes ago, including wp-config.php of course.
One should think that missing the wp-config.php isn’t that bad, basically it’s just information to log in to your MySQL database. Well, if you want to make things really interesting you have cleverly disguised your WP-database with a non-describing name. After some minutes looking through your databases you find the database with contains the WP data, and everything seems to go your way.
FINALLY! The blog is back, or wait, what the hell is this?! – The default wordpress theme?! Yes, that’s right. Don’t you remember? You deleted all your old theme files – and you don’t have any backup! Oh well, it shouldn’t take more than a couple of hours to get a working theme up and running again. Enjoy! :(
Summary
Yesterday sucked monkey balls :(
Norwegian mac keyboard layout in Ubuntu
February 23rd, 2009
For the last years I’ve been using Mac OS X, but now I’m running Ubuntu. Ubuntu has very much functionality build in, but the Norwegian mac keyboard layout isn’t that great out of the box.
There are three steps required to get the layout partially[NB!] right:
- Change 3rd level chooser and switch Alt / Win (cmd) key.
- Edit the XKB-file to get keys right.
- Set the keyboard in Ubuntu to “Norway Macintosh”
Step 1:
Open the keyboard settings (System -> Preferences -> Keyboard) and click the “Layouts” tab. Then click the “Other options…” button.
1.1) Press “Alt/Win key behavior” and choose “Left Alt is swapped with left Win-key”.
1.2) Press “Third level choosers” and select “Press any of Alt keys to choose 3rd level” (or “Press left Alt keys to choose 3rd level”).
Step 2:
This part is a bit more tricky.
Open the terminal and open the folder “/usr/share/X11/xkb/symbols”
$ cd /usr/share/X11/xkb/symbols
The file we are going to edit is named “no”, but before we begin lets backup the file!
From now on every command run as root (noted by #).
# cp no no_backup
Now open the “no”-file with your favorite editor, I’m using VIM.
# vim no
Scroll down to the part which starts with:
// Copied from macintosh_vndr/no
partial alphanumeric_keys
xkb_symbols "mac" {
You now need to change the following lines:
key <TLDE> { [ bar, section, brokenbar, paragraph ] };
to:
key <TLDE> { [ apostrophe, paragraph, bar, brokenbar ] };
And:
key <AE04> { [ 4, currency, dollar, dollar ] };
to:
key <AE04> { [ 4, dollar, currency, dollar ] };
Then save.
Step 3:
The only thing remaining is to select “Norwegian Macintosh” as your default keyboard layout.
In System -> Preferences -> Keyboard, press the “Layouts”-tab and press the “+”-button.
If everything is done right you should have the basic Norwegian mac layout.
NB!
This layout is not equivalent to the real Norwegian mac layout. There is a lot of keys that needs mapping to do so. The original layout looks like this (keys are pressed from left to right).
Edit:
It seems that if you use the newer versions of Apple’s keyboard you have to change the setup for the TLDE-key and the LSGT-key. I don’t know why, but it works!
Bug when trying to edit existing snippets in gedit
June 18th, 2008
When trying to edit the existing snippets in gedit the changes was gone the next time I opened gedit. It turns out that the predefined snippets is located in /usr/share/gedit-2/plugins/snippets/ (I’m running Ubuntu 8.04). To edit these files you need root access, which gedit doesn’t have (unless you do “sudo gedit” or something). To fix this I moved the snippet files from /usr/share/gedit-2/plugins/snippets/ into ~/.gnome2/gedit/snippets/. Fix in terminal:
sudo cp /usr/share/gedit-2/plugins/snippets/* ~/.gnome2/gedit/snippets
It’s probably possible to change the permission of the files too.