Thursday, April 11, 2013

How to install Rmpi on Fedora


  1. sudo yum install R R-devel openmpi
  2. R CMD INSTALL Rmpi --configure-args="--with-Rmpi-libpath=/usr/lib64/openmpi/lib --with-Rmpi-include=/usr/include/openmpi-x86_64 --with-Rmpi-type=OPENMPI"

Sunday, June 27, 2010

NVIDIA ION + Ubuntu 10.04 Lucid Lynx + 5.1 sound analog output

1. Edit alsa-base.conf:
sudo gedit /etc/modprobe.d/alsa-base.conf
2. Add the following line to it:
options snd-hda-intel model=3stack-6ch enable=1 index=0
3. Reboot. The 5.1 channels would be enabled so that alsamixer could be used to unmute them. Enjoy! Credit: Pascal's blog

Wednesday, September 16, 2009

Setting up an AZBox cross-compiling environment (i.e. toolchain for the MIPS Sigma processor)

Recently, I was playing with my new AZBox, a Linux-powered DVB-S receiver. It is a MIPS platform with a Sigma processor. AZBox's official site provides SDK for programming together with a simple example plugin. Since setting up the compiling environment on my Ubuntu 9.04 was not so straightforward, I have written this post. So, the goal is to compile, install and run the provided example plugin on the AZBox. (This HOWTO is based on Geordy's blog post and Jorgen's comments. Thanks!)
  1. Make sure you have installed all important pre-requisites:
    sudo apt-get install flex genromfs bison libncurses5-dev ncurses-base gcc-3.4
  2. Download and extract official toolchain of Sigma:
    wget http://www.networkedmediatank.com/download/firmware/nmt/gpl/smp86xx_toolchain.20080505.tar.bz2
    tar -xjsf smp86xx_toolchain.20080505.tar.bz2
  3. Download and extract AZBox-SDK:
    wget http://www.azupd.com/Plugins-SDK.tgz
    tar -xzf Plugins-SDK.tgz
  4. Continue with preparing the toolchain:
    cd smp86xx_toolchain.20080505
    export CC=gcc-3.4
    make menuconfig

    You don't need to change anything in the configuration, just select "exit".
  5. Next, start the toolchain compilation. It will last for some time and some stuff will be automatically downloaded from the Internet:
    make
    If everything went right, you are now prepared to compile for your AZBox.
  6. Load environment variables needed for cross-compilations:
    source toolchain-path.env
  7. Now move to the directory of the AZBox's sample plugin, "mwkeytest":
    cd ../azbox-sdk/ExternTarget/samples
  8. Compile the sample plugin:
    make install
  9. Two files, mwkeytest.plugin and plugins.lst would be created. Copy them via FTP to your AZBox's /tmp directory.
  10. Take AZBox's remote control, go to the Plugins menu and select installation of the new plugin "mwkeytest" from /tmp.
  11. Now run your new plugin "mwkeytest"! It is a simple application that displays key-press events that it receives.
Enjoy! :-)

Wednesday, June 10, 2009

Changing Evolution's SMTP server configuration with a script

Evolution is my favorite e-mail client and I am quite satisfied with it. However, there is a pitfall of switching networks with Evolution.

SMTP servers used for sending e-mails are often configured to accept request from the internal network only. It is due to various spammers not to flood the service. If you want to send e-mails from each network you are actually connected to (as me), you come very soon to a problem: you have to change your Evolution's SMTP server configuration always after switching the network.

This post presents a workaround: a script that does the setting change for you, automatically. Creating some button at your desktop that uses such script is then a matter of seconds. Here is the source code of changeEvolutionSmtp:

#!/bin/bash
SMTP=${1?'Specify the SMTP server name as the first parameter!'}
SETUP=`gconftool-2 --get /apps/evolution/mail/accounts | sed "s/\(smtp:\/\/\)[^;]*/\1${SMTP}\//g"`
gconftool-2 --unset /apps/evolution/mail/accounts
gconftool-2 --type=list --list-type=string --set /apps/evolution/mail/accounts "$SETUP"


If you run that script with a parameter specifying the new SMTP server name, all your Evolution's e-mail accounts get changed SMTP server:

changeEvolutionSmtp smtp.myprovider.com

Enjoy!

Remote access to encrypted directory at Linux server

This post describes how to configure remote access to an encrypted directory. I wanted to create a personal directory on a Linux server:
  • accessible as a mountable network filesystem;
  • with the content being encrypted;
  • easily configurable.
For the sake of simplicity, I selected SSHFS instead of NFS because:
  • SSHFS does not need to perform any configuration on the server, it lasts the SSH connection to be configured (that is often done already);
  • SSHFS does not need any new special ports to be open on the firewall (SSH port is sufficient).
The disadvantage of SSHFS is that the connection may be slower because of communication encryption. However, I want to use it for personal purposes only. Data encryption will be performed with EncFS. Both the server and client are Ubuntu Linux systems.

The desired configuration is as follows:
  • On the server, I want an encrypted directory available over the SSHFS. Thus, the shared directory would be /home/user/shared that would contain encrypted directory /home/user/shared/encrypted.
  • On the client a remote directory would exist,
    /home/user/.remotedir, that would contain encrypted subdirectory encrypted, which I want to mount to the decrypted directory /home/user/Remote.
  • Only the /home/user/Remote directory would be used by me and EncFS will encrypt all the content into /home/user/.remotedir/encryped, which in turn would be remotely stored via SSHFS on the server.

Server configuration

  1. Make sure SSH is up and running.
  2. Create shared directory:
    mkdir /home/user/shared
  3. Inside of the shared directory create encrypted directory:
    mkdir /home/user/shared/encrypted
  4. Update permissions:
    chmod -R o-rwx /home/user/shared

Client configuration

  1. Install SSHFS and EncFS:
    sudo apt-get install sshfs encfs
  2. Create directory for mounting the remote directory
    mkdir /home/user/.remotedir
  3. Create directory for mounting the encrypted remote directory:
    mkdir /home/user/Remote
  4. Mount the remote directory using SSHFS (insert SSH password to the server):
    sshfs user@myserver.org:/home/user/shared /home/user/.remotedir
  5. Enable encryption:
    encfs /home/user/.remotedir/encrypted /home/user/Remote
    The computer would ask you the type of instalation. Hit ENTER to select "standard". Then insert password for the encrypted content.
  6. To unmount everything, you should first unmount the encrypted volume and then the SSHFS:
    fusermount -u /home/user/Remote
    fusermount -u /home/user/.remotedir
  7. That's all.
For the sake of simplicity, I have created two simple scripts: mountRemote and umountRemote:
  • mountRemote:
    #!/bin/bash
    sshfs user@myserver.org:/home/user/shared /home/user/.remotedir
    encfs /home/user/.remotedir-hucak/encrypted /home/user/Remote
  • umountRemote:
    #!/bin/bash
    fusermount -u ~/Remote
    fusermount -u ~/.remotedir-hucak

Friday, June 5, 2009

Setting up EDUROAM network connection (at OSU.cz) on Ubuntu 9.04

This is how I configured the EDUROAM network connection on my Ubuntu 9.04. My home university is the University of Ostrava (OSU).
  1. First of all, there was a problem with certificates. I have downloaded University's CA Certificates (osu-ca.pem, cesnet-ca.pem) from the OSU's website. We are going to install the certificates as trustworthy.
  2. Determine the directory where all the certificates are stored:
    openssl version -d
  3. Create an executable script file CreateSymLinks:
    #!/bin/bash
    for CERTFILE in $*; do
    # make sure file exists and is a valid cert
    test -f "$CERTFILE" || continue
    HASH=$(openssl x509 -noout -hash -in "$CERTFILE")
    test -n "$HASH" || continue

    # use lowest available iterator for symlink
    for ITER in 0 1 2 3 4 5 6 7 8 9; do
    test -f "${HASH}.${ITER}" && continue
    ln -s "$CERTFILE" "${HASH}.${ITER}"
    test -L "${HASH}.${ITER}" && break
    done
    done
  4. Run
    ./CreateSymLinks *.pem
    This will create symbolic links to the certificate files.
  5. Copy all *.pem files together with all created symbolic links to the path obtained in step 2.
  6. Setup EDUROAM connection in Network Manager: WPA/WPA2 Enterprise, Tunelled TLS (TTLS), osu-ca.pem as CA certificate, MSCHAP, your identity (my was XXX@osu.cz), password.
The connection should be established and work properly.

Thursday, June 4, 2009

Installing IEs4Linux on Ubuntu 9.04

IEs4Linux is an easy way of running various versions of Microsoft Internet Explorer under Linux. Recently, I have installed it on Ubuntu 9.04 Jaunty Jackalope and went to some problems. The official documentation was not up-to-date, so I was forced to improvize. Here is workaround:
  1. sudo gedit /etc/apt/sources.list
  2. add this line to the file or uncomment:
    deb http://us.archive.ubuntu.com/ubuntu jaunty universe
  3. add this line to the file:
    deb http://wine.budgetdedicated.com/apt jaunty main
  4. wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -
  5. sudo apt-get update
  6. sudo apt-get install wine cabextract
  7. wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
  8. tar zxvf ies4linux-latest.tar.gz
  9. cd ies4linux-*
  10. run no GUI installation (since GUI makes all the troubles):
    ./ies4linux --no-gui --no-desktop-icon --install-ie55 --install-ie5 --install-corefonts
Enjoy!