Questions tagged [scripting]

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

A form of computer programming that — in the context of system administration — lends it self well to automating tasks.

Scripting is usually done in a scripting language. Such scripting languages are often dynamically typed and interpreted, as opposed to compiled languages. Examples of such languages include PowerShell, Perl and Bash.

1826 questions
26
votes
13 answers

How to encourage Windows administrators to pick up scripting?

When I worked as an administrator in my first job, I was frustrated that our administration processes with Windows servers were a series of point-and-clicks; we could never match the level of efficiency with the Unix servers which had a group of…
icelava
  • 870
  • 4
  • 13
  • 28
26
votes
15 answers

Scripting alternatives to Bash shell scripts

I have just migrated to a UNIX workstation. My memory of Bash shell scripts has faded since school and I find the syntax to be highly confusing. I am wondering what other scripting languages are used to automate tasks. The two most popular ones…
Scott Davies
  • 423
  • 1
  • 5
  • 9
26
votes
12 answers

How to find the gateway IP address in Linux

What command can you use to find the Gateway IP Address (ie. home router address) for eth0 in Linux? I need to get the IP address from a command line app to use in a shell script.
J. Polfer
  • 529
  • 2
  • 6
  • 9
26
votes
5 answers

Send bash -x output to logfile without interrupting standard output

Is there a way to send the information displayed by running a bash script with the -x option to a file, while not changing the standard output seen by a user running the script? This is a debugging feature I would like to implement in a bash script…
26
votes
13 answers

Need leading zero for batch script using %time% variable

I came across a bug in my DOS script that uses date and time data for file naming. The problem was I ended up with a gap because the time variable didn't automatically provide leading zero for hour < 10. So running> echo %time% gives back: '…
Ira
  • 363
  • 1
  • 3
  • 4
24
votes
4 answers

How to edit Local Group Policy with a script?

I have to set the local group policy settings and the the local security policy for a couple of machines which are not in a Windows domain. Until now, I've done that by manually setting the keys in gpedit. Due to the transition to Windows 10, I…
P. Egli
  • 341
  • 1
  • 3
  • 4
24
votes
4 answers

How to automatically and temporarily block an IP address making too many hits on the server in a short timespan?

One of my LAMP servers was recently brought down by some kind of script bot looking for exploits. From the looks of it, it was making so many requests a second, that it overloaded the RAM on the server and brought my entire site down for an hour. …
ProgrammerGirl
  • 449
  • 1
  • 4
  • 8
23
votes
5 answers

Scripted install of MySQL on Ubuntu

I need to write a script that will build my server from a fresh Ubuntu server install. Among things like Apache and PHP it needs to install MySQL. The only problem here is that when I install MySQL with apt-get, at some point the installation will…
Luke
  • 3,826
  • 8
  • 36
  • 40
22
votes
5 answers

Temporarily increasing sudo's timeout for the duration of an install script

I'm trying to write a script that will install a bunch of software and I'd like to not have to run everything as root, so I'd like to be able to prompt for a password and then go about the install, using sudo or su to get privileges when I need…
Arelius
  • 357
  • 2
  • 5
21
votes
7 answers

Setting the Timezone with an automated script

I'm writing scripts to automate setting up new slicehost installations. In a perfect world, after I started the script, it would just run, with no attention from me. I have succeeded, with one exception. How do I set the timezone, in a permanent…
Tom
  • 213
  • 1
  • 2
  • 6
20
votes
5 answers

What version of Windows Management Framework is installed?

How do you check to see what version of Windows Management Framework (WMF) is installed? It seems like it should be a simple thing to find out, but I cannot. Even Googling a bunch of different versions of the question turns up little to…
Loduwijk
  • 565
  • 3
  • 5
  • 15
20
votes
1 answer

Shell command slow when using pipe, fast with intermediate file

Does anyone understand this huge difference in processing time, when using an intermediate file, or when using a pipe? I'm converting tiff to pdf using standard tools on a fresh debian squeeze server. A standard way of doing this is to convert to ps…
plang
  • 325
  • 3
  • 10
20
votes
9 answers

script to automatically test if a web site is available

I'm a lone web developer with my own Centos VPS hosting a few small web sites for my clients. Today I discovered my httpd service had stopped (for no apparent reason - but that's another thread). I restarted it but now I need to find a way that I…
Xoundboy
  • 603
  • 1
  • 10
  • 21
19
votes
14 answers

What are some good resources for learning PowerShell scripting?

Are there online resources or books that you would recommend as an introduction to PowerShell scripting? The resources I've found primarily focus on interactive use.
dmo
  • 2,100
  • 1
  • 16
  • 22
19
votes
6 answers

Find GUID of MSI Package

How can I find the GUID of an MSI package? I would like to script the removal of a program on a large number of desktops by using: msiexec.exe /x ProductCode Any reason why this would not work for any applications listed in "Add/Remove…
SamErde
  • 3,409
  • 3
  • 24
  • 44