Run incognito/private commands for Bash and Zsh
Simply put a space before the command and it won't be saved to ~/.bash\_history. E.g. qrencode -o out.png "Some secret text"
Upgrade postgres database with homebrew
To upgrade postgres you can run
Amazon AWS S3 CLI copy with set perms
Open term (or equivalent) and paste the following:
Angry Docker Purge
If you receive No Space left error on Docker this the brute force solution:
Back up a file with same name + prefix
NOTE: Actually you can use !#:1 in every command 'cause that's last argument passed to a command.
Bash aliases and magic
I have a seperate file in my user folder named ~/.aliases. I use this to store all of my bash aliases. I use aliases a lot and add new ones regularly so I created a bash function to add new aliases…
Check for IKEA item availability
If you're waiting for an IKEA item to restock, here's a practical solution to stay updated automatically. This guide explains how to use a shell script to check IKEA's stock availability and get…
Check if command exists with shell script
Check if command exists with shell script
Create your own git commands (aliases)
Ever wanted to shorten a git command? You can go with shell alilas for sure but you have to always include context so that you don't forget what each ailas stands for but you can define your own…
Delete already-merged branchs in Git
You can safelist more branches in egrep -v 'master|develop|foo|bar'
Delete merged git branches
Handy git command for deleting all local git branches that already merged git branch --merged | egrep -v "(^\\|master|dev)" | xargs git branch -d*
Diff a local file with remote version in Git
Easily run the below command and get a diff version from the remote
Find a branch based on a commit
c198bb715 Make default expired description logic pretty `
Force push previous commit to repo
If you push some code and want to force push a previous commit you can do so with shell git push origin +commit\sha^:branch\name
Get current git branch name
Get current git branch name
Go through a file Git history (GUI)
Go through a file Git history (GUI)
Kill rails that got stuck
I'd like to kill rails running w/specific port. (My laptop running several rails servers. )
Kill unresponsive SSH session
Occasionally an SSH session may become unresponsive. If I put my laptop to sleep this happens fairly often. Rather than killing the tab you can use SSH Escape Characters to kill the session
List directory structure except one or more dirs
Ever wanted to display the structure of the current directory except or two directories?
make a pr from command line using hub
install hub first with brew: brew install hub then use a simple command, like at the example below: hub pull-request -m "best pr ever" -b oozou:develop -h feature/awesome-improvements
Remove unwanted commit from your branch
Remove unwanted commit from your branch
Restore a deleted file in Git
Restore a deleted file in Git
Run same command on different input/inputs
If you have to run the same command repetitively over different input/inputs.
See deleted files in previous commits [git]
See deleted files in previous commits [git]
Send messages to Slack using cURL
Slack allows you to send messages via the Webhooks service
Shallow clone a old repo
If you don't need the full git history for a repo you will be working on you can supply a clone depth to only clone x revisions of the repo.
Use `host` to get more information about domains
You might be using dig to find out A/CNAME/MX etc records of a domain from DNS servers. But if you just want to get a quick overview, use host:
Using Git's aliases feature
Git allows you to create aliases internally through the config. Your global config should be located here ~/.gitconfig
Watch CI status on Github
When you have Github's hub installed, you can get the ci-status of your current branch like this:
Zsh function to list file tree
When navigating through directories on the command line, it’s often helpful to see the structure of directories and subdirectories in a "tree" format. While there are plenty of tools out there, such…