Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathen Harvey nathenharvey

View GitHub Profile
View Dockerfile
FROM node:12.3.1
EXPOSE 8080
COPY server.js .
CMD node server.js
View server.js
var http = require('http');
var handleRequest = function(request, response) {
response.writeHead(200);
response.end("Hello World!");
}
var www = http.createServer(handleRequest);
www.listen(8080);
View nginx-group.sh
#! /bin/bash
gcloud compute instance-groups managed create nginx-group \
--base-instance-name nginx \
--size 2 \
--template nginx-template \
--target-pool nginx-pool
@nathenharvey
nathenharvey / startup.sh
Created Jun 4, 2019
nginx startup script
View startup.sh
#! /bin/bash
apt-get update
apt-get install -y nginx
service nginx start
sed -i -- 's/nginx/Google Cloud Platform - '"$HOSTNAME"'/' /var/www/html/index.nginx-debian.html
View keybase.md

Keybase proof

I hereby claim:

  • I am nathenharvey on github.
  • I am nathenharvey (https://keybase.io/nathenharvey) on keybase.
  • I have a public key ASA20KLLVgTgpZkHio5RYm86jLeHWKy_hiKtCpHrYIAG-Ao

To claim this, I am signing this object:

@nathenharvey
nathenharvey / log-debug.txt
Created Mar 19, 2018
Sensitive property on execute resource
View log-debug.txt
$ chef-client -z sensitive.rb -l debug
[2018-03-19T13:54:21-04:00] DEBUG: Sleeping for 0 seconds
[2018-03-19T13:54:21-04:00] INFO: Started chef-zero at chefzero://localhost:1 with repository at /Users/nathenharvey
One version per cookbook
[2018-03-19T13:54:21-04:00] DEBUG: Running Ohai with the following configuration: {}
[2018-03-19T13:54:21-04:00] INFO: Forking chef instance to converge...
[2018-03-19T13:54:21-04:00] DEBUG: Fork successful. Waiting for new chef pid: 15310
[2018-03-19T13:54:21-04:00] DEBUG: Forked instance now converging
@nathenharvey
nathenharvey / chef-functions.psm1
Last active Apr 17, 2018
Some powershell functions to ease some common knife commands
View chef-functions.psm1
function Bootstrap-SSH {
param (
$name,
$env,
$cookbook,
$recipe
)
Write-Output "Bootstrapping host $name into $env with recipe $cookbook::$recipe"
knife bootstrap $name -N $name -E $env -r "'''recipe[$cookbook::$recipe]'''" -i ~/.ssh/id_rsa -x ubuntu --sudo -y
View catalina-opts.conf
{{~#if bind.database}}
{{~#each bind.database.members}}
export CATALINA_OPTS="-DMONGODB_SERVICE_HOST={{address}} -DMONGODB_SERVICE_PORT={{port}}"
{{~/each}}
{{~/if}}
View sample_post_mortem_template.md

INCIDENT DATE - INCIDENT TYPE

Meeting

Meeting Participants

Incidents should be scheduled within 24 hours or two business days of incident resolution. Keep the following in mind when scheduling the meeting:

  1. Who is required to attend the postmortem?
View plan.sh
pkg_origin=firstnamelastname
pkg_name=mytutorialapp
pkg_version=0.2.0
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_license=()
pkg_upstream_url=https://github.com/habitat-sh/habitat-example-plans
pkg_source=nosuchfile.tar.gz
pkg_deps=(core/node)
pkg_exports=(
[port]=listening_port