openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
openssl req -x509 -newkey rsa:4096 -sha256 -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650 -passout pass:foobar
openssl x509 -x509toreq -in example.crt -out example.csr -signkey example.key -passin pass:foobar
| /* | |
| HookHandler - listen for github webhooks, sending updates on channel. | |
| DeploymentMonitor select update type based on channel and call deployment script | |
| */ | |
| package main | |
| import ( | |
| "fmt" | |
| "html/template" | |
| "io/ioutil" |
| /* | |
| * This implementation of popen3() was created in 2007 for an experimental | |
| * mpg123 frontend and is based on a popen2() snippet found online. This | |
| * implementation may behave in unexpected ways if stdin/stdout/stderr have | |
| * been closed or modified. No warranty of its correctness, security, or | |
| * usability is given. My modifications are released into the public domain, | |
| * but if used in an open source application, attribution would be appreciated. | |
| * | |
| * Mike Bourgeous | |
| * https://github.com/mike-bourgeous |
| // curl -X POST -H "Content-Type: application/octet-stream" --data-binary '@filename' http://127.0.0.1:5050/upload | |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| "time" |
| #!/usr/bin/env python | |
| import base64 | |
| import hashlib | |
| import subprocess | |
| import sys | |
| B32ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' | |
| def luhn_checksum(data, alphabet=B32ALPHABET): | |
| n = len(alphabet) |
| node { | |
| echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1' | |
| echo 'No quotes, pipeline command in single quotes' | |
| sh 'echo $BUILD_NUMBER' // 1 | |
| echo 'Double quotes are silently dropped' | |
| sh 'echo "$BUILD_NUMBER"' // 1 | |
| echo 'Even escaped with a single backslash they are dropped' | |
| sh 'echo \"$BUILD_NUMBER\"' // 1 | |
| echo 'Using two backslashes, the quotes are preserved' | |
| sh 'echo \\"$BUILD_NUMBER\\"' // "1" |
| package main | |
| import ( | |
| "github.com/pkg/sftp" | |
| "golang.org/x/crypto/ssh" | |
| ) | |
| func main() { | |
| addr := “my_ftp_server:22" | |
| config := &ssh.ClientConfig{ |
| // fileResponseWriter wraps an http.ResponseWriter and a File | |
| // passing it to an http.Handler's ServeHTTP | |
| // will write to both the file and the response. | |
| type fileResponseWriter struct { | |
| file io.Writer | |
| resp http.ResponseWriter | |
| multi io.Writer | |
| } |
| #! /bin/sh | |
| # Highlight.ME - console output higlighter | |
| # Copyright (c) 2016 Levi Taule | |
| # | |
| # This software is provided 'as-is', without any express or implied | |
| # warranty. In no event will the authors be held liable for any damages | |
| # arising from the use of this software. | |
| # | |
| # Permission is granted to anyone to use this software for any purpose, |
| package example_test | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "hex" | |
| "io" | |
| ) | |
| // AES-GCM should be used because the operation is an authenticated encryption |