Category Archives: Operation Systems

GNOME tools: gnome-common, intltool

$ sudo apt-get install gnome-common
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  autopoint intltool
The following NEW packages will be installed:
  autopoint gnome-common intltool
0 upgraded, 3 newly installed, 0 to remove and 1163 not upgraded.
Need to get 673 kB of archives.
After this operation, 1,127 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install gtk-doc-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  docbook docbook-dsssl docbook-to-man jade libsp1c2 sp
Suggested packages:
  docbook-defguide psgml jadetex docbook-dsssl-doc
The following NEW packages will be installed:
  docbook docbook-dsssl docbook-to-man gtk-doc-tools jade libsp1c2 sp
0 upgraded, 7 newly installed, 0 to remove and 1163 not upgraded.
Need to get 2,895 kB of archives.
After this operation, 13.9 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install yelp
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libyelp0
The following packages will be upgraded:
  libyelp0 yelp
2 upgraded, 0 newly installed, 0 to remove and 1161 not upgraded.
Need to get 179 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install yelp-tools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  itstool
The following NEW packages will be installed:
  itstool yelp-tools
0 upgraded, 2 newly installed, 0 to remove and 1161 not upgraded.
Need to get 35.4 kB of archives.
After this operation, 408 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install gobject-introspection
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libgirepository-1.0-1
The following NEW packages will be installed:
  gobject-introspection
The following packages will be upgraded:
  libgirepository-1.0-1
1 upgraded, 1 newly installed, 0 to remove and 1160 not upgraded.
Need to get 384 kB of archives.
After this operation, 1,162 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

$ sudo apt-get install libxml2-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  gstreamer0.10-plugins-base gstreamer0.10-plugins-base:i386 libcroco3 libcroco3:i386 librsvg2-2 librsvg2-2:i386 librsvg2-common librsvg2-common:i386 libsoup2.4-1 libsoup2.4-1:i386 libxml2 libxml2:i386
  libxslt1.1 libxslt1.1:i386
Suggested packages:
  librsvg2-bin librsvg2-bin:i386
Recommended packages:
  xml-core:i386
The following NEW packages will be installed:
  libxml2-dev
The following packages will be upgraded:
  gstreamer0.10-plugins-base gstreamer0.10-plugins-base:i386 libcroco3 libcroco3:i386 librsvg2-2 librsvg2-2:i386 librsvg2-common librsvg2-common:i386 libsoup2.4-1 libsoup2.4-1:i386 libxml2 libxml2:i386
  libxslt1.1 libxslt1.1:i386
14 upgraded, 1 newly installed, 0 to remove and 1146 not upgraded.
Need to get 5,027 kB of archives.
After this operation, 2,888 kB of additional disk space will be used.
Do you want to continue [Y/n]? y

WD MyBook Live: mediacrawler aus Autostart nehmen

[root@MyBookLive ~]# vi /etc/nas/service_startup/orion
Vorher: enabled
Nachher: disabled

mediacrawler:
[root@MyBookLive ~]# update-rc.d -f orion remove
 Removing any system startup links for /etc/init.d/orion ...
   /etc/rc0.d/K05orion
   /etc/rc2.d/S86orion
   /etc/rc3.d/K05orion
   /etc/rc4.d/K05orion
   /etc/rc6.d/K05orion

twonky:
[root@MyBookLive ~]# update-rc.d -f twonky remove
 Removing any system startup links for /etc/init.d/twonky ...
   /etc/rc0.d/K10twonky
   /etc/rc2.d/S85twonky
   /etc/rc3.d/K10twonky
   /etc/rc4.d/K10twonky
   /etc/rc6.d/K10twonky

itunes:
[root@MyBookLive ~]# update-rc.d -f forked-daapd remove
 Removing any system startup links for /etc/init.d/forked-daapd ...
   /etc/rc0.d/K10forked-daapd
   /etc/rc2.d/S84forked-daapd
   /etc/rc3.d/K10forked-daapd
   /etc/rc4.d/K10forked-daapd
   /etc/rc6.d/K10forked-daapd
# update-rc.d -f orion remove
Removing any system startup links for /etc/init.d/orion ...
   /etc/rc0.d/K05orion
   /etc/rc2.d/S86orion
   /etc/rc3.d/K05orion
   /etc/rc4.d/K05orion
   /etc/rc6.d/K05orion

# /etc/init.d/orion stop

# update-rc.d orion defaults; /etc/init.d/orion start

Ubuntu: install build dependencies

$ sudo apt-get build-dep wireshark-dev
[sudo] password for andreas: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Picking 'wireshark' as source package instead of 'wireshark-dev'
Note, selecting 'libcap-dev' instead of 'libcap2-dev'
The following NEW packages will be installed:
  comerr-dev debhelper dh-apparmor geoip-bin html2text krb5-multidev libasound2-dev libatk1.0-dev libc-ares-dev libcairo-script-interpreter2 libcairo2-dev libcap-dev libdbus-1-dev libexpat1-dev
  libfontconfig1-dev libfreetype6-dev libgcrypt11-dev libgdk-pixbuf2.0-dev libgeoip-dev libglib2.0-dev libgnutls-dev libgnutls-openssl27 libgnutlsxx27 libgpg-error-dev libgssrpc4 libgtk2.0-dev
  libjack-jackd2-dev libkadm5clnt-mit8 libkadm5srv-mit8 libkdb5-6 libkrb5-dev liblua5.1-0-dev libp11-kit-dev libpango1.0-dev libpcap0.8-dev libpcre3-dev libpcrecpp0 libpixman-1-dev libpng12-dev
  libportaudiocpp0 libreadline-dev libreadline6-dev libsmi2-dev libtasn1-3-dev libxcb-render0-dev libxcb-shm0-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxext-dev libxfixes-dev libxft-dev libxi-dev
  libxinerama-dev libxrandr-dev libxrender-dev po-debconf portaudio19-dev python-ply x11proto-composite-dev x11proto-damage-dev x11proto-fixes-dev x11proto-randr-dev x11proto-render-dev x11proto-xext-dev
  x11proto-xinerama-dev xsltproc
The following packages will be upgraded:
  bluez-alsa bluez-alsa:i386 gir1.2-atk-1.0 gir1.2-gdkpixbuf-2.0 glib-networking glib-networking:i386 glib-networking-common glib-networking-services gstreamer0.10-plugins-good gstreamer0.10-plugins-good:i386
  gtk2-engines-pixbuf:i386 libasound2 libasound2:i386 libatk1.0-0 libatk1.0-0:i386 libatk1.0-data libcairo-gobject2 libcairo-gobject2:i386 libcairo2 libcairo2:i386 libcanberra-pulse libcanberra0
  libcanberra0:i386 libcap2 libcap2:i386 libdbus-1-3 libdbus-1-3:i386 libexpat1 libexpat1:i386 libfreetype6 libfreetype6:i386 libgail-common libgail-common:i386 libgail18 libgail18:i386 libgdk-pixbuf2.0-0
  libgdk-pixbuf2.0-0:i386 libgdk-pixbuf2.0-common libgl1-mesa-glx libgl1-mesa-glx:i386 libglapi-mesa libglapi-mesa:i386 libglib2.0-0 libglib2.0-0:i386 libglib2.0-bin libgnutls26 libgnutls26:i386 libgpg-error0
  libgpg-error0:i386 libgtk2.0-0 libgtk2.0-0:i386 libjack-jackd2-0 libjack-jackd2-0:i386 libpcre3 libpcre3:i386 libportaudio2 libreadline6 libvisual-0.4-plugins libvisual-0.4-plugins:i386 libxcb-render0
  libxcb-render0:i386 libxcb-shm0 libxcb-shm0:i386 libxcomposite1 libxcomposite1:i386 libxcursor1 libxcursor1:i386 libxdamage1 libxdamage1:i386 libxext6 libxext6:i386 libxfixes3 libxfixes3:i386 libxi6
  libxi6:i386 libxinerama1 libxinerama1:i386 libxrandr2 libxrandr2:i386 libxrender1 libxrender1:i386
81 upgraded, 67 newly installed, 0 to remove and 1161 not upgraded.
Need to get 34.3 MB of archives.
After this operation, 62.7 MB of additional disk space will be used.
Do you want to continue [Y/n]? y

Inject packets from PCAP-format

tcpreplay / tcprewrite

$ sudo apt-get install tcpreplay
$ tcpreplay -t -L <limit> -i <interface> <file.cap>

Options:
-i string, --intf1=string      Server/primary traffic output interface.
-I string, --intf2=string      Client/secondary traffic output interface.
-L number, --limit=number      Limit the number of packets to send.

-M float , --mbps=float        Replay packets at a given Mbps. Specify a floating point value.
-t,        --topspeed          Replay packets as fast as possible. 
-p number, --pps=number        Replay packets at a given packets/sec.
without -t or -p               Send out packets as in the timestamp of each packet of the PCAP file.

tcpreplay.synfin.net Wiki: tcpreplay
tcpreplay.synfin.net Wiki: tcprewrite
How to capture and replay network traffic on Linux

ostinato

packeth

$ sudo apt-get install packeth
$ sudo packeth
Load -> PCAP

netdude

Netdude 0.5.1 and libnetdude 0.12 released
Edit PCAP files in a GUI.
Netdude Homepage
Netdude Source

mergecap

Merges two or more capture files into one

mergecap [ -a ] [ -v ] -w <outfile> <infile> [<infile> ...]
-a             Causes the frame timestamps to be ignored. 
               When -a is not specified, the contents of the input files are merged
               in chronological order based on each frame's timestamp.
-v             Causes mergecap to print a number of messages while it's working.
-w  <outfile>  Sets the output filename.

capinfos

Prints information about capture files

-a    Displays the start time of the capture.
-e    Displays the end time of the capture.
-c    Displays the number of packets in the capture file.
-u    Displays the capture duration, in seconds.
-S    Display the start and end times as seconds (unixtime)

editcap

Edit and/or translate the format of capture files

-A  <start time>               Saves only the packets whose timestamp is on or after start time. 
-B  <stop time>                Saves only the packets whose timestamp is before stop time.
-t  <time adjustment>          Sets the time adjustment to use on selected packets.
                               The adjustment is specified as [-]seconds[.fractional seconds].
-S  <strict time adjustment>   Time adjust selected packets to insure strict chronological order.
                               The value represents relative seconds specified as [-]seconds[.fractional seconds].
                               If the value is 0 or greater then only packets with a timestamp less than the previous packet will be adjusted.
                               If the value is specified as a negative value, then the timestamp values of all packets will be adjusted
                               to be equal to the timestamp value of the previous packet plus the absolute value of the value

Windows Network Configuration: netsh.exe

netsh>int
netsh interface>ipv4
netsh interface ipv4>show

Folgende Befehle sind verfügbar:

Befehle, die aus dem netsh-Kontext übernommen wurden:
show alias     - Listet alle definierten Aliase auf.
show helper    - Listet alle Hilfsprogramme der höchsten Ebene auf.
show mode      - Zeigt den aktuellen Modus an.

Befehle in diesem Kontext:
show addresses - Zeigt die IP-Adresskonfigurationen an.
show compartments - Zeigt die Depotparameter an.
show config    - Zeigt die IP-Adresse und weitere Informationen an.
show destinationcache - Zeigt Zielcacheeinträge an.
show dnsservers - Zeigt die DNS-Serveradressen an.
show dynamicportrange - Zeigt Konfigurationsparameter für dynamischen
                        Portbereich an.
show global    - Zeigt globale Konfigurationsparameter an.
show icmpstats - Zeigt ICMP-Statistiken an.
show interfaces - Zeigt Schnittstellenparameter an.
show ipaddresses - Zeigt die aktuellen IP-Adressen an.
show ipnettomedia - Zeigt IP-Netz-zu-Medien-Zuordnungen an.
show ipstats   - Zeigt IP-Statistiken an.
show joins     - Zeigt zusammengeführte Multicastgruppen an.
show neighbors - Zeigt Nachbarcacheeinträge an.
show offload   - Zeigt die Abladeinformationenan.
show route     - Zeigt Routetabelleneinträge an.
show subinterfaces - Zeigt die Unterschnittstellenparameter an.
show tcpconnections - Zeigt TCP-Verbindungen an.
show tcpstats  - Zeigt TCP-Statistiken an.
show udpconnections - Zeigt UDP-Verbindungen an.
show udpstats  - Zeigt UDP-Statistiken an.
show winsservers - Zeigt die WINS-Serveradressen an.

netsh interface ipv4>show interfaces

Idx     Met         MTU          State                Name
---  ----------  ----------  ------------  ---------------------------
  1          50  4294967295  connected     Loopback Pseudo-Interface 1
 11          20        1500  connected     LAN-Verbindung
 14           5        1500  disconnected  LAN-Verbindung 2
 15           5        1500  disconnected  LAN-Verbindung 3
 16          20        1500  connected     LAN-Verbindung 4
 18           5        1500  disconnected  LAN-Verbindung 5

netsh interface ipv4>show ipstats
MIB-II IP-Statistik
------------------------------------------------------
Weiterleiten ist                    : Deaktiviert
Standardgültigkeitsdauer            : 128
Eingehend empfangen                 : 17997
Eingehende Headerfehler             : 0
Eingehende Adressenfehler           : 0
Datagramme weitergeleitet           : 0
Eingehend unbekanntes Protokoll     : 0
Eingehend verworfen                 : 61
Eingehend überliefert               : 18722
Ausgehende Anforderungen            : 17919
Routing verworfen                   : 0
Ausgehend verworfen                 : 0
Ausgehend keine Routen              : 8
Reassemblierungszeitlimit           : 60
Reassemblierung erforderlich        : 0
Reassemblierung OK                  : 0
Reassemblierung fehlgeschlagen      : 0
Fragmente OK                        : 0
Fragmente fehlgeschlagen            : 0
Fragmente erstellt                  : 0


netsh interface ipv4>show addresses

Konfiguration der Schnittstelle "LAN-Verbindung 5"
    DHCP aktiviert:                       Nein
    Schnittstellenmetrik:                 5

Konfiguration der Schnittstelle "LAN-Verbindung 4"
    DHCP aktiviert:                       Nein
    IP-Adresse:                           192.168.1.1
    Subnetzpräfix:                        192.168.1.0/24 (Maske 255.255.255.0)
    Schnittstellenmetrik:                 20

Konfiguration der Schnittstelle "LAN-Verbindung 3"
    DHCP aktiviert:                       Nein
    Schnittstellenmetrik:                 5

Konfiguration der Schnittstelle "LAN-Verbindung 2"
    DHCP aktiviert:                       Nein
    Schnittstellenmetrik:                 5

Konfiguration der Schnittstelle "LAN-Verbindung"
    DHCP aktiviert:                       Ja
    IP-Adresse:                           86.85.230.39
    Subnetzpräfix:                        86.85.230.0/24 (Maske 255.255.255.0)
    Standardgateway:                      86.85.230.1
    Gatewaymetrik:                        0
    Schnittstellenmetrik:                 20

Konfiguration der Schnittstelle "Loopback Pseudo-Interface 1"
    DHCP aktiviert:                       Nein
    IP-Adresse:                           127.0.0.1
    Subnetzpräfix:                        127.0.0.0/8 (Maske 255.0.0.0)
    Schnittstellenmetrik:                 50

netsh interface ipv4>

Publickey auf SSH-Target: Login ohne Passwort

Anleitung

user@notebook $ ssh-keygen -t rsa
user@notebook $ cat .ssh/id_rsa.pub | \
                ssh user@server 'cat >> .ssh/authorized_keys'

Now without password
user@notebook $ ssh user@server
user@server $

Diverses

Ursache:

root@target:~ /etc/rc.d/S16openssh stop
root@target:~ /usr/sbin/sshd -d
[...]
Connection from 192.168.1.1 port 59187
[...]
debug1: trying public key file /home/.ssh/authorized_keys
Authentication refused: bad ownership or modes for directory /home

Lösung:
Im beiliegenden Script ändert sich in der Benutzerverwaltung der Benutzer “root”:
Home-Verzeichnis: /root
Shell: /bin/bash

andreas@host:~ ssh-keygen -t rsa
andreas@host:~ ssh-keygen -t dsa
andreas@host:~ ssh-copy-id -i ~/.ssh/id_rsa.pub root@target
andreas@host:~ ssh-copy-id -i ~/.ssh/id_dsa.pub root@target

Kopiert die zwei Publickeys aufs Target ins ~/.ssh/authorized_keys

Da das Verzeichnis /root die Berechtigung “drwx——” hat (nur User-Berechtigt), erlaubt OpenSSH nun über ein Publickey einzuloggen.

Wenn es noch nicht funktioniert, geh über die Serial-Console, stoppe den OpenSSH-Server und starte ihn im Debug-Modus:

root@target:~ /etc/rc.d/S16openssh stop
root@target:~ /usr/sbin/sshd -d

Das gleiche Spiel auf Client-Seite (mit Verbose-Flag!!):

andreas@host:~ ssh -v root@target

SSH ohne Passwort — Kurze Anleitung zur Nutzung
SSH login without password
SSH Without a Password
SSH/OpenSSH/Keys

Doxygen

Installation

$ sudo apt-get install doxygen doxygen-gui doxygen-doc graphviz

Ubuntu User Wiki: Doxygen

Konfiguration

MACRO_EXPANSION        = YES
EXPAND_ONLY_PREDEF     = NO

Dokumentation

Hauptseite

/** @mainpage XCTL 
 *  
 *  @section sec1 Einleitung 
 *  Hier folgt eine kurze Einleitung... 
 * 
 *  @section sec2 Subsysteme 
 *  @subsection sec2_1 Motorsteuerung 
 *  @subsection sec2_2 Ablaufsteuerung  
 */

Klassen

/** Klasse realisiert Beispiel2.  
 *   
 *  @author David Damm  
 *  @date 2.7.2004 
 * 
 *  @version 0.2 
 *  Toten Code entfernt. 
 * 
 *  @version 0.1 
 *  Kommentare hinzugefügt (Doxygen). 
 */
class Beispiel2
{
} 

Funktionen

/** Klasse realisiert Beispiel3.  
 *  
 *  @author David Damm 
 *  @date 2.7.2004 
 */
class Beispiel3
{
  public:
  /** Addiert zwei ganze Zahlen.  
   *  @param[in] a Die erste Zahl. 
   *  @param[in] b Die zweite Zahl.  
   *  @return Die Summe der beiden Zahlen a und b.  
   *  @see Addiere(double,double)  
   */
  int Addiere(int a, int b);
  double Addiere(double a, double b);
}

Strukturen

/**
 * @brief Use brief, otherwise the index won't have a brief explanation.
 *
 * Detailed explanation.
 */
typedef struct BoxStruct_struct {
  int a;    /**< Some documentation for the member BoxStruct#a. */
  int b;    /**< Some documentation for the member BoxStruct#b. */
  double c; /**< Etc. */
} BoxStruct;

oder

/**
 * @struct BoxStruct_struct
 * @brief  brief explanation
 *
 * @var    BoxStruct_struct::a
 * @brief  Some documentation for the member
 */

Links

Doxygen
David Damm: Dokumentationswerkzeug Doxygen
Doxygen usage example (for C)
Document the code with Doxygen