Skip to content

Instantly share code, notes, and snippets.

View bcfurtado's full-sized avatar
🏠
Working from home

Bruno Furtado bcfurtado

🏠
Working from home
View GitHub Profile
@bcfurtado
bcfurtado / setting-up-heroku-and-cloudflare.md
Created May 23, 2022 09:58 — forked from mrispoli24/setting-up-heroku-and-cloudflare.md
Setting up Heroku and Cloudflare (the right way)

Setting up Heroku and Cloudflare (the right way)

The following outlines how to setup Heroku + Cloudflare with a full SSL certificate. What this means is that communication between the browser and the Cloudflare CDN is encrypted as well as communication between Cloudflare and Heroku’s origin server. Follow these steps exactly and the setup is a breeze.

Step 1: Set up domain names in Heroku

First you want to add the root domain and the www domain to heroku. You do this by clicking into your production application, then going to settings and then scrolling down to Domains and certificates.

Here you will add <your_domain>.com and www.<your_domain>.com. This will give you two CNAME records. They will look something like <your_domain>.com.herokudns.com and www.<your_domain>.com.herokudns.com.

Step 2: Add CNAME records to Cloudfare.

@bcfurtado
bcfurtado / clean-up-zfs-snapshots-ubuntu-20.md
Last active September 8, 2021 20:09
ubuntu 20 - clean up zfs snapshots

List available space

$ zpool list

Delete old snapshots

$ zfs list  | grep legacy | awk -F ' ' '{print $1}' | xargs -n 1 sudo zfs destroy -R

Reinstall GRUB on ubuntu 20.04 with ZFS

sudo -i
zpool export -a
zpool import -N -R /mnt rpool
zpool import -N -R /mnt bpool
@bcfurtado
bcfurtado / config.py
Created December 10, 2019 09:44
log all python requests
import http.client
import logging
http.client.HTTPConnection.debuglevel = 1
logging.basicConfig()
logging.getLogger().setLevel(logging.DEBUG)
requests_log = logging.getLogger("urllib3")
requests_log.setLevel(logging.DEBUG)
requests_log.propagate = True

i3 Window Manager - Shortcuts

Moving Around

Command Description
$mod Enter Open new Terminal
$mod ( j / ← ) Focus left
$mod ( k / ↓ ) Focus down
$mod ( l / ↑ ) Focus up

Tips and Commands for development using emacs lisp

command description
ielm Open emacs lisp REPL
@bcfurtado
bcfurtado / inspiration-emacs-settings.org
Created June 24, 2018 18:02
inspiration emacs settings

Emacs Settings for Inspiration

NameDescription
pucell-emacs.dAn Emacs configuration bundle with batteries included
magnars-emacs.dMy personal emacs settings, and the ones used in @emacsrocks
prelude-bbatsovPrelude is an enhanced Emacs 24.4+ distribution that should make your experience with Emac

Bash/ZSH Keyboard Shortcuts

Shortcuts Command
Tab Auto complete
^a Beginning of line
^e End of line
^f Forward one character
^b Back one character
^h Delete one character (backw­ards)

So you've installed Emacs. Now what?

Well, you can start the tutoral by pressing C-h t, and that's not a bad place to start. If you're completely new to Emacs, the Emacs Prelude package offers a nice set of sensible defaults and packages.

The best documentation on Emacs Lisp is... shipped with Emacs itself!

From the EmacsWiki Entry:

EmacsLispReference is the official Emacs Lisp documentation. It is built into the Emacs Info pages and is the go-to for most Elisp programmers. It is shipped with Emacs and can be accessed by the menu bar, with M-x menu-bar-read-lispref, or from the top page of InfoMode.

@bcfurtado
bcfurtado / working_with_multi_emacs_configurations.md
Last active July 2, 2018 20:45
Opening multi emacs instances with different settings

In Mac OS:

open -a Emacs -n --args -q --eval='(setq user-emacs-directory "~/dot.emacs")'  -l ~/dot.emacs/init.el

In console line:

emacs -q --eval='(setq user-emacs-directory "~/dot.emacs")'  -l ~/dot.emacs/init.el