Skip to content

Instantly share code, notes, and snippets.

@edevil
edevil / start.sh
Created October 27, 2016 10:09 — forked from camshaft/start.sh
elixir startup script with graceful shutdown
#!/bin/bash
HOSTNAME="localhost"
PORT=${PORT-4000}
NODE="app_$PORT"
if [ -z "$COOKIE" ]
then
COOKIE=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1)
fi
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
[Unit]
Description=Copy CIFS mount
After=network.target
[Service]
Type=oneshot
RemainAfterExit=yes
TimeoutStartSec=0
ExecStart=/bin/sh -c "rm -fr /opt/sbin && rsync -a /usr/sbin/ /opt/sbin/ && /usr/bin/docker run -v /opt/sbin:/target so0k/mount.cifs_copy /target && mount --bind /opt/sbin/ /usr/sbin/"
@edevil
edevil / stress.yaml
Created July 1, 2016 08:17 — forked from sercand/stress.yaml
Kubernetes Stress Job
apiVersion: batch/v1
kind: Job
metadata:
name: pi-with-timeout
spec:
parallelism: 20
completions: 100
template:
metadata:
name: pi
@edevil
edevil / phoenix-app.service
Created February 12, 2016 12:49 — forked from kzkin/phoenix-app.service
systemd service for phoenix framework release (exrm)
# Phoenix Framework - A productive web framework that does not compromise speed and maintainability
[Unit]
Description=Phoenix Framework ISControl Application
After=network.target
[Service]
Type=simple
User=deployer
RemainAfterExit=yes
@edevil
edevil / geventfd.py
Created June 18, 2012 08:57 — forked from wolever/geventfd.py
Simple wrapper around a file descriptor which will perform non-blocking reads/writes using gevent
import os
import fcntl
from gevent.core import wait_read, wait_write
class GeventFD(object):
""" Wrap a file descriptor so it can be used for non-blocking reads and writes with gevent.
>>> stdin = GeventFD(sys.stdin.fileno())
>>> stdin.read(5)
'hello'