Scripting is a form of programming generally characterized by low formality, loose typing, and no requirement for explicit compilation. There are numerous scripting languages, and these are used in a wide variety of scenarios - command-line applications, GUIs, server-side applications, extension ...
0
votes
1answer
33 views
A small backup script in Python
I work on ubuntu machine and my backup requirements are straightforward. My only requirement is the usual copy paste, but only changed files (ie. the files whose modification-time OR size has changed) ...
1
vote
0answers
13 views
Script to configure Synaptics touchpad
I have a shell script to configure Synaptics touchpad settings at login.
Background
You configure the touchpad with the synclient command. Its usage is
...
3
votes
2answers
89 views
Handling signals in Python inside a function
I have code that needs to exit gracefully. To simplify things, I am presenting an example based on the answer given here.
Since I need to handle a few signals, I thought of putting this logic in a ...
2
votes
1answer
31 views
Grep to search for array of location targets
Please review my short 65 lines of code:
Is there a way to avoid eval (security)?
Is there a better way or place to use ...
4
votes
1answer
62 views
Shortcut script for elusive grep command
This is an example of my filesystem:
/code/
internal/
dev/
main/
public/
dev/
main/
release/
tools/
/code/internal/dev/, /code/public/dev/ and /code/tools/ contain subdirectories for ...
1
vote
1answer
26 views
Writing a small script to extract MS Exchange audit logs in .csv format
Background
I'm using MS Exchange 2013 in my environment, and have a separate siem box which analyze logs produced by different systems (i.e exchange). The logs for Exchange are internally stored and ...
2
votes
1answer
22 views
0
votes
0answers
45 views
Perl script to find world-writable files in local directories only
Over at stackoverflow I asked how to scan a local filesystem ignoring all remote mount points. I only really wanted a push in the right direction and received it. After clacking away on my keyboard I ...
9
votes
2answers
94 views
Bash script to clear files not matching a given extension
Using LaTeX creates a bunch of auxiliary files like foo.aux, foo.log, etc. Sometimes, I want to create a clean run of my ...
7
votes
1answer
75 views
Script for handling PPA's on Ubuntu
I'm writing a bash script to handle the PPA's on Ubuntu & derivatives. I was wondering how to know if I'm handling this the right way.
So, the script works (flawlessly), but I posted it to a ...
5
votes
1answer
97 views
Convert a mediawiki to dokuwiki script
I have quickly wrote a Perl script to convert a mediawiki to a dokuwiki. I know there's an existing script to make that, but I would have a simpler usage code and some use of the API from mediawiki. ...
10
votes
2answers
116 views
How Pythonic is my Excel-formula-analysis state machine?
This is one of my first useful scripts. I run it on a highlighted text selection within Notepad++, but I've provided a sample formula and commented out the Scintilla-specific references.
I'm a rank ...
2
votes
1answer
85 views
Bash pass multiple commands to SSH and make readable
I have a script that sends multiple commands after logging in a remote machine via SSH.
Problem is, it's barely readable. I've tried quoting everything with "", but it's terrible (everything appears ...
5
votes
1answer
90 views
Improving a triangulation test script
I am a relative beginner to Python and as such I've been working on little things here and there in the office that strike me as something interesting that might be fun to try and code a solution.
...
2
votes
1answer
75 views
Looping through selected cells to indent text
I have written the following Google Spreadsheet script that attempts to loop through all selected cells and then update the value so that it adds an indent, by adding ...
2
votes
1answer
188 views
2
votes
1answer
86 views
Ruby install script; packages+installs as a .deb or .rpm from source?
I have a variety of scripts of this form:
...
10
votes
3answers
189 views
Counting words / lines in Ruby - more compact / idiomatic way?
I solved this problem in Ruby:
Write an utility that takes 3 command-line parameters P1, P2 and P3.
P3 is OPTIONAL (see below) P1 is always a file path/name. P2 can take
the values:
...
1
vote
1answer
122 views
Interactive menu system in Bash [closed]
This is a simple loop menu script that I have for class. The goal was to make a menu with applicable commands.
Menu:
A. Greet me. (Greet the user by their username (using the whoami ...
6
votes
1answer
85 views
Making a .bat batch command-line interface
Recently I am working on batch to make a very simple command line interface.
The code looks like this:
...
3
votes
2answers
82 views
Mixing function parameters, commands and command arguments in Bash functions
I'm trying to write a bash function that will take a command such as xcode-select -v or brew -v that outputs a lot of extra ...
3
votes
2answers
77 views
Parallelizing upload
I needed smth that could send (scp/rsync) many files in parallel but that would not overload machine, firewalls on the way by starting e.g. 600 simultaneous uploads, so upload should be done in ...
1
vote
2answers
77 views
3
votes
1answer
616 views
Using ADO to run sql script (with GO syntax) in inno setup
I am using this code to run my sql scripts in inno setup. However ADO gives an error if the script contains GO syntax within it. I added my own code to overcome this problem.
My code below splits the ...
3
votes
0answers
251 views
Signal simulation through Python scripts using shared memory for testing a C application
This is bit long, but I need to explain something before I can ask for actual reviews/advice.
I have to test generated C code from Matlab Simulink model. I can create a executable binary from those. ...
2
votes
1answer
90 views
Script for starting a rails app, with some peculiarities
I wanted to write a script, which starts a rails app, and opens it in the browser.
I'm trying to implement this in a peculiar way though - I expect two things:
the script must wait until the server ...
3
votes
1answer
104 views
AppleScript to close running processes
I've been trying to emulate MS Windows behavior on my OS X and close processes that do not have a window.
What I'd really like to do is "quit" the process on clicking the red "x" button. Instead, ...
3
votes
2answers
220 views
Automating easy-rsa cert creation with Bash script
In order to make cert creation with easy-rsa as practical for others, this script was created and it works so far. The questions are:
where can it be improved?
are there flaws that are not obvious ...
1
vote
1answer
73 views
Please review this PowerShell cmdlet
I am learning PowerShell, and created the following script cmdlet.
It reads one or more specified script files, to discover ...
1
vote
1answer
1k views
Parsing through CSV file to convert to JSON format file
I am given the following CSV file which I extracted from an excel spreadsheet. Just to give some background information which could be of assistance, it discusses AGI Numbers (think of it as protein ...
3
votes
0answers
1k views
Parse emails and create HTML markup from attachments
I am developing a script that will act as a surrogate of sorts for a web portal and an email blast program. The web portal is used to create web-to-print files and is very good at creating print-ready ...
0
votes
2answers
52 views
ruby notes scrubber search for specific characters [closed]
I am looking to making a not scrubber for my testing notes. I want to run a script that will read the entire file looking for special "tags" that I made in my notes, like @ ? (c) etc...
I then want to ...
1
vote
1answer
338 views
Python script to update a cPanel zone record with my public IP
This is my first attempt at using Python to send http requests. I want to keep a zone record on cPanel pointed at my home network's public IP. I'm just looking for some general feedback/suggestions. ...
-1
votes
1answer
46 views
bash file manipulation [closed]
I have files in a directory named so:
1welcome.avi
2introdution.avi
I have a rhcsa.txt file that has what these files should be named as:
rhcsa_1_welcome.avi
rhcsa_2_introduction.avi
both the ...
3
votes
1answer
251 views
Improve a script to generally check status of several git repos
I've tried to write a bash script that gives me a general overview of the status of git repos I have cloned/created. It's not meant to replace git status by any ...
0
votes
1answer
53 views
Batch script to customize cmd.exe color and prompt [on hold]
Write a batch script which configures this list of commands :
Put the name of the window "Cmd configuration"
Put the color of the text in green.
Put the prompt character "$"
Show the message "Cmd ...
4
votes
2answers
162 views
Script for automating regression testing
I am writing a simple script to automate my regression testing. I am new to bash scripting and my goal is achieve the most efficient and clean code. I have written a simple function to allow me to ...
4
votes
1answer
642 views
Renaming Files and/or Directory
I'm quite new to Python and would love to gather feedback on my code. I've written a piece a script that allows me to search all file or directory names within a folder matching a particular pattern. ...
3
votes
3answers
260 views
Shell script to sync dotfiles repository
I'm doing the git dot files thing and created a script -- my first Unix shell script -- to synchronise the repo dot files with those in the user's home. It checks which dot files exist in the repo ...
2
votes
1answer
581 views
Creating a basic secure php mailer
I am busy creating a basic php mailer script to post to _self and email to a address.
Is the script secure?
How can I avoid someone clicking on submit the whole time, to spam the mailbox, with ...
3
votes
2answers
2k views
Powershell script for manipulating Excel files
I have a directory of .xls workbooks with the following naming convention:
001.WIP Monthly Report
002.WIP Joes Custom Report
...
129.PUR Supplier Spend
The ...
3
votes
2answers
86 views
How to improve the way I handle greping in this script
What my script does is:
Append data to a file on a continuous basis.
If an error pattern is observed, then do something.
I need feedback on the way I am grepping for patterns in the continuously ...
3
votes
1answer
257 views
Parsing Oracle errors with a ksh function
Some time ago I wrote a small routine to run some quick n' dirty queries (and with that I mean it is not used for large queries) against an Oracle DB, but also wanted to do it a bit easier to parse ...
2
votes
1answer
163 views
2
votes
2answers
180 views
New to PHP, can I script this in a better way?
How can I code this in a better way, in one file? Output must be more than one (if there is more that one status_update with the given word "online or performancedegradation"),like:
...
2
votes
0answers
67 views
Word problem solver in applescript — a mess [closed]
I'm having a difficult time creating functions. I can't really encapsulate code because it's used all over the place, and needs to be refactored. However, this is a complete rewrite from my old ...
3
votes
2answers
589 views
6
votes
4answers
266 views
How can I make this password search more inteligent?
In a homework, there is exercice when I have a script that is used to search a password.
One of the questions is if is possible to make it "more inteligent", and I'm stuck on it.
The script:
...
2
votes
1answer
671 views
Javascript-generated Social Media Links - a more valid, improved way of writing this?
I'm still fairly new with Javascript, and wrote something to generate some social media links on my page. The idea was to have that script grab the necessary URL info and feed it to the social media ...
3
votes
1answer
341 views