Skip to content

Instantly share code, notes, and snippets.

View sthorne's full-sized avatar

Sean Thorne sthorne

View GitHub Profile
@sthorne
sthorne / gist:d66c3f35fb65198af165
Created February 24, 2015 14:43
Shell Encrypt / Decrypt a File
openssl enc -aes-256-cbc -salt -in ugh.txt -out ugh.out
openssl enc -d -aes-256-cbc -in ugh.out
@sthorne
sthorne / gist:63e3d6e657ab7d660bf0
Created February 24, 2015 14:45
Shell SSH Tunnel
ssh ssh-host -p 322 -L local-host:443:remote-host:443 -N
@sthorne
sthorne / gist:5c977840f4bc2f25ad2e
Created February 24, 2015 19:42
Enable TLS in Postfix
postconf -e 'smtp_tls_security_level = may’
postconf -e 'smtp_tls_loglevel = 1’
postconf -e 'smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt’
service postfix restart
@sthorne
sthorne / gist:7de70dc5cd871ce2f48f
Created February 24, 2015 19:45
Install Java on CentOS 6
mkdir /usr/java
cp jre-7u51-linux-x64.rpm /usr/java/jre-7u51-linux-x64.rpm
cd /usr/java
rpm -ivh jre-7u51-linux-x64.rpm
alternatives --config java
java -version
@sthorne
sthorne / gist:db368c3c57b94aab5756
Created February 26, 2015 17:38
Go - Time Duration
package main
import "fmt"
import "time"
func main() {
t := time.Now()
time.Sleep(10 * time.Millisecond)
@sthorne
sthorne / gist:6f7090c529182ce91948
Created February 28, 2015 22:29
Cross Compile Go
# This must be run from GOROOT
cd /usr/local/go/src
# Options
# darwin_386
# darwin_amd64
# freebsd_386
# freebsd_amd64
# linux_386
# linux_amd64
@sthorne
sthorne / gist:e9f0284d074d0383b029
Created June 3, 2015 17:14
String to Byte Slice
import (
"fmt"
"bytes"
)
func main() {
s := bytes.NewBufferString("hello world").Bytes()
fmt.Printf("%#v", s)
}
sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia \
--volume /Volumes/UNTITLED\ 1 \
--applicationpath /Applications/Install\ OS\ X\ Yosemite.app
@sthorne
sthorne / tls-check.go
Created June 3, 2016 19:41
Fetch an HTTPS Asset from Specific IP and Skipping DNS lookup
package main
import (
"crypto/tls"
"log"
"net/http"
)
@sthorne
sthorne / timecheck.go
Created June 3, 2016 19:43
Validating Time in String
package main
import (
"fmt"
"time"
)
func main() {