Computer Science Software, hardware, computational theory, cool peripherals, and emerging cybernetic technologies


Advertisement (please log in or register to remove this ad)
Notices

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 05-10-2008, 12:53 PM
alexander's Avatar
Resident USSRian
Points: 69,755, Level: 100 Points: 69,755, Level: 100 Points: 69,755, Level: 100
Activity: 42% Activity: 42% Activity: 42%
Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member
 

Join Date: May 2004
Location: Just before 0xAA55
Posts: 3,984
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
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....
__________________

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Advertisement
  #2 (permalink)  
Old 05-12-2008, 04:01 PM
DFINITLYDISTRUBD's Avatar
Creating
Points: 30,214, Level: 76 Points: 30,214, Level: 76 Points: 30,214, Level: 76
Activity: 28% Activity: 28% Activity: 28%
 
Space Invaders Champion!
Join Date: Sep 2005
Location: A bit to the North of Hell... (Pa.)
Posts: 1,003
DFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to beholdDFINITLYDISTRUBD is a splendid one to behold
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
__________________
I'm not "mad" just slightly deranged!
Reply With Quote
  #3 (permalink)  
Old 05-13-2008, 12:56 AM
Boerseun's Avatar
Holy cow!
Points: 122,205, Level: 100 Points: 122,205, Level: 100 Points: 122,205, Level: 100
Activity: 22% Activity: 22% Activity: 22%
Hypography Staff Member
Moderator
 

Join Date: May 2005
Location: Hartbeespoort, South Africa
Posts: 4,650
Blog Entries: 3
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
Re: BASH Line Contest

BASH? Batch? er...
__________________
Hypography Forums Moderator

IIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIII
IIIIIIIIIIIIIIIII



Bovinely blessed be thee.
Reply With Quote
  #4 (permalink)  
Old 05-13-2008, 03:49 AM
sanctus's Avatar
Resident Diabolist
Points: 29,076, Level: 74 Points: 29,076, Level: 74 Points: 29,076, Level: 74
Activity: 4% Activity: 4% Activity: 4%
Hypography Staff Member
Administrator
 

Join Date: Mar 2004
Location: Geneva-Bern-Zürich, Switzerland
Posts: 2,449
Blog Entries: 1
sanctus is a name known to allsanctus is a name known to allsanctus is a name known to allsanctus is a name known to allsanctus is a name known to allsanctus is a name known to allsanctus is a name known to all
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
  #5 (permalink)  
Old 05-13-2008, 05:01 AM
alexander's Avatar
Resident USSRian
Points: 69,755, Level: 100 Points: 69,755, Level: 100 Points: 69,755, Level: 100
Activity: 42% Activity: 42% Activity: 42%
Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member
 

Join Date: May 2004
Location: Just before 0xAA55
Posts: 3,984
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
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.
__________________

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
  #6 (permalink)  
Old 05-13-2008, 05:12 AM
alexander's Avatar
Resident USSRian
Points: 69,755, Level: 100 Points: 69,755, Level: 100 Points: 69,755, Level: 100
Activity: 42% Activity: 42% Activity: 42%
Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member
 

Join Date: May 2004
Location: Just before 0xAA55
Posts: 3,984
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
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
__________________

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
  #7 (permalink)  
Old 05-13-2008, 05:21 AM
alexander's Avatar
Resident USSRian
Points: 69,755, Level: 100 Points: 69,755, Level: 100 Points: 69,755, Level: 100
Activity: 42% Activity: 42% Activity: 42%
Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member
 

Join Date: May 2004
Location: Just before 0xAA55
Posts: 3,984
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
Re: BASH Line Contest

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

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
  #8 (permalink)  
Old 06-10-2008, 09:05 AM
Thinking
Points: 91, Level: 1 Points: 91, Level: 1 Points: 91, Level: 1
Activity: 0% Activity: 0% Activity: 0%
 

Join Date: Oct 2007
Posts: 16
Morally.Corrupted is an unknown quantity at this point
Re: BASH Line Contest

sudo !!
Reply With Quote
  #9 (permalink)  
Old 06-10-2008, 09:27 AM
alexander's Avatar
Resident USSRian
Points: 69,755, Level: 100 Points: 69,755, Level: 100 Points: 69,755, Level: 100
Activity: 42% Activity: 42% Activity: 42%
Hypography Staff Member
Administrator
Gallery Curator
Dev Team Member
 

Join Date: May 2004
Location: Just before 0xAA55
Posts: 3,984
alexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant futurealexander has a brilliant future
Send a message via AIM to alexander
Re: BASH Line Contest

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

This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 License.
Reply With Quote
Reply

Bookmarks

Tags
bash, contest
Advertisement


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

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

» Advertisement
» Latest Science News
A Fine-Tooth Comb To Measure The Accelerating Universe
imageAstronomical instruments needed to answer crucial questions, such as the search for Earth-like planets or the way the Universe expands, have come a step closer with the first demonstration at the telescope of a new calibration system for precise spectrographs. The method uses a Nobel Prize-winning technology called a 'laser frequency comb', and is published in this week's issue of Science.
Read » | 0 comments

Fermilab physicists discover "doubly strange" particle
imagePhysicists of the DZero experiment at the U.S. Department of Energy's Fermi National Accelerator Laboratory have discovered a new particle made of three quarks, the Omega-sub-b (Ωb). The particle contains two strange quarks and a bottom quark (s-s-b). It is an exotic relative of the much more common proton and weighs about six times the proton mass.
Read » | 0 comments

Stanford's 'autonomous' helicopters teach themselves to fly
imageStanford computer scientists have developed an artificial intelligence system that enables robotic helicopters to teach themselves to fly difficult stunts by watching other helicopters perform the same maneuvers. The result is an autonomous helicopter than can perform a complete airshow of complex tricks on its own.
Read » | 0 comments
» Current Poll
Do U text?
No - 35.29%
12 Votes
Yes; < 6 messages/day - 41.18%
14 Votes
Yes; 6-15 messages/day - 11.76%
4 Votes
Yes; 16 to 43 messages/day - 5.88%
2 Votes
Yes; > 43 messages/day - 2.94%
1 Vote
What? - 2.94%
1 Vote
Total Votes: 34
You may not vote on this poll.
» Random Social Groups
Science Fiction Buffs
7 members | 7 pictures
Gardening
12 members | 46 pictures
Star Trek
3 members | 0 pictures
ESP
5 members | 10 pictures
Astronomy Picture of the Day
9 members | 26 pictures
» View All Groups
Advertisement

All times are GMT -8. The time now is 02:16 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
Copyright © 2000-2008 Hypography
Part of the Hypography - Science for Everyone Network