Skip to content

Instantly share code, notes, and snippets.

View displague's full-sized avatar
🐝
Mergin' 🎶 on a Sunday afternoon 🎶

Marques Johansson displague

🐝
Mergin' 🎶 on a Sunday afternoon 🎶
View GitHub Profile

Trying Terraform with Linode

eval $(go env)
export PATH=$PATH:$GOPATH/bin
go get github.com/hashicorp/terraform
cd $GOPATH/src/github.com/hashicorp/terraform
git remote add displague [email protected]:displague/terraform
git fetch displague
git checkout add-linode-provider
{
"ACTION": "avail.linodeplans",
"DATA": [
{
"AVAIL": {
"10": 500,
"11": 500,
"2": 500,
"3": 500,
"4": 500,
@displague
displague / querySome.cfm
Created February 7, 2017 20:00
QuerySome implementation for Adobe CF
<cfscript>
// return true if closure passes for any query row (supplied as a struct)
// based on http://cfdocs.org/querysome available in Lucee
boolean function QuerySome(required query q, required function f) {
for (var r in q) if (f(r)) return true;
return false;
}
</cfscript>
<cfscript>
// converted to cfscript from https://www.petefreitag.com/item/487.cfm
array function srv_lookup(required string name, numeric timeout=60, numeric retries=3) {
var ht = createobject("java", "java.util.Hashtable");
ht.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
// with arg: string dnsserver="8.8.8.8"
// ht.put("java.naming.provider.url", "dns://" & arguments.dnsserver);
ht.put("com.sun.jndi.dns.timeout.initial", arguments.timeout);
ht.put("com.syb.jndi.dns.timeout.retries", arguments.retries);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
npm -g install eslint-config-airbnb eslint-plugin-jsx-a11y eslint-plugin-react eslint babel-eslint eslint-plugin-import
http://stackoverflow.com/questions/20160921/syntastic-complaining-about-es6-module-syntax
@displague
displague / via pivot_root
Last active March 20, 2016 17:37
thoughts on fetching / installing box image for linode in a single blind boot
api create - single disk - minimal% (debian)
boot
lish # (maybe ssh?)
mkdir -p /newroot/oldroot
apt-get install -y debootstrap
debootstrap jessie /newroot http://mirrors.linode.com/debian
pivot_root / switch_root / systemctl switch-root /newroot
umount oldroot/{dev/{pts,shm,},proc,sys,} oldroot
...
loss of console? loss of root password?
i=0;$(".employee-pad strong").each(function(){$(this).replaceWith($('<input>').prop("pattern",$(this).text()).attr('tabindex',++i));});$("<style>:invalid{background:red}:valid{background:green}</style>").appendTo("head");
apt-get update; apt-get -y install qemu-system-x86
dd if=/dev/zero of=fs bs=100M count=6
mkfs -t btrfs fs
mount fs -o compress=zlib /mnt
curl http://9front.org/iso/9front-4661.a15f0069aa9d.iso.bz2 | bunzip2 -c > /mnt/9front.iso
ip addr show
qemu-system-x86_64 -drive file=/dev/sda -cdrom /mnt/9front.iso -boot d -vnc :0
qemu-system-x86_64 -drive file=/dev/sda -m 512 -curses -vnc :0
{
ERRORARRAY: [ ],
DATA: [
{
LOCATION: "Dallas, TX, USA",
DATACENTERID: 2,
ABBR: "dallas"
},
{
LOCATION: "Fremont, CA, USA",