### Archive

Archive for April, 2009

## Using ssh-keygen & ssh-copy-id

Just because I always forget:

[user@Host ~]$ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/home/user/.ssh/id_rsa): Created directory '/home/user/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/user/.ssh/id_rsa. Your public key has been saved in /home/user/.ssh/id_rsa.pub. The key fingerprint is: 0d:d2:94:07:93:a9:48:b9:33:73:fb:f1:6e:33:ce:d7 user@Host The key's randomart image is: +--[ RSA 2048]----+ | . += | | o o+.. | | . o..o. | | * o. o | | = .S . | | . . | | . o . | | ..= . E | | +++ | +-----------------+  #### Step 2: Copy the public key to remote-host using ssh-copy-id Now here comes the awesome part: You don’t have to scp the public key to your remote host and cat it into ~/.ssh/authorized_keys. Instead, you can use ssh-copy-id [user@Host ~]$ ssh-copy-id -i .ssh/id_rsa.pub user@remote-host
Now try logging into the machine, with "ssh 'user@remote-host'", and check in:

.ssh/authorized_keys

to make sure we haven't added extra keys that you weren't expecting.

Categories: Uncategorized Tags:

## Customizing Gnome keyboard shortcuts

It’s possible to define keyboard shortcuts for your own commands in addition to the predefined Gnome actions. Since metacity is Gnome’s default window manager, you have to edit the metacity keys in your GConf configuration system. The easiest way is doing it with the gconf-editor (although you can of course edit the xml-definition in ~/.gconf/apps/metacity/ by hand).

So open your gconf-editor and navigate to the tree ‘/apps/metacity/global_keybindings’. Assign a shortcut to one of the keys run_command_1 to run_command_12, e.g. Alt + F9.

Now you have to tell metacity, which command to run. In the corresponding key run_command_1 to run_command_12 under ‘/apps/metacity/keybinding_commands’ you specify the command that you want to attach to the shortcut.

An Example: We want to start xmms when XF86AudioPlay is pressed, so we have to alter the keys as follows

/apps/metacity/global_keybindings/run_command1  =  XF86AudioPlay
/apps/metacity/keybinding_commands/command1     =  xmms -t


Of course, this only works with the default windows manager metacity. If you use a composition-manager like Compiz or Beryl, your mileage will vary.

Categories: Uncategorized Tags:

## Writing long articles w/ TOC

Saw my last article about RF remotes and Fedora? Noticed the box in the top right corner containing a table of contents? Pretty cool, huh?

This really nice plugin by Hackadelic parses your headings automatically and puts them into a TOC-box. It’s even collapsable and you can change its position through shortcodes within the post.

Categories: Uncategorized Tags:

## RF remote with Fedora 10

Remote controls for PCs are really great. With an ordinary remote for just a few bucks you can control almost everything on your PC while sitting on your couch. Well, thanks to lirc, of course. But most of them have one major design flaw: They’re infrared based, i.e. remote controls transmit data on an modulated infrared beam to your IR-receiver. Even a (think) sheet of paper can block the beam. So your remote always has to be within visual range of your receiver.

But there are some remotes out there which use a 433MHz beam instead of the short-waved IR-beam. For example this one by X10

Categories: Uncategorized Tags:

Recently (well, yesterday to be exact) I was really sold on a a syntax highlighting plugin for WordPress called WP-Syntax. Basically, I am still. It is still easy to use, looks good and comes with a huge variety of supported languages.

But if you ask the WordPress-guys it isn’t first choice. In their FAQ they point you to Alex Gorbatchev’s syntaxhighligher Google Code project. There are quite a lot of implementations availible including three different plugins for WordPress. So I looked a little closer at SyntaxHighlighter Evolved and I must admit that it is really nice.

public class Hello {
public static void main(String[] args) {
/* This line is highlighted. */
System.out.println("Hello world!");
}
}


Especially the line highlighting is very nice. It doesn’t support as many languages as WP-Syntax, but as I mainly use it for Java snippets that shouldn’t be a major problem.

Categories: Uncategorized Tags:

## Syntax highlighting ftw!

1 2 3 4 5 public class Hello { public static void main(String[] args) { System.out.println("Hello world!"); } }