Archive for the ‘Guide’ Category

Line number su emacs


2010
06.03

Con emacs 23.x il modulo linum-mode è incluso di default nell’editor di testo. Per attivarlo basta dare il comando M-x linum-mode.

Il problema è che non c’è spaziatura tra la colonna dei numeri e il testo. Con questo spezzone di codice da inserire all’interno del file .emacs invece oltre che partire all’avvio insieme ad emacs, linum si comporta in maniera un po’ più “graziosa”.

(global-linum-mode 1)
(setq linum-format "%d ")

Auto-complete mode su Emacs


2010
05.19

Ecco come fare:

  1. Scaricate il pacchetto da qui e scompattatelo nella vostra /home
  2. Aprite emacs
  3. M-x load-file
  4. Selezionate auto-complete-1.2/etc/install.el
  5. Lasciate la directory di installazione di default
  6. Copiate e incollate quello che vi dice di copiaincollare nel vostro file .emacs
  7. Voilà!

Per i più curiosi ecco un video esplicativo

Aprire i risultati della ricerca in una nuova scheda


2010
05.03

Giocherellando con firefox mi capita di sminchiarmi spesso le impostazioni. Una cosa che uso moltissimo e che invariabilmente va persa è la possibilità di aprire i risultati di ricerca (dalla casellina in alto a destra) in un nuovo tab.
Voglio dire, automaticamente, non premendo ALT+ENTER.
Dato che mi sono stancato di cercarlo ogni volta sul web me lo segno qui:

  1. Aprire about:config
  2. Cercare la stringa browser.search.openintab
  3. Modificarne il valore da false a true
  4. Fine

New Gimp version on Ubuntu 9.04


2010
03.25

To fix the orrible #606372 bug in GIMP that avoid the creation of indexed PPM (who have messed up with the syslinux splash knows about) here’s a short guide to build a brand new GIMP from the development (GIT) repository, on a Ubuntu 9.04:

  1. Install the dependencies for gimp (the same for 2.6.6, included in Ubuntu 9.04) with sudo apt-get build-dep gimp.
  2. Install ruby and libtool: sudo apt-get install ruby libtool.
  3. Export the variable PKG_CONFIG_PATH (needed for future compilations): export PKG_CONFIG_PATH=~/devel/gimp/lib/pkgconfig/
  4. Create a temporary directory to fetch all the repositories you need: mkdir ~/gimp-build
  5. Enter in the directory just created and clone the gimp repository from gnome.org: git clone git://git.gnome.org/gimp.
  6. Clone also these two repositories, for libbabl and libgegl. This because the versions in Ubuntu repositories (o.o.22) are too old for the new GIMP version:
    git clone git://git.gnome.org/babl
    git clone git://git.gnome.org/gegl
  7. Now let’s decide a directory where to install gimp. For example I use ~/devel/gimp: mkdir -p ~/devel/gimp
  8. Enter in the babl directory (just created), configure and compile it:
    cd babl/
    ./autogen.sh –prefix=~/devel/gimp
    nice make -j2
    make install
  9. Do the same for gegl:
    cd gegl/
    ./autogen.sh –prefix=~/devel/gimp
    nice make -j2
    make install
  10. And now for gimp itself:
    cd gimp/
    ./autogen –prefix=~/devel/gimp
    nice make -j2
    make install
  11. Now you can find GIMP in ~/devel/gimp/bin

Happy drawing!

Debian testing as a perfect low-latency audio workstation: software and tweaking


2010
01.14

This post is not completed yet!

I’m very well with Ubuntu Studio 9.10, but I’ve tried last Indamixx Transmission OS. I’m pretty disappointed of the incompleteness of the UI and documentation, but the price was fine so I bought it.

Reading on Creating Digital Music I’ve read some comments about Debian testing as perfect for this, so I’m writing this post keep tracking of the software I install on it and the config tweaking to make it a fully functionable Linux Audio Workstation!

First of all the Debian version.

I choose Debian Testing netinstall. The latest daily build can be found here.

I’ve chosen an alternative desktop (LXDE) under advanced options at the cd-rom boot due to the speed of this light DE. English as language and the most used (default) options for the rest.
The partition (all in /) has been formatted in ext4 to increase speed; Install only the laptop metapackage (obviously the desktop environment) and the SSH server too.

Software installed:

Named as package in Debian; obviously you won’t need all of those (like emacs or gnome-do) but this is my list, not yours…

  • jackd
  • qjackctl
  • ardour
  • mixxx
  • patchage
  • vlc
  • jack-rack
  • sooperlooper
  • wine
  • gnome-do
  • epdfviewer
  • lmms
  • emacs23-nox
  • build-essential
  • libncurses5-dev
  • zlib1g-dev
  • kernel-package
  • network-manager

Kernel compilation:

You need to compile a RT kernel so let’s patch it! In this case I use a 2.6.31 vanilla kernel:

  • wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.31.6.tar.bz2
  • wget http://www.kernel.org/pub/linux/kernel/projects/rt/patch-2.6.31.6-rt19.bz2
  • tar xvjf linux-2.6.31.6.tar.bz2
  • cd linux-2.6.31.6/
  • bzcat ../patch-2.6.31.6-rt19.bz2 |patch -p1
  • make clean && make mrproper
  • make menuconfig
    Set the following values:

    • processor type and features -> Preemption mode -> complete preemption
    • processor type and features -> Timer frequency -> 1000Hz
    • Kernel Hacking -> Disable kernel debugging

    And in general disable what you don’t want to use in this kernel (you really need XBOX controller drivers?)

  • make-kpkg clean
  • export CONCURRECY_LEVEL=2
  • time fakeroot make-kpkg –initrd –append-to-version=-rt-20100112 kernel_image kernel_headers (change the date if you want…)
  • Now install all the *.deb packages in the directory

Another (maybe simpler) way to obtain a real time kernel:

  • Add this line to /etc/apt/sources.list:
    deb http://debian.pengutronix.de/debian sid main contrib non-free
  • give a sudo apt-get -q update
  • when error appears give a sudo apt-get -q –allow-unauthenticated install pengutronix-archive-keyring
  • sudo apt-get -q update
  • sudo apt-get install linux-image-2.6-rt-686

That’s it! Now you should have a 2.6.31.2-rt13-1-686 shiny new kernel!

Another (even simpler) way to obtain an updated kernel:

Stole it from the latest Ubuntu Studio!

I did do because I cannot manage my wifi card with the rt kernel included in the fedora repos and seems that the patch give a mess with my Ralink card.

Tweaking:

  • Enabled bash completion (uncomment the entry in /etc/bash.bashrc)
  • Add your local user to the sudo group (Ubuntu like behaviour); as root: adduser youruser sudo
  • Enable real-time support while installing jackd
  • To add a menu entry of an application that does not shows in the menu do that:
    • launch lxshortcuts -o appname.desktop (change appname, obviously)
    • fill all the fields (for example, I use sooperlooper so put “slgui” without quotes in the command field
    • mv appname.desktop /usr/share/applications/
    • Now the applications will show in the “other” menu so you can add it to a panel…
  • This the qjackctl settings to obtain best performances (can be different from yours, feel free to experiment with):
    • Frames/Period: 512
    • Sample Rate: 48000
    • Periods/Buffer: 3

Comparisons:

  • Fully updated Transmission OS (Indamixx): latency 23.2 ms
  • Debian Testing (prepared with this guide): 32 ms
  • For Ubuntu Sudio 9.10 (same jackd settings): 32 ms (as Debian)