Skip to content

Instantly share code, notes, and snippets.

@solrevdev
Last active December 10, 2020 09:43
Show Gist options
  • Save solrevdev/0d3775cfbf9b0d361351a4b4b764a953 to your computer and use it in GitHub Desktop.
Save solrevdev/0d3775cfbf9b0d361351a4b4b764a953 to your computer and use it in GitHub Desktop.
macos .bash_aliases
#!/bin/bash
# update system vim
alias vim="nvim"
alias vi="nvim"
alias oldvim="vim"
alias vimdiff="nvim -d"
export EDITOR="nvim"
# directory stuff
alias ll="ls -alF"
alias la="ls -A"
alias l="ls -CF"
alias dir="ls -lah"
alias rm="trash"
# list: shortcut for exa - $brew install exa
alias la="exa -bghHliSa"
alias l="exa -bghHliS"
#git commands
alias ggg="git add . && git commit -m'feat:(wip) [skip ci] work in progress'"
alias gst="git status"
alias grp="git log --since='2 sunday ago' --format='%Cgreen%ci%Creset %s%Creset' --no-merges"
alias gpe="git commit --allow-empty -m 'empty commit for ci/cd'"
alias gac="git add . && git commit -m"
alias gcm="git commit -m"
alias gcl="git clean -xdf"
alias gdf="git diff --color-moved"
alias gitdiff="gdf"
alias gitbrew='git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask" fetch --unshallow'
# git pull all (first install npm install -g git-pull-all)
alias gpa="git-pull-all"
# clear / cls
alias cls="clear"
# last pass
alias lp="lpass"
# safe rm - https://github.com/sindresorhus/guides/blob/285270f06e117c7e0a6b6e51eca6e488d9d7c44d/how-not-to-rm-yourself.md#how-not-to-rm-yourself
alias rm="trash"
# uuidgen to copy a new guid to the clipboard and the console
alias guid="uuidgen | tee >(pbcopy)"
# findit
alias findit="find . -type f -name"
# open this file for editing
alias zshconfig="subl $HOME/.zshrc"
# rename screenshots
alias sss="dotnet script $HOME/Dropbox/Projects/utils/rename-screenshots/index.csx"
# ssh into various machines
alias ssh-hplaptop="ssh [email protected]"
# my bank thing
alias lloyds="node $HOME/Dropbox/Projects/play/javascript/lloyds-bank.js"
# explorer
alias explorer="open ."
# connect to mycli
alias db="mycli -u root "
# cat replacement
#alias cat="bat -p"
# linqpad replacement
alias linqpad="dotnet ~/Applications/RoslynPad/RoslynPad.dll"
# browserstack
alias browserstack="~/Applications/BrowserStack/BrowserStackLocal --key oZbvkBwbCLpKXFmHpqsS"
# start photobox dev
alias photobox-start-dev="~/Scripts/aws/start-ec2-pbxdev.sh"
# stop photobox dev
alias photobox-stop-dev="~/Scripts/aws/stop-ec2-pbxdev.sh"
# list photobox servers running
alias photobox-list-servers="~/Scripts/aws/ec2-describe-pbx-all.sh"
# imgur upload
alias imgur="~/Projects/imgur/imgur.sh"
# dropbox
alias dropbox="~/Applications/Dropbox/dropbox.sh"
# cd into my local dev folder git pull and then bundle serve
alias solrevdevserver="cd ~/Code/github/solrevdev.github.io/ && git pull && bundle exec jekyll serve --drafts 2>/dev/null"
# web server at port 5000 here
alias www="http-server --port 5000"
# replace now.sh with vercel
alias now="vercel"
# replace notepad with gedit
alias notepad="subl"
# fix common typos
alias dotent="dotnet"
# paste image from clipboard to screenshots or well any folder you are in.
alias pasteimage='xclip -selection clipboard -t image/png -o > "$(date +%Y-%m-%d_%H-%M-%S).png"'
# pulse audio ubuntu sound mixer thing
alias sound="alsamixer"
# new terminal - the terminator
alias terminator="terminator --profile=hplaptop"
# fd - brew install fd
alias fda="fd -IH"
# ripgrep - fif (find in files)
alias fif="rg -uuus"
# ncdu
alias diskinfo="ncdu"
# restart pc
alias restart-now="~/Scripts/restart-now.sh"
# restart gnome
alias restart-gnome="~/Scripts/restart-gnome.sh"
# weather
alias weather="curl -s wttr.in | head -n7"
alias weather-full="curl -s wttr.in"
# whats my ip address
alias whats-my-ip-full="curl -s http://ip-api.com/json | jq"
alias whats-my-ip="curl -s http://ip-api.com/json | jq ".query""
# computer info
alias computer-info="sudo lshw"
# refreshenv replacement
alias refreshenv=". ~/.zshrc"
# flushdns
alias flushdns="sudo killall -HUP mDNSResponder"
# sys: system preferences panel
alias sys="open /Applications/System\ Preferences.app/"
# server: open default browser to localhost and start simple python web server
alias server="open http://localhost:8000 && python -m SimpleHTTPServer"
# myip
alias myip="ifconfig | grep inet | grep -v 127.0.0.1 | cut -d\ -f2"
# solrevdev.seedfolfer: dotnet tool install --global solrevdev.seedfolder
alias seed="seedfolder"
alias trello="seedfolder"
alias nf="seedfolder"
# pip
alias pip='python -m pip'
# ocr from imagess to text
alias extract='pytesseract'
# update everything.sh
alias ue='/Users/solrevdev/Scripts/update-everything.sh'
# open chrome
alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome "
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment