Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
#!/bin/bash | |
function git_is_dirty { | |
[[ $(git diff --shortstat 2> /dev/null | tail -n1) != "" ]] && echo "yes" | |
} | |
function git_is_diverged { | |
LOCAL=$(git rev-parse --abbrev-ref HEAD 2> /dev/null || echo "none") | |
REMOTE=$(git rev-parse --abbrev-ref --symbolic-full-name @{u} 2> /dev/null || echo "none") | |
if [[ "$LOCAL" == "none" ]]; then # No commits yet |
Create a template service file at /etc/systemd/system/[email protected]
. The template parameter will correspond to the name
of target host:
[Unit]
Description=Setup a secure tunnel to %I
After=network.target
package main | |
import ( | |
"fmt" | |
"os" | |
"os/exec" | |
"syscall" | |
) | |
func main() { |
#!/bin/sh | |
# contributors: Generate MAINTAINERS content from git commits | |
# | |
# Author: Steven Enten <[email protected]> | |
# License : MIT | |
# Requirements: dirname cat echo eval grep read readlink shift tail | |
# Site: https//github.com/enten/losh | |
set -u |
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"time" | |
) | |
// SSE writes Server-Sent Events to an HTTP client. |
import os | |
import asyncio | |
import sys | |
from asyncio.streams import StreamWriter, FlowControlMixin | |
reader, writer = None, None | |
@asyncio.coroutine | |
def stdio(loop=None): |
/* This is a wrapper library that will give your server the power of | |
* /dev/null as a service, as seen at http://devnull-as-a-service.com/ | |
* | |
* Compile: | |
* gcc -ggdb -shared -fPIC dnaas.c -ldl -lcurl -o libdnaas.so | |
* | |
* Try: | |
* LD_PRELOAD=./libdnaas.so dd if=/dev/sda of=/dev/null bs=8192 count=16 | |
* | |
* Install: |
package main | |
import( | |
"log" | |
"net/url" | |
"net/http" | |
"net/http/httputil" | |
) | |
func main() { |
#!/usr/bin/env python | |
# jsonenv reads a json object as input and produces | |
# escaped shell commands for setting environment vars | |
import json | |
import pipes | |
import sys | |
for k, v in json.load(sys.stdin).items(): |