apt-get update
apt-get upgrade
apt-get install curl
# Check VXLAN exists
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
bash$ pg_ctl -D /usr/local/var/postgres start ## init postgres | |
bash$ psql -d postgres ## connect to postgres | |
psql# create database logger; -- create a database named "logger" | |
psql# begin; -- start a transaction | |
psql# \i log.sql -- load database | |
psql# commit; -- commit the transaction | |
bash$ go run log.go ## run driver program |
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" | |
"golang.org/x/crypto/openpgp" | |
"os" | |
) | |
func main() { | |
keyRingReader, err := os.Open("signer-pubkey.asc.txt") |
$ npm install
$ ./node_modules/.bin/webpack-dev-server
$ open http://localhost:8080/webpack-dev-server/
Notes:
- Note the trailing slash on the URL is significant. Without it webpack-dev-server shows a file listing page.
- You need 1.0.11 or later of webpack-dev-middleware for this URL to work. With earlier versions you need to specify the full URL like this:
http://localhost:8080/webpack-dev-server/index.html
. - To get a non-autoreloading version of the page use
http://localhost:8080/index.html
.
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" | |
"image/jpeg" | |
"io/ioutil" | |
"log" | |
"os" | |
"strings" |
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
/* | |
* Example code for my blog post on function shims for NancyFx request handlers | |
* Blog post is here: http://anthonysteele.co.uk/more-patterns-for-web-services-in-nancyfx | |
*/ | |
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using Nancy; |
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
IEnumerator ForceDirectGraph<T>( Graph<T> graph, Dictionary<T, Vector3> graphPositions ) { | |
// settings | |
float attractToCenter = 15f; | |
float repulsion = 10f; | |
float spacing = 0.1f; | |
float stiffness = 100f; | |
float damping = 0.9f; | |
// initialize velocities and positions | |
Dictionary<Vertex<T>, Vector2> velocity = new Dictionary<Vertex<T>, Vector2>(); |
see https://github.com/ankidroid/Anki-Android/wiki/Database-Structure for a more maintained version of this
Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.
cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/
NewerOlder