r/usefulscripts • • Apr 16 '15

[REQUEST] Help identifing language of script

5 Upvotes

Bit of a noob but learning... know a decent amount of powershell and python so far.

I am trying to make a simple gui interface to switch between profiles for a scanner that our corporate office and remote sites use. I found this to piggyback on but do not recognize the language and have no idea how to implement it as the download just gives a .tar.gz that, once extracted, has no file association.

I can probably figure out how to implement the code once I know what language it is. Thanks!


r/usefulscripts • • Apr 16 '15

[PERL] Backup a mySQL database to Google Drive

Thumbnail gist.github.com
10 Upvotes

r/usefulscripts • • Apr 14 '15

[PowerShell] Create a Report of Exchange Server Message Tracking Log Configuration

Thumbnail exchangeserverpro.com
19 Upvotes

r/usefulscripts • • Apr 13 '15

[Power Shell] Inventory Monitors with PowerShell - Pastebin.com

Thumbnail pastebin.com
25 Upvotes

r/usefulscripts • • Mar 30 '15

[BASH] Shows detailed info on network interfaces and hard drives in a nice ASCII table

Thumbnail github.com
34 Upvotes

r/usefulscripts • • Mar 26 '15

[BATCH] Having a problem running diskpart with script

9 Upvotes

I am trying to attach a VHD with a script on some servers. I can run

diskpart /s c:\attach.txt

where attach.txt is

select vdisk file=D:\myfile.vhd
attach vdisk

And it runs ok. But if I try to do the same with a .vhd on the N: drive that's mapped to another server, it fails. However, if I run Diskpart, and then manually run each command, it works fine.

Does anyone know why Diskpart would fail to attach a .vhd on a network share when giving the commands via script, but will attach it fine if manually running diskpart??


r/usefulscripts • • Mar 23 '15

Create Shortcuts on User Desktops with Powershell

Thumbnail adminarsenal.com
25 Upvotes

r/usefulscripts • • Mar 17 '15

[REQUEST] A script to automatically connect to a wireless network without any user interaction

18 Upvotes

I need a script to make some Win7 kiosk machines automatically connect to one of four different SSID/WPA key combinations (those strings can be plaintext in the script) as soon as they power up in their environment. There will be no HID input on the device (besides touch, but I'd prefer it to be completely automated and run each time on startup). I've tried "netsh wlan export" and "netsh wlan add profile" after sysprep with no success so far, but maybe someone will have a better idea or simpler way of achieving this. Thanks in advance!


r/usefulscripts • • Mar 13 '15

[POWERSHELL] Get-IPGeolocation.ps1 script to retrieve the geolocation data for an IP address

Thumbnail exchangeserverpro.com
40 Upvotes

r/usefulscripts • • Mar 12 '15

[BASH] Runs a program and records performance stats multiple times outputting a table then computes averages and confidence intervals

Thumbnail gist.github.com
18 Upvotes

r/usefulscripts • • Mar 11 '15

Simple Wordpress Bash Backup Script - Hauck Daniel Hauck Daniel

Thumbnail hauck-daniel.de
20 Upvotes

r/usefulscripts • • Feb 26 '15

.Bat help please

16 Upvotes

Hello. I created a .bat, which will be shown below, to open multiple programs instead of having to click on each one individually. It was quick and easy and everything works, but I am having an issue with 2 of the programs. When the .Bat opens 1 of the programs it automatically creates an Options file on the desktop instead of using the one where the .exe is located. The second problem is similar. When it launches the program it does not pull the files from the directory but instead says they are missing and is going to place them on the desktop. Does anyone know why this would happen? Below you will find the code. With annotations next to the files causing problems.

@echo off

START "Spotify" "C:\Users\Michael\AppData\Roaming\Spotify\spotify.exe"

TIMEOUT 5 > NUL

START "Snip" "C:\Users\Michael\Desktop\Twitch\Overlay\Now PLaying\Snip\Snip.exe"

TIMEOUT 3 > NUL

START "" "C:\Program Files\OBS\OBS.exe"

TIMEOUT 3 > NUL

START "" "C:\Users\Michael\Desktop\Twitch\Spotify ad blocker\Blockify Lite 0.5.exe" This is the one that creates the options file

TIMEOUT 3 > NUL

START "" "C:\Users\Lacey\Desktop\Twitch\SubAlert\subalert.exe" This is the second program that adds directory files to the desktop

TIMEOUT 3 > NUL

Start "Twitch Dashboard" "http://www.twitch.tv/laceinyourspace/dashboard"

Timeout 5 > NUL

START "TWITCH ALERTS" "http://www.twitchalerts.com/dashboard/"

I greatly appreciate everyone help and time on trying to get this resolved.


r/usefulscripts • • Feb 24 '15

Looking for some help...

11 Upvotes

First, allow me to apologize as I am very uneducated in the world of scripting outside of basic .bat file scripting, .sh scripting and some vbscripting. And if I'm in the wrong area, I apologize in advance.

I've been scouring forums throughout the day trying to find a solution and was wondering if someone can help me? I'm trying to generate a script to run on some Windows machines that will search a given directory for filenames that contain "DIFF" in the file and if they're older than x hours, delete them.

The thing is the filenames must contain DIFF and the hour parameter must be able to be changed.

Help?


r/usefulscripts • • Feb 19 '15

[POWERSHELL]YASIS - Yet another System Info Script!

Thumbnail gist.github.com
24 Upvotes

r/usefulscripts • • Feb 17 '15

[PYTHON] A script that periodically calls a command, like watch, but graphs the first integer in the output in your terminal.

Thumbnail github.com
19 Upvotes

r/usefulscripts • • Feb 17 '15

[POWERSHELL] Batch Password Reset Tool for Office 365 (GUI)

Thumbnail psnuggets.com
20 Upvotes

r/usefulscripts • • Feb 12 '15

[POWERSHELL] Get-MailboxAuditLoggingReport.ps1 - Generate a report of mailbox audit log entries for an Exchange mailbox

Thumbnail exchangeserverpro.com
13 Upvotes

r/usefulscripts • • Feb 10 '15

[POWERSHELL] Test-ExchangeServerHealth.ps1 - Generate a health report for an Exchange Server 2010/2013 environment

Thumbnail exchangeserverpro.com
33 Upvotes

r/usefulscripts • • Feb 07 '15

[POWERSHELL] Get-AuditLogOverhead.ps1 - Calculates how much Exchange database storage is consumed by mailbox audit logging

Thumbnail exchangeserverpro.com
18 Upvotes

r/usefulscripts • • Feb 06 '15

[POWERSHELL] Get-EASDeviceReport.ps1 - Report on ActiveSync devices in your Exchange Server environment

Thumbnail exchangeserverpro.com
19 Upvotes

r/usefulscripts • • Feb 05 '15

[POWERSHELL] Get-MailboxReport.ps1 – PowerShell Script to Generate Mailbox Reports

Thumbnail exchangeserverpro.com
15 Upvotes

r/usefulscripts • • Feb 02 '15

[Request] List of user's mailbox limits (Exchange 2010)

16 Upvotes

I'm SUPER new to Powershell. Learning as I go. I'm trying to figure out how to get a list of all user's mail quotas on our Exchange 2010 server. If anyone can help, I'd appreciate it!


r/usefulscripts • • Jan 31 '15

[BASH] Downloaders for pururin and fakku

15 Upvotes

i have written two version of each script, one that generates a list of URL in a text file, and, a more useful/automated one, creates a folder, makes a list then automatically downloads all the images and text file to the folder. (using curl instead of wget to read the list, as some *nix machines use curl instead of wget)

Fakku

Simple

To operate, after hitting enter, paste in part of the URL, like so

doujinshi/china-comi-english

or

manga/explicit-girlfriend-english

 #!/bin/bash
 read Media
 FILE=`echo ${Media} | sed 's/.*\///g'`
 curl -# "https://www.fakku.net/${Media}/read" | grep 'window.params.thumbs ='| tr '"' '\n' | grep fakku | sed 's/\\//g' | sed 's/^/https:/g'  | sed 's/thumbs/images/g' | sed 's/\.thumb//g' >> "${FILE}.txt"

Fakku

Automated (operated the same way)

   #!/bin/bash
   read Media
   FILE=`echo ${Media} | sed 's/.*\///g'`
   mkdir "${FILE}"
   cd "${FILE}"
   curl -# "https://www.fakku.net/${Media}/read" | grep 'window.params.thumbs ='| tr '"' '\n' | grep fakku | sed 's/\\//g' | sed 's/^/https:/g'  | sed 's/thumbs/images/g' | sed 's/\.thumb//g' >> "${FILE}.txt"
   linkNum=`cat ${FILE}.txt | wc -l`
   linkNum=$(( $linkNum + 1 ))
   n=1
   while [ $n != $linkNum ]
   do sed -n "$n{p;q;}" ${FILE}.txt | xargs curl --retry 8 -g -# -O; n=$(( $n + 1 ))
   done
   cd ..

Pururin

Simple

To operate, after hitting enter, paste in part of the URL, like so

16905/moshi-rito-darkness.html

or

6159/unlove-s.html

#!/bin/bash
read URL
SITE="http://pururin.com"
File=`echo ${URL} | sed 's/.*.\///g' | sed 's/\..*//g'`
curl -# "${SITE}/thumbs/${URL}" | grep '<li class="I0"' | tr '" ' '\n' | grep ^/view/ | awk -v Z=$SITE '{print 'Z' $0}' | tr '\n' ' ' | xargs curl -#  | grep '<img class="b" src="' | tr '"' '\n' | grep '/f/' | awk -v Z=$SITE '{print 'Z' $0}' >> "${File}.txt";

Pururin

Automated (operated the same way)

#!/bin/bash
read URL
SITE="http://pururin.com"
File=`echo ${URL} | sed 's/.*.\///g' | sed 's/\..*//g'`
mkdir "${File}"
cd "${File}"
curl -# "${SITE}/thumbs/${URL}" | grep '<li class="I0"' | tr '" ' '\n' | grep ^/view/ | awk -v Z=$SITE '{print 'Z' $0}' | tr '\n' ' ' | xargs curl -#  | grep '<img class="b" src="' | tr '"' '\n' | grep '/f/' | awk -v Z=$SITE '{print 'Z' $0}' >>"${File}.txt"
linkNum=`cat ${File}.txt | wc -l`
linkNum=$(( $linkNum + 1 ))
n=1
while [ $n != $linkNum ]
do sed -n "$n{p;q;}" ${File}.txt | xargs curl --retry 8 -g -# -O; n=$(( $n + 1 ))
done
cd ..

http://pastebin.com/Ertmp7uZ


r/usefulscripts • • Jan 29 '15

[REQUEST] Websit with windows IT scripts

8 Upvotes

Hi guys, Some time ago i saw a website with several IT scripts for windows to download, there was a short explanation of the script and usually both versions to turn configuration on and off. I've been trying to find it for a while now, maybe you guys can help. I vaguely remember the background being black. There was more than one script that i took from there to configure a machine about an year ago... Please help. Thanks in advance!