Freitag, 9. Januar 2009

# & Leerzeilen rausfiltern mit grep

Wenn man z.B. Konfigdateien anzeigen lassen will
aber nicht mit den Leerzeilen könnte man das so lösen.

grep -v "#" /usr/local/nagios/etc/nagios.cfg | grep -v "^$"

So werden Kommentarzeilen und Leerzeilen rausgefiltert.

Freitag, 31. Oktober 2008

Versionsinfo abschalten apache & php

/etc/apache2/apache2.conf


# ScriptAlias /cgi-bin/ "/usr/local/apache2/cgi-bin/"
LogLevel notice


Options -FollowSymLinks -Includes -Indexes -MultiViews
#
#
#



/etc/apache2/sites-available/default
# ErrorLog
# CustomLog


/etc/apache2/conf.d/security


ServerTokens Prod
ServerSignature Off
TraceEnable Off



/usr/include/apache2/ap_release.h
#define AP_SERVER_BASEVENDOR "Restricted server"
#define AP_SERVER_BASEPRODUCT "Secure Web Server"




---------


httpd.conf

ServerTokens Prod
ServerSignature Off



php.ini


expose_php = Off
display_errors=Off
register_globals = Off


bei SuSE mit apache v2.xx und php5


/etc/php5/apache2/php.ini

expose_php = Off
display_errors=Off
register_globals = Off



/etc/sysconfig/apache2

APACHE_SERVERTOKENS="Prod"
APACHE_SERVERSIGNATURE="off"

Montag, 1. September 2008

Leerzeilen entfehrenen mit grep

grep -v "^$" /path/to/file

z.B. grep -v "#" /usr/local/nagios/etc/nagios.cfg | grep -v "^$"

Freitag, 27. Juni 2008

Dateien in jpg-Bildern verstecken

cat bild1.jpg archiv.rar > bild2.jpg

# file bild2.jpg
bild2.jpg: JPEG image data, JFIF standard 1.01

# unrar e bild2.jpg

Extracting from bild2.jpg

Mittwoch, 13. Februar 2008

CFG Files ohne # Ausgeben

grep -v "#" /path/file

z.B. grep -v "#" /etc/nagios/nagios.cfg

Dienstag, 5. Februar 2008

Verzeichnisschutz Apache

Alle verzeichnisse ab /html/ nicht mehr Indexieren


Options -Indexes



Indexierung in diesem einem Verz. /info zulassen


Options +Indexes

Montag, 3. Dezember 2007

Teaming / bonding

Beispiel unter Fedora Core Linux

Doku:

/usr/share/doc/kernel-doc-x.x.x/Documentation/networking/bonding.txt


/etc//modprobe.conf


alias bond0 bonding
alias eth0 pcnet32
alias eth1 pcnet32
options bond0 mode=0 miimon=100 use_carrier=1



/etc/sysconfig/network-scripts/ifcfg-bond0

DEVICE=bond0
IPADDR=172.16.132.135
NETMASK=255.255.255.0
GATEWAY=172.16.132.254
USERCTL=no
BOOTPROTO=none
ONBOOT=yes


/etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:C5:30:A5
MASTER=bond0
SLAVE=yes
ONBOOT=yes


/etc/sysconfig/network-scripts/ifcfg-eth1

DEVICE=eth1
BOOTPROTO=static
MASTER=bond0
SLAVE=yes
ONBOOT=yes