This file contains hidden or 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 | |
| set -e | |
| ###################################################################### | |
| NOT_FOUND="EXECUTABLE NOT FOUND" | |
| get_first_path() { | |
| for path in "$@"; do | |
| if [ -e "$path" ]; then |
This file contains hidden or 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
| 0 0 * * * /usr/local/bin/timeout -s 9 3600 /Users/adam/bin/nightly | |
| 0 0 * * * /usr/local/bin/timeout -s 9 3600 /Users/adam/bin/nightly >> /Users/adam/log/nightly.log 2>&1 |
This file contains hidden or 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 | |
| # 1. Search for text in files using Ripgrep | |
| # 2. Interactively narrow down the list using fzf | |
| # 3. Open the file in Vim | |
| IFS=: read -ra selected < <( | |
| rg --color=always --line-number --no-heading --smart-case "${*:-}" | | |
| fzf --ansi \ | |
| --color "hl:-1:underline,hl+:-1:underline:reverse" \ | |
| --delimiter : \ |
This file contains hidden or 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 | |
| pandoc -N \ | |
| --variable "geometry=margin=0.75cm" \ | |
| --variable mainfont="Palatino" \ | |
| --variable sansfont="Helvetica" \ | |
| --variable monofont="Menlo" \ | |
| --variable fontsize=10pt \ | |
| --variable version=2.0 \ | |
| --from=gfm "$1.md" \ | |
| --pdf-engine=xelatex \ |
This file contains hidden or 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 | |
| function usage() { | |
| echo "usage: $0 start|stop" | |
| } | |
| if [[ $# -ne 1 ]] || [[ -z $1 ]]; then | |
| usage | |
| exit -1 | |
| fi |
This file contains hidden or 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
| echo "# ping" | |
| ping -q -w1 -c1 google.com &>/dev/null && echo online || echo offline | |
| echo "" | |
| echo "# scutil" | |
| scutil -r google.com | |
This file contains hidden or 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 | |
| function usage() { | |
| echo "usage: $0 <dir>" | |
| } | |
| if [[ $# -ne 1 ]] || [[ -z $1 ]]; then | |
| usage | |
| exit -1 | |
| fi |
This file contains hidden or 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 | |
| function usage() { | |
| echo "usage: $0 <dir>" | |
| } | |
| if [[ $# -ne 1 ]] || [[ -z $1 ]]; then | |
| usage | |
| exit -1 | |
| fi |
This file contains hidden or 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 [[ ! -d ./.venv ]]; then | |
| echo "no virtual environment in current directory" | |
| exit 1 | |
| fi | |
| . .venv/bin/activate | |
| PYVER=`python --version | cut -d " " -f2` | |
| DNAME="[${PYVER}]: ${PWD}" | |
| KNAME=${PWD##*/} |
This file contains hidden or 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 | |
| echo "" | |
| echo -e "running : screen -ls " | |
| echo -e "start : screen -d -m -S NAME command" | |
| echo -e "stop : screen -X -S NAME quit " | |
| echo -e "attach : screen -r NAME " | |
| if [[ $# -gt 0 ]]; then | |
| echo "" | |
| echo -e "screen $*" |