Donnerstag, 15. November 2012

Install nmap 6.0.1 on Debian


apt-get install build-essential checkinstall

wget http://nmap.org/dist/nmap-6.01.tar.bz2

bzip2 -cd nmap-6.01.tar.bz2 | tar xvf -

cd nmap-6.01

./configure

make

checkinstall

dpkg -i nmap_6.01-1_i386.deb

Donnerstag, 18. Oktober 2012

VirtualBox: Debian Linux display resolution 1920x1080


$ gtf 1920 1080 60

# 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync

$ xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync

$ xrandr --addmode VBOX0 "1920x1080_60.00"

Then open Display settings and select the previously added mode!



-----

permanent:

~/.xprofile:


xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
 xrandr --addmode VBOX0 "1920x1080_60.00"
 xrandr --output VBOX0 "1920x1080_60.00"


-------

on lubuntu:

xrandr --newmode "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync
 xrandr --addmode Virtual1 "1920x1080_60.00"


xrandr --output Virtual1 --mode "1920x1080_60.00"

but had to install packages "xfonts xfonts-100dpi xfonts-75dpi xfonts-scaleable" first


Sonntag, 20. Mai 2012

list users

awk -F":" '{ print "username: " $1 "\t\tuid:" $3 }' /etc/passwd

Mittwoch, 4. Januar 2012

dont log apache mod_status requests

Wenn M/Monit konfiguriert wurde Apache zu überwachen, setzt es in regelmäßigen Abständen Anfragen ab.

127.0.0.1 - - [04/Jan/2012:12:40:02 +0100] "GET /server-status?auto HTTP/1.1" 200 609 "-" "libwww-perl/5.836"

Diese Anfragen blähen die logfiles extrem auf - was nervig seien kann, wenn man die logs mal manuell durchsehen möchte. Man kann Apache beibringen diese Anfragen nicht zu loggen.

In /etc/apache2/mods-enabled/status.conf setzt man eine Umgebungsvariable, dontlog.

<Location /server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1 ::1
   
SetEnv dontlog
</Location>
Dann sucht man die CustomLog Anweisung in der Apache-Konfig und ändert (zb in "sites-available/default" ) die Zeile so ab, dass nur geloggt wird, wenn dontlog nicht gesetzt ist.

CustomLog ${APACHE_LOG_DIR}/access.log combined env=!dontlog


Nurnoch Apache neustarten und dann werden die Anfragen auf /server-status nicht mehr geloggt.

Links:
SetEnv
mod_status
CustomLog Directive

find in *.gz

zgrep

compressed logfiles

logrotate (<- needed)
rsyslog (optional)

uncomment "#compress" in /etc/logrotate.conf

run to test it: logrotate /etc/logrotate.conf -f

optional define olddir in logrotate.conf
eg: olddir /var/log/old
or define it per file.. its up to you.

check if any files missed and create commands in /etc/logrotate.d/ for them..