Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   OT: Scripting humour (http://www.linux-archive.org/ubuntu-user/30298-ot-scripting-humour.html)

anthony baldwin 01-06-2008 05:08 PM

OT: Scripting humour
 
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

--
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.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

James Black 01-06-2008 05:47 PM

OT: Scripting humour
 
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.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

anthony baldwin 01-06-2008 06:12 PM

OT: Scripting humour
 
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.


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

"Steve Flynn" 01-07-2008 12:32 PM

OT: Scripting humour
 
On Jan 6, 2008 7:12 PM, anthony baldwin <anthony.baldwin01@comcast.net> wrote:
>
> Does OSX use sh? The BSD's do, right?

Yes - OSX has a command line. Mine uses Bash but there are other to
select from if preferred.

--
Steve
When one person suffers from a delusion it is insanity. When many
people suffer from a delusion it is called Religion.

09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

"Samuel Thurston, III" 01-07-2008 03:32 PM

OT: Scripting humour
 
On Jan 7, 2008 7:32 AM, Steve Flynn <anothermindbomb@gmail.com> wrote:
> On Jan 6, 2008 7:12 PM, anthony baldwin <anthony.baldwin01@comcast.net> wrote:
> >
> > Does OSX use sh? The BSD's do, right?
>
> Yes - OSX has a command line. Mine uses Bash but there are other to
> select from if preferred.

While this is true, there are a great number of differences in the
available options for even very common BSD shell programs like tar and
others that often cause script incompatibilities. Generally speaking,
if it works on BSD it will almost certainly work on linux but the
obverse is far from guaranteed.

Great gag though!

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

anthony baldwin 01-07-2008 05:47 PM

OT: Scripting humour
 
Steve Flynn wrote:
> On Jan 6, 2008 7:12 PM, anthony baldwin <anthony.baldwin01@comcast.net> wrote:
>
>> Does OSX use sh? The BSD's do, right?
>>
>
> Yes - OSX has a command line. Mine uses Bash but there are other to
> select from if preferred.
>
>
So a bash script written for Linux will work on OSX?
Or are there differences in the commands, and stuff?
(Does OSX have zenity, or can if be installed?)

I suppose that's all rather OT, but I'm curious...

/tony

--
Anthony Baldwin
http://www.BaldwinLinguas.com - Translation & Interpreting
203-507-2575 / 860-235-8233
http://www.LinguasOS.org - Linux for Translators

Así también, la lengua es un miembro pequeño,
y se gloría de grandes cosas.
He aquí, ¡un pequeño fuego *cuán grande bosque enciende!


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Peter Garrett 01-08-2008 08:06 AM

OT: Scripting humour
 
On Mon, 07 Jan 2008 13:47:55 -0500
anthony baldwin <anthony.baldwin01@comcast.net> wrote:

> Steve Flynn wrote:
> > On Jan 6, 2008 7:12 PM, anthony baldwin <anthony.baldwin01@comcast.net> wrote:
> >
> >> Does OSX use sh? The BSD's do, right?
> >>
> >
> > Yes - OSX has a command line. Mine uses Bash but there are other to
> > select from if preferred.
> >
> >
> So a bash script written for Linux will work on OSX?
> Or are there differences in the commands, and stuff?

If it was just bash, and it called only installed software, I assume it
would work.

> (Does OSX have zenity, or can if be installed?)

Zenity is a GNOME thing - at least, it is installed as part of GNOME on
Ubuntu. There may be a version available for OS-X installable via "fink",
for example, but I haven't used OS-X on my iBook for a couple of years now.
I installed Ubuntu on it and blew OS-X away. I haven't missed it :)

I assume that if zenity is available it would only run on X11, so you
would need Apple's X11 installed as well (or the darwinports / Fink
version) Also have a look at

apt-cache depends zenity
apt-cache rdepends zenity

Ah, update:
http://zenity.darwinports.com/
http://darwinports.com/?q=zenity
>
> I suppose that's all rather OT, but I'm curious...

I just put "Mac OS-X zenity " into Uncle Google to find those links ;)

Peter
--
"INX Is Not X" based on Ubuntu 7.04 Live CD: http://inx.maincontent.net
Screenshots slideshow: http://inx.maincontent.net/album/1.png.html
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Brian McKee 01-11-2008 01:18 AM

OT: Scripting humour
 
On Mon, 2008-07-01 at 13:47 -0500, anthony baldwin wrote:
> Steve Flynn wrote:
> > On Jan 6, 2008 7:12 PM, anthony baldwin <anthony.baldwin01@comcast.net> wrote:
> >
> >> Does OSX use sh? The BSD's do, right?
> >>
> >
> > Yes - OSX has a command line. Mine uses Bash but there are other to
> > select from if preferred.
> >
> >
> So a bash script written for Linux will work on OSX?
> Or are there differences in the commands, and stuff?
> (Does OSX have zenity, or can if be installed?)
>
> I suppose that's all rather OT, but I'm curious...

It has bash - but not Gnome, which is required for the zenity command.
Most of the basic gnu commands are there with the bash shell, and there
is an (optional) X11 interface, but anything GUI is completely
different, and not generally accessible via bash scripts. (yes, there
are exceptions, I'm doing the broad strokes here....)

Brian McKee
(www.muskokamug.org if you want more info....)
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

anthony baldwin 01-11-2008 02:14 AM

OT: Scripting humour
 
Brian McKee wrote:
> On Mon, 2008-07-01 at 13:47 -0500, anthony baldwin wrote:
>
>> Steve Flynn wrote:
>>
>>> On Jan 6, 2008 7:12 PM, anthony baldwin <anthony.baldwin01@comcast.net> wrote:
>>>
>>>
>>>> Does OSX use sh? The BSD's do, right?
>>>>
>>>>
>>> Yes - OSX has a command line. Mine uses Bash but there are other to
>>> select from if preferred.
>>>
>>>
>>>
>> So a bash script written for Linux will work on OSX?
>> Or are there differences in the commands, and stuff?
>> (Does OSX have zenity, or can if be installed?)
>>
>> I suppose that's all rather OT, but I'm curious...
>>
>
> It has bash - but not Gnome, which is required for the zenity command.
> Most of the basic gnu commands are there with the bash shell, and there
> is an (optional) X11 interface, but anything GUI is completely
> different, and not generally accessible via bash scripts. (yes, there
> are exceptions, I'm doing the broad strokes here....)
>
> Brian McKee
> (www.muskokamug.org if you want more info....)
>
Is there a KDE equivalent to zenity?
Oddly, I don't have gnome installed, but I do have zenity.

thanks
tony

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

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

Así también, la lengua es un miembro pequeño,
y se gloría de grandes cosas.
He aquí, ¡un pequeño fuego *cuán grande bosque enciende!


--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Peter Garrett 01-11-2008 07:04 AM

OT: Scripting humour
 
On Thu, 10 Jan 2008 22:14:53 -0500
anthony baldwin <anthony.baldwin01@comcast.net> wrote:

> Is there a KDE equivalent to zenity?
> Oddly, I don't have gnome installed, but I do have zenity.

I think the KDE equivalent is kdialog. There is also Xdialog, which is gtk
1.2, but has more flexibility than either zenity or kdialog. For example,
it has "spinboxes" and various other "boxes" that zenity and kdialog lack.

The Xdialog documentation is also much more comprehensive.

Peter
--
"INX Is Not X" Live CD based on Ubuntu 7.04 : http://inx.maincontent.net
Screenshots slideshow: http://inx.maincontent.net/album/1.png.html
--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 01:23 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.