Skip to content

Instantly share code, notes, and snippets.

View chroto's full-sized avatar
🦍

Chris Proto chroto

🦍
View GitHub Profile
@zmanji
zmanji / gist:6575133
Created September 15, 2013 23:15
Lol Scala.
Zameers-MacBook-Air:~ zmanji$ scala
Welcome to Scala version 2.10.1 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_17).
Type in expressions to have them evaluated.
Type :help for more information.
scala> null == null.asInstanceOf[Int]
<console>:8: warning: comparing values of types Null and Int using `==' will always yield false
null == null.asInstanceOf[Int]
^
res0: Boolean = true
@slotrans
slotrans / lambda_test_harness.js
Created December 27, 2014 21:01
Local test harness for AWS Lambda functions. I'm no JS programmer so this is probably horrible in some way or other, but it does appear to work. Note that this does NOT directly simulate the permissions of the function's execution role. It will run with whatever permissions belong to the AWS credentials you use, unless you run it on an EC2 insta…
var fs = require('fs');
// Lambda knows what region it's in but a local execution doesn't, so preload the SDK and set the region
// This will only work if the same variable name is used in the Lambda function file
var AWS = require('aws-sdk');
AWS.config.update({region: 'us-east-1'});
// validate arguments
if(process.argv.length < 4) {
@Marinlemaignan
Marinlemaignan / super_json_logger.rb
Last active May 4, 2020 06:34
Airbrake + Lograge Super JSON Logger (for rails apps to use syslog-ng)
# encoding: utf-8
MAP::Application.configure do
config.lograge.enabled = true
config.lograge.keep_original_rails_log = false
config.lograge.logger = ActiveSupport::Logger.new "#{Rails.root}/log/#{Rails.env}.log"
config.lograge.formatter = Lograge::Formatters::Json.new
# Ignore errors with Lograge, will send them through Airbrake,
# so we have ez access to all the airbrake infos
@gene1wood
gene1wood / all_aws_managed_policies.json
Last active April 30, 2025 20:07
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
This file has been truncated, but you can view the full file.
{
"APIGatewayServiceRolePolicy": {
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy",
"AttachmentCount": 0,
"CreateDate": "2019-10-22T18:22:01+00:00",
"DefaultVersionId": "v6",
"Document": {
"Statement": [
{
"Action": [
@mkubenka
mkubenka / install.sh
Created April 23, 2016 19:28
OpenVPN Access Server Letsencrypt
#!/bin/sh
apt-get -y install git bc
git clone https://github.com/letsencrypt/letsencrypt /opt/letsencrypt
mkdir /etc/letsencrypt

This the procedure for generating ignition configs for govcloud using th 4.3 installer (which actively thwarts attempts to do this)

Create install-config.yaml

apiVersion: v1
baseDomain: sjennings.me
# disconnected install requires local mirror
# oc adm release mirror
imageContentSources:
- mirrors: