Showing posts with label easter. Show all posts
Showing posts with label easter. Show all posts

Sunday, April 12, 2009

An Easter Story: More ASCII Art For Linux And Unix

Hey There,

It's yet another holiday that we haven't ASCII'ed yet, and we've got another script to print a somewhat-tame Easter story, and picture, to your terminal. Yet again, I've gone back to Joan Stark's ASCII Art Gallery to find a really good picture. And I don't just pick her site because it comes up as Google search result number one for every query I run; there actually is an enormous quantity of high quality ASCII art there. Check it out if you still haven't.

If you're interested in any of our other ASCII art holiday script postings, just check out this page, which is a general search for ASCII Art on our site and you're sure to find most of them there.

If the pictorial representation of the script output below isn't large enough, click on it once to be smacked in the face with the HUMONGOUS version ;)

easter ASCII art

For this installment, I've attached two scripts to the post. The first one is the straight-up bash script. The second is the same script, except with all the spaces padded with "X"'s. If you're having problem maintaining the spaces when you copy/paste the original script, just copy/paste the padded one and then (in vi, or whatever your favorite editor is) substitute "X" with a space character for all occurrences. In vi, that would be an "ex" command like:

[esc]:g/X/s// /g

or

[esc]:%s// /g

Enjoy and Happy Easter :)


Creative Commons License


This work is licensed under a
Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License



REGULAR

#!/bin/bash

#
# easter.sh
#
# 2009 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -en "...THE FIRST EASTER BUNNY... by Francine M. O'Connor\n (ASCII Art by joan stark)\n\n __ /^\\\\\n .' \ / :.\ This is the story of a long-eared rabbit\n / \ | :: \ who couldn't learn to do the bunny hop.\n / /. \ / ::: | His ears were floppy, his feet were sloppy,\n | |::. \ / :::'/ he'd hippity hop, then he'd trip and plop.\n | / \::. | / :::'/\n \`--\` \' \`~~~ ':'/\`\n / ( So this little rabbit developed the habit\n / 0 _ 0 \ of staying awake when the sun went down.\n \/ \_/ \/ He'd stay up all night, \n -== '.' | '.' ==- till the morning light, and \n /\ '-^-' /\ practice his hopping just outside of town.\n \ _ _ / \n .-\`-((\o/))-\`-. \n _ / //^\\ \ _ On the first Easter morn, \n.\"o\".( , .:::. , ).\"o\". just before dawn,\n|o o\\\\\ \:::::/ //o o| He was startled by a bright\n \ \\\\\ |:::::| // / and blinding light.\n \ \\\\\__/:::::\__// / And Jesus was there in the \n \ .:.\ \`':::'\` /.:. / shimmering glare,\n \':: |_ _| ::'/ smiling at that funny bunny's plight.\n jgs \`---\` \`\"\"\"\"\"\` \`---\`\n \n Don't worry, little lad, and don't be so sad, .-\"-.\n for humankind will celebrate this special day. .'=^=^='.\n You must bring the word to every beast and bird /=^=^=^=^=\\\\\n that I have risen and am in the world to stay. :^= HAPPY =^;\n |^ EASTER! ^|\n You should've seen that cottontail hop away, :^=^=^=^=^=^:\n feeling mighty proud to be the chosen one. \=^=^=^=^=/\n Though this story is quite old, it can now be retold \`.=^=^=.'\n to make little children smile on Easter morn. \`~~~\`\n"



PADDED
#!/bin/bash

#
# easter.padded.sh
#
# 2009 - Mike Golvach - eggi@comcast.net
#
# Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
#

echo -en "...THEXFIRSTXEASTERXBUNNY...XbyXFrancineXM.XO'Connor\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX(ASCIIXArtXbyXjoanXstark)\n\nXXXXXX__XXXXXXXXXXXX/^\\\\\nXXXX.'XX\XXXXXXXXXX/X:.\XXXXXXXThisXisXtheXstoryXofXaXlong-earedXrabbit\nXXX/XXXXX\XXXXXXXXX|X::X\XXXXXXwhoXcouldn'tXlearnXtoXdoXtheXbunnyXhop.\nXX/XXX/.XX\XXXXXXX/X:::X|XXXXXXHisXearsXwereXfloppy,XhisXfeetXwereXsloppy,\nX|XXXX|::.X\XXXXX/X:::'/XXXXXXXhe'dXhippityXhop,XthenXhe'dXtripXandXplop.\nX|XXX/X\::.X|XXX/X:::'/\nX\`--\`XXX\'XX\`~~~X':'/\`\nXXXXXXXXX/XXXXXXXXX(XXXXXXXXXXXSoXthisXlittleXrabbitXdevelopedXtheXhabit\nXXXXXXXX/XXX0X_X0XXX\XXXXXXXXXXofXstayingXawakeXwhenXtheXsunXwentXdown.\nXXXXXX\/XXXXX\_/XXXXX\/XXXXXXXXHe'dXstayXupXallXnight,X\nXXXX-==X'.'XXX|XXX'.'X==-XXXXXXXXXtillXtheXmorningXlight,XandX\nXXXXXX/\XXXX'-^-'XXXX/\XXXXXXXXpracticeXhisXhoppingXjustXoutsideXofXtown.\nXXXXXXXX\XXX_XXX_XXX/XXXXXXXXXXXXX\nXXXXXXX.-\`-((\o/))-\`-.XXX\nXX_XXX/XXXXX//^\\XXXXXX\XXX_XXXXOnXtheXfirstXEasterXmorn,X\n.\"o\".(XXXX,X.:::.X,XXXX).\"o\".XXXXXjustXbeforeXdawn,\n|oXXo\\\\\XXXX\:::::/XXXX//oXXo|XXHeXwasXstartledXbyXaXbright\nX\XXXX\\\\\XXX|:::::|XXX//XXXX/XXXXXXandXblindingXlight.\nXX\XXXX\\\\\__/:::::\__//XXXX/XXXXAndXJesusXwasXthereXinXtheX\nXXX\X.:.\XX\`':::'\`XX/.:.X/XXXXXXXXshimmeringXglare,\nXXXX\'::X|_XXXXXXX_|X::'/XXXXXXsmilingXatXthatXfunnyXbunny'sXplight.\nXjgsX\`---\`X\`\"\"\"\"\"\`X\`---\`\nXXXXXXXXXXXXXXXXXXXXXXXXXX\nXXXXDon'tXworry,XlittleXlad,XandXdon'tXbeXsoXsad,XXXXXXXXXXX.-\"-.\nXXXXforXhumankindXwillXcelebrateXthisXspecialXday.XXXXXXXX.'=^=^='.\nXXXXYouXmustXbringXtheXwordXtoXeveryXbeastXandXbirdXXXXXX/=^=^=^=^=\\\\\nXXXXthatXIXhaveXrisenXandXamXinXtheXworldXtoXstay.XXXXXX:^=XHAPPYX=^;\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|^XEASTER!X^|\nXXXXYouXshould'veXseenXthatXcottontailXhopXaway,XXXXXXXX:^=^=^=^=^=^:\nXXXXfeelingXmightyXproudXtoXbeXtheXchosenXone.XXXXXXXXXXX\=^=^=^=^=/\nXXXXThoughXthisXstoryXisXquiteXold,XitXcanXnowXbeXretoldXX\`.=^=^=.'\nXXXXtoXmakeXlittleXchildrenXsmileXonXEasterXmorn.XXXXXXXXXXX\`~~~\`\n"




, Mike




Discover the Free Ebook that shows you how to make 100% commissions on ClickBank!



Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.

Tuesday, December 30, 2008

Unix And Linux Easter Eggs For The Wrong Holiday

Hey there,

Today, since it's just past Christmas and almost New Year's, I figured this would be a great time to trot out some Linux and/or Unix Easter eggs. Actually, it doesn't make sense at all, but if you can put aside your burnt-in sense of the chronological order of the holidays, these can still be fun ;)

I found all of the Easter Eggs for today at a site with the very strange name Eeggs.com. I don't know what an eegg is, and I'm not sure that I want to know, but they have a great collection of Easter Eggs for all manner of OS' ;) I spent most of my time in their Linux section, but you could spend hours on other sections of their site and only occasionally be reminded that you're still at work. Of course, in all seriousness, if you're at work, the thought of driving home as soon as possible is keeping you aware of your location at all times ;)

The following are a few of the cooler ones I ran across (AND could personally verify). If you get a chance, drop by Eeggs.com and submit a support email asking why "eegs" isn't in the dictionary when "ain't" is ;)

1. Fun with PHP. This has worked with every site I've tested it against. The key here is just to find a php-enabled site, and navigate to a php page. Then, all you need to do is pass the php page a few arguments on the browser command line to find these four gems.

For a working example, we'll look at linuxandunixupdates.com's index.php page. Using that URL, we can add the following four strings and get the following four easter eggs. All of the links in this section are set to open up in new windows, so you can click on the link above and add the strings manually, or you can just click on any of the links below. I've also included a picture of the outcome of running those commands below each "magic string" just in case you're worried that I might be luring you into clicking on a redirected link or something else I don't have the time to invest in doing properly right now ;) You should be able to replicate this on any php page on any site anywhere. I haven't been able to fully test the veracity of that claim, but it appears to be true so far!

a. Add ?=PHPE9568F34-D428-11d2-A769-00AA001ACF42 to the end of your URL to see this picture:

php logo

b. Add ?=PHPE9568F35-D428-11d2-A769-00AA001ACF42 to the end of your URL to see this picture:

zend engine 2 logo

c. Add ?=PHPE9568F36-D428-11d2-A769-00AA001ACF42 to the end of your URL to see this picture:

squiggly php logo

d. Add ?=PHPB8B5F2A0-3C92-11d3-A3A9-4C7B08C10000 to the end of your URL to see the PHP Credits. This page looks exactly like the standard info.php page, but lists all the developers who worked on each component. I haven't included it here because it's incredibly long and there are more Easter Eggs to get to before we all forget why we're here :)

2. MAGIC reboot times in the Linux Kernel. This one is interesting, and a bit of a puzzle, since the original entry only gives the answer to the first time (they're all significant to Linux in some way). In any event, you can find these times by looking in /usr/include/linux/*.h and grepping for LINUX_REBOOT_MAGIC. As you can see, below, in our includes, they're all in reboot.h:

host # grep LINUX_REBOOT_MAGIC /usr/include/linux/*.h
/usr/include/linux/reboot.h:#define LINUX_REBOOT_MAGIC1 0xfee1dead
/usr/include/linux/reboot.h:#define LINUX_REBOOT_MAGIC2 672274793
/usr/include/linux/reboot.h:#define LINUX_REBOOT_MAGIC2A 85072278
/usr/include/linux/reboot.h:#define LINUX_REBOOT_MAGIC2B 369367448
/usr/include/linux/reboot.h:#define LINUX_REBOOT_MAGIC2C 537993216


MAGIC2 (as well as the MAGIC2A, B and C) is where you'll find the Easter Egg. If you take any of those values and convert them into regular time (using Perl, for instance), they resolve to an important date in Linux history.

host # perl -e 'print localtime(672274793). "\n";'
Sun Apr 21 17:59:53 1991
host # perl -e 'print localtime(85072278). "\n";'
Mon Sep 11 10:11:18 1972
host # perl -e 'print localtime(369367448). "\n";'
Mon Sep 14 21:04:08 1981
host # perl -e 'print localtime(537993216). "\n";'
Sun Jan 18 12:33:36 1987


Sun Apr 21 17:59:53 1991 is supposedly (and I'm not using the word "supposedly" to cast any more doubt than any reasonable human being would have. I'm not sure if the following is true, so I can only "suppose" that the folks who submitted these Easter Eggs aren't just prepping a new Wikipedia page. Just kidding, of course. Everything in Wikipedia is true ;)) the date Linus Torvalds first began writing Linux. The rest is left up to us to figure out. Something tells me the answers are all somewhere in this Linux Online Timeline.

3. And lastly, so there's plenty more left for you to check out at Eeggs.com, I really enjoyed this last one (actually there were a few others I'm dying to try, along the same lines, but don't have the proper OS' to validate right now) since I'm a "huge" fan of Douglas Adams, even beyond the HitchHiker's Series (although lots and lots of people got really upset over Mostly Harmless when he chose to wrap up the HitchHiker's Trilogy (with the 5th book in the series) in a manner that, apparently, was extremely dissatisfying to ardent fans of the series. I don't begrudge them their opinions. I dug it. I'm only sorry that he passed away and that we'll never know if the The Salmon of Doubt was going to be the sixth HitchHiker's book (answering the fan's complaints, at worst) or the next Dirk Gently novel.

Back to planet earth ;) If you open up vim, and type the following:

host # vim
[esc]:help 42


with the [esc]: being the actual "escape" or "esc" key, followed by the colon (:)

You'll, sadly, not get an explanation of the answer to the meaning of life, the universe and everything, but the payoff's just as pleasant :)

What is the meaning of life, the universe and everything? *42*
Douglas Adams, the only person who knew what this question really was about is
now dead, unfortunately. So now you might wonder what the meaning of death
is...

==============================================================================

Next chapter: |usr_43.txt| Using filetypes
...


Hope you all enjoyed those Easter Eggs and, should you decide to look for more, happy hunting :)

Cheers,

, Mike




Please note that this blog accepts comments via email only. See our Mission And Policy Statement for further details.