Skip to content

Instantly share code, notes, and snippets.

View sistlm's full-sized avatar
💭
I may be slow to respond.

Sistla sistlm

💭
I may be slow to respond.
View GitHub Profile
@sistlm
sistlm / .gitignore
Created December 15, 2021 16:45 — forked from isaacarnault/.gitignore
AWS VPC using Terraform and Jenkins integration
________ ________ ___ __ ___
|\_____ \|\ __ \|\ \|\ \ |\ \
\|___/ /\ \ \|\ \ \ \/ /|\ \ \
/ / /\ \ __ \ \ ___ \ \ \
/ /_/__\ \ \ \ \ \ \\ \ \ \ \
|\________\ \__\ \__\ \__\\ \__\ \__\
\|_______|\|__|\|__|\|__| \|__|\|__|
ignore Azure, GCP
@sistlm
sistlm / main.tf
Created December 15, 2021 16:45 — forked from jhanley-com/main.tf
Terraform Azure Service Principal - Part 1
# Test code for the question: https://stackoverflow.com/q/65525116/8016720
# Provides configuration details for the Azure Terraform provider
provider "azurerm" {
# !!! Must include features even if empty
features {}
}
variable "appName" { default = "testAppName" }
variable "subscriptionId" { default = "" }
# https://docs.docker.com/engine/install/ubuntu/
apt-get update -y
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
@sistlm
sistlm / colors.js
Created December 15, 2021 16:57 — forked from ngs/colors.js
// http://jan5.fc2web.com/model/mr_color.html
[cols, ...rows] = $$('table[border="1"] tr').map(tr => Array.from(tr.childNodes).filter(cn => cn.nodeName === 'TD').map(td => td.getAttribute('bgcolor') || td.innerText))
'| ' + cols.join(' | ') + ' |\n| ---- | ---- | ---- | ---- | ---- | ---- |\n| ' + rows.map(row => row.join(' | ').replace(/\n/g, '<br>')).join(' |\n| ').replace(/#([A-F0-9]{6})/g, '![$1](https://dummyimage.com/20x20/$1/fff&text=+)')
# /etc/systemd/system/gpio-watch.service
[Unit]
Description=gpio-watch is a tool for running scripts in response to GPIO events.
[Service]
User=root
WorkingDirectory=/root
ExecStart=/usr/bin/gpio-watch 6:rising
Restart=always
@sistlm
sistlm / inspect.sh
Created December 15, 2021 16:58 — forked from ngs/inspect.sh
MusicDir = /home/pi/music
ALSADevice = default
ALSAMixer1 = Headphone
#ALSAMixer2 = Master
ALSAStutterDefeat = no
/**
* Responds to any HTTP request.
*
* @param {!express:Request} req HTTP request context.
* @param {!express:Response} res HTTP response context.
*/
const fetch = require('node-fetch');
exports.handle = async (req, res) => {
@sistlm
sistlm / s3podcast.js
Created December 15, 2021 16:59 — forked from ngs/s3podcast.js
const AWS = require('aws-sdk');
const s3 = new AWS.S3();
exports.handler = async (event) => {
const filename = 'feed.xml';
const { bucket, object } = event.Records[0].s3;
const { eventTime, awsRegion } = event.Records[0];
const date = new Date(eventTime).toUTCString();
console.info(JSON.stringify(event, null, 2));
const res = await s3.getObject({ Bucket: bucket.name, Key: filename }).promise();
@sistlm
sistlm / install.sh
Created December 15, 2021 16:59 — forked from ngs/install.sh
Install vim 8 on a Raspberry Pi 3
# Modified from the gist @https://gist.github.com/odiumediae/3b22d09b62e9acb7788baf6fdbb77cf8
sudo apt-get remove -y --purge vim vim-runtime vim-gnome vim-tiny vim-gui-common
sudo apt-get install -y liblua5.1-dev luajit libluajit-5.1 python-dev ruby-dev libperl-dev libncurses5-dev libatk1.0-dev libx11-dev libxpm-dev libxt-dev
#Optional: so vim can be uninstalled again via `dpkg -r vim`
sudo apt-get install -y checkinstall
sudo rm -rf /usr/local/share/vim /usr/bin/vim
@sistlm
sistlm / .travis.yml
Created December 15, 2021 17:01 — forked from ngs/.travis.yml
language: objective-c
cache:
directories:
- vendor/bundle
- Pods
install:
- bundle install --path=vendor/bundle --binstubs=vendor/bin
- bundle exec pod install
script:
- '[ ! -z $(echo ${TRAVIS_BRANCH} | grep "^release.*$") ] && CONFIG=release || CONFIG=adhoc'