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
from os import listdir, rename | |
from os.path import join, isdir | |
from readline import parse_and_bind | |
def main(): | |
print("Batch Rename - Developed by Telmo H. V. Silva") | |
print("-" * 50) | |
parse_and_bind("control-v: paste") |
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 python3 | |
# Ported to Python 3 by Telmo "Trooper" (telmo.trooper@gmail.com) | |
# | |
# Original code from: | |
# http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
# https://gist.github.com/dergachev/7028596 | |
# | |
# To generate a certificate use: | |
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes |
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/bash | |
extensions=$(ls -l | awk '{print $9}' | cut -f 2-99 -d '.' | uniq) | |
for ext in $extensions | |
do | |
echo "-- $ext --" | |
ls -l | grep ".$ext" | awk '{print $9,$5}' | column -t -s " " | |
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
function deploy { | |
deploy_dir=/home/telmo/Development/deploy-scripts | |
if [ $1 = "frontend" ] || [ $1 = "front" ] || [ $1 = "f" ]; then | |
sh "$deploy_dir/deploy_frontend.sh" | |
elif [ $1 = "backend" ] || [ $1 = "back" ] || [ $1 = "b" ]; then | |
sh "$deploy_dir/deploy_backend.sh" | |
else | |
(>&2 echo "ERROR: \"$1\" doesn't match any known parameter.") | |
return 1 |
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
# Remap prefix from 'Ctrl + B' to 'Ctrl + A' | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# Split panes using | and - | |
bind | split-window -h | |
bind - split-window -v | |
unbind '"' | |
unbind % |
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
# Create a new branch based on the current one and push it to the remote. | |
function gcob { | |
echo "You're on branch \"$(git branch --show-current)\"." | |
git pull | |
echo "Creating branch with name \"$1\"." | |
git checkout -b $1 | |
echo "Pushing branch to remote." | |
git push --set-upstream origin $1 | |
} |
OlderNewer