Skip to content

Instantly share code, notes, and snippets.

View arodbits's full-sized avatar

Anthony Rodriguez arodbits

View GitHub Profile
@arodbits
arodbits / s3s-deploy.sh
Created March 13, 2018 01:08
deploy files into an s3 bucket from the cli
#s3 server deployment
aws s3 cp --acl public-read --content-type=text/html --metadata-directive REPLACE index.html s3://bucketname/index.html
@arodbits
arodbits / copy-current-git-branch.sh
Created March 12, 2018 15:08
Shell profile alias to copy the current Git branch
alias cbranch="git rev-parse --abbrev-ref HEAD | pbcopy"
@arodbits
arodbits / chrome-cache-clear.txt
Created March 11, 2018 20:58
Clear Chrome cache
chrome://net-internals
@arodbits
arodbits / delete-files-only.sh
Created February 21, 2018 20:51
delete all files in directory except any subdirectory
find . -maxdepth 1 -type f -delete
@arodbits
arodbits / force-a-git-pull.sh
Created November 1, 2017 16:18
force a git pull (git clone)
git fetch origin master
git reset --hard FETCH_HEAD
@arodbits
arodbits / top-bigger-files.sh
Created October 30, 2017 00:34
top bigger files
du -cks * | sort -rn | head
@arodbits
arodbits / remove-all-docker-containers.sh
Created October 29, 2017 20:45
Docker: remove all containers
docker rm -f $(docker ps -a -q)
@arodbits
arodbits / regex-from-a-file.sh
Last active September 25, 2017 21:47
read regex patterns from a file
while read line; do egrep -r -e "$line" ./extracted --color --only-matching | awk -F':' '{print $1}' >> ./useful_files_list.txt ;done < ./csv-variables-grep.csv
@arodbits
arodbits / move-files-over-ssh.sh
Last active September 25, 2017 17:35
move files between hosts over ssh using the secure copy command (scp)
scp -r /path/to/source hostname:port/path/to/destination
#if using an entity file for ssh
scp -r -i /path/to/key.pem /path/to/source hostname:port/path/to/destination
@arodbits
arodbits / copy-files-from-a-list-of-files.sh
Created September 22, 2017 15:08
copy files from a list of files
#!/bin/sh
# list_of_useful_files.txt contains a list of files as follows.
# example1.csv\n
# example2.csv\n
# example3.csv\n
# the scrip reads the list of files and proceeds to copy them into the specified directory.
cat ~/Downloads/IPEDs/list_of_useful_files.txt | awk -F'/' '{print "cp "$0 " ~/Downloads/IPEDs/files_downloaded/"$7"-"$8 }' | sh