The Twat-O-Tron device driver for Solaris 10 and Linux

/dev/twat-o-tron
The "Have Your Say" comment generator ported to the Solaris kernel.

Every once in a while comes an idea so appallingly bad that it just has to be done and here it is;  The Twat-O-Tron ported to the Solaris kernel.  An idea so bad it could only have come from a real HYS poster.

We've all seen HYS.  A place where the moronic, uninformed racists amongst us can vent spleen and subject us to bad spelling, worse grammar and some of the most fucked up rhetoric ever seen.
Along came spEak You're bRanes , who describe HYS far more eloquently than I ever could and provided the excellent Twat-O-Tron, proving that the average HYS poster can be easily replaced by a small piece of Javascript.  I was doing some Solaris kernel work, I'd had a few drinks and the two just went together.




Build:

I built on an Ultra 5 running Solaris 10 and SunStudio 12.  I have no idea if it will work with any other setup and I don't particularly care but I would like to know if will build on x64 Solaris without modification.  The Makefile will have to be changed and installation paths will be different for the obvious reason.

gunzip < twatotron-0.2.tar.gz | tar xvf -
cd twatotron
make

should the job unless you have a dodgy environment.



Install:

Install into /tmp and symlink into the kernel ferfuxache.  You don't want to get into an infinite panic do you?

su root
cp twatotron.conf /usr/kernel/drv
cp twatotron /tmp
ln -s /tmp/twatotron /usr/kernel/drv/sparcv9/twatotron
add_drv twatotron



Running:

root@twatbox:/# cat < /devices/pseudo/twatotron\@0\:twatotron
FIRST THINGS FIRST! I HEARD THIS WEEK THAT THE EU WILL SOON B EBENDNIG OVER
BACKWARDS FOR THE ETHNI MINORITIES IN A WHITEOCNUTRY BECAUSE OF OGRDON BROWN! ALL
TRUE BRITS SHOUDL ELETC BORIS JOHSNNO SA PIME MNIISTER! 

Totally Disgruntled, Shropshire
root@twatbox:/#



Removing:

You're going to need this bit.

rem_drv twatotron
rm -f /usr/kernel/drv/sparcv9/twatotron
rm -f /usr/kernel/drv/twatotron.conf
rm -f /tmp/twatotron


Linux:

For the record, writing this for Linux was much easier than writing it for Solaris.

Unpacking:

twatbox:~/projects$ gunzip < twatotron-linux-0.2.tar.gz | tar xvf -

./twat/

./twat/twat-main.c

./twat/Makefile

./twat/turdspurt.h

./twat/turdspurt.c

twatbox:~/projects$ cd twat

twatbox:~/projects/twat$


Building:

twatbox:~/projects/twat$ make

make -C /lib/modules/4.2.0-16-generic/build M=/home/twat/projects/twat modules

make[1]: Entering directory '/usr/src/linux-headers-4.2.0-16-generic'

  CC [M]  /home/twat/projects/twat/twat-main.o

  CC [M]  /home/twat/projects/twat/turdspurt.o

  LD [M]  /home/twat/projects/twat/twat.o

  Building modules, stage 2.

  MODPOST 1 modules

  CC      /home/twat/projects/twat/twat.mod.o

  LD [M]  /home/twat/projects/twat/twat.ko

make[1]: Leaving directory '/usr/src/linux-headers-4.2.0-16-generic'

twatbox:~/projects/twat$


Loading:

twatbox:~/projects/twat$ sudo insmod ./twat.ko

twatbox:~/projects/twat$ 


Check dmesg:

twatbox:~/projects/twat$ dmesg | tail -1

[11711.572235] /dev/twat: fire up the twatotron


Running:

twatbox:~/projects/twat$ cat /dev/twat

its simple everyone knows we are being brainwashed into dumbing us down whenwill

cameron send them to syria :)


English and Proud, Uk, United Kingdom

twatbox:~/projects/twat$


Check dmesg for debugging info:

twatbox:~/projects/twat$ dmesg | tail 

[11711.572235] /dev/twat: fire up the twatotron

[11830.123810] /dev/twat: generating unholy turdspurt...

[11830.123863] /dev/twat: moronicise:  remove commas and apostrophes

[11830.123872] /dev/twat: moronicise:  lowercase

[11830.123878] /dev/twat: moronicise:  drop punctuation

[11830.123892] /dev/twat: moronicise:  dropping 1 of 111 letters

[11830.124546] /dev/twat: EOT

twatbox:~/projects/twat$ 


Unloading:

twatbox:~/projects/twat$ sudo rmmod twat

twatbox:~/projects/twat$ 


Confirm unload in dmesg:

twatbox:~/projects/twat$ dmesg | tail

[12269.418603] /dev/twat: moronicise:  drop punctuation

[12269.418611] /dev/twat: MORONICISE:  SHOUTING!

[12269.418622] /dev/twat: moronicise:  dropping 1 of 118 letters

[12269.418735] /dev/twat: EOT

[12270.009420] /dev/twat: generating unholy turdspurt...

[12270.009474] /dev/twat: moronicise:  change periods to exclaimation marks

[12270.009482] /dev/twat: moronicise:  lowercase

[12270.009496] /dev/twat: moronicise:  dropping 4 of 133 letters

[12270.009718] /dev/twat: EOT

[12275.249936] /dev/twat: exit the twatotron







FAQ:

Q:  That's some damn flaky code, were you pissed when you wrote it or something?
A:  Yep, sure is and sure was. You don't get ideas like this from being sober.

Q:  So how about fixing it then?
A:  Fuck you funny boy, if you care about it so much then fix it yourself.

Q:  This code just crashed my production server.
A:  And you were expecting what exactly?

Q:  Just how unstable is this?
A:  My rigourous unit testing procedure involves leaving it running while I go to the off license.  If it hasn't panicked by the time I get back then I consider it stable.

Q:  I can't get this to run on Ubuntu.
A:  Of course it won't, silly boy.  It won't work on AIX, Irix, MS-DOS or VMS either.  It probably won't work on Solaris 8.  It only just works on Solaris 10.  

Now, seven years later, I've finally ported to Linux.  Same as applies to Solaris, don't blame me if this crashes your production server.



Thanks to:

veghead for /dev/bollocks
Chris and Ed for writing the unholy turdspurt in the first place
unlikely_name from ifyoulikeitsomuchwhydontyougolivethere for hosting it
The UK and RoI TV networks.  If you didn't constantly show unwatchable shite I would never get round to doing this stuff.





Coming Soon:

sys/twat-o-tron
The Twat-O-Tron as a Solaris syscall.  Arriving probably never.  I no longer have a Solaris box.


Finally the twat-o-tron for Linux is here.  Tarball below.





comments and suggestions are welcome but will probably be ignored.  I've changed a few lines of turdspurt to try and bring it up to date but got bored very quickly.  If anyone fancies doing it properly, mail the results to the address on this page and I'll update the tarballs and credit you.



ċ
grauniad-linux-0.1.tar.gz
(8k)
Dev Twat,
Nov 11, 2015, 2:28 AM
ċ
twatotron-0.2.tar.gz
(48k)
Dev Twat,
Jun 16, 2008, 9:57 AM
ċ
twatotron-linux-0.2.tar.gz
(8k)
Dev Twat,
Oct 30, 2015, 1:46 PM
Comments