 |
05-10-2008
|
#1 (permalink)
|
|
Dedicated Smart-ass
Location: Just before 0xAA55
|
Not Ranked
:
+0 / -0
0 score
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.

|
|
05-12-2008
|
#2 (permalink)
|
|
meh.......
|
Not Ranked
:
+0 / -0
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
|
|
05-13-2008
|
#3 (permalink)
|
|
Phantom Cow of Justice
Location: Hartbeespoort, South Africa
|
Not Ranked
:
+0 / -0
0 score
Re: BASH Line Contest
BASH? Batch? er...
----------------
Hypography Forums Moderator
IIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIII
Ecce bos taurus justitia
|
|
05-13-2008
|
#4 (permalink)
|
|
Resident Diabolist
Location: Geneva-Bern-Zürich, Switzerland;Oslo,Norway
|
Not Ranked
:
+0 / -0
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.
|
|
05-13-2008
|
#5 (permalink)
|
|
Dedicated Smart-ass
Location: Just before 0xAA55
|
Not Ranked
:
+0 / -0
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.

|
|
05-13-2008
|
#6 (permalink)
|
|
Dedicated Smart-ass
Location: Just before 0xAA55
|
Not Ranked
:
+0 / -0
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.

|
|
05-13-2008
|
#7 (permalink)
|
|
Dedicated Smart-ass
Location: Just before 0xAA55
|
Not Ranked
:
+0 / -0
0 score
Re: BASH Line Contest
----------------
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.

|
|
06-10-2008
|
#8 (permalink)
|
|
Thinking
|
Not Ranked
:
+0 / -0
0 score
Re: BASH Line Contest
sudo !!

|
|
06-10-2008
|
#9 (permalink)
|
|
Dedicated Smart-ass
Location: Just before 0xAA55
|
Not Ranked
:
+0 / -0
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.

|
|
 |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
|
» Advertisement |
|
|
|