Skip to content

Instantly share code, notes, and snippets.

@JcBanks
JcBanks / gist:eb1b2db0ba4fc5aa10dfca4ca312934e
Last active August 23, 2017 21:12
Parse S3 access logs with GoAccess from Multiple directories
find . -type f -exec cat {} ';' | goaccess --log-format=AWSS3 -r -0 GoAccessS3Report.html
find . -type f -exec cat {} ';' | goaccess --log-format=AWSELB -r -0 GoAccessELBReport.html
@JcBanks
JcBanks / gist:c8e6bb07f649a70518c27055fa0adbad
Created August 21, 2017 13:01
Bulk S3 bucket logging update
Objective update all s3 buckets to a single logging bucket
Variables:
Target Bucket: [AccountId].logs
Target Prefix: s3/
Replace $TargetPrfix and $TargetBucket
for i in `aws s3api list-buckets --query "Buckets[].Name" --output text`;do aws s3api put-bucket-logging --bucket $i --bucket-logging-status '{"LoggingEnabled":{"TargetPrefix":"$TargetPrfix'$i'/","TargetBucket":"'$TargetBucket'"}}';done
@JcBanks
JcBanks / nginx
Created August 26, 2014 14:03
nginx - init.d
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemon
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /usr/local/nginx/conf/nginx.conf
# pidfile: /var/run/nginx.pid
@JcBanks
JcBanks / nginx.conf
Created August 26, 2014 13:56
nginx.conf - lost request research
worker_processes 6;
worker_rlimit_nofile 10240;
timer_resolution 500ms;
pid /var/run/nginx.pid;
events {
worker_connections 10240;
@JcBanks
JcBanks / unicorn.rb
Last active August 29, 2015 14:05
unicorn.rb - lost request research
worker_processes 10
pid "/var/www/webapp/tmp/pids/unicorn.pid"
stderr_path "/var/log/unicorn.stderr.log"
stdout_path "/var/log/unicorn.stdout.log"
working_directory "/var/www/webapp/"
listen '/var/sockets/unicorn.sock', :backlog => 64