Skip to content

Instantly share code, notes, and snippets.

devster31 / tasks.jsonc
Created Feb 11, 2020
yamllint Visual Studio Code task
View tasks.jsonc
// See
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
"label": "yamllint",
"type": "shell",
"command": "/usr/local/bin/yamllint",
"args": [

query is not returning an empty list.

  • Bug Report
View hyper.js
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
devster31 / joseph_reagle.bash
Last active Feb 23, 2019
ssh-agent automation done well
View joseph_reagle.bash
function start_agent {
echo "Initialising new SSH agent..."
/usr/bin/ssh-agent | sed 's/^echo/#echo/' > "${SSH_ENV}"
echo succeeded
chmod 600 "${SSH_ENV}"
. "${SSH_ENV}" > /dev/null
devster31 /
Created Feb 25, 2018
messy post-processing
#!/bin/bash -u
file=$1 # {f}
location=$2 # {f.dir.dir}
database=${3} # {info.DataBase}
id=${4:-x} # {}
name="${5}" # {info.Name}
if [[ ! -f "$1" ]]; then
from subprocess import Popen, PIPE
def run_command():
with Popen([''], stdout=PIPE, stderr=PIPE, bufsize=1, universal_newlines=True) as p:
while p.poll() is None:
out = p.stdout.readline()
err = p.stderr.readline()
print(out, end='')
print(err, end='')


The trend_ema strategy (default)

  • The default strategy is called trend_ema and resides at ./extensions/strategies/trend_ema.
  • Defaults to using a 2m period, but you can override this with adding e.g. --period=5m to the sim or trade commands.
  • Computes the 26-period EMA of the current price, and calculates the percent change from the last period's EMA to get the trend_ema_rate
  • Considers trend_ema_rate >= 0 an upwards trend and trend_ema_rate < 0 a downwards trend
  • Filters out low values (whipsaws) by neutral_rate, which when set to auto, uses the standard deviation of the trend_ema_rate as a variable noise filter.
  • Buys at the beginning of upwards trend, sells at the beginning of downwards trend
devster31 / Dockerfile
Last active Jan 23, 2022
[Beets Docker] #config #software
View Dockerfile
FROM lsiobase/alpine
# environment settings
BEETSDIR="/config" \
devster31 /
Created Aug 16, 2017
Bash script to setup a temporary SSH tunnel

You can do this cleanly with an ssh 'control socket'. To talk to an already-running SSH process and get it's pid, kill it etc. Use the 'control socket' (-M for master and -S for socket) as follows:

$ ssh -M -S my-ctrl-socket -fnNT -L 50000:localhost:3306
$ ssh -S my-ctrl-socket -O check
Master running (pid=3517) 
$ ssh -S my-ctrl-socket -O exit
Exit request sent. 

Note that my-ctrl-socket will be an actual file that is created.

devster31 /
Created Aug 16, 2017
Transmission script to clean completed downloads
# the folder to move completed downloads to
# port, username, password
SERVER="9091 --auth transmission:transmission"
# use transmission-remote to get torrent list from transmission-remote list
# use sed to delete first / last line of output, and remove leading spaces
# use cut to get first field from each line