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
/**
* 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 / 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
# /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 / 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=+)')
# 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 / 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 = "" }
@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 / gist:03542fd52294ea6f3c0ae034b35a670b
Created December 15, 2021 16:43 — forked from mrlesmithjr/gist:72e23d0a0cceefef553b83b4fce5d06f
Example GitLab CI Pipeline using Terraform, etc.
---
# Most pre-req tooling, etc. is installed using jumphosts.yml playbook
variables:
ADMIN_EMAIL: mrlesmithjr@gmail.com
CLOUD_PROVIDER: Azure # Define Supported Cloud Provider (Azure)
GIT_CRYPT_ENABLED: "true" # Must be lowercase (true|false)
GIT_SUBMODULE_STRATEGY: recursive
ORGANIZATION: example_org
PROJECT_NAME: example_project
TERRAFORM_VERSION: 0.12.28
@sistlm
sistlm / format-terraform-cli-args.py
Created December 15, 2021 16:42 — forked from martingutierrezg/format-terraform-cli-args.py
Python script - Azure DevOps - Format Terraform Command Line Arguments
#!/usr/bin/python3
import sys
import re
terraform_plan_command_str = ''.join(sys.argv[1:])
# terraform_plan_command_str = ""
plan_splits = terraform_plan_command_str.rpartition("false")
plan_first_split = plan_splits[0] + plan_splits[1]
plan_second_split = plan_splits[2]
@sistlm
sistlm / install-openstack.sh
Created December 15, 2021 16:40 — forked from blipp/install-openstack.sh
Scripts to setup an virtual external network with OpenStack after a setup with packstack --allinone
#!/bin/bash
# see http://information-technology.web.cern.ch/book/cern-cloud-infrastructure-user-guide/advanced-topics/installing-openstack#icehouse
set -x
echo "set term=xterm" >> .vimrc
yum install -y etckeeper
etckeeper init
etckeeper commit
yum install -y http://rdo.fedorapeople.org/rdo-release.rpm
sed -i -e 's/priority.*/priority=1/g' /etc/yum.repos.d/rdo-release.repo
sed --in-place '/^exclude=libmongodb/d;s/^priority=/exclude=libmongodb,pymongo\*,mongodb\*,python-bson,python-webob,python-mako,python-webtest\npriority=/g' /etc/yum.repos.d/slc6-os.repo /etc/yum.repos.d/slc6-updates.repo /etc/yum.repos.d/slc6-extras.repo