Skip to content

Instantly share code, notes, and snippets.

View derekmurawsky's full-sized avatar

Derek Murawsky derekmurawsky

View GitHub Profile
@macox
macox / data.yaml
Last active June 29, 2021 03:43
OPA exceptions - data driven
dockerfile:
policies:
- name: warn_latest_tag
enabled: true
function _cdk_completer {
STACK_CMDS="list synthesize bootstrap deploy destroy diff metadata init context docs doctor"
if [ "$3" == "cdk" ]; then
COMPREPLY=($(compgen -W "$STACK_CMDS" $2))
elif [[ -d "cdk.out" ]] && ! [[ "$2" == "-"* ]]; then
TEMPLATES=$(ls -1 cdk.out/*.template.json | awk '{split($0,t,/\/|\./); print t[3]}')
COMPREPLY=($(compgen -W "$TEMPLATES" $2))
else
COMPREPLY=()
@burnsie7
burnsie7 / tracing_w_nodejs.md
Last active April 8, 2020 13:47
Native Tracing w/ NodeJS

Create service and add dependencies

serverless create --template hello-world
npm init
npm install dd-trace@dev
npm install serverless-plugin-datadog

Install Lambda Forwarder

@jlollis
jlollis / gitkeep.md
Last active April 21, 2024 11:24
.gitkeep - Push your entire folder structure to GitHub, including empty folders

.gitkeep

A .gitkeep file tells github to do the opposite of its default behaviour, which is to ignore empty folders.

If you want to track an empty folder, or a folder with untracked files, create a 0kb file with the .gitkeep file extension in that folder.

touch FOLDER_NAME/.gitkeep

@klaaspieter
klaaspieter / ASS.md
Created June 22, 2017 07:59 — forked from anonymous/ASS.md
Acronyms Seriously Suck - Elon Musk

From time to time, Musk will send out an e-mail to the entire company to enforce a new policy or let them know about something that's bothering him. One of the more famous e-mails arrived in May 2010 with the subject line: Acronyms Seriously Suck:

There is a creeping tendency to use made up acronyms at SpaceX. Excessive use of made up acronyms is a significant impediment to communication and keeping communication good as we grow is incredibly important. Individually, a few acronyms here and there may not seem so bad, but if a thousand people are making these up, over time the result will be a huge glossary that we have to issue to new employees. No one can actually remember all these acronyms and people don't want to seem dumb in a meeting, so they just sit there in ignorance. This is particularly tough on new employees.

That needs to stop immediately or I will take drastic action - I have given enough warning over the years. Unless an acronym is approved by me, it should not enter the SpaceX glossary.

@andreicristianpetcu
andreicristianpetcu / ansible-summary.md
Created May 30, 2016 19:25
This is an ANSIBLE Cheat Sheet from Jon Warbrick

An Ansible summary

Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)

Configuration file

intro_configuration.html

First one found from of

@drmalex07
drmalex07 / README-setup-socket-activated-systemd-service.md
Last active December 26, 2023 05:13
An example inetd-like socket-activated service. #systemd #inetd #systemd.socket

README

This is an example of a socket-activated per-connection service (which is usually referred to as inetd-like service). A thorough explanation can be found at http://0pointer.de/blog/projects/inetd.html.

Define a socket unit

The key point here is to specify Accept=yes, which will make the socket accept connections (behaving like inetd) and pass only the resulting connection socket to the service handler.

#!/usr/bin/env ruby
require 'snmp'
#include SNMP
require 'logger'
require 'sensu-plugin/check/cli'
# Usage: Import specific MIB modules into the snmp gem mib folder
# - : Import specific MIB modules into the snmp gem mib folder
# - : Performs some SNMP Checks
@casecode
casecode / secure-websockets
Last active April 19, 2023 17:50
Basic Config for SSL with Secure Websockets using Nginx 1.6.0 + Puma + Thin
=========================
# /etc/nginx/nginx.conf
=========================
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
@danrigsby
danrigsby / packer-ami-id
Last active December 14, 2023 15:07
Get AMI ID from a packer build
packer build packer.json 2>&1 | sudo tee output.txt
tail -2 output.txt | head -2 | awk 'match($0, /ami-.*/) { print substr($0, RSTART, RLENGTH) }' > sudo ami.txt