Skip to content

Instantly share code, notes, and snippets.

View shadycuz's full-sized avatar

Levi shadycuz

View GitHub Profile
@shadycuz
shadycuz / nginx.conf
Last active September 20, 2016 02:09 — forked from spikegrobstein/nginx.conf
Nginx Reverse Proxy config for Plex to prevent user from needing port or /web/index.html
upstream plex-upstream {
# change plex-server.example.com:32400 to the hostname:port of your plex server.
# this can be "localhost:32400", for instance, if Plex is running on the same server as nginx.
# I just use the IP and port of my server
server plex-server.example.com:32400;
}
server {
listen 80;
@shadycuz
shadycuz / worldclock.js
Created November 7, 2016 07:56
Worldclock .js for SolarWinds in 12hr format
<script language="JavaScript">
<!--
function worldClock(zone, region){
var dst = 0
var time = new Date()
var gmtMS = time.getTime() + (time.getTimezoneOffset() * 60000)
var gmtTime = new Date(gmtMS)
var day = gmtTime.getDate()
var month = gmtTime.getMonth()
var year = gmtTime.getYear()
@shadycuz
shadycuz / lxc-ctrl.sh
Created November 8, 2016 10:05
Allows you to create LXD containers with static ip in one go. Thanks to http://jason.trickett.us/2016/08/lxd-containers-static-ip-addresses-heres/
#!/bin/bash
conf="/etc/default/lxd_dnsmasq.conf"
func1 ()
{
sh -c "echo 'dhcp-host=$1,$2' >> $conf" && service lxd-bridge stop && service lxd-bridge start && lxc launch $3 $1
wait
levi@La-Tower:~/repos/mobilityware/tf-templates/test$ terraform plan
2017/07/10 18:14:19 [WARN] Invalid log level: "true". Defaulting to level: TRACE. Valid levels are: [TRACE DEBUG INFO WARN ERROR]
2017/07/10 18:14:19 [INFO] Terraform version: 0.9.11 efca455c35d0d218a9bfee835a8ec3ef8d4d1c8c
2017/07/10 18:14:19 [INFO] Go runtime version: go1.8
2017/07/10 18:14:19 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan"}
2017/07/10 18:14:19 [DEBUG] Detected home directory from env var: /home/levi
2017/07/10 18:14:19 [DEBUG] Detected home directory from env var: /home/levi
2017/07/10 18:14:19 [DEBUG] Attempting to open CLI config file: /home/levi/.terraformrc
2017/07/10 18:14:19 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2017/07/10 18:14:19 [INFO] CLI command args: []string{"plan"}
@shadycuz
shadycuz / gist:cec53d5a2affcfc202c45e76e65890fe
Created April 30, 2019 19:11
Get rendered cfn init files
aws cloudformation describe-stack-resource --stack-name MYSTACK --logical-resource-id MYLC | jq -Cr '.StackResourceDetail.Metadata | fromjson | ."AWS::CloudFormation::Init".MY_INITNAME.files | to_entries[] | {(.key): .value.content }'
@shadycuz
shadycuz / main.tf
Created June 21, 2022 00:35
aws_central_logging CF converted to TF using cf2tf
data "aws_caller_identity" "current" {
}
data "aws_partition" "current" {
}
data "aws_region" "current" {