Skip to content

Instantly share code, notes, and snippets.

View hewersonfreitas's full-sized avatar

Hewerson Freitas hewersonfreitas

View GitHub Profile
@hewersonfreitas
hewersonfreitas / csv.js
Created November 5, 2020 19:58 — forked from surjikal/csv.js
Generating a downloadable CSV file in the browser.
// assumes variable data, which is a homogenous collection of objects
// get keys
var keys = _.keys(data[0]);
// convert to csv string
var csv = keys.join(",");
_(data).each(function(row) {
csv += "\n";
csv += _(keys).map(function(k) {
@hewersonfreitas
hewersonfreitas / varnishlog-examples.sh
Created June 11, 2020 18:56 — 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
@hewersonfreitas
hewersonfreitas / install-configure-letsencrypt.sh
Last active August 3, 2020 14:00 — forked from craigvantonder/install-configure-letsencrypt.md
Install and configure LetsEncrypt on Ubuntu Server 14.04 & 16.04 (Apache) forked from craigvantonder/install-configure-letsencrypt.sh
#!/bin/bash
# https://www.digitalocean.com/community/tutorials/how-to-secure-apache-with-let-s-encrypt-on-ubuntu-14-04
# Download the Let’s Encrypt Client
cd /usr/local/sbin
sudo wget https://dl.eff.org/certbot-auto
sudo chmod a+x /usr/local/sbin/certbot-auto
# Set Up the SSL Certificate