I hereby claim:
- I am neilellis on github.
- I am neilellis (https://keybase.io/neilellis) on keybase.
- I have a public key whose fingerprint is 0ACC 8350 1CAB 2EC3 A09A 8086 EBDD DCB1 AAAF 22CE
To claim this, I am signing this object:
#!/usr/bin/env bash | |
set -eux | |
#e - error if non zero return value | |
#u - undefined variables trigger syntax error | |
#x - debug | |
#minus sign ADDS the flags | |
#plus sign REMOVES the flags |
/* | |
* Copyright (c) 2014 Neil Ellis | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
$GET("/v2/webshot/:key", (http) -> | |
$($("params", http.params()), $("query", http.queryParams())) | |
.$pipe(new ParamValidator()) | |
.$pipe(new KeyValidator()) | |
.$void(() -> $().$error( | |
"Sorry your key is not recognized, maybe you need to check http://app.snapito.io/#/account", | |
var.ErrorType.VALIDATION)) | |
.$pipe((v) -> { | |
if (v.$match("userStatus", "over_free")) { | |
http.status(302); |
package com.cazcade.dollar.pipe; | |
import com.cazcade.dollar.Script; | |
import com.cazcade.dollar.var; | |
import java.util.Date; | |
/** | |
* @author <a href="http://uk.linkedin.com/in/neilellis">Neil Ellis</a> | |
*/ |
import com.cazcade.dollar.Script; | |
import com.cazcade.dollar.SecondScript; | |
import com.cazcade.dollar.var; | |
import java.util.Date; | |
/** | |
* @author <a href="http://uk.linkedin.com/in/neilellis">Neil Ellis</a> | |
*/ | |
public class HelloScript extends Script { |
#!/bin/bash -eu | |
function fixIt() { | |
ip=$1 | |
if ssh -o "StrictHostKeyChecking no" root@${ip} "env X='() { (a)=>\' bash -c \"echo date\"; cat echo" | grep 2014 | |
then | |
ssh -o "StrictHostKeyChecking no" root@${ip} "apt-get install -y unattended-upgrades; apt-get update; unattended-upgrades; rm echo" | |
else | |
echo $ip passed | |
fi |
#!/bin/bash -eu | |
#apt-get install -y jq | |
host_ip=$1 | |
#Check to see if we have a cached session for this machine and if it is still valid | |
if [ -f ~/.consul_subnet_session ] && [[ -n $(< ~/.consul_subnet_session) ]] && [[ $(curl "http://localhost:8500/v1/session/info/$(< ~/.consul_subnet_session)") != null ]] | |
then | |
session=$(< ~/.consul_subnet_session) | |
else |
I hereby claim:
To claim this, I am signing this object:
function errexit() { | |
local err=$? | |
set +o xtrace | |
local code="${1:-1}" | |
echo "Error in ${BASH_SOURCE[1]}:${BASH_LINENO[0]}. '${BASH_COMMAND}' exited with status $err" | |
# Print out the stack trace described by $function_stack | |
if [ ${#FUNCNAME[@]} -gt 2 ] | |
then | |
echo "Call tree:" | |
for ((i=1;i<${#FUNCNAME[@]}-1;i++)) |
#!/bin/bash -eu | |
convert() { | |
while read line | |
do | |
mc=$(echo $line | cut -d' ' -f1) | |
if echo $mc | grep $1 | |
then | |
ip=$(echo $line | cut -d':' -f2 | cut -d',' -f1) | |
cfcli addrecord -t A $mc $ip || cfcli editrecord -t A $mc $ip |