Donnerstag, 30. Mai 2013

Check and repair LUKS encrypted partitions in Ubuntu 13.04

Unfortunately Gnome Disks was castrated in version 3.6, it is now impossible to repair LUKS encrypted filesystems with the help of Gnome Disks. But you can easily do this within the terminal.

If you are using a LUKS encrypted partition and you want to check whether it has file system errors, you can do this with the following commands:

  1. Mount and open your LUKS partition:

    sudo cryptsetup luksOpen /dev/<yourPartition> <someMountName>

    e.g.: sudo cryptsetup luksOpen /dev/sdb3 foo
  2. Run fsck on it to check and auto-repair the filesystem:

    sudo fsck -a /dev/mapper/<someMountName>

    e.g.:  sudo fsck -a /dev/mapper/foo
  3. After the check / repair is finished, do not forget to close your LUKS volume again:

    sudo cryptsetup luksClose <someMountName>

    e.g. sudo cryptsetup luksClose foo
If you want to avoid an auto-repair and instead want to do a user guided check / repair, just remove the "-a" option.

That's it easy peasy, isn't it ?

Freitag, 24. Mai 2013

Install latest Homerun version in Kubuntu 13.04

Install latest Homerun version in Kubuntu 13.04



Just a small tutorial how to build and install the latest version of Homerun in Kubuntu 13.04 as the PPA is slightly outdated:
  1. Get the latest stable release and extract it or get the git snapshot (via git clone git://anongit.kde.org/homerun)
  2. Install necessary dependencies: 

    sudo apt-get install libkonq5-dev kde-workspace-dev kdelibs5-dev
  3. Go into folder:

    cd homerun

  4. Create build directory and go into it:

    mkdir build; cd build
  5. Build it:

    cmake -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix` ..

  6. Compile it:

    make
  7. Install it:

    sudo make install
  8. If you already run an older version of Homerun killit and restart homerun:killall homerunviewer; homerunviewer

There we go ! You can easily remove it via sudo make uninstall from install dir.

Donnerstag, 2. Mai 2013

R mit PostgreSQL unter Ubuntu 12.04

Hier die ultimative Übersicht für alle die gerne mit R unter Ubuntu arbeiten und Daten aus PostgreSQL verwenden möchte. Ich geh davon aus, dass die PostgreSQL-Datenbank jeder allein einrichten kann.


  1. Schritt: Abhängigkeiten (PostgreSQL, JDBC-Connector für PostgreSQL und R) installieren
    sudo apt-get install postgresql libpostgresql-jdbc-java r-base-core r-cran-rjava r-cran-dbi 
  2. Schritt: Terminal öffnen & R starten mit
    R
  3. Schritt: JDBC-Paket (RJDBC) für R installieren
    install.packages(c("RJDBC"))
  4. Schritt: Verbindung zur Datenbank aus R herstellen
    # JDBC-Paket einbinden
    library(RJDBC)

    # JDBC-PostgresSQL-Treiber initialisieren
    drv <- JDBC("org.postgresql.Driver", "/usr/share/java/postgresql-jdbc4-9.1.jar", identifier.quote="`")

    # Verbindung zur Datenbank herstellen
    conn <- dbConnect(drv, "jdbc:postgresql://localhost/datenbank", "user", "pw")
    # SQL-Query ausführen
    data <- dbGetQuery(conn, "select * from iris where Species='setosa'")
  5.  Fertig :) 
Bei Verbindungen zur nicht lokalen Datenbanken muss der dbConnect-Aufruf angepasst werden.