Skip to content

Instantly share code, notes, and snippets.

Avatar

Geoff Webster sidewinder12s

  • Aurora Innovation
  • San Jose, CA
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am sidewinder12s on github.
  • I am gwebster (https://keybase.io/gwebster) on keybase.
  • I have a public key ASDgbkTUKESBuSlUM-Dw2azsaSYWfl9m7SLloDPWZsXkcgo

To claim this, I am signing this object:

@sidewinder12s
sidewinder12s / gitlab-ci-validate
Created Sep 29, 2017
GitLab CI Validate shell scripts
View gitlab-ci-validate
function gitlab-ci-validate(){
DATA=$(jq.node -r js-yaml -x 'jsYaml.safeLoad | thru(x => (JSON.stringify({content: JSON.stringify(x)})))' < .gitlab-ci.yml)
curl -s --header "Content-Type: application/json" https://gitlab.com/api/v4/ci/lint --data $DATA | jq.node
}
function gitlab-ci-validate-watch(){
watchexec --watch $(pwd)/.gitlab-ci.yml 'zsh -c "source ~/.zshrc && gitlab-ci-validate"'
}
@sidewinder12s
sidewinder12s / list-shutdown-instances.sh
Last active Mar 20, 2017
Lists out instances that have been user shutdown. Display's Instance ID, Shutdown Date, Contact & Name tags.
View list-shutdown-instances.sh
aws ec2 describe-instances --region us-west-2 --output text --filters Name=state-reason-code,Values=Client.UserInitiatedShutdown --query 'sort_by(Reservations[*].Instances[], &StateTransitionReason)[*].[InstanceId,`,`, StateTransitionReason,`,`, [Tags[?Key==`Name`].Value] [0][0],`,`, [Tags[?Key==`Contact`].Value] [0][0] ]' > shutdown_instances.csv
View elastic_beanstalk.py
#!/usr/bin/python
#
# This is a free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This Ansible library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@sidewinder12s
sidewinder12s / handler.js
Last active Aug 29, 2015 — forked from ThisIsMissEm/handler.js
The better way to execute Go on Amazon Lambda (see: http://blog.0x82.com/2014/11/24/aws-lambda-functions-in-go/)
View handler.js
var child_process = require('child_process');
exports.handler = function(event, context) {
var proc = spawn('./test', [ JSON.stringify(event) ], { stdio: 'inherit' });
proc.on('close', function(code){
if(code !== 0) {
return context.done(new Error("Process exited with non-zero status code"));
}
View pydio-dsc.ps1
# Powershell DSC configuration script for Pydio
# Be sure to set the $timezone and $repo variables
# The $repo location requires two folders - "installers" and "pydio-files"
# installers has php.zip (the latest PHP VC11 non-threadsafe zip), phpmanager.msi (the latest PHP Manager for IIS x64) and vcredist_x86.exe (VC++ Redistributable x86 11.0.61030)
# pydio-files has the latest Pydio zip unzipped to the base folder. This is done because unzip performance on DSC is rubbish
Configuration Pydio
{
param ($MachineName)