Notes on Debian (GNU/Linux)

2015-09-09 - ifdown and ifup

On my Debian Wheezy system I can disable and enable a network connection like so:

# ifdown eth0
# ifup eth0

2014-03-29 - Optical Character Recognition

I am just looking for OCR software in the Debian repository. Here I want to take notes what I will find...

2014-03-22 - Copy Music CD on Wheezy

This packages need to be installed:

      # aptitude install lshw
      # aptitude install cdrdao
Please apologise for the packages that should be installed as well! Get the name of your cd burner.
      # lshw -C disk
      description: DVD-RAM writer
      product: iHES208   2
      vendor: ATAPI
      physical id: 0.1.0
      bus info: scsi@6:0.1.0
      logical name: /dev/cdrom
      logical name: /dev/cdrw
      logical name: /dev/dvd
      logical name: /dev/dvdrw
      logical name: /dev/sr0
      version: 8L0C
      capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram
      configuration: ansiversion=5 status=nodisc
Now, first read cd and then write it.
      $ cdrdao read-cd --device /dev/sr0 --paranoia-mode 3 /tmp/my_cd
      $ cdrdao write --device /dev/sr0 --driver generic-mmc-raw --speed 8 /tmp/my_cd

2014-03-22 - Installing icaclient_13 on Wheezy

As mentioned on (see sources) one needs to install packages listed below.

	% aptitude install libxp6:i386
	% aptitude install libsm6:i386
	% aptitude install libxmu6:i386
	% aptitude install libxinerama1:i386
	% aptitude install libglib2.0-0:i386
	% aptitude install libxft2:i386
	% aptitude install libgtk2.0-0:i386
I am not sure if one has to perform some other tasks on that page like
	% dpkg --add-architecture i386
	% dpkg --print-architecture
	% dpkg --print-foreign-architectures
	deb [arch=amd64,i386]
in /etc/apt/sources.list. (see sources) shows how to get rid of the nspluginwrapper dependency.

	cd ~/Downloads
	mkdir ica_temp
	dpkg-deb -x icaclient_13.0.0_amd64.deb ica_temp
	dpkg-deb --control icaclient_13.0.0_amd64.deb ica_temp/DEBIAN
	sudo emacs ica_temp/DEBIAN/control
And get rid of nspluginwrapper in the section Depends.
	Depends: ...nspluginwrapper...
Rebuild the package.
	dpkg -b ica_temp icaclient-modified.deb
Install this modified package.
	sudo dpkg -i icaclient-modified.deb

As last mission I had to export ThawtePremiumServerCA.crt into folder /opt/Citrix/ICAClient/keystore/cacerts as PEM file. It's quite possible that not everyone would have to do this last thing. Update: It turned out that the above mentioned is not needed.

One way to launch a session is like so: /opt/Citrix/ICAClient/ launch.ica. Update: Launching like this lead to an error message SSL error, Contact your helpdesk with the following information: A network error occorred (SSL error 4). Lauching the application (Citrix remote desktop connection, Citrix Receiver) from within iceweasel by applying Open with did not bring an SSL error.


2014-01-06 - Using a Beamer with Debian

This note is to show how I managed to find out how to toggle output to beamer on my Debian Sid on and off.

First I plugged in the VGA cable and switched on the laptop. All went automatically well: The resolution was resized and the same screen was displayed on LCD as well as on beamer. This way I found out what resolution will work (see next listing).

	$ xrandr
	Screen 0: minimum 320 x 200, current 1024 x 768, maximum 1400 x 1400
	VGA-0 connected 1024x768+0+0 (normal left inverted right x axis y axis) 0mm x 0mm
	1360x768       59.8
	LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 287mm x 215mm
	1400x1050      60.0 +   50.0  

Now I knew that things could work using ,,1024x768'' as a resolution for VGA-0 and LVDS (which actually did work). I guessed so because I read ,,VGA-0 connected 1024x768+0+0...'' and ,,LVDS connected 1024x768+0+0...'' as output of the command ,,xrandr''.

So next I could switch VGA-0 on and off doing the following thing: Switching it on by typing

	$ xrandr -s 1024x768
	$ xrandr --output VGA-0 --mode 1024x768

Switching it off by typing

	xrandr --output VGA-0 --off

Switching it back on again by typing

	xrandr --output VGA-0 --mode 1024x768

1978-10-27 - Git

List local branches

    $ git branch -a
List remote branches
    $ git branch -r
git remote and git ls-remote are also useful to list information about remote branches. The former displays plenty of information about the remote in general and how it relates to your own repository, while the latter simply lists all references to branches and tags that it knows about (Source:

1978-10-27 - Change Filename

$ touch KPS-20100331-hallo.txt
    $ touch KPS-20100331-wie.txt
    $ touch KPS-20100331-gehts.txt
    $ for f in *20100331*
    > do echo cp $f $(echo $f | sed 's/20100331/20110331/')
    > done
    cp KPS-20100331-gehts.txt KPS-20110331-gehts.txt
    cp KPS-20100331-hallo.txt KPS-20110331-hallo.txt
    cp KPS-20100331-wie.txt KPS-20110331-wie.txt

Spaltenweise Anzeige einer Datei

$ echo "123.456.789" > datei
    $ cut -d. -f1
    $ echo "123;456;789" > datei
    $ cut -d\; -f2 datei

1978-10-27 - iptables

As far as I know one can 'iptables' is the GNU/Linux firewall.


1978-10-27 - Hhhhmmm

Das untenstehende Beispiel habe ich noch nicht ganz gecheckt!

$ touch datei
      $ for s in Hallo wie geht es dir
      > do echo $s >> datei
      > done
      $ bzip2 datei
      $ bunzip2 < datei.bz2 | awk '{print $1}'

1978-10-27 - ToLowerCase using awk

Im Beispiel unten werden alle Grossbuchstaben der Ordner-Namen in Kleinbuchstaben geƤndert.

      for d in IB-API OMS OMS-FIXML OMS-OnlineTest; \ 
      do s=`echo $d | awk '{print tolower($0)}'`; mv $d $s; done
oder in mehreren Zeilen geschrieben:
      for d in IB-API OMS OMS-FIXML OMS-OnlineTest
      > do s=`echo $d | awk '{print tolower($0)}'`
      > mv $d $s
      > done


1978-10-27 - Strip Directory

    $ touch eine-Datei
    $ pwd /home/shb7/Desktop/bin-bash
    $ basename /home/shb7/Desktop/bin-bash/eine-Datei eine-Datei

1978-10-27 - Strip Suffix

    $ touch eine-Datei
    $ basename eine-Datei -Datei eine