go build -o goencrypt main.go
This file contains hidden or 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
| /* | |
| 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 file contains hidden or 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
| /* | |
| * 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 |
This file contains hidden or 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
| // 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" |
This file contains hidden or 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
| #!/usr/bin/env python | |
| import base64 | |
| import hashlib | |
| import subprocess | |
| import sys | |
| B32ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567' | |
| def luhn_checksum(data, alphabet=B32ALPHABET): | |
| n = len(alphabet) |
This file contains hidden or 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
| 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" |
This file contains hidden or 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 ( | |
| "github.com/pkg/sftp" | |
| "golang.org/x/crypto/ssh" | |
| ) | |
| func main() { | |
| addr := “my_ftp_server:22" | |
| config := &ssh.ClientConfig{ |
This file contains hidden or 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
| // 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 | |
| } |
This file contains hidden or 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
| #! /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, |
This file contains hidden or 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 example_test | |
| import ( | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "hex" | |
| "io" | |
| ) | |
| // AES-GCM should be used because the operation is an authenticated encryption |