Skip to content

Instantly share code, notes, and snippets.

View notbrain's full-sized avatar

Brian Ross notbrain

View GitHub Profile
@balexandre
balexandre / f1_viewer_config.json
Last active August 30, 2023 08:51
My F1Viewer configuration
{
"live_retry_timeout": 60,
"preferred_language": "en",
"check_updates": true,
"save_logs": true,
"log_location": "",
"horizontal_layout": false,
"theme": {
"background_color": "#000000",
"border_color": "#0CA597",
@brianleroux
brianleroux / BeforeExitListener.js
Created September 12, 2019 22:04
Lambda NodeJS 10.x Default Runtime JavaScript
/** Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. */
"use strict";
/**
* The runtime has a single beforeExit function which is stored in the global
* object with a symbol key.
* The symbol is not exported.
* The process.beforeExit listener is setup in index.js along with all other
* top-level process event listeners.
*/
@TimothyJones
TimothyJones / ssm-kms-put-parameter.sh
Created August 30, 2019 05:29
Example script for putting KMS-encrypted parameters into SSM as plain strings
#!/bin/bash -eu
# (C) Timothy Jones
# This function prints the usage
function usage {
{
echo "Usage:"
echo " ${BASH_SOURCE[0]} <NAME> <VALUE> <KEY_ID>"
echo " NAME - the name of the SSM variable"
@dsmrt
dsmrt / query-aws-logs-insights.bash
Last active December 14, 2023 11:27
Using AWS CLI to query CloudWatch Logs with Insights. Looking -30 mins to now.
# this script queries aws logs with insights filtering on ERROR
# explanation of start and end times
#--start-time = unix timestamp 30 mins in the past
#--end-time = unix timestamp now
QUERY_ID=$(aws logs start-query \
--profile $profile \
--log-group-name /aws/lambda/aap-event-consumer-dev \
--start-time `date -v-30M "+%s"` \
@notbrain
notbrain / pm2-pm2user.conf
Last active April 18, 2017 20:34
plist file to run pm2 as pm2user on macOS with environment variables, linux systemd override.conf
[Service]
Environment="MYSQL_CONN=-h mydb.domain.com -u dbadmin -pnotastrongpassword database_name"
Environment="SLACK_TOKEN=xoxb-94849484948-jfhJSdlobYIFfeFBFYHckiUUJHW19v0F"
@maxim
maxim / gh-dl-release
Last active April 29, 2024 08:55
Download assets from private Github releases
#!/usr/bin/env bash
#
# gh-dl-release! It works!
#
# This script downloads an asset from latest or specific Github release of a
# private repo. Feel free to extract more of the variables into command line
# parameters.
#
# PREREQUISITES
#
@nl5887
nl5887 / gpg-agent.conf
Last active November 14, 2022 09:37
Using GPG Agent on OS-X
launchctl unload -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
launchctl load -w -S Aqua /System/Library/LaunchAgents/gpg.agent.daemon.plist
@ktmud
ktmud / gulpfile.js
Last active February 28, 2022 10:39
An example gulpfile.js with bower components and live reload support
var BatchStream = require('batch-stream2')
var gulp = require('gulp')
var coffee = require('gulp-coffee')
var uglify = require('gulp-uglify')
var cssmin = require('gulp-minify-css')
var bower = require('gulp-bower-files')
var stylus = require('gulp-stylus')
var livereload = require('gulp-livereload')
var include = require('gulp-include')
var concat = require('gulp-concat')
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000