Skip to content

Instantly share code, notes, and snippets.

@glennschler
glennschler / readme.md
Created December 16, 2023 19:12
cloud-ubuntu-desktop
sudo apt install ubuntu-desktop xrdp zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

cd
git clone https://github.com/gpakosz/.tmux.git
ln -s -f .tmux/.tmux.conf
cp .tmux/.tmux.conf.local .
tmux
@glennschler
glennschler / _01-test-stack-failure.md
Last active January 26, 2022 17:06
Mockup of cloudformation failure in some regions when using IAM policies
curl -o a-test-stack-template.yaml https://gist.githubusercontent.com/glennschler/7c6eb8c506c7460929b07a2c97fa6fca/raw/_02-test-stack-template.yaml

Set the temporary bash variable named aws_cred_profile with the aws credentials profile name to be used for the aws cli commands

aws_cred_profile=
@glennschler
glennschler / _how-to_algovpn_1.md
Last active April 14, 2022 21:44
Algo VPN configs and scripts
git clone https://github.com/trailofbits/algo.git
cd algo

Create more client usernames, and change some values to be the following:

  • ipsec_enabled: false
  • arch: arm64
  • size: t4g.micro
  • instance_market_type: spot
@glennschler
glennschler / $ Openhab-rules.md
Last active December 25, 2023 06:34
Tasmota, Sonoff, and OpenHab
Add rules

vim $OPENHAB_CONF/rules/default.rules

  1. rule "email Backyard Temperature every morning and every night"
  • OU_Backyard_Temperature must be defined in an .items file
import org.eclipse.smarthome.core.library.types.QuantityType
import org.eclipse.smarthome.core.library.unit.SIUnits
@glennschler
glennschler / aws-algo-vpn-readme.md
Last active April 20, 2019 23:20
Algo VPN with enhancements

ALGO VPN running in an AWS Spot instance

Given the highlights from the Alestic blog Feb-2018, now enhance the Algo VPN Ansible script to start a spot instance vs on demand instance.

Alestic blog highlights reason to enhance algo script

  • Can run an instance like you normally do for on-demand instances. One new parameter can make it a Spot instance
  • Spot price volatility has been significantly reduced
  • No longer have to specify a bid price
  • CloudWatch Events can now send a two-minute warning before a Spot instance is interrupted
#!/usr/bin/env bash
set -e
# Get secrets from ansible vault
ec2credentials=$(ansible-vault view ./aws-secrets.vault.yml | sed -E "s/aws_access_key = ([^ ]+)|aws_secret_key = ([^ ]+)|aws_mfa_serial = ([^ ]+)/\1\2\3/g")
export AWS_ACCESS_KEY_ID=$(echo $ec2credentials | cut -d' ' -f1)
export AWS_SECRET_ACCESS_KEY=$(echo $ec2credentials | cut -d' ' -f2)
exec ./algo $1 -e "aws_mfa_serial=$(echo $ec2credentials | cut -d' ' -f3)"
@glennschler
glennschler / readme.md
Created March 14, 2017 22:00
VirtualBox on OSX

Keybase proof

I hereby claim:

  • I am glennschler on github.
  • I am glennms (https://keybase.io/glennms) on keybase.
  • I have a public key ASCQudVJeM81fGROtlqJcLQ7ds0sw2pThp-0USTdj3vmcQo

To claim this, I am signing this object:

@glennschler
glennschler / a. Raspberry Pi Zero Notes.md
Last active November 11, 2019 15:19
Raspberry Pi Zero Notes 2015-2019

Setup initial access

  1. Step 1. Edit config.txt & cmdline.txt
  • Read learn.adafruit.com first time boot rPi. After creating raspbian SD image, edit and create the following 3 files in the SD boot volume

    • Add dtoverlay=dwc2 to the last line of config.txt
    • Edit cmdline.txt. Search rootwait text, and after add a space and then modules-load=dwc2,g_ether
    • Create an empty file named on ssh
  1. Edit /etc/network/interfaces as shown below
@glennschler
glennschler / Dockerfile
Last active January 23, 2018 09:12
node-inspector debug node app running in docker container
FROM node:onbuild
ADD ./package.json /tmp/package.json
RUN npm install -g node-inspector
RUN cd /tmp && npm install
RUN mkdir -p /opt/app/node
RUN if [ -d /tmp/node_modules ] ; then cp -a /tmp/node_modules /opt/app/node; fi
WORKDIR /opt/app/node
ADD . /opt/app/node