Skip to content

Instantly share code, notes, and snippets.

View ffernand's full-sized avatar

Filipe Fernandes ffernand

View GitHub Profile

Keybase proof

I hereby claim:

  • I am ffernand on github.
  • I am ffernand (https://keybase.io/ffernand) on keybase.
  • I have a public key whose fingerprint is 39CA 1C1F A896 A1B8 3B1A 389F CB36 BAAE FDC1 176A

To claim this, I am signing this object:

@ffernand
ffernand / System Design.md
Created April 21, 2016 12:09 — forked from vasanthk/System Design.md
System Design Cheatsheet

#System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

##Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@ffernand
ffernand / renew_cert.sh
Created October 31, 2016 13:29 — forked from mauron85/renew_cert.sh
Certificate renew script for letsencrypt (acme-tiny)
#!/usr/bin/env bash
# Read https://github.com/diafygi/acme-tiny before using this script
# This scripts expects:
# 1. letsencrypt account.key is present $ACCOUNT_KEY dir (Step 1.)
# 2. CSR to generated (files: domain.key and domain.csr) (Step 2.)
# domain.csr should be present in $DOMAIN_ROOT/$DOMAIN
# (eg. /home/letsencrypt/acme-tiny/mapilary.com/domain.csr)
# Resulting cert chained.pem will be stored in $DOMAIN_ROOT/$DOMAIN/chained.pem
@ffernand
ffernand / nginx.conf
Created November 2, 2016 17:46 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ffernand
ffernand / ubuntu_unattended_upgrades_gmail.markdown
Created November 3, 2016 12:54 — forked from dwilkie/ubuntu_unattended_upgrades_gmail.markdown
Setup unattended upgrades on Ubuntu with Gmail

Install the unattended-upgrades package

$ sudo apt-get install unattended-upgrades 

Edit the periodic configuration

$ sudo nano /etc/apt/apt.conf.d/10periodic
@ffernand
ffernand / rbenv-install-system-wide.sh
Created December 13, 2016 12:45 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install ruby 1.9.3-p448 on Debian 6 Squeeze
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core curl libssl-dev \
libreadline5 libreadline5-dev \
zlib1g zlib1g-dev \
libmysqlclient-dev \
libcurl4-openssl-dev \
libxslt-dev libxml2-dev
@ffernand
ffernand / task.yml
Created December 13, 2016 12:49 — forked from holms/task.yml
Adding github to known_hosts with ansible
- name: ensure github.com is a known host
lineinfile:
dest: /root/.ssh/known_hosts
create: yes
state: present
line: "{{ lookup('pipe', 'ssh-keyscan -t rsa github.com') }}"
regexp: "^github\\.com"
@ffernand
ffernand / iptables_rules.sh
Created January 15, 2017 22:52 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@ffernand
ffernand / pr.md
Created March 20, 2017 13:13 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ffernand
ffernand / GnuPG-2.2.md
Created October 8, 2017 01:52 — forked from vt0r/GnuPG-2.2.md
Build/install instructions for GnuPG 2.2.x on Ubuntu and similar distros (formerly for 2.1.x)

GnuPG 2.2.1 Build Instructions

Below are my build instructions for GnuPG 2.2.1, released on September 19th, 2017. These instructions are built for a headless Ubuntu 14.04 LTS server (and have also been tested on Ubuntu 15.10/16.04/16.10/17.04).

If you prefer, you may use the below install script to install GnuPG 2.2.1 by running the following commands:

curl -OL "https://gist.githubusercontent.com/vt0r/a2f8c0bcb1400131ff51/raw/b303568fad4dec72c62104f8f60bf5b076df70dc/install-gnupg22.sh" && sudo -H bash ./install-gnupg22.sh

Install the needed dependencies