llamaenterhear
Username: Password:

Author Topic: (Shell) Scripting!  (Read 1513 times)

0 Members and 1 Lonely Barbarian are spying on this topic.

Offline Chaosmark

  • Harbringer of Segfaults
  • Strolenati
  • Emperor
  • *
  • Posts: 1260
  • Awards Master Questor Item Guild Hall of Heroes 10
    • The Sleepless Hacker
    • Awards
(Shell) Scripting!
« on: August 29, 2007, 05:16:36 PM »
The official EECS (Electrical Engineering and Computer Science) lab here at KU runs Linux, for various different reasons, not the least of which is that Vista still has too many kinks in it to be worth the trouble.

Thus, I've been introduced to the wonderful world of scripting, for the simple fact that in doing so I can make my life easier with repetitive command line tasks. For example:

<code>
mkdir lab1
cd lab1
mkdir #######-Chaosmark-Lab-1
...
</code>

That is the rough order of operations that I have to go through every time I have a Programming I lab. Mildly annoying, especially since they want very specific names that change by a single number every time. Bugger that. Gimme a shell script I can call from ~/startup.rc (whatever the name is...).

Simple enough, though I still need to write it. However, this introduction gave me a question for Strolen and the other Tech Guys around here:

What do you use scripts for? What sorts of stuff comes with the sysadmin job that you end up doing repetitively? Inquiring minds wish to know!
P(A|B) = P(B|A)*P(A)/P(B)

By the power of Bayes!

Acolyte Lithil Darkheart – Level 1 Necromancer
STR: 1 | END: 2 | CON: 3 | DEX: 3 | CHA: 3 | INT: 3

Current guild quest: --

Offline Ancient Gamer

  • Hammer of the Citadel
  • Emperor
  • ****
  • Posts: 3897
  • Enough about you, let's talk about me!
  • Awards 2013 Best Play By Post Game Elite Item Guild Golden Creator Elite Systems Guild Elite Plot Guild Hall of Heroes 10
    • Coldforged Home
    • Awards
Re: (Shell) Scripting!
« Reply #1 on: August 29, 2007, 11:04:22 PM »
I use scripts for the following:
1) (Windows) When developing software I always use a very restricted user account to host the development environment. However that also means I won't have admin access to critical components, like Visual Studio, so I have a BUNCH of scripts that enables me to shutdown as an admin (restricted users can only log of win2k3), launch various programs as an admin, launch our product as various test users (with differing rights), and so on. Very handy!

2) (Linux) When running a heuristic or an algorithm for research uses X number of times, I used a bash script to repeatedly run the algorithm, and to save the results in the appropriate locations.

3) (Unix) Back in the day, when I was playing RPGs online (So called MUDs - Multi User Dungeon), I used scripts to launch automated sequences that I did frequently. That never ceased to amaze the other MUDers that complemented me on my insane typing skills. ;)

4) (Linux/Windows) I sometimes use scripts during logon and logoff, and whenever various events are raised on the computer (like remote users logging onto my OS!).
Authentic Strolenite™©®

"Secretly a Squirrel"
Guild Master of the Squirrelati
Scourge of Nutanuns!
Harbinger of Acorns!


Offline manfred

  • His Manic Majesty, blesseth by Mathom
  • Emperor
  • ****
  • Posts: 2462
  • Awards Systems Guild Society Guild Locations Guild Questor Item Guild Lifeforms Guild
    • Awards
Re: (Shell) Scripting!
« Reply #2 on: August 30, 2007, 05:48:57 AM »
*looses himself in fond memories*

The biggest use I had for scripts was in my old job. Tired of searching for always the same problems (or new problems that looked the same), I entered a circle of ever-growing tool use I had to expand myself. :)

The basic job was to analyze logfiles on a (usually remote) machine, find problems that happened during intense testing or without it, and then attempt to diagnose the problem (emphasis on attempt, as you didn't know what caused them in the first place, or there were many possible causes). With some sporadic problems this grew into the task of running the test on dozens of machines, and hope that they crop up.

Ahhh, those were the days... *gets sentimental*
Do not correct me, I know I am wrong.

Offline Pariah

  • The Guildless
  • Strolenati
  • Emperor
  • *
  • Posts: 1384
  • Awards Item Guild Hall of Heroes 10
    • Awards
Re: (Shell) Scripting!
« Reply #3 on: August 31, 2007, 11:57:42 AM »
1) Games:  Due to the fact that I game on a machine that is nearing obsolete for games, I have to etch out EVERY piece of memory possible, including things like explorer...  And manually shutting down 10+ processes and then starting up a game gets rather annoying after the second or third time you do it.

2) Circumventing the Sysadmin...: In my own defense it's because he's far too restrictive, and entirely too heavy handed in how he goes about enforcing his idea of a "secure" network.  I mean, come on, telling the users that they don't have sufficient privledges to view the contents of a cd?

3) Backup: Having lost much information to such things as a friend setting my laptop down on his amp, I try my hardest to make sure my important info is backed up in at least one other place, preferably two...
They were immediately and absolutely recognizable as adventurers... They were hardy and dangerous, lawless, stripped of allegiance or morality, living off their wits, stealing and killing, hiring themselves out to whoever and whatever came. They were inspired by dubious virtues.  China Mieville - Perdido Street Station

Offline Chaosmark

  • Harbringer of Segfaults
  • Strolenati
  • Emperor
  • *
  • Posts: 1260
  • Awards Master Questor Item Guild Hall of Heroes 10
    • The Sleepless Hacker
    • Awards
Re: (Shell) Scripting!
« Reply #4 on: December 05, 2007, 12:48:51 PM »
...

2) Circumventing the Sysadmin...: In my own defense it's because he's far too restrictive, and entirely too heavy handed in how he goes about enforcing his idea of a "secure" network.  I mean, come on, telling the users that they don't have sufficient privledges to view the contents of a cd?

...

The other two I can see quite easily, but this one caught me off guard. Do you use Windows, or Linux, and how exactly do you do so? I'm not seeing how you'd accomplish this with a Linux box...

(Just so I'm not accused of bad intentions, this would be useful to know for IT security as a sysadmin.)
P(A|B) = P(B|A)*P(A)/P(B)

By the power of Bayes!

Acolyte Lithil Darkheart – Level 1 Necromancer
STR: 1 | END: 2 | CON: 3 | DEX: 3 | CHA: 3 | INT: 3

Current guild quest: --

Offline Strolen

  • Ignorance Incarnate
  • Guild Leader
  • Emperor
  • *
  • Posts: 8030
  • All your base are belong to us.
  • Awards Locations Guild Questor Locations Guild Elite Item Guild Hall of Heroes 10 Plot Guild
    • Strolen's Citadel
    • Awards
Re: (Shell) Scripting!
« Reply #5 on: December 05, 2007, 05:09:18 PM »
Only scripts I wrote were for homework but I quickly saw the shear power of them. From searching and grabbing text to synching file structures between machines you can do an incredible amount of things with scripts. It is well worth your time to get familiar with them if you have repetitive or labor intensive tasks! I haven't really needed any so I don't actively use any but just knowing they are available, I am sure, will become very handy!

Flying Squirrel – Strolenati Guild
Grothar Rockfury - Dwarvish Guild
Minor Minion - Cartographer's Guild
Level 3
STR: 5 | END: 2 | CON: 3 | DEX: 2 | CHA: 2 | INT: 6
Authentic Strolenite™©® | Llama is as Llama does.