All code is available in example app - https://github.com/maxivak/webpacker-rails-example-app
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 | |
| VENV=$1 | |
| if [ -z $VENV ]; then | |
| echo "usage: runinenv [virtualenv_path] CMDS" | |
| exit 1 | |
| fi | |
| . ${VENV}/bin/activate | |
| shift 1 | |
| echo "Executing $@ in ${VENV}" | |
| exec "$@" |
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
| package main | |
| import ( | |
| "context" | |
| "log" | |
| "net/http" | |
| "os" | |
| "os/signal" | |
| "time" | |
| ) |
Due to the incessant swarm of complete and utter nonsense that has been forcing its way into Firefox over time, I've decided to start collecting my personal list of “must-have” about:config tweaks required to turn Firefox into a functional brower.
NOTE: Unfortunately this is somewhat out of date. The comments link to some resources that may be more up-to-date. Patches welcome.
These can be used for nefarious purposes and to bypass access restrictions.
I hereby claim:
- I am akhy on github.
- I am akhy (https://keybase.io/akhy) on keybase.
- I have a public key ASAuLFMP1bKJSRzHLNcuvBpH2k6s36AZMXrzgddwuLgzhQo
To claim this, I am signing this object:
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
| from sys import platform | |
| if platform == "linux" or platform == "linux2": | |
| from sh import grep, wc, cat | |
| # cat /proc/cpuinfo | grep 'core id' | wc -l | |
| cpu_count = wc(grep(cat('/proc/cpuinfo'), 'core id'), '-l') | |
| elif platform == "darwin": | |
| from sh import grep, sysctl, awk | |
| # sysctl -a | grep machdep.cpu.core_count | awk '{print $2}' | |
| cpu_count = awk(grep(sysctl('-a'), 'machdep.cpu.core_count'), '{print $2}') |
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 | |
| # Have to redirect stderr to stdout here because slave.py uses stderr for output. | |
| ~/bin/slave.py list 2>&1 >/dev/null | grep beaker-slave- | while read slave; do | |
| echo | |
| echo "Checking status of $slave..." | |
| # First, check if we can SSH into the host. If we can, then check the process and maybe shut down. | |
| # This makes sure that we don't consider an SSH failure to be reason to shut down the node. | |
| if ssh $slave echo < /dev/null; 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
| #!/bin/bash | |
| # Notes: | |
| # - RANCHER_URL, RANCHER_ACCESS_KEY, RANCHER_SECRET_KEY must be set | |
| # - jq is required (brew install jq) // TODO: remove this dependency | |
| # - cache is located at $HOME/.rancher-compose/cache.txt | |
| # - usage is the same as rancher-compose, it's just a wrapper | |
| if [ `uname` == "Darwin" ]; then | |
| ARCH="darwin-amd64" |
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/python | |
| maxw=25 # largest width | |
| minw=1 # smallest width | |
| pad=1 # left-right padding per step | |
| incr=pad*2 # | |
| # assumptions | |
| assert maxw >= minw + 2 # max width must be equals or greater than minw+2 | |
| assert minw > 0 |
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 | |
| # | |
| # Copies certain kinds of known files and directories from a given Jenkins master directory | |
| # into a git repo, removing any old ones, adds 'em, commits 'em, pushes 'em. | |
| # | |
| set -ex | |
| if [ $# -ne 2 ]; then | |
| echo usage: $0 root_dir jenkins_master |