Wednesday, February 29, 2012

Switch the layout of your keyboards

Handy switch if you need to change regularly between layouts of keyboards.


Setxkbmap is a tool to set the keyboard layout. In the options of the tool you're allowed to set a switch.

setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll be,us

sets the keyboard to belgium (be) and with alt+shift I can switch to a us layout.

You can find the explanation for the coding in:

/usr/share/X11/xkb/rules/xorg.lst

You might want to execute this command autocratically on login, so you don't have to type it all the time again.

create a file "setxkbmap.desktop" in "~/.config/autostart/"

nano  ~/.config/autostart/setxkbmap.desktop

and enter the setxkbmap command

[Desktop Entry]
Encoding=UTF-8
Name=sertxkbmap
GenericName=set keyboard layout
Comment=Switch with alt+shift the layout of your keyboard
Exec=setxkbmap -option grp:switch,grp:alt_shift_toggle,grp_led:scroll be,us

this file will be run every time you login to your system

Tuesday, February 28, 2012

Changing the filename extension in R

Filenames ending with *.bin or *.txt will be given the extension *.grd. Applies to a character array containing multiple strings

outFileName = gsub("\\.bin|\\.txt", ".grd", inFileName)

Saturday, February 18, 2012

Ubuntu keyserver

If you have a keyserver error after adding a new repository try doing
 
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 16126D3A3E5C1192
 
replace 16126D3A3E5C1192 with the key of the repository you just added.

Thursday, February 16, 2012

Free tool for resizing a windows partition - EASEUS

EASEUS is free and works like a charm. It resizes a windows NTFS partition smaller than the size allowed by the Windows' own partition manager.

Tuesday, February 7, 2012

Reloading an updated R package without quitting R

Let us say that we worked on the source code of the package Cops and we would like to reload it  without quitting R

Re-install the package from Terminal 1 :
R CMD build Cops; sudo R CMD INSTALL Cops_1.2.tar.gz


Reload the modified package from the R session already running in  Terminal 2 :
detach(package:Cops,unload=T); library(Cops)