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
# git clean is destructive, particularly if you have .env files | |
# and/or /vendor or /node_modules directories. | |
# Instead, use this to reset your current branch back before a pull or something. | |
# | |
# Personally, I keep this in my ~/.bashrc file so it's available on session boot. | |
alias gitr='git reset --hard && git ls-files --others --exclude-standard | xargs rm' |
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
# WARNING - This is a destructive process. It literally | |
# removes all local branches except master. | |
# | |
# If you make a mistake, there _is_ a way to get back a | |
# branch using `git reflog` however, why risk it? | |
git checkout master | |
git branch | grep -ve "master$" | xargs git branch -D |
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
sudo apt-get update | |
sudo apt install composer mysql-server -y | |
sudo apt install php7.4 php7.4-cli php7.4-common php7.4-mysql php7.4-xml php7.4-xmlrpc | |
php7.4-curl php7.4-gd php7.4-imagick php7.4-cli php7.4-dev php7.4-imap php7.4-mbstring | |
php7.4-opcache php7.4-soap php7.4-zip php7.4-intl php7.4-fpm php7.4-json | |
php7.4-bcmath -y | |
sudo mysql_secure_installation | |
#remember that now, root user requires sudo to log in: | |
sudo mysql -uroot -p | |
#>>>>>>>>>>>>>>>>>> |
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
# This allows you to go back and rewrite the commiters in your | |
# git history. For example, if you accidentally had "server" | |
# as your git name. | |
# | |
# You can put this in a shell script or run from the command line, | |
# just be sure to change the values first of course. | |
git filter-branch --env-filter ' | |
WRONG_EMAIL="[email protected]" | |
NEW_NAME="New Name Value" |
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
# just do `gitl` from the command-line and you will get a nicely formatted | |
# commit list. | |
# Defaults to the most recent 15, but if you add a number you can go as far | |
# back as you like: `gitl 100` | |
function gitl () { | |
NUMBER="${1:-15}" | |
git log -n $NUMBER --pretty=format:"%C(yellow)%h %C(auto,magenta)%>(12)%ad %Cgreen%<(7)%aN%Cred%d %Creset%s" | |
} |
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
# if your ~/.ssh/config file isn't cutting it for some reason, | |
# use this. Add as many ssh-add lines as you want. | |
eval $(ssh-agent -s) > /dev/null | |
ssh-add ~/.ssh/private-key > /dev/null |
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
# If you want to connect to a vpn using openconnect from the command-line | |
# you can use this. I had it working with Citrix, and works with OpenVPN too. | |
echo 'password' | sudo openconnect --user=username --passwd-on-stin vpnurl.com |