r/ScriptSwap • • Mar 07 '12

[python] BMI calculator

3 Upvotes

r/ScriptSwap • • Mar 03 '12

SVN repository backup script

3 Upvotes

Just a simple bit of Bash I threw together a few months ago to back up my SVN repos. It dumps each repo in a given directory and compresses them.

#!/bin/bash

if [ -z "$2" ]
then
	echo "Syntax: $0 [dump name] [SVN repository location]"
	exit
fi

cd $2
mkdir ~/$1/

for D in `find . -maxdepth 1 -type d`; do
	echo "->Dumping $D..."
	svnadmin dump $D > ~/$1/$D
done

echo "->Compressing..."
cd 
tar -jcvf $1-`date +"%F"`.tar.bz2 $1/
echo "->Deleting $1/ ..."
rm -rf $1/
echo "->Done!"

r/ScriptSwap • • Mar 02 '12

One-liner to update your ipfilter file

3 Upvotes
wget -qO- 'http://list.iblocklist.com/?list=bt_level1&fileformat=p2p&archiveformat=gz' | funzip > ~/.local/ipfilter.p2p

Stick it in your cron, change the path to your destination, and even change the list if you please.


r/ScriptSwap • • Mar 02 '12

hash/rm script NSFW

3 Upvotes

coincidences oxides ritually tends hentai worsen


r/ScriptSwap • • Mar 02 '12

[Perl]Generic Cron Backup Script

3 Upvotes

Unless someone can tell me how exactly to post it in clean format, I am going to post the link to it (its my website). I truly suck at posting in nice format on reddit and I dont want to have to go through the entire thing and add specific things per line to support reddit format

http://ckozler.net/?p=344

EDIT: I do know it says to not post the link and to post it in plaintext but all the format is broken


r/ScriptSwap • • Mar 02 '12

[Python] scripts for Apple system administrators

3 Upvotes

I've found these to be invaluable in my line of work. Hopefully by posting them, someone else will find them useful.

https://github.com/rtrouton/rtrouton_scripts

[EDIT] I realized I didn't read the rules before posting this, forgive that I posted a link and not the source code...


r/ScriptSwap • • Mar 30 '25

Automatically migrating GitHub labels to the new "issue types"

Thumbnail boronine.com
2 Upvotes

r/ScriptSwap • • Apr 12 '24

My Install script

2 Upvotes

For my repo FBD, here is the install script.

#!/bin/bash

chmod +x ./src/fbd.sh sudo pacman -S gum gum log --level info "Setup Finished. Before running FBD, test your gum installation. Then, execute the command : ./src/fbd.sh"


r/ScriptSwap • • Mar 16 '24

Add logged in user to docker-users group

2 Upvotes

As the title says, I’m trying to figure out a way to add the current logged in user to the docker-users group in Windows. Some of our developers are using Docker Desktop on Windows, and it would be great to automate this step after the install.

I have found numerous scripts that have you specify the user, but ideally I would like a script that uses the currently logged in user to skip that manual part. This can be a batch file, a powershell or python script. I’m just not familiar with how to pull in the logged in user name here.

Thanks for any info on this!


r/ScriptSwap • • Dec 03 '23

google captcha

2 Upvotes

Hello

I used Buster script addon to do capatcha google but now i have this error "Your computer or network may be sending automated queries. To protect our users, we can't process your request right now. For more details visit our help page."

How can i fix it? and still using a script to do the captchar


r/ScriptSwap • • May 05 '21

Script help to format data

2 Upvotes

Looking for a script to format data in a tool that's coming from Mac Numbers. I download the file and open as program Numbers on Mac and it has all column values in a single row. Than I copy this row and put it in an online tool for future use. This tool doesn't format it properly as it's in numbers program and I have to each time format it. Its repetitive and a script can do it. Possibly looking to host the script in violetmonket or tampermonkey. The column values are mostly same each time as there are distinct queries that I get data from.

Any help or guide is appreciated.Thanks.


r/ScriptSwap • • Mar 01 '21

[BASH] [XORG] I need to get the full or relative path of a file when I click on it. Help please.

2 Upvotes

Sorry to ask here, I saw there is a r/AskScriptSwap but it's almost dead.

Anyway, I want to create a script to do some things with selected files. I don't want the script to be dependent of the file manager (I'm using Thunar), so I think this is a X server and Bash related question.

Thanks!


r/ScriptSwap • • Dec 27 '20

Anybody have a script or know of one that follows/unfollows people?

2 Upvotes

r/ScriptSwap • • Mar 26 '19

Advice on script to edit group policy

2 Upvotes

I am trying to create a script that can edit group policies on windows 10. Does anyone have any advice or recommendations on how to learn to do this? My endgame is to have a usb stick that I can plug into the computer, have it run the script and edit some settings. I'm slowly learning batch in order to do this.


r/ScriptSwap • • Mar 25 '19

Looking for constructive criticism of my backup script

Thumbnail
self.shell
2 Upvotes

r/ScriptSwap • • Nov 14 '18

cookie: A command-line utility that generates files from templates.

2 Upvotes

I'm looking for some feedback on this if you've got the time. Here's the project homepage: https://github.com/bbugyi200/cookie

The homepage has a demo GIF that will do a better job explaining the project than I can.


r/ScriptSwap • • Sep 26 '18

[bash] odtdiff: a simple script to convert two odt files to text, then open both in a diff tool

2 Upvotes

I found myself having to diff several libreoffice text (.odt) files so I made this simple script. It first ensures both files provided to it exist. It then generates unique filenames for each temporary text file to be created. Finally, it converts both .odt files to text using the temporary filenames and opens both in a diff tool (to use a different diff tool, replace vimdiff with whatever you want). The script's contents are as shown below:

#!/bin/bash

# Ensure both files provided exist
if [ ! -f "$1" ]; then exit 1; fi
if [ ! -f "$2" ]; then exit 1; fi

# Generate unique filenames for temporary files
tmp1="/tmp/`basename $1`-`openssl rand -base64 12`.txt"
tmp2="/tmp/`basename $2`-`openssl rand -base64 12`.txt"

# Convert both files to text
odt2txt "$1"  > "$tmp1"
odt2txt "$2"  > "$tmp2"

# Open both text files in diff tool
vimdiff "$tmp1" "$tmp2"

Use the script like this:

odtdiff /path/to/file1.odt /path/to/file2.odt

r/ScriptSwap • • Sep 17 '18

Unlock all processors (Automated)

2 Upvotes

ISSUE: The enterprise network I work on has a baseline Image that is put on all machines before going out to there respective workplaces. The image only only requires 1 proccessor to run thus it only activates 1 ; even tho most machines will have 2 or more.

GET TO THE POINT : I would like to create a script that will unlock the Max # of processors on a list of computers.

Any help to get this started?


r/ScriptSwap • • Jun 29 '18

Script for Mail export to EML

2 Upvotes

Hello there,

I'm searching for a script to export an IMAP account to EML, resursively, while maintaining the folder-structure. After the export I should have a folder INBOX, with lots of subfolders, with EML mails in them, at best with the subject as file-name.

Anyone know of such a script?


r/ScriptSwap • • Jun 20 '18

Script to pull lat/long from a text file and map it

2 Upvotes

So I just finished modifying a python script that will poll a site for locations which are presented in lat/long, I then created a simple bash script that will run the python script, then cat/grep/sed the output file for the lat/long and addresses and enter them into a new file. What I am trying to figure out now is how to essentially plot those points onto a map.

Ideally it would be beautiful if someone could point/nudge/direct/kick me in the right direction. So far today I have had fun modifying a python script, creating my first successful bash script, and learned how to use sed. So if I could then learn how to do this part as well then I figured why not.

Thank you in advanced.


r/ScriptSwap • • Dec 17 '17

[help] simple shell script

2 Upvotes

Hi everyone,

I need help with a simple shell script that can count the number of http 4xx responses per unique ip address in the server access logs at /var/logs/httpd/access_logs

I found this online but doesn’t help much since it tell me the count for all response codes without IP

cat access_log | cut -d ‘“‘ -f3 | cut -d ‘ ‘ -f2 | sort |uniq -c | sort -rn

Please can someone help me? Thank you!


r/ScriptSwap • • Aug 28 '17

Script for Windows display settings?

2 Upvotes

We have Airwatch MDM deployed but to my surprise, Airwatch does not have a profile for display settings. Is there a script i can upload and push to window devices that contain the following:

  1. Display goes to sleep/screensaver after 5 minutes of no activity

  2. Password is required immediately upon wake up

Any help is appreciated!


r/ScriptSwap • • May 31 '17

[bash] api call loop

2 Upvotes

Built this with help from stackoverflow
This will run a curl script to pull in data from an api that has page breaks, so it will watch for the page breaks and stop at the final page. It also formats the output to proper json, by pulling out an improperly added comma: #!/bin/bash

#for script to pull each page
for ((i=1; ; i++)); do
    contents=$(curl -H "Authorization: Token insertlengthytokenhere" -H "Content-Type: application/json" https://api.app.provider.com/api/tickets/?page=$i)
#jq in /usr/bin removes unneeded text from the json, including a "," between each event and text at each page end
    echo "$contents" | jq .results[]
#stops the loop when the text next":null is seen
    if [[ $contents =~ '"next":null' ]]
    then break
    fi
done

r/ScriptSwap • • Feb 11 '17

[perl] Add subscriber to MailChimp list from terminal

2 Upvotes

Simple script to add subcribers to your mailchimp list from the terminal. Uses Mail::Chimp3 https://github.com/derrickcope/bin/blob/master/addchimplist


r/ScriptSwap • • Feb 22 '16

[Request] Office 365 New Licenses Help

2 Upvotes

Running the following lines of code one line at a time successfully does what I want it to do. However when placing them in .ps1 file and trying to run it never completes. I was wondering if anyone had any ideas for me to try? The goal of this is to have it run once a night to pickup any new accounts that have been added set their usage-local and add a license to their account.

#Connects to Office365 using credentials file
Import-Module MSOnline
$MyO365Creds = Import-Clixml "C:\Users\Administrator\Documents\Powershell Scripts\Office365Creds.xml"
Connect-MsolService -Credential $MyO365Creds

#Shows number of licesnses available
#Get-MsolAccountSku


#Sets location GB which is required to apply licenses
Get-MsolUser -UnlicensedUsersOnly -All | Set-MsolUser -UsageLocation GB

#By department add office365 license
Get-MsolUser -All -Department "intake2015" -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "catmosecollege:OFFICESUBSCRIPTION_STUDENT"
Get-MsolUser -All -Department "intake2014" -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "catmosecollege:OFFICESUBSCRIPTION_STUDENT"
Get-MsolUser -All -Department "intake2013" -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "catmosecollege:OFFICESUBSCRIPTION_STUDENT"
Get-MsolUser -All -Department "intake2012" -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "catmosecollege:OFFICESUBSCRIPTION_STUDENT"
Get-MsolUser -All -Department "staffact" -UnlicensedUsersOnly | Set-MsolUserLicense -AddLicenses "catmosecollege:OFFICESUBSCRIPTION_FACULTY