Going cycling for a long ride

A while back I’ve shared my list for getting ready to cycle long-distance on the Facebook group called Solitary Cycling. The comments were a mixed bag. From people who enjoyed my list and thanked me, to people who had no idea what long-distance cycling meant and thought I should “just ride” and improvise if something …

Video games and learning new words

Just saw a great video from Pr. James Paul Gee from Arizona State University.

When learning new words we need to have an image, an action, something tangible to associate to that new word. If you have nothing but a synonym or a definition or even a translation, you don’t really grasp the meaning of that new word.

In order to understand this, go to a video game shop and buy a brand new video game. Go home and start reading the manual. See if it teaches you to play the game… You will most likely not understand anything this is about. It will like a sequence of unrelated words with no meaning whatsoever.

Then start playing the game for some time.

Take the manual again and start reading. You should be able to understand everything it says. That’s because you can now easily associate the words on the manual with the actions you’ve just been performing.

how to automatically blacklist unsubscribed emails on interspire email marketer

Simply create a trigger which will insert unsubscribed users in the blacklist after every update on the subscriber table.

FOR EACH ROW INSERT IGNORE INTO ya_banned_emails 
(emailaddress, list, bandate)
SELECT emailaddress, ‘g’, UNIX_TIMESTAMP( ) 
FROM iem_list_subscribers
WHERE unsubscribed != ‘0’;

How to make a script sleep for a random amount of seconds

If you want to insert a sleep in a script for a random number of seconds, you can do the following:

        NUMBER=$[ ( $RANDOM % 60 )  + 1 ]
        sleep $NUMBER

Replace 60 with the interval chosen and you will get a random sleep between 1 and 60 seconds.

This can be useful if you are trying to fetch data from a server who’s monitoring the number of connections you are opening and tends to blacklist you if you do too much.

How to crash a linux server

Easy!

You need to execute this as root.

First enable SysRq feature in the kernel
echo “1” > /proc/sys/kernel/sysrq

Then crash the kernel (makes a kernel dump)
echo c > /proc/sysrq-trigger

Reboot with no conditions (no disk unmount, just like pressing reset button)
echo b > /proc/sysrq-trigger

Shutdown all the processes gracefully except init
echo e > /proc/sysrq-trigger

Kill all the process brutally except init
echo i > /proc/sysrq-trigger