Jack Hacks

Show All

  • 2010
    • January
      • Useful exim commands
        01/22/10
        Here are some helpful hints on exim administration. All of the commands are formated for debian (exim4) but are also tested on centos (exim).

        List message count in message queue:
        # exim4 -bpc

        List all messages in the queue, sorted by date:
        # exim4 -bp

        Print

  • 2007
    • March
      • List user open sockets on cPanel server
        03/17/07
        As simple as this:


        lsof -n -u^65534,^`cat /etc/passwd | awk -F':' '{if($3 < 32000) print $3}' | xargs | sed -e 's/ /,\^/g'` -i | awk '{if ($2 ~ /[0-9]*/) print $3, $1}' | sort | uniq -c | sort -n


        The awk part is for excludi

    • February
      • How to extract SYN packets with tcpdump
        02/21/07
        tcpdump

        # tcpdump -ne dst port 80 and 'tcp[13] & 2 == 2'

        This way effectively filtering only SYN packets on port 80.


        # tcpdump -c 30000 -ne dst port 80 and 'tcp[13] & 2 == 2' | awk '{print $11}' | cut -d. -f1|sort | uniq -c

      • WPA for Ubuntu
        02/18/07
        It is a bit tricky (took me almost two days :), but basically this is the procedure:

        - configure your wireless card
        (using ndiswrapper is described in another article)
        in case your wifi card is identified as wlan0 add the following to /etc/network/interfaces

        auto wlan

      • Make BASH update your terminal window title after logon
        02/18/07
        ~/.bash_profile

        This code would do the trick:


        if [ "$TERM" = "xterm" ] ; then
        export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME}\007"'
        else
        unset PROMPT_COMMAND
        fi


        After logon th

      • FreeBSD rc.firewall fix for blacklisted ip support
        02/18/07
        /etc/rc.firewall

        Add this code at the end of the set_loopback function:


        if [ -f "${banned_ips}" ]; then
        for i in `cat ${banned_ips} | grep -vE "^#"`; do
        echo ${fwcmd} add deny ip from ${i} to me