[Script] irssi + ubuntu notify-osd (notification system)

I was on #ubuntu-fr trying to help people, and a person talked about irssi-notify script. It’s a irssi script written in perl, that when there is message with your name in it (even highlights should work too), a notification pops-up (using the ubuntu notification system).

That’s very helpful. Plus it says the channel! Here’s a screenshot:

irssi with ubuntu notification system

Continue reading “[Script] irssi + ubuntu notify-osd (notification system)”

Cron, SSH, Rsync, and a ssh key with a passphrase (Ubuntu)

I recently scheduled some backup tasks on my VPS using backup-manager which is a neat program for this job. Everything is fine for that.
Then I wanted to set up a cron on my home computer to download the backup archives everyday. This wasn’t as easy as it sounded at first.
You might even get those errors:

Permission denied, please try again.
Permission denied, please try again.
Permission denied (publickey,password).
rsync: connection unexpectedly closed (0 bytes received so far) [receiver]
rsync error: unexplained error (code 255) at io.c(635) [receiver=3.0.3]

I need to connect to my VPS using a SSH key that is protected by a passphrase (password). This ssh key is added to my ssh agent (at login time).

The main problem is that cron is run using a restricted environment, meaning it doesn’t give environment variables like SSH_AUTH_SOCK.
This variable is needed by the ssh client in order to communicate with the ssh agent that will provide the information on the ssh key.

Here’s a workaround for it. It’s a quite secure way to fix this.
Continue reading “Cron, SSH, Rsync, and a ssh key with a passphrase (Ubuntu)”

.vimrc for developers: syntax coloring, indent, mouse, paste

I’m posting here the .vimrc I use for both my desktop computer and my server. It works through SSH too!
It gives the following features to vim:

  • Syntax coloring
  • Dark background every time
  • Highlight search
  • Case insensitive search
  • Autoindent
  • Mouse support (for selecting text, moving cursor)
  • Safe Pasting (Push F2 to activate/deactivate)
  • Always shows current line number

Continue reading “.vimrc for developers: syntax coloring, indent, mouse, paste”

Print Installed font list with preview for each font

If you wish to print (or see) a preview of your installed fonts under linux. I found this command myself:

Here is the All-in-One command, copy and paste all this in a terminal (Applications > Accessories > Terminal):

(echo '<html><body>' && (fc-list | sed 's/\(.*\):.*/<font face="\1">\1<\/font><br>/') && echo '</body></html>') > fonts.html
firefox fonts.html

Then Hit Enter.

This should open firefox and open fonts.html, by itself.

Otherwise, go to your user’s directory and open fonts.html yourself.

Find files very quickly using Locate with Linux

Tired of using the Find command? want something faster? Use locate!!! It’s easy to use.

locate myfile

Would give you all the files found since last indexing.

Locate uses a database containing file indexes. That’s why it is very fast to find files, that’s the good point of this system. The bad point is that the database is not updated everytime you create/move/delete a file. But it’s easy to force updating.
Continue reading “Find files very quickly using Locate with Linux”