Skip to content

Instantly share code, notes, and snippets.

View ronaldoedy's full-sized avatar

Ronaldo ronaldoedy

View GitHub Profile
@ronaldoedy
ronaldoedy / edgecache.vcl
Created March 27, 2017 22:26 — forked from matthewjackowski/edgecache.vcl
A basic vcl setup for edge caching
# A basic setup for the edge
# Strips cookies and un-needed params
# Does a few redirects
# Sets forwarded proxy headers
# Custom error page
vcl 4.0;
import std;
# Backend setup
backend default {
@ronaldoedy
ronaldoedy / wordpress.vcl
Created March 27, 2017 22:27 — forked from matthewjackowski/wordpress.vcl
Varnish 4 VCL configuration for WordPress. Also allows purging
# A heavily customized VCL to support WordPress
# Some items of note:
# Supports https
# Supports admin cookies for wp-admin
# Caches everything
# Support for custom error html page
vcl 4.0;
import directors;
import std;
@ronaldoedy
ronaldoedy / default.vcl
Created March 29, 2017 21:15 — forked from sublimino/default.vcl
Wordpress-optimised VCL configuration file for varnish.
# This is a Wordpress-optimised VCL configuration file for varnish.
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
.max_connections = 800;
}
@ronaldoedy
ronaldoedy / rsync-deploy.sh
Created June 12, 2017 13:49 — forked from jsborjesson/rsync-deploy.sh
Deploying a folder via rsync over ssh. This is for deployments from OSX to Linux servers.
#!/bin/bash
# You might have to install a new version of rsync for this to work.
# This is easily done by `brew install rsync` and restarting your terminal.
# To use a file as an exclude-list you can use the option
# --exclude-from='donot-deploy.txt'
# Change these to match your settings
USER_NAME='username'
@ronaldoedy
ronaldoedy / git.md
Created June 21, 2017 15:20 — forked from leocomelli/git.md
Lista de comandos úteis do GIT

#GIT

Estados

  • Modificado (modified);
  • Preparado (staged/index)
  • Consolidado (comitted);

Ajuda

Installing mailx

yum -y update
yum install -y mailx

We can now start sending e-mails using

@ronaldoedy
ronaldoedy / lambdaAMIBackups.py
Created April 10, 2018 17:35 — forked from bkozora/lambdaAMIBackups.py
AWS Lambda AMI Backups
# Automated AMI Backups
#
# @author Robert Kozora <bobby@kozora.me>
#
# This script will search for all instances having a tag with "Backup" or "backup"
# on it. As soon as we have the instances list, we loop through each instance
# and create an AMI of it. Also, it will look for a "Retention" tag key which
# will be used as a retention policy number in days. If there is no tag with
# that name, it will use a 7 days default value for each AMI.
#
@ronaldoedy
ronaldoedy / install_rsyslog_centrallogging_centos7.md
Created April 11, 2018 14:17 — forked from jpawlowski/install_rsyslog_centrallogging_centos7.md
Configure rsyslogd on CentOS 7 as Remote Syslog Server

Configure rsyslogd on CentOS 7 as Remote Syslog Server

echo "\$ModLoad imudp" > /etc/rsyslog.d/server.conf
echo "\$UDPServerRun 514" >> /etc/rsyslog.d/server.conf
echo "\$ModLoad imtcp" >> /etc/rsyslog.d/server.conf
echo "\$InputTCPServerRun 514" >> /etc/rsyslog.d/server.conf
echo "\$PreserveFQDN on" >> /etc/rsyslog.d/server.conf

yum -y install rsyslog-gnutls rsyslog-mysql rsyslog-crypto
@ronaldoedy
ronaldoedy / rds.sh
Created April 19, 2018 22:37 — forked from onyxraven/rds.sh
Amazon RDS Performance Tuning Settings
#XLarge DBInstanceClassMemory = 15892177440 = 14.8GB
#/32 = 496630545 = 473MB
#/64 = 248315272 = 236MB
#/128 = 124157636 = 118MB
#/256 = 62078818 = 59MB
#/512 = 31039409 = 29MB
#/12582880 = 1263 #default same divisor as max_connections = 4041.6MB = 4237924762
#/25165760 = 623 # half of max_connections = 1993.6MB
#/50331520 = 315 # quarter of max_connections = 1008MB = 1056964608
#*(3/4) #default innodb pool size = 11922309120
@ronaldoedy
ronaldoedy / varnishlog-examples.sh
Created August 1, 2018 10:46 — forked from cupracer/varnishlog-examples.sh
varnishlog examples (version 4.x)
# filter by request host header
varnishlog -q 'ReqHeader ~ "Host: example.com"'
# filter by request url
varnishlog -q 'ReqURL ~ "^/some/path/"'
# filter by client ip (behind reverse proxy)
varnishlog -q 'ReqHeader ~ "X-Real-IP: .*123.123.123.123"'
# filter by request host header and show request url and referrer header