Skip to content

Instantly share code, notes, and snippets.

View bradcosine's full-sized avatar
👋

Brad Inscoe bradcosine

👋
View GitHub Profile
@bradcosine
bradcosine / add_cloudflare_ips.sh
Created December 1, 2020 23:50 — forked from dduvnjak/add_cloudflare_ips.sh
Add CloudFlare IP addresses to an EC2 Security Group using awscli
# first we download the list of IP ranges from CloudFlare
wget https://www.cloudflare.com/ips-v4
# iterate over the lines in the downloaded file
# make sure to set `--group-id` and `--port`; more details at http://docs.aws.amazon.com/cli/latest/reference/ec2/authorize-security-group-ingress.html
while read p; do aws ec2 authorize-security-group-ingress --group-id sg-e0000000 --protocol tcp --port 80 --cidr $p; done< ips-v4
@bradcosine
bradcosine / with-analytics.js.html
Created December 11, 2018 20:19 — forked from simondahla/with-analytics.js.html
Updated Instructions for Implementing Google Optimize. Where `GTM-XXXXXX` is the Optimize Container ID & where `GTM-YYYYYY` is the Google Tag Manager Container ID and where `UA-ZZZZZZZZ-Z` is the Google Analytics Property ID. Based on the latest documentation at https://support.google.com/360suite/optimize/answer/7359264
<!DOCTYPE html>
<html>
<head>
<!-- 0. UTF-8 encoding -->
<meta charset="utf-8">
<!-- 1. (OPTIONAL) Move jQuery here. -->
<!-- 2. (OPTIONAL) Datalayer -->

Keybase proof

I hereby claim:

  • I am bradcosine on github.
  • I am cosine (https://keybase.io/cosine) on keybase.
  • I have a public key ASDFQDUF8zJWYxXLgEBKOvMS6Sjq0_AI8Z2aT-BpOlIAGwo

To claim this, I am signing this object:

@bradcosine
bradcosine / .ebextensions_00_tune_ec2.config_.yaml
Created August 16, 2017 23:02 — forked from ianblenke/.ebextensions_00_tune_ec2.config_.yaml
Tuning EC2 with an ElasticBeanstalk ebextension
packages:
yum:
wget: []
curl: []
commands:
00_remove_99_swap.conf.bak:
command: rm -f /etc/sysctl.d/99_swap.conf.bak
test: test -f /etc/sysctl.d/99_swap.conf.bak
ignoreErrors: true
00_remove_99_filesystem.conf.bak:
@bradcosine
bradcosine / boxstarter-windows-dev
Last active April 12, 2016 17:59
Boxstarter windows-dev script
Set-ExplorerOptions -showHiddenFilesFoldersDrives -showFileExtensions
cinst sublimetext3
cinst console-devel
cinst googlechrome
cinst firefox
cinst poshgit
cinst gow
cinst putty
cinst 7zip
@bradcosine
bradcosine / nginx
Created January 26, 2015 20:09
CentOS NGINX init script when compiled from source
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# 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: /usr/local/nginx/logs/nginx.pid