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 | |
python3 -m venv venv | |
source venv/bin/activate |
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/zsh | |
cat <<EOT >> ~/.zshrc | |
alias freeze-packages="pip freeze | sed '/pkg-resources==0.0.0/d'" | |
EOT | |
. ~/.zshrc |
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
export FORMAT="\nID\t{{.ID}}\nIMAGE\t{{.Image}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.RunningFor}}\nSTATUS\t{{.Status}}\nPORTS\t{{.Ports}}\nNAMES\t{{.Names}}\n" | |
# this shell will only work on bash |
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 bash | |
PARAMS="" | |
# Check if git repo | |
if ! git rev-parse --git-dir > /dev/null; then | |
exit 1 | |
fi; | |
while (( "$#" )); do | |
case "$1" in | |
-v|--verbose) | |
VERBOSE=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
" = VIM configuration example | |
" ============================================================================= | |
" == Information | |
" Author: Mina Ghobrial | https://github.com/minamaged113 | |
" Should be stored in ~/.vimrc | |
" To download vim, check https://www.vim.org/download.php | |
" On ubuntu: apt-get install vim | |
" ============================================================================= |
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
SSH agent forwarding is great. It allows you to ssh from one server to | |
another all the while using the ssh-agent running on your local | |
workstation. The benefit is you don't need to generate ssh key pairs | |
on the servers you are connecting to in order to hop around. | |
When you ssh to a remote machine the remote machine talks to your | |
local ssh-agent through the socket referenced by the SSH_AUTH_SOCK | |
environment variable. | |
So you the remote server you can do something like: |
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 | |
# git hook to add ticket number from branch name | |
# branch names should have the following naming | |
# convention for this to work: | |
# <type>/<ticket-handle-without-hashes>-<ticket-title> | |
BRANCH_NAME="$(git rev-parse --abbrev-ref HEAD)" | |
COMMIT_MSG=$(cat "$1") | |
TICKET_NO_FROM_BRANCH_NAME=$(echo $BRANCH_NAME | cut -d "/" -f 2 | cut -d "-" -f 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
function pcolor() { | |
red=$'\e[1;31m' | |
grn=$'\e[1;32m' | |
yel=$'\e[1;33m' | |
blu=$'\e[1;34m' | |
mag=$'\e[1;35m' | |
cyn=$'\e[1;36m' | |
end=$'\e[0m' | |
printf "${!1}%-6s\n${end}" "$2" |
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
export FORMAT="ID\t{{.ID}}\nNAME\t{{.Names}}\nIMAGE\t{{.Image}}\nPORTS\t{{.Ports}}\nCOMMAND\t{{.Command}}\nCREATED\t{{.CreatedAt}}\nSTATUS\t{{.Status}}\n" | |
// usage: | |
docker ps --format="$FORMAT" |
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 bash | |
# Add this to your `~/.$(echo $0 | tr -d "-")rc` file to run it for | |
# every shell instance | |
##################################################################### | |
# Add one of the following options to forward the displace from WSL | |
# outside | |
##################################################################### | |
# Option 1 @ port 0 |