Go Back   Science Forums > Physical Sciences Forums > Computer Science and Technology
Reply
 
LinkBack Thread Tools
Old 05-10-2008   #1 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Exclamation BASH Line Contest

Havent done contests that anyone has really participated in, so this is for real, real contest, real prize (an elitist must-have)!!!

Why? Because I can

Looking for quirky bash lines, you can only post one line, as in a command that upon entering into bash terminal will execute and do something It may pull data from outside sources, it can not call for another bash file though (unless you do it creatively i guess).

Winne will get a "BASH Master" tee shirt that i am designing right now, i am in the contest, but not for the win, i want to set bars, etc, to get people to post, and earn the prize.

BTW, no excuse for not doing this, bash lines in cedega are just as quirky as linux or os x, so ALL operating systems welcome

I will not make this shirt until we have a winner and i know their size, and it will be a limited run (if i decide to make it a run, dunno yet). But trust me, nobody will have the same shirt as you, so... oh i have to say now, you have to post a pic, wearing it, as the winner

Have at it, i will set the first mark though, this is my basic script for rolling out an update to this package we use:
Code:
$ nmap --excludefile exclude.txt -sP -n -iL subnets.dat | grep "to be up" | awk '{print "copy \\\\server\\Client_Kit\\install.bat \\\\", $2, "\\
c$\\Windows\\Temp\npsexec -u user -p pass \\\\", $2, "C:\\Windo
ws\\Temp\\install.bat"}' > runme.bat
Last thoughts, this is an OPEN contest, you can submit, submit, submit, i will only use the one you choose (upon my pm to you) at the end of the contest. There will be only ONE winner (person who gets a shirt), no loosers though, only participants, so participate, and who knows, you may just win

Oh, don't google for a line someone has already posted somewhere and think if you change a couple of things i wont know, WARNING you now, i will disqualify you, publically! Besides, I know your IP....


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 05-12-2008   #2 (permalink)
DFINITLYDISTRUBD's Avatar
meh.......


Location:
Here
 
DFINITLYDISTRUBD has disabled reputation
Send a message via AIM to DFINITLYDISTRUBD
 



Not Ranked  0 score     
Re: BASH Line Contest

DANGIT!!!! Wish I knew how to do em! (to be perfectly honest I don't even fully understand what the heck bash is!)

Cool contest though


----------------
Last edited by trained chimp #6
Reply With Quote
Old 05-13-2008   #3 (permalink)
Boerseun's Avatar
Phantom Cow of Justice

Moderator

Location:
Hartbeespoort, South Africa
 
Boerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond reputeBoerseun has a reputation beyond repute
 



Not Ranked  0 score     
Re: BASH Line Contest

BASH? Batch? er...


----------------
Hypography Forums Moderator

IIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIII



Ecce bos taurus justitia
Reply With Quote
Old 05-13-2008   #4 (permalink)
sanctus's Avatar
Resident Diabolist

Administrator

Location:
Geneva-Bern-Zürich, Switzerland;Oslo,Norway
 
sanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant futuresanctus has a brilliant future
 



Not Ranked  0 score     
Re: BASH Line Contest

I thuought I knew a bit the base of bash...seeing your code I figured out that I have way to learn!


----------------
Administrator

A COUNTRY WITHOUT AN ARMY IS LIKE A FISH WITHOUT A BIKE!!!


I don't believe in god, but I do believe in what others call utopies.
Reply With Quote
Old 05-13-2008   #5 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: BASH Line Contest

BASH stands for Born Again SHell, a command language interpreter, that will appear in the GNU operating system. Bash is an sh-compatible shell that incorporates useful features from the Korn shell (ksh) and C shell (csh). It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. It offers functional improvements over sh for both programming and interactive use. (gnu.org)

Ok, you don't have to post lines that use awk or anything like that, just a quirky line... perhaps from something you were working on, or something.


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 05-13-2008   #6 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: BASH Line Contest

reason i used awk is to split the output of the nmap command, into separate arguments and then check for the host being up. awk is a great parsing tool, and that line requires 2 things; subnet.dat file, where you would put like 10.10.100.*.... one subnet = one line, second one is exceptions.txt - which is a file containing exceptions to that scan.

I was rolling out a package on all the windows machines at work, but i didn't need to do it on the server, so i threw my server ips in the exceptions, then scanned multiple subnets and generated a file that utilizes psexec (free, command line remote execution tool for windows) and writes a batch file that upon execution would run the invisible, remote install (well install.bat had the procedure for installation)

oh i gotta add one more thing to this line too

Code:
nmap --excludefile exclude.txt -sP -n -iL subnets.dat |
grep "to be up" | awk '{print "copy \\server\Client_Kit\install.bat \\" 
$2 "\c$\Windows\Tempnpsexec -u user -p pass \\" $2, 
"C:\Windows\Temp\install.bat"}' | Unix2dos > runme.bat
ps dont get confused with \\\\ and the use of commas. In awk, when printing, you need to escape the \ character, so in order to have 2 slashes, you need to enter 4. And commas will put a space between the text field and the data you are appending, it helps sometimes, but in batch file creation case, i only needed it once. Also i was creating a windows file in a linux-like environment, so you need to convert text standards, so i added a Unix2dos command to do so (it converts newline characters to dos standard. dos2unix does the opposite, as you can imagine


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 05-13-2008   #7 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: BASH Line Contest

references:
http://tldp.org/LDP/abs/html/
An Awk Primer
Sed - An Introduction and Tutorial
GREP
Linux Command Reference


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Old 06-10-2008   #8 (permalink)
Morally.Corrupted's Avatar
Thinking


 
Morally.Corrupted is an unknown quantity at this point
 



Not Ranked  0 score     
Re: BASH Line Contest

sudo !!
Reply With Quote
Old 06-10-2008   #9 (permalink)
alexander's Avatar
Dedicated Smart-ass

Senior Moderator
Gallery Curator
Dev Team Member

Location:
Just before 0xAA55
 
alexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond reputealexander has a reputation beyond repute
Send a message via AIM to alexander
 



Not Ranked  0 score     
Re: BASH Line Contest

come on it's like cat !$ you are gonna have to be more creative then thaat...


----------------
Microsoft, the leader in using innovative tactics to promote irksome experience, coupled with antiquated technology that's held together by a pyramid of makeshift afterthoughts.

Apple, the leader in using irksome tactics to promote innovative experience, coupled with an antiquated core that's enhanced by state-of-the-art afterthoughts.

Linux, the leader in not using any tactics to promote user-defined experience, coupled with state-of-the-art core enhanced by innovative afterthoughts.

Reply With Quote
Reply

Bookmarks

Tags
bash, contest


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Infection in Picc Line ThisIsMyName Watercooler 4 10-02-2007 09:43 AM
One Line, A Thousand Points DivineNathicana Physics and Mathematics 11 03-04-2005 03:14 PM
New line of G4 laptops. alexander Computer Science and Technology 0 02-01-2005 06:39 AM
Line up the LINUX geeks, please... IrishEyes Computer Science and Technology 10 09-14-2004 01:30 PM
Straight Line? Eugene Physics and Mathematics 12 06-23-2002 08:30 AM

» Advertisement
» Current Poll
Who's the sexiest man alive? Johnny Depp or Robert Pattinson?
Johnny Depp - 27.27%
3 Votes
Robert Pattinson - 0%
0 Votes
Someone else (please specify) - 45.45%
5 Votes
I'm too macho to think a guy is sexy - 27.27%
3 Votes
Total Votes: 11
You may not vote on this poll.


All times are GMT -8. The time now is 05:44 AM.

Hypography?

Hypography [n.]: A combination of "hyperlink" and "bibliography" - ie, a list of links to electronic documents. Comparable to discography and bibliography, but not cartography.

We have been online since May 2000, and aim to be the best place to find and share science-related content of all kinds.

Share the love!

Please add more science to your life. Use our RSS feeds on your blog, your portal, or your favorite feedreader!


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
Copyright © 2000-2009 Hypography
Part of the Hypography - Science for Everyone Network