Skip to content

Instantly share code, notes, and snippets.

View bendalby82's full-sized avatar

Ben Dalby bendalby82

View GitHub Profile
@bendalby82
bendalby82 / listresources.sh
Last active May 15, 2017 15:31
Cloud Foundry Example .profile.d Script
#List contents of /home/vcap on start up
#Ref: https://discuss.pivotal.io/hc/en-us/articles/221429687-How-to-initialize-the-application-container-environment-with-profile-d-script
#Stored at: https://gist.github.com/bendalby82/bda1bfd6744ae6dfe68ee168a8863287
#Check the contents of cf logs <APP NAME> to see output.
echo "**************************************************"
echo "START: listresources.sh running in .profile.d"
echo "Running 'find /home/vcap'"
echo "**************************************************"
find /home/vcap
echo "**************************************************"
@bendalby82
bendalby82 / create-layer.sh
Created September 25, 2020 15:51
Create Node.js layer to simplify connecting AWS Lambda to PostgreSQL
#!/usr/bin/env bash
#https://medium.com/coinmonks/connecting-aws-lambda-node-js-to-redshift-or-postgresql-try-aws-lambda-layers-78e60c27f39b
#Note the name of the folder *must* be nodejs, see explanation here:
#https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html
mkdir nodejs
cd nodejs
npm init -y
npm install --save pg
@bendalby82
bendalby82 / iis-log-file-format-grok.txt
Created September 29, 2020 14:43
Grok rule to parse IIS log file format (a fixed ASCII text-based format that cannot be customized)
%{IP:client_ip},%{SPACE}%{NOTSPACE:username},%{SPACE}%{DATE_US:date},%{SPACE}%{TIME:time},%{SPACE}%{WORD:service},%{SPACE}%{HOSTNAME:server_name},%{SPACE}%{IP:server_ip},%{SPACE}%{INT:time_taken_ms},%{SPACE}%{INT:client_bytes_sent},%{SPACE}%{INT:server_bytes_sent},%{SPACE}%{INT:http_status_code},%{SPACE}%{INT:windows_status_code},%{SPACE}%{WORD:http_request_verb},%{SPACE}%{URIPATH:http_verb_target},%{SPACE}%{NOTSPACE:http_parameters},