Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
package main | |
import ( | |
"fmt" | |
"time" | |
"rand" | |
"sync" | |
"runtime" | |
) |
package main | |
import ( | |
"flag" | |
"fmt" | |
"sync" | |
) | |
var ( |
// largely cargo-culted from http://go.pkgdoc.org/code.google.com/p/go.crypto/ssh#_example_Listen | |
package main | |
import "fmt" | |
import "io/ioutil" | |
import "code.google.com/p/go.crypto/ssh" | |
import "code.google.com/p/go.crypto/ssh/terminal" | |
func main() { |
package main | |
import ( | |
"crypto/sha1" | |
"fmt" | |
"io" | |
"mime/multipart" | |
"net/http" | |
"os" | |
"path/filepath" |
package main | |
import ( | |
"bufio" | |
"fmt" | |
"os" | |
"time" | |
) | |
const numWorkers = 3 |
########################################################################################### | |
# Liquidsoap Radio System - built by GeekBrony, based from Liquidsoap. # | |
########################################################################################### | |
# Primary Features: | |
# - AutoDJ that crossfades between songs and has a 1/10 chance of landing on a Station ID/Jingle/Ad. | |
# - AutoDJ also selects tracks from "High Priority", "Low Priority" and "New Songs" playlists randomly. | |
# - Live Shows (that automatically dump to a directory) | |
# - Mic to speak over the stream. | |
# - Requests via Telnet/Web Interface, which have a 80-90% chance of queuing up when a song ends. |
# Build environment. I use vagrant ubuntu/trusty64 | |
sudo apt-get install build-essential git-core | |
sudo git clone https://github.com/raspberrypi/tools.git /opt/tools | |
export CCPREFIX="/opt/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-" | |
# Get ffmpeg and x264 repos | |
git clone git://source.ffmpeg.org/ffmpeg.git |
/** | |
* ESP8266 project template with optional: | |
* - WiFi config portal - auto or manual trigger | |
* - OTA update - Arduino or web server | |
* - Deep sleep | |
* - Process timeout watchdog | |
* | |
* Copyright (c) 2016 Dean Cording <dean@cording.id.au> | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy |
You'll probably be working with a single smartcard, so you'll want only one primary key ( |
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in: