This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for region in `aws ec2 describe-regions --query "Regions[].RegionName" --region us-west-1 --output text` | |
do | |
echo "[${region}]" | |
aws lambda list-functions --region ${region} --output text --query "Functions[].{ARN:FunctionArn, Runtime:Runtime}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# All photos and videos are in a folder, from here on called ORIGINALS | |
# Parallel command can speed up some tasks, specially the conversion ones, check -j for the number of processes to run in parallel | |
# Before starting, lets clean temporary files to make sure we dont have to deal with them later | |
find ORIGINALS -maxdepth 9999 -noleaf -type f \( -iname ".DS_Store" -o -name "._*" -o -iname "thumbs.db" -o -iname ".picasa.ini" \) -exec rm -v "{}" \; | |
# Before continue, maybe search for some file types for some extra cleanup (for quick cleanup copy the -exec part above) | |
find ORIGINALS -maxdepth 9999 -noleaf -iregex '.*\.\(exe\|tcb\|tcpmd\|txt\|doc\|docx\|xls\|xlsx\|ptp\|7z\|rar\|zip\|iso\|mp3\|m3u\|amr\|xmp\|epp\|xcf\)$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
cd $1 | |
ls | cat -n | while read n f; do ext=${f##*.}; mv "$f" `printf "%02d.$ext" $n`; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in *; do echo "== $i"; exiftool "-subject<directory" -overwrite_original -sep "/" -P -r "$i"; echo ""; done; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
function git-rename() { | |
if [ $# -lt 2 ] | |
then | |
echo "Usage: $0 old_branch_name new_branch_name"; | |
else | |
git branch -m $1 $2 | |
git push origin :$1 $2 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
function git-reset-and-clean() { | |
git fetch origin | |
git reset --hard origin/$(git branch --show-current) | |
git clean -xdf | |
} | |
git-reset-and-clean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
function git-branch-cleanup() { | |
git remote prune origin | |
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -d | |
} | |
git-branch-cleanup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!#/bin/bash | |
function git-status() { | |
find . -name .git -type d -exec sh -c '(cd {}; cd ..; git_temp=`git status -s`; if [ -n "${git_temp}" ]; then (echo $PWD && git status -s && echo); fi;)' \; | |
} | |
git-status |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws s3 ls | cut -d" " -f 3 | xargs -I{} aws s3 rb s3://{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ngs | |
F ebs(volumeSize: Int) { | |
volumeId = null | |
took = time({ | |
volumeId = ``log:'Creating volume' aws ec2 create-volume --availability-zone eu-central-1a --size ${volumeSize}``.VolumeId | |
retry( | |
times = 100 | |
sleep = 0 |
NewerOlder