- Related Setup: https://gist.github.com/hofmannsven/6814278
- Related Pro Tips: https://ochronus.com/git-tips-from-the-trenches/
- Interactive Beginners Tutorial: http://try.github.io/
- Git Cheatsheet by GitHub: https://services.github.com/on-demand/downloads/github-git-cheat-sheet/
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
## Delete a remote branch | |
$ git push origin --delete <branch> # Git version 1.7.0 or newer | |
$ git push origin :<branch> # Git versions older than 1.7.0 | |
## Delete a local branch | |
$ git branch --delete <branch> | |
$ git branch -d <branch> # Shorter version | |
$ git branch -D <branch> # Force delete un-merged branches | |
## Delete a local remote-tracking branch |
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 | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 <service_account_name> <namespace>" | |
exit 1 | |
fi |
Magic words:
psql -U postgres
Some interesting flags (to see all, use -h
or --help
depending on your psql version):
-E
: will describe the underlaying queries of the\
commands (cool for learning!)-l
: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
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
#### | |
# DigitalOcean: this file was written via cloud-init and composed from /etc/cloud/cloud.cfg | |
# In order to support resize events, 'growpart' and 'resizefs' are run each boot. | |
# 'update_etc_hosts' will be run only once per instance. To see the differences, run | |
# 'diff -u /etc/cloud/cloud.cfg /etc/cloud/cloud.cfg.d/90-digitalocean.cfg'. | |
#### | |
users: | |
- default |
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 | |
# Backs up and restores tilix settings | |
set -e | |
if [[ $1 == 'backup' ]]; then | |
dconf dump '/com/gexperts/Tilix/' > tilix-settings.dconf | |
echo "backup done" | |
exit 0 |
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-plug example | |
call plug#begin('~/.vim/plugged') | |
Plug 'pearofducks/ansible-vim' | |
call plug#end() | |
let g:ansible_goto_role_paths = './roles,../_common/roles' | |
function! FindAnsibleRoleUnderCursor() | |
if exists("g:ansible_goto_role_paths") | |
let l:role_paths = g:ansible_goto_role_paths |
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 | |
set -e | |
trkpad=$(synclient | grep -i 'touchpadoff' | awk '{print $(NF)}') | |
if (( trkpad == 0 )); then | |
synclient TouchpadOff=1 | |
notify-send -t 1500 'Touchpad Disabled' | |
else |