Last active
April 16, 2019 20:59
-
-
Save neoighodaro/7da6eaeb3471dcb25e73066588e975ff to your computer and use it in GitHub Desktop.
Bash Aliases
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
# PHP | |
alias artisan="php artisan" | |
alias art="php artisan" | |
# Git | |
alias gc="git commit" | |
alias ga="git add" | |
alias gr="git rm" | |
alias gp="git push" | |
alias gs="git status" | |
alias gpull="git pull" | |
alias gpullm="git pull origin master" | |
alias git-nah="git reset --hard; git clean -df" | |
alias gpm="git push origin master" | |
alias grmt="git config --get remote.origin.url" | |
alias clone="git clone" | |
# Wordpress | |
alias new_wordpress=wp_install | |
# Misc | |
alias clr="clear" | |
alias l="ls -lsa" | |
# Docker | |
alias dc="docker-compose" | |
alias drmi='docker rmi $(docker images --filter "dangling=true" -q --no-trunc)' | |
alias dockerssh="dockerSshIn" | |
# ------------------------------------------------------------------ | |
# Functions | |
# ------------------------------------------------------------------ | |
# Git | |
function commit { | |
git add --all | |
if (($# > 1)); then | |
params='' | |
for i in $*; | |
do | |
params=" $params $i" | |
done | |
git commit -m "$params" | |
else | |
git commit -m "$1" | |
fi | |
} | |
function pushme { | |
br=`git branch | grep "*"` | |
git add --all | |
if (($# > 1)); then | |
params='' | |
for i in $*; | |
do | |
params=" $params $i" | |
done | |
git commit -m "$params" | |
else | |
git commit -m "$1" | |
fi | |
git push origin ${br/* /} | |
} | |
# Docker | |
dockerSshIn() { | |
docker exec -it $1 bash | |
} | |
# Wordpress | |
wp_install() { | |
mkdir "$1" | |
cd "$1" | |
wget "http://wordpress.org/latest.zip" | |
unzip latest.zip | |
rm -rf __MACOSX latest.zip | |
cp -rf ./wordpress/* ./ | |
rm -rf ./wordpress/ ./wp-content/plugins/hello.php ./readme.html | |
mkdir ./wp-content/uploads/ | |
mv wp-config-sample.php wp-config.php | |
touch htaccess.txt robots.txt | |
nano wp-config.php | |
open https://api.wordpress.org/secret-key/1.1/salt/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment