This file contains hidden or 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 bash | |
| # copy-key-pair [name] | |
| # This scripts moves the last downloaded pem key while also setting the correct | |
| # permission | |
| SOURCE="$HOME/Downloads/" | |
| DEST=${1:-.} | |
| [ "$DEST" != "." ] && DEST=$DEST.pem | |
| KEY=$(ls -1rt ${SOURCE}*.pem | tail -1) |
This file contains hidden or 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 bash | |
| IN=${1:-/etc/passwd} | |
| sort -r -k3 -t: -n $IN | # Ordenamos por UID (reverso) | |
| # ALTERNATIVA 1 | |
| cut -f1-3 -d: | # Nos quedamos con los campos user:pass:UID | |
| sed 's/\(.*\):.*:\(.*\)/\1 \2/g' | # Eliminamos el campo pass | |
| # ALTERNATIVA 2 | |
| # cut -f1,3 -d: | #Nos quedamos con los campos user:UID |
This file contains hidden or 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 bash | |
| # while [[ $1 ]]; do # Opción Fabiano | |
| # while (( $1 )); do # Opción Jesús | |
| while [ "$#" -gt 1 ]; do | |
| # echo $1 | |
| case $1 in | |
| -d) | |
| DIR=$2 | |
| shift |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |