cf login -a https://api.run.pivotal.io -u [email protected]
cf push APP_NAME [-b BUILDPACK_NAME] [-c COMMAND] [-d DOMAIN]
[-f MANIFEST_PATH] [--docker-image DOCKER_IMAGE]
[-i NUM_INSTANCES] [-k DISK] [-m MEMORY] [--hostname HOST] [-p PATH]
package main | |
import ( | |
"fmt" | |
) | |
func xorSwap(x, y *int) { | |
if x != y { | |
*x ^= *y; | |
*y ^= *x; |
package main | |
import ( | |
"fmt" | |
) | |
func insertionSort(a []int, asc bool) { | |
for i := 1; i < len(a); i++ { | |
for j := i; j > 0; j-- { | |
switch asc { |
package main | |
import "fmt" | |
func main() { | |
s := "Let's hack together!" | |
fmt.Printf("%# x\n", s) | |
fmt.Println([]byte(s)) | |
} |
go fmt | |
warnings=`golint` | |
if [[ $warnings != "" ]]; then | |
echo $warnings | |
exit 1 | |
fi | |
exit 0 |
<?php | |
/* | |
pfBlockerNG_import.php | |
pfBlockerNG | |
Copyright (C) 2014 [email protected] | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: |
cf login -a https://api.run.pivotal.io -u [email protected]
cf push APP_NAME [-b BUILDPACK_NAME] [-c COMMAND] [-d DOMAIN]
[-f MANIFEST_PATH] [--docker-image DOCKER_IMAGE]
[-i NUM_INSTANCES] [-k DISK] [-m MEMORY] [--hostname HOST] [-p PATH]
raspivid -o - -t 0 -fps 30 -b 6000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 50 -strict experimental -f flv rtmp://a.rtmp.youtube.com/live2/$KEY | |
./mjpg_streamer -o "output_http.so" -i "input_raspicam.so -x 1920 -y 1080 -fps 30" | |
sudo ./mjpg_streamer -i "input_uvc.so -d /dev/video1 -r 1280x720 -f 30 -q 85" -o "output_http.so" | |
sudo ffmpeg -f v4l2 -video_size 1920x1080 -i /dev/video0 -f v4l2 -video_size 1920x1080 -i /dev/video1 -filter_complex "[0:v]setpts=PTS-STARTPTS[background];[1:v]setpts=PTS-STARTPTS,scale=iw/2:-1[foreground];[background][foreground]overlay=main_w-overlay_w-10:main_h-overlay_h-10" -c:v libx264 -crf 18 -preset ultrafast -c:a copy output.mkv | |
CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo | |
# Dockerfile | |
FROM scratch | |
#ADD ca-certificates.crt /etc/ssl/certs | |
ADD app / # add binary | |
ENV LISTEN_PORT 7905 | |
ENTRYPOINT [ "/app" ] |
#!/bin/sh | |
## Clean up any stale tempfile | |
echo "Removing old files..." | |
[ -f /tmp/hosts.working ] && rm -f /tmp/hosts.working | |
## Awk regex to be inverse-matched as whitelist | |
# - Project Wonderful does unobtrusive ads on a lot of webcomics | |
# - SolveMedia is needed for captchas on some websites | |
#whitelist='/(projectwonderful.com|api.solvemedia.com)/' |
package main | |
import ( | |
"fmt" | |
"io/ioutil" | |
"bufio" | |
"bytes" | |
"strings" | |
"strconv" | |
) |