export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS
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 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 |
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 ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| "syscall" | |
| ) | |
| func main() { |
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/sh | |
| # contributors: Generate MAINTAINERS content from git commits | |
| # | |
| # Author: Steven Enten <steven@enten.fr> | |
| # License : MIT | |
| # Requirements: dirname cat echo eval grep read readlink shift tail | |
| # Site: https//github.com/enten/losh | |
| set -u |
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
| // 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: |
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 ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| ) | |
| // SSE writes Server-Sent Events to an HTTP client. |
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
| import os | |
| import asyncio | |
| import sys | |
| from asyncio.streams import StreamWriter, FlowControlMixin | |
| reader, writer = None, None | |
| @asyncio.coroutine | |
| def stdio(loop=None): |
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
| /* 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: |
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( | |
| "log" | |
| "net/url" | |
| "net/http" | |
| "net/http/httputil" | |
| ) | |
| func main() { |