sokai.name Potsdam bloggt (wieder)

Ubuntu: Downgrade vom „proposed“-Repo

21. Oktober 2011

Schon seit einer Weile habe ich unter Ubuntu auf meinem EeePC das „proposed“-Repository installiert. Doch gerade nach meinem Upgrade zu Oneiric habe ich einige merkwürdige Erscheinungen, als deren Ursache ich eben dieses Repo in Verdacht habe. (Außerdem ist das „proposed“-Repo für ein Produktivsystem – auf dem also im Alltag alles funktionieren soll – wohl eh nicht gut)

Nun wollte ich einfach das „proposed“-Repo deaktivieren und mein System sozusagen (wieder auf den Standard) „deaktualisieren“. Aber irgendwie funktioniert das nicht so einfach…

Nach einigem Suchen habe ich dann einen funktionierenden Weg bei „Ask Ubuntu“ gefunden, den ich hier mal (auch für mich zum Merken) verlinke: „How can I revert back from an upgrade to the Proposed repository?“.

Noch ein kleiner Hinweis zu obigem Vorgehen: Bevor ihr die beiden Skripte durchlaufen lasst, deaktiviert das „proposed“-Repo nicht. Erst nachdem ihr euer System deaktualisiert habt, könnt ihr bspw. über die Software-Paketquellen-Verwaltung auf dem Reiter „Aktualisierungen“ den Haken beim Repo weg machen.

Viel Glück! :)

Pidgin-Klänge knacken

11. April 2011

Wer (unter GNOME & Ubuntu Maverick) auch das Problem hat, dass beim Instant Messenger Pidgin (2.7.11) die Klänge – wenn sich Buddies an- oder abmelden etc. – so komisch knarzen/knacken, dem sei der Tipp empfohlen, die (Ausgabe-)Methode der Klänge von „Automatisch“ (die Default Einstellung) auf PulseAudio umzustellen.

Und so gehts:

  1. Pidgin → Werkzeuge → Einstellungen (oder [Strg + P])
  2. Reiter „Klänge“ auswählen
  3. bei der Option „Methode“ steht wahrscheinlich „Automatisch“ – hier ist jetzt „Kommando“ auszuwählen
  4. und nun (ganz oben) Folgendes bei „Klang-Abspielbefehl (%s für den Dateinamen)“ hinein schreiben: paplay %s
  5. auf „Schließen“ klicken *fertig*

Dank für die Lösung – dieser schon eine Weile recht nervigen Problematik – geht an burli und seinen Post im ubuntuusers.de-Forum!

Copy: My variation of Git branch in bash prompt

1. April 2011

The followig post is not written by myself. It’s a copy! – Today I found the article in the Google Cache and thought there are more people (than me) interested in the archived text that was originally published at a blog named M-x Kelsin.
Let’s start:

After reading another cool blog post about putting your current git branch in your bash prompt I decided I needed to try this out. Once I got it working I added in color coding to see the status of the current checkout as well!

First off, you need bash-completion and git installed on your server (bash-completion and git-core on Debian/Ubuntu). Once installed you can enable bash completion in the system wide bash file (/etc/bash.bashrc) or in your own ~/.bashrc by adding these lines (Clearly if you are not on Debian/Ubuntu double check file paths):

# Completion
if [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
fi

Once this is all set you should have a function called git_ps1 available. Try it out by just running „git_ps1″ on your command line from a git repo. You should get the branch name returned inside parenthesis’s.

Now comes my variations on how to include this in your prompt. My entire ~/.bash_prompt file can be found on my git repo. I source this file into my ~/.bashrc. The two most interesting parts are the function that determines the color of the branch based on git-status output and the function that gets the branch name. Branch name is pretty simple. We check that the __git_ps1 function is available and if it is, check that we‘re in a branch using it. If we are we echo the branch name. Pretty clean.

prompt_git_branch() {
    if type -p __git_ps1; then
        branch=$(__git_ps1 '%s')
        if [ -n "$branch" ]; then
            echo -e "$branch"
        fi
    fi
}

The next function has to grep stuff out of git status to determine what state the repo is in. If we are completely up to date we use green. If I have local changes it’s blue. If we have files in our index ready to be committed I use red. This is really great with my home directory cause it helps remind me to add new dotfiles that I don’t care about to .gitignore (or commit them if they should be public config files).

prompt_git_branch_color() {
    if type -p __git_ps1; then
        branch=$(__git_ps1 '%s')
        if [ -n "$branch" ]; then
            status=$(git status 2> /dev/null)

            if $(echo $status | grep 'added to commit' &> /dev/null); then
                # If we have modified files but no index (blue)
                echo -e "\033[1;34m"
            else
                if $(echo $status | grep 'to be committed' &> /dev/null); then
                    # If we have files in index (red)
                    echo -e "\033[1;31m"
                else
                    # If we are completely clean (green)
                    echo -e "\033[1;32m"
                fi
            fi
        fi
    fi
}

It took some playing but I finally found the right final line to correctly tell bash which characters in the prompt are visible. If anyone has a good way of making these functions smaller or faster I‘d love to hear it. I had some trouble making sure that the functions were always executed (not just on a new shell’s creation, but on every display of PS1). The speed is FINE on all of my computers but more speed never hurts.

radioeins: Trailer-Download

25. März 2011

Schon seit einer Weile laufen auf radioeins sehr amüsante Trailer für das „Hörspielkino unterm Sternenhimmel“ – einer großartigen und sehr zu empfehlenden Veranstaltung der anderen Art –, die auch online anhörbar sind.

Nun fand ich letztens den Hörspielkino-Trailer „Bud Spencer und Terence Hill“ so nett, dass ich ihn mir gerne – für das private Archiv – herunterladen wollte. Doof daran war, dass die MP3 in dem Flash-Player „JW Player“ eingepackt ist und somit nicht einfach über einen Rechtsklick herunterladbar ist.

Auf der Suche nach einer Lösung bin ich dann über RTMPDump gestolpert und konnte die MP3 nach der Installation unter Ubuntu mittels

$ sudo aptitude install rtmpdump

mit dem Aufruf

$ rtmpdump -r rtmp://stream5.rbb-online.de/rad -o radio1-trailer.mp3 -y mp3:_programm/8/201103_hsk_bud

in den aktuellen Ordner streamen/herunterladen. :) (Die URL für den -r Parameter findet man im Quelltext der Seite, auf der der JW Player eingebunden ist…)

Etwas später bin ich dann – wohl durch Zufall – auch noch über den Direktlink zu der MP3-Datei gestolpert: http://download.radioeins.de/mp3/_programm/8/201103_hsk_bud.mp3 *naja*

Musikvideo: Adobe Flash Player (Version 9 oder höher) wird benötigt um dieses Musikvideo abzuspielen. Die aktuellste Version steht hier zum herunterladen bereit. Außerdem muss JavaScript in Ihrem Browser aktiviert sein.

…das mal so kurz am Rande… ;)