Skip to content

Instantly share code, notes, and snippets.

@johnypony3
johnypony3 / alexa homeskill lambda to sns
Created January 11, 2017 21:02
this is a lambda function to be used by an alexa homeskill. this will write to a sns topic, the idea is to have another lambda function subscribe, and act
/**
* This sample demonstrates a simple driver built against the Alexa Lighting Api.
* For additional details, please refer to the Alexa Lighting API developer documentation
* https://developer.amazon.com/public/binaries/content/assets/html/alexa-lighting-api.html
*/
var https = require('https');
var AWS = require('aws-sdk');
var REMOTE_CLOUD_BASE_PATH = '/';
var REMOTE_CLOUD_HOSTNAME = 'www.amazon.com';
@johnypony3
johnypony3 / fenix4
Last active January 11, 2017 22:48
this is the content source directory for a fenix4 app posts to a restful api, which in turn does home automation
fenix4
@johnypony3
johnypony3 / sns-mqtt-lambda
Last active January 11, 2017 22:48
a labda function that subscribes to an sns queue and pushes data to an mqtt queue
We couldn’t find that file to show.

Squashing commits the easy way

Rewriting history is only safe if no one depends on your branch.

So for example never do this on parent branches ie: develop, master, a feature branch with child branches, etc.

Example workflow:

  1. Make feature branch
  2. Haxxor
  3. Push to origin (optional but your dentist recommends you floss)
  4. Repeat steps 2 - 3 as necessary
  5. Squash commits using the function in this article
@johnypony3
johnypony3 / brew-formulae-update.sh
Last active May 7, 2017 13:59
cleanup, update, upgrade bundle, update all casks
#!/bin/bash
brew cleanup
brew cask cleanup
brew update
brew upgrade
#brew bundle
list your VMs to find the VM ID:
$ VBoxManage list vms
"UCS 4.1" {acef4c0a-35be-4640-a214-be135417f04d}
You can now package that VM as a Vagrant box:
$ vagrant package --base acef4c0a-35be-4640-a214-be135417f04d --output UCS.box
==> acef4c0a-35be-4640-a214-be135417f04d: Exporting VM...
==> acef4c0a-35be-4640-a214-be135417f04d: Compressing package to: /home/crohr/dev/ucs/UCS.box
And add it to the list of your local Vagrant boxes:
Set-ExecutionPolicy Bypass -Scope Process -Force
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install python3 -y
choco install pip -y
choco install gitlab-runner -y
$Env:RUNNER_NAME = 'gitlabrunnerwindows'
$Env:REGISTRATION_TOKEN = 'xNCuu_ebSJVHKKFYuzqa'
$Env:CI_SERVER_URL = 'https://gitlab.nordstrom.com/'
@johnypony3
johnypony3 / gist:13225db9b2e86f9131ee57bc2286034f
Last active March 27, 2018 14:23
EC2 Update, Dist-Upgrade, Log Config
#!/bin/bash -x
exec > >(tee /var/log/syslog|logger -t user-data -s 2>/dev/console) 2>&1
echo 'do full automated update and upgrade'
unset UCF_FORCE_CONFFOLD
export UCF_FORCE_CONFFNEW=YES
export DEBIAN_FRONTEND=noninteractive
ucf --purge /boot/grub/menu.lst
{
"chefdk_bootstrap": {
"package": {
"atom": false,
"chef_ca": true,
"kdiff3": false,
"vagrant": false,
"virtualbox": false,
"git": false,
"gitextensions": false,
{
"chefdk_bootstrap": {
"package": {
"atom": false,
"chef_ca": true,
"kdiff3": false,
"vagrant": false,
"virtualbox": false,
"git": false,
"gitextensions": false,