Initial commit

This commit is contained in:
Benjamyn 2018-02-10 16:27:53 -05:00
commit cfc77fc119
9 changed files with 62 additions and 0 deletions

3
README.md Normal file
View File

@ -0,0 +1,3 @@
This is a collection of work related scripts that I am writing
NOTE: Due to certain events that are going on things may be incomprehensible

1
email-tools/README.md Normal file
View File

@ -0,0 +1 @@
Not sure if I want to use Python or Bash just yet, So i'll write it in both

View File

@ -0,0 +1,3 @@
mail.benjamyn-testing.com mail2.benjamyn-testing.com
test@benjamyn-testing.com pass123 test2@benjamyn-testing.com pass123,'
test3@benjamyn-testing.com pas#42$ test4@benjamyn-testing.com pa$$89*

4
email-tools/imapsync.py Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/python3
# Benjamyn Love 2017
# I cannot concerntrate at the moment :(

25
email-tools/imapsync.sh Normal file
View File

@ -0,0 +1,25 @@
#!/bin/bash
#Benjamyn Love 2017
#this script will generate imapsync commmands from email account information that we supply (hopefully)
## Usage for imapsync in its most basic form
# imapsync --host1 [Domain name or the IP of the source server] --user1 [Username of the source account (Usally the email address iteself, it depends on how the server auths)] --pass1 [The password for the source account] --host2 [Domain name or the IP of the destination server] [Other --*1 params] --user2 [Username of the destination account (Usally the email address iteself, it depends on how the server auths)] --pass1 [The password for the detination account] [Other --*2 params]
# Using my email account as a baseline test@benjamyn-testing.com will be moved to test2@benjamyn-testing.com[Other --*2 params]
# The command will look like:
# Using my email account as a baseline test@benjamyn-testing.com will be moved to test2@benjamyn-testing.com
# imapsync --host1 benjamny-testing.com --user1 "test@benjamyn-testing.com" --pass1 '"password1"' --user2 "test2@benjamyn-testing.com" --pass2 '"pas$w0rd*("'
# Note the ' followed by the " this makes sure the shell will not glob any of the special chars in the password
# Ideas for usage of this script
# Add server IP/Domain to a file followed by usernames and passwords
# i.e
# mail.benjamyn-testing.com
# test@benjamyn.testing.com,password1,test2@benjamyn-testing.com,password2
#
# The aboce will not work... fucking passwords
# Will need to use tab delimiters ' '
#
## TODO Stop being a basic bitch and change it to just use awk
cat $1 | while read a; do echo $a | awk '{print $1 $2 $3 $4}'; done

1
website-tools/README.md Normal file
View File

@ -0,0 +1 @@
NOTE: These are meant to be run pasted into the terminal so these will mainly be oneliners, the .sh files are for easy reading and storing

View File

@ -0,0 +1,7 @@
#!/bin/bash
#Benjamyn Love 2017
#renames the .htaccess.vipback to .htacces
#
#find . -name ".htaccess.vipback" -printf %h\\n | while read a; do mv -v $a/.htaccess.vipback $a/.htaccess; done
if [[ "$PWD" == "/home/"?* ]]; then find . -name ".htaccess.vipback" -printf %h\\n | while read a; do mv -v $a/.htaccess.vipback $a/.htaccess; done; else echo "Not in a users home directory"; fi

View File

@ -0,0 +1,8 @@
#!/bin/bash
#Benjamyn Love 2017
#finds and renames all .htaccess files to .htaccess.vipback (This name is to avoid clobbering client .htaccess backups)
#run in users home directory not anywhere else
#TODO add the homedir check if [[ "$PWD" == *"home/"?* ]]; then; echo 1; else echo 0; fi
if [[ "$PWD" == "/home"?* ]];then find . -name ".htaccess" -exec mv -v {} {}.vipback \;;else echo "Not in users home directory";fi

10
website-tools/htaccess-test.sh Executable file
View File

@ -0,0 +1,10 @@
#!/bin/bash
#Benjamyn Love 2017
#this script will setup a test environment to test the .htaccess scripts/commands on
#make directories to simulate client guff
mkdir blog shop dev staging
mkdir blog/images shop/products
#create the .htaccess files
touch .htaccess blog/.htaccess blog/images/.htaccess shop/.htaccess shop/products/.htaccess dev/.htaccess staging/.htaccess