OT: Scripting humour

anthony baldwin anthony.baldwin01 at comcast.net
Sun Jan 6 19:12:31 UTC 2008


James Black wrote:
> anthony baldwin wrote:
>   
>> After using Linux for 8 years, I am finally getting around to learning 
>> some shell scripting.
>>
>> I created the follow script and installed it on my wife's computer to 
>> run from
>> /usr/local/bin/found and put a warning icon on her desktop pointing to 
>> the script.
>> (she has dual-boot w/XP so she can play Sims2 and stuff, also, I 
>> configged xscreensaver for BSOD.
>> She will have no clue what the output of lsof means):
>>
>> #!/bin/bash
>>
>> # just playing around...trying to learn scripting.
>> # author: Tony Baldwin, LinguasOS.org
>>
>> export DISPLAY=:0.0
>> zenity --warning --title WARNING! --text "MicroSOFT Windows has been 
>> found.  Would you like to remove it?"
>>
>> zenity --warning --title WARNING! --text "MicroSOFT Windows has been 
>> found on this machine. Windows is likely to harm your computer, crash, 
>> get viruses, and be easily vulnerable to malware, spyware and other 
>> intrusions.  It is recommended that you remove it.  Would you like to 
>> remove it now?"
>>
>> zenity --title='You better do something!' --list --checklist --column 
>> "Select" --column "Which is it" TRUE 'Remove Windows now!' FALSE 'No.  
>> Do not remove Windows'
>>
>> zenity --question --title='What?!' --text 'Are you serious?'
>>
>> zenity --title='MAKE UP YOUR MIND!' --list --checklist --column "Select" 
>> --column "Which is it" TRUE 'Remove Windows now!' FALSE 'Please do not 
>> remove Windows.'
>>
>> sudo lsof | zenity --text-info --title "These files will now be deleted" 
>> --width 600
>>
>> locate so | tee >(zenity --title "Destroying files!" --width 400 
>> --progress --pulsate)
>>
>> locate li | tee >(zenity --title "Reformatting drive!" --width 400 
>> --progress --pulsate)
>>
>> xscreensaver
>>
>> zenity --warning --title "ERROR!" --text "Hard drive contains no data! 
>> Press Okay to reboot computer.  Press Cancel to attempt system recover."
>>
>> xscreensaver-command -lock
>>
>> zenity --warning --title "ROFLMAO!" --text "JUST KIDDING!"
>>
>> exit
>>
>>
>> Thankfully, my wife *does* have a sense of humor.
>> I may have to spend a night on the couch, but,
>> It's going to be too fun to watch her run this script.
>>
>> /tony
>>
>>   
>>     
> i literally LOL"d at that. i want something like that for my wife.
> it'd have to be Windows only because she's not dual booting.
> funny script though.
>
>   
I was thinking about making something cross-platform with java, which
I am also trying to learn, but, I would have to figure out other
means of displaying confusing text (lsof here) and long-winded
processes for the progress bars (locate so, locate li here),
and, of course, without xscreensaver's lovely BSOD hack, I believe it
would lack impact...There are likely other means of displaying confusing
running text errors message, though, or actually bringing up a mock BSOD.
I suspect for MacOS it wouldn't be that tough to work up a shell script,
but, I don't know their shell and have no mac to play with.
Does OSX use sh?  The BSD's do, right?
Likely, the above is a bit beyond me at this juncture, but, I will work 
on it.
I need to take on challenges to learn more.

Glad you like it!

/tony

-- 
http://www.BaldwinLinguas.com - Translation & Interpreting

http://www.LinguasOS.org - Linux for Translators

mais la langue, aucun homme ne peut la dompter; 
c'est un mal qu'on ne peut réprimer; 
elle est pleine d'un venin mortel.





More information about the ubuntu-users mailing list