Skip to content

Instantly share code, notes, and snippets.

View joshmarlow's full-sized avatar

Josh Marlow joshmarlow

View GitHub Profile
@joshmarlow
joshmarlow / debug.log
Created October 23, 2018 17:12
Debug output from stderr
panic: interface conversion: interface {} is digitalocean.Config, not *digitalocean.Config
2018/10/23 13:12:41 packer:
2018/10/23 13:12:41 packer: goroutine 91 [running]:
2018/10/23 13:12:41 packer: github.com/hashicorp/packer/builder/digitalocean.(*stepCreateSSHKey).Run(0xc000346080, 0x281cb80, 0xc0001b4380, 0x281a980, 0xc0003841e0, 0x0)
2018/10/23 13:12:41 packer: /Users/azr/go/src/github.com/hashicorp/packer/builder/digitalocean/step_create_ssh_key.go:31 +0xac7
2018/10/23 13:12:41 packer: github.com/hashicorp/packer/helper/multistep.(*BasicRunner).Run(0xc0001b4340, 0x281a980, 0xc0003841e0)
2018/10/23 13:12:41 packer: /Users/azr/go/src/github.com/hashicorp/packer/helper/multistep/basic_runner.go:72 +0x222
2018/10/23 13:12:41 packer: github.com/hashicorp/packer/builder/digitalocean.(*Builder).Run(0xc0004dec00, 0x2822400, 0xc000346040, 0x280ff40, 0xc00019c0e0, 0x281cf40, 0xc00000c008, 0x4bca9c, 0x1e1d9e0, 0x1e1d9e0, ...)
2018/10/23 13:12:41 packer: /Users/azr/go/src/github.com/hashicorp/packer/builder/dig
@joshmarlow
joshmarlow / crash.log
Created October 23, 2018 17:10
Crash Log
2018/10/23 13:07:12 [INFO] Packer version: 1.3.1
2018/10/23 13:07:12 Packer Target OS/Arch: linux amd64
2018/10/23 13:07:12 Built with Go Version: go1.11
2018/10/23 13:07:12 Detected home directory from env var: /home/joshmarlow
2018/10/23 13:07:12 Using internal plugin for googlecompute
2018/10/23 13:07:12 Using internal plugin for lxc
2018/10/23 13:07:12 Using internal plugin for profitbricks
2018/10/23 13:07:12 Using internal plugin for amazon-chroot
2018/10/23 13:07:12 Using internal plugin for azure-arm
2018/10/23 13:07:12 Using internal plugin for docker
@joshmarlow
joshmarlow / build.json
Created October 23, 2018 17:09
My Failing Packer Build
{
"variables": {
"do_token": ""
},
"builders": [
{
"type": "digitalocean",
"api_token": "{{ user `do_token` }}",
"image": "ubuntu-18-04-x64",
"region": "nyc3",
@joshmarlow
joshmarlow / bst.hs
Created September 19, 2016 18:01
Binary Tree Operations
{-# OPTIONS_GHC -Wall #-}
module Tree where
import Data.List
data Tree a = Leaf
| Node Integer (Tree a) a (Tree a)
deriving (Show)
treeHeight :: Tree a -> Integer
treeHeight Leaf = 0
@joshmarlow
joshmarlow / time_it.rs
Last active September 17, 2016 16:34
time_it macro in Rust
macro_rules! time_it {
($msg:expr, $code:block) => ({
let start = SystemTime::now();
let res = { $code };
let end = SystemTime::now();
println!("{:?} duration: {:?}", $msg, end.duration_since(start).ok().unwrap());
res
})
}
@joshmarlow
joshmarlow / bindigo_makefile
Created October 16, 2015 22:06
Example Makefile for a small OCaml module
# Note: I've used a consistent naming schem for the files in this project
# (ie, bindigo.mli bindigo.ml bindigo_tests.ml).
# This allows easy construction of various make targets working working with the files.
DELIM = ----------------------------
LIB_NAME = bindigo
# Install this package so that is accessible in other projects on this sytem
install: clean uninstall $(LIB_NAME).byte $(LIB_NAME).native
@echo $(DELIM) Installing...
@joshmarlow
joshmarlow / ambition_api_c#_example.cs
Created June 9, 2015 15:19
Ambition API - C# Example
/*
* upload_to_ambition.cs
* Simple program demonstrating how to upload data to the Ambition Data API
*
* This code needs to be linked to the System.Web.Extensions assembly.
*
* For mono, use 'gmcs ambition_api_c#_example.cs -r:System.Web.Extensions'
*/
using System;
@joshmarlow
joshmarlow / ambition_api_python_example.py
Created June 9, 2015 15:14
Ambition API - Python Example
#!/bin/env python
#
# ambition_api_python_example.py
# Simple script demonstrating how to upload data to the Ambition Data API.
import json
import sys
import urllib2
@joshmarlow
joshmarlow / ambition_api_curl_example.sh
Created June 9, 2015 15:13
Ambition API - Curl/Bash Example
#!/bin/env/sh
#
# upload_to_ambition.sh
# Simple script demonstrating how to upload data to the Ambition Data API.
export AUTH_TOKEN=<AUTH-TOKEN>
curl -vvv -H "Content-Type: application/json" -X POST "https://<SUBDOMAIN>.ambition.com/public-api/integration/v1/data/new/" -H "Authorization: Token $AUTH_TOKEN" -d "{\"depot\": \"custom_depot\", \"data\": \"Data from Curl!\"}"