Skip to content

Instantly share code, notes, and snippets.

View scottsbaldwin's full-sized avatar

Scott Baldwin scottsbaldwin

View GitHub Profile
@scottsbaldwin
scottsbaldwin / self-signed-certs.md
Created August 16, 2016 20:12
Create a self-signed certificate

Generate a self-signed certificate

mkdir -p certs && \
  openssl req -newkey rsa:4096 -nodes -sha256 \
    -keyout certs/domain.key \
    -x509 -days 365 \
    -out certs/domain.crt
@scottsbaldwin
scottsbaldwin / lets_encrypt_cert.md
Created August 16, 2016 20:01
Generating an SSL Certificate with Let's Encrypt

Generating an SSL Certificate with Let's Encrypt

curl -o acme.sh https://get.acme.sh
chmod a+x acme.sh
./acme.sh

Logout and log back into to get the alias that acme.sh installed.

HOST=172.17.0.1
PORT=5000
tcpdump -s 0 -i eth0 -A host ${HOST} and tcp port ${PORT} -w /tmp/dump -W 1000
@scottsbaldwin
scottsbaldwin / go_docker.md
Last active February 2, 2016 00:31
Go CD in Docker

Go CD in Docker

Pull the images

docker pull gocd/gocd-server
docker pull gocd/gocd-agent

Create Data Volume Containers

@scottsbaldwin
scottsbaldwin / build-pipeline-plugin.css
Last active August 29, 2015 14:18
jenkins build pipeline plugin css
#build-pipeline-plugin-content {
background-color: #fff;
border-radius: 0;
}
tbody.pipelineGroup {
background-color: #ddd;
}
.SUCCESS {
# http://stackoverflow.com/questions/5108876/kill-a-postgresql-session-connection
namespace :db do
desc "Fix 'database is being accessed by other users'"
task :terminate => :environment do
ActiveRecord::Base.connection.execute <<-SQL
SELECT
pg_terminate_backend(pid)
FROM
pg_stat_activity
WHERE
@scottsbaldwin
scottsbaldwin / dumppiechartdata.js
Last active August 29, 2015 13:56
highchart data dump
series = WellMatch.Chart.Donut.series[0];
function dumpPieData(series) {
for(var i=0;i<series.data.length;i++) {
var entry = series.data[i];
//console.log(entry[0] + ': ' + entry[1]);
console.log(entry.name + ': ' + entry.y);
}
}
dumpPieData(series);
@scottsbaldwin
scottsbaldwin / provider_dump.js
Last active August 29, 2015 13:56
Search algorithm provider dump
function dumpProvider(i) {
p = providers.models[i];
return {
overall: p.overallScore(),
memberRate: p.overallMemberRateScore(),
outOfPocket: p.overallOutOfPocketScore(),
distance: p.overallDistanceScore(),
aexcel: p.overallAexcelScore(),
ratingScore: p.overallRatingScore(),
tier: p.aexcel_tier()
@scottsbaldwin
scottsbaldwin / Peppermint.terminal
Created February 20, 2013 17:49
Peppermint terminal theme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECcw
LjI5OTE1MzMyNzkgMC4yOTkyNTI0NTA1IDAuMjk5MTAwMzY5MgAQAYAC0hAREhNaJGNs
YXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFyY2hp
@scottsbaldwin
scottsbaldwin / robots.txt
Created February 7, 2013 15:40
robots.txt
User-agent: *
Disallow: /