This file contains 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
/* | |
Simple test webserver for static content - the docs are bigger than the code! | |
1. install node and npm: http://nodejs.org/ | |
2. create a directory where you want your little web server | |
3. cd to that directory | |
4. save this file you are reading to that directory as app.js | |
5. npm install express | |
6. mkdir public |
This file contains 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 ( | |
"bufio" | |
"fmt" | |
"log" | |
"math/rand" | |
"net" | |
"time" | |
) |
This file contains 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 | |
/*test with curl | |
curl -X POST -H "Content-Type: application/json" \ | |
-d '{"method":"HelloService.Say","params":[{"Who":"Test"}], "id":"1"}' \ | |
http://localhost:10000/rpc | |
*/ | |
import ( | |
"github.com/gorilla/rpc" |
This file contains 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 | |
//http://play.golang.org/p/kLmBrJYchH | |
import ( | |
"fmt" | |
"time" | |
) | |
func mychan(id string, c chan string) { |
This file contains 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" | |
"math/rand" | |
"time" | |
) | |
func pickone(ticketsize int) []int { | |
one := make([]int, ticketsize) |
This file contains 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 logging | |
import ( | |
"fmt" | |
"log" | |
) | |
const ( | |
DEBUG = 0 | |
INFO = 1 |
This file contains 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/env bash | |
# | |
# Create a base CentOS Docker image. | |
# | |
# This script is useful on systems with yum installed (e.g., building | |
# a CentOS image on CentOS). See contrib/mkimage-rinse.sh for a way | |
# to build CentOS images on other systems. | |
usage() { | |
cat <<EOOPTS |
This file contains 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 addppa { | |
add-apt-repository $1 -y | |
} | |
function aptinstall { | |
apt-get install $1 -y | |
} |
This file contains 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 | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
export ORACLE_HOME=${DIR} | |
export LD_LIBRARY_PATH=${DIR}:$LD_LIBRARY_PATH |
This file contains 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 random | |
import time | |
import subprocess | |
random.seed() | |
full_files = [] | |
rootdir = "/home/dbehnke/wallpapers" | |
sleeptime = 300 | |
while 1: | |
print("reading pictures from ", rootdir) |
OlderNewer