0

Where is my add-apt-repository in Ubuntu Server LTS 12.04 ?

Yes, where is it ?

biafra@vm:~$ sudo add-apt-repository ppa:rwky/redis
[sudo] password for biafra: 
sudo: add-apt-repository: command not found

So, you are using the latest stable and supported LTS server distribution from Ubuntu. And it doesn’t install the package to simplify the management of PPA repositories (Personal Package Archives). The de facto Ubuntu repository for all people.

They even state that in the help text:

Read about installing

“Read about installing”

But don’t despair! They could already had installed it with one of the upgrades but… They forgot it. add-apt-repository comes with package python-software-properties

$ sudo apt-get install python-software-properties

And now at last:

biafra@vm:~$ sudo add-apt-repository ppa:rwky/redis
You are about to add the following PPA to your system:
 Redis is a in memory persistent datastore. This is package kept up
to date with the latest stable version from http://redis.io it uses
an upstart script instead of an init script which fits nicely with
the newer ubuntu distributions.
 
For support email admin {at} rwky {dot} net
 
For support in other distributions please contact me at the above
address and I'll consider other builds if there is demand.
 
If you like this package please consider flattring me
http://flattr.com/thing/360264/Redis-package-for-Ubuntu
 
Sponsored by @Food_Nation http://www.food-nation.co.uk/
 More info: https://launchpad.net/~rwky/+archive/redis
Press [ENTER] to continue or ctrl-c to cancel adding it
 
gpg: keyring `/tmp/tmp48ytqX/secring.gpg' created
gpg: keyring `/tmp/tmp48ytqX/pubring.gpg' created
gpg: requesting key 5862E31D from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp48ytqX/trustdb.gpg: trustdb created
gpg: key 5862E31D: public key "Launchpad PPA for Rowan" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

I hope this will help you like it helped me!

0

Connecting Thunderbird to an Exchange Calendar

Or How to Install an Add On .xpi in Thunderbird

You have your Ubuntu Desktop running smooth. Thunderbird is connecting to the corporate Exchange server through IMAP. However you can’t deal with all those appointments and meeting requests.

Add-ons you will need

You will need two Add-ons:

  • Lightning
  • Exchange 2007/2010 Calendar and Tasks Provider

Lightning is a calendar and task extension.

Open Thunderbird and go to your menu Tools / Add-ons. Select Get Add-ons.
If “Lightning” appears right away just click on it and added it. If not you have to use the search box. Keep in mind that you are looking just for “Lightning”. It will show up many add-ons with similar names. Continue to the next search page if there’s no add-on named just “Lightning”.

And now you think you could do the same for the second add-on. Wrong!
You must go here and download the Development Version 3.1.x.

Now you have the second add-on in a file named exchangecalendar-3.1.x.xpi

How do I install a .xpi add-on in Thunderbird ?

Well, you won’t find a menu option to do that. Go again to Tools / Add-ons / Get Add-ons. Now just click on the tools icon and select Install Add-on From File....

Tools for all add-ons

Conclusion

There’s now one less argument for the Management to go against Linux on the Desktop. And this is a really important one on the Corporation world. Unfortunately you can’t continue to not attend meetings with the excuse you were not invited or that it was not on your calendar :-)

2

Vim safe copy paste without bad indentation

The Horror

One thing that was always great with Linux desktop X11 (and continued with Ubuntu 12.10) was copying text with a mouse selection and just pasting it with the middle button. That’s why I became horrified when it started to not work with Vim!

I was evaluating a Perl Module and when I copy/pasted a block of an example code this happened

 

Borked Paste

It has to be a way to have a clean copy/paste again!

The Solution

Fortunately Vim has the notion of paste and so has a mode to activate it and ignore indentations and other features. You just activate it with :set paste

normal-set-paste-500

paste-mode-500

Change to insert mode

paste-mode-insert-500

and now just paste the text the way it was supposed.

Paste Ok

Hurray! Now press Esc and get back to our helpful indentations with :set nopaste.

paste-set-nopaste-500

normal-set-nopaste-500

Less typing, may I ?

Of course there’s a pragmatic way of doing all these. We can define a keyboard key to just make the copy/paste a safe operation. I’m using key F12.

:set pastetoggle=<F12>

In insert mode you can toggle the paste mode so you don’t despair with the wrong indentation. Add it to your .vimrc

Another way it’s to just paste what you want into the line you are at in visual mode.

map <F12> :r! xsel<CR><Esc>

xsel is a command line X11 tool to manipulate its “clipboard”.
This mapping reads into Vim the output of xsel which is the clipboard copy buffer. I’m using this one.

You may need to install it but it’s simple

$ sudo apt-get install xsel

Conclusion

Vim customization and plugins broke a plain simple copy/paste. However we got a no brain and fast solution with our F12 key.