I wrote this four years ago, so instead use this command:
$ docker rmi $(docker images -q -f dangling=true)
| # The Nginx configuration based on https://coderwall.com/p/rlguog | |
| http { | |
| ssl_certificate server.crt; | |
| ssl_certificate_key server.key; | |
| ssl_session_timeout 15m; | |
| ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2; | |
| ssl_prefer_server_ciphers on; | |
| ssl_session_cache shared:SSL:10m; |
| r := mux.NewRouter() | |
| // Single handler | |
| r.HandleFunc("/form", use(http.HandlerFunc(formHandler), csrf, logging) | |
| // All handlers | |
| http.Handle("/", recovery(r)) | |
| // Sub-routers | |
| apiMiddleware := []func(http.Handler) http.Handler{logging, apiAuth, json} |
| { | |
| "title": "Collectd: Blackbox", | |
| "services": { | |
| "query": { | |
| "list": { | |
| "0": { | |
| "query": "plugin:\"load\"", | |
| "alias": "Load", | |
| "color": "#7EB26D", | |
| "id": 0, |
| [unix_http_server] | |
| file=/var/run/supervisor.sock | |
| chmod=0770 | |
| chown=root:supervisor | |
| [supervisord] | |
| pidfile=/var/run/supervisord.pid | |
| nodaemon=false | |
| logfile=/var/log/supervisord/supervisord.log | |
| loglevel=error |
Single-line comments are started with //. Multi-line comments are started with /* and ended with */.
C# uses braces ({ and }) instead of indentation to organize code into blocks.
If a block is a single line, the braces can be omitted. For example,
| package auth | |
| import ( | |
| "net/http" | |
| "net/url" | |
| "strings" | |
| "time" | |
| "lib/crypto" | |
| "lib/utils" |
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "log" | |
| "net/rpc" | |
| ) | |
| func main() { |
I recently had the following problem:
We didn't want to open the MySQL port to the network, but it's possible to SSH from the Jenkins machine to the MySQL machine. So, basically you would do something like
ssh -L 3306:localhost:3306 remotehost
| #!/usr/bin/env python | |
| import sys, os, time, atexit | |
| from signal import SIGTERM | |
| class Daemon: | |
| """ | |
| A generic daemon class. | |
| Usage: subclass the Daemon class and override the run() method |