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

learn more… | top users | synonyms (2)

5
votes
4answers
7k views

How to parse and convert ini file into bash array variables?

I'm trying to convert an ini file into bash array variables. The sample ini is as below: [foobar] session=foo path=/some/path [barfoo] session=bar path=/some/path so these become: ...
1
vote
1answer
49 views

How do I prevent Apache2 from trying to execute a file as a script?

So basically, I followed this guide about iptraf monitoring and rrdtool to the letter. I put it in /usr/lib/cgi-bin/ as usual for cgi scripts. Then, when I visit it from a browser, the images it makes ...
19
votes
8answers
7k views

Is there any reason to use bash over zsh? [closed]

I'm curious about why one would want to run bash instead of zsh. I mean zsh is fully backwards-compatible with bash. Don't get me wrong: I don't dislike bash or anything. I just genuinely want to ...
-3
votes
0answers
19 views

remove lines from a file based on whether corrersponde to a list of names [on hold]

could help to create a perl script to delete a line file based on a specific name , eg if I want to delete me from node 1 and node 4 and its contents until you find another based on one ready names eg ...
0
votes
1answer
1k views

How do I delete a remote file using NCFTP (Windows client)?

With ncftpput.exe how do I delete a remote file once logged in? I have tried using the -W option to send a Raw FTP command but cannot get it to work. Has anyone got a working example? Have tried ...
2
votes
2answers
4k views

Powershell script to delete sub folders and files if creation date is >7 days but maintain parent folders of sub folders and files <7 days old

I'm currently using the Powershell script below to delete all files directories and sub directories of "$dump_path" that are seven days or older based upon the creation date and not modified date. ...
2
votes
1answer
95 views

Joining 150 computers to Active Directory

I am a junior system IT administrator. We have Windows server 2008 R2 standard and 150 computers with Windows 7 professional (32 bit). We have installed an Active Directory domain on the server and we ...
0
votes
0answers
27 views

Collecting PC to Printer relationship information across an entire domain using a script

I'm trying to create a script which will enable view every PC to Printer relationship across an entire domain of around 1200 machines. In theory I am looking for a script to be run so that it will ...
1
vote
0answers
167 views

Openvpn-server: Execute a script when on a failed connection?

Good morning, I was wondering if It was possible to setup something to execute a script when someone tried to connect but the TLS check failed (When someone who is not supposed to connected try to° ...
1
vote
2answers
47 views

Loop in a Windows batch file

I have a problem where I need to clone one virtual machine into several machines for production. The machines have names that is assigned by variables and a rdp port is also assigned by a variable. ...
2
votes
3answers
3k views

Use GRUB/GRUB2 to PXE boot OS image

Asked this in stackoverflow but they recommended I post this here: Here is the situation I am in: I currently have a Windows drive that boots XP. The BIOS does not support PXE booting so this is out ...
4
votes
6answers
25k views
1
vote
1answer
1k views

Windows Server 2008 x86 Services for Unix SDK (SUA) RSH

Running RSH commands on a Windows box against a Linux box works only for the administrator user. Is there a file somewhere that has a list of users that can run commands remotely? More Info The ...
0
votes
1answer
87 views

Complex retention policy

I have daily database backups scp'd to a directory on a local linux machine for multiple databases. The naming format is [dbname].backup; there is no timestamp and currently the latest backup ...
2
votes
1answer
2k views

How to set a timeout within a BASH script for a process that sometimes becomes inactive?

I have a bash script that runs a lot of commands/tools like convert or pdftk via CRON. It happens quite often that e.g. pdftk becomes "stale" or "hangs" and the calling script stops proceeding. Is ...
1
vote
2answers
1k views

List of groups and users on Windows 2003 Server

I am setting up a user group and user audit/review process. For this I am looking for a script that can easily generate a list of groups and the assigned users. E.g.: Administrators/Administrator ...
12
votes
4answers
17k views

Multi-select menu in bash script

I'm a bash newbie but I would like to create a script in which I'd like to allow the user to select multiple options from a list of options. Essentially what I would like is something similar to the ...
2
votes
3answers
2k views

Is there a command line equivalent of Sigverif.exe?

The windows XP sigverif tool is useful for identifying non-signed executables, but does not seem to be amenable to scripting -- is there a command line equivalent?
18
votes
1answer
1k views

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. ...
1
vote
1answer
38 views

Puppet: How to write a proper “condition and condition” statement?

I wrote a "Message of the day" Puppet module which affects all proxy servers in my company. Within the template file, I have the following "if statement": <% if @hostname !~ /^haproxy\d+/ and ...
1
vote
3answers
206 views

How Do I Automatically Update My Database Nightly

Currently, every day before I start work, I complete the following procedure: ssh to the production server gzip our daily database dump file scp the gzipped dump file over to my computer gunzip the ...
-2
votes
1answer
130 views

How to automate a java service to start if server restarts

I normally run my java service on CentOS box using nohup like below: nohup java -jar myapp-0.0.1-SNAPSHOT.jar server my-configure.yml > outfile & However, if the server restarts the service ...
0
votes
5answers
1k views

Which characters if cat'd will mess up my terminal and make a ton of noise?

I've written a wrapper script that I alias to cat, called safecat, that protects me from accidentally cating binaries and getting a ton of screeching from my PC speaker. Right now it considers a file ...
1
vote
2answers
38 views

How to import or export nagios host Data from command line

This might be a basic question for some of you but being a beginner i wanted to know how to export or import data of the current status(CPU, Memory, Diskspace etc) of the host from command line into a ...
0
votes
1answer
36 views

Turning off specific Icinga 2 notifications over HTTP

In Nagios Core, it is possible to turn off notifications for a specific service or host through the web interface. This is a simple web request, which we can also construct in a command line ...
1
vote
2answers
69 views

Linux: How to get a machine's IP address? [duplicate]

I'm using Linux CentOS 6.4 . I'm writing a shell script and I need to extract a machine's IP in order to use it in the script. How can I find the machine's IP? I'm looking for the "best" way because ...
0
votes
1answer
30 views

Need looping Powershell script to email me when site has error message [closed]

Running 08 windows server on a VM We need to be notified by email or by other means whenever the site is either 404 or goes to maintenance page. Therefore, we need the script to be constantly ...
10
votes
6answers
2k views

Sort a list of domain names (FQDNs) starting from tld and working left

I am looking to sort a list of domain names (a web filter whitelist) starting from the TLD and working upwards. I am looking any *nix or windows tools that can do this easily, though a script would ...
1
vote
1answer
936 views

Accessing Workgroup Shared Folder from Domain

I have a domain and a workgroup. My users are supposed to upload files on regular basis to several shared folders on the workgroup. I have difficulty accessing the workgroup shared folders without ...
5
votes
2answers
1k views

Changing physical path on IIS through appcmd isn't activated

We have come across an issue on IIS 7.5 where we have a simple deploy system which consists of the following: Create a zip-file of new webroot, consisting of three folders: Api Site Manager This ...
0
votes
0answers
9 views

Apache2 on Ubuntu - Start external process on request?

I am using Apache2 on Ubuntu Server 14.04.01 LTS (i368). I would like to start an external process whenever a request comes in (The process started will actually get the request proxied to it.) I am ...
34
votes
8answers
8k views

How can I run arbitrarily complex command using sudo over ssh?

I have a system that I can only log in to under my username (myuser), but I need to run commands as other user (scriptuser). So far, I have come up with the following to run the commands I need: ssh ...
-7
votes
1answer
57 views

Trying to understand linux script [closed]

I have this Linux script I found and I'm trying to understand it. Could someone please help me to understand it. The script if [ ! -d "/home/ftp/$PAM_USER" ]; then /bin/su - ftp -s /bin/sh -c ...
0
votes
2answers
652 views

How can I convert a UNICODE word to an International Domain Name? (and back) [closed]

I want to convert a few Unicode words to an International Domain Name, (and back) but can't find a script or other resource to do it on a Windows PC. Does anyone have such a tool?
-3
votes
1answer
42 views

bash script mysql reset pass

It seems that this code is not working I tried using it on my debian 7 machine and the password it gives me is wrong. # Please confirm that you want to reset the MySQL passwords CONFIRM="n" echo -n ...
0
votes
1answer
313 views

How do I run a process remotely from inside a shell script?

What I am trying to do is to run the shell script 'ABCDE' on one machine, but use another machine to support it. ABCDE is an all-in-one ripper/encoder/tagger script for turning CD's into digital ...
1
vote
2answers
418 views

Ola Hallengren's SQL Backup to Network Location not working

Good Evening All, I have set up Ola Hallengren's SQL Server Maintenance Solution on several SQL Express servers (2008 to 2012 R2) in the past few years. I recently have started having issues with the ...
1
vote
1answer
46 views

Configuring Pfsense via ssh

I want to know how i can completely configure and add add tables to pfsense via ssh. my goal is to have a web installer that configured multiple system and based on the output it will configure the ...
1
vote
1answer
49 views

SSH issues: keyfile and host file not working as expected

When I login to server with a key ssh -i /home/me/.ssh/id_rsa server everything goes without glitch. The key is authorized on the server. However if I try to do same from a shell script, I get a ...
0
votes
1answer
49 views

Assigning Department based on Active Directory OU's

We have just gone to Office 365 tied in with ADFS. We want to be able to see people's departments automatically when we view their contact info in Office 365. We do not have any Department ...
22
votes
5answers
18k views

What is “-bash: !”: event not found"

Try executing the following under a bash shell echo "Reboot your instance!" On my installation: root@domU-12-31-39-04-11-83:/usr/local/bin# bash --version GNU bash, version 4.1.5(1)-release ...
10
votes
5answers
2k views

Where do you normally keep your UNIX/Linux scripts?

There are numerous scripts that I have written for my server. Some of them are in my ~/scripts and some of them are in application directories. I am just wondering is there a directory that you would ...
0
votes
0answers
27 views

Programatically Pull Account Track Data from Konica Minolta/Ricoh Copy Machines

To be safe, I checked the serverfault guidelines, and I think this question falls under management of 3rd party platforms or administration of networks. I'm sure I'm not the only sysadmin with this ...
1
vote
3answers
3k views

Automatically run a script on an uploaded FTP file

Is there a way to run a script over a file that has been uploaded on an FTP server. I am running ProFTP on the server and would like to process the uploaded files immediately after they are ...
0
votes
1answer
69 views

Powershell script to display all groups and the users they contain [duplicate]

I'm currently trying to write a script that displays each group and user in the domain. Import-Module ActiveDirectory $Groups = (Get-AdGroup -filter * | Where {$_.name -like "**"} | select ...
8
votes
10answers
8k views

Batch Query Dell Service Tags

Anyone know of a way to get a bunch of information for a list of service tags, does Dell have a section on their site for this? I would also be open to any Perl / Python libraries or *nix shell ...
1
vote
2answers
165 views

How to automate GPG file decryption over SSH?

I would like to use GnuPG to decrypt short messages that are stored on a remote host (running Linux), i.e.: ssh [<user>@]<host> gpg -d <file-to-decrypt> interact with gpg-agent ...
4
votes
1answer
3k views

How can I find all groups a user belongs to via DSQUERY

How can I find all groups for a specific user (groups for which the user is assigned) using dsquery?
0
votes
2answers
526 views

Is there a way to restart automatically the HHVM service if I get a '502 Bad Gateway Error'?

I've reported the error on stackoverflow - from time to time my Nginx/PageSpeed+HHVM+MariaDB+WordPress blog stops working. There is some problem with the HHVM service that I don't locate, and I'm ...
2
votes
1answer
60 views

How to make BSDP NetBoot image selection from a script on OS X 10.9+?

Background: BSDP is Apple's protocol used to discover and make selections on NetBoot servers on the network (Not to be confused with PC-style PXE boot). specs (Word doc). Long story short - it's a ...