Skip to content

Instantly share code, notes, and snippets.

View gabrielfalcao's full-sized avatar
👨‍💻
probably writing tests

Gabriel Falcão gabrielfalcao

👨‍💻
probably writing tests
View GitHub Profile
@gabrielfalcao
gabrielfalcao / orgtbl-config.el
Created November 7, 2017 19:47 — forked from sigma/orgtbl-config.el
#emacs ReST support for #org tables
(defun yh/orgtbl-to-rst-paddings (table)
(let* ((pruned-table (remove 'hline table))
(size-table (mapcar (lambda (row)
(mapcar #'length row))
pruned-table)))
(apply #'mapcar* #'max size-table)))
(defun yh/orgtbl-padded-hline (paddings &optional chr)
(let ((chr (or chr ?-)))
(concat (format "+%c" chr)
@gabrielfalcao
gabrielfalcao / scp_demo.py
Created September 15, 2017 01:30 — forked from mlafeldt/scp_demo.py
[Python] paramiko examples
#!/usr/bin/env python
import sys, paramiko
if len(sys.argv) < 5:
print "args missing"
sys.exit(1)
hostname = sys.argv[1]
password = sys.argv[2]
@gabrielfalcao
gabrielfalcao / EmacsKeyBinding.dict
Created May 28, 2017 02:46 — forked from jwreagor/EmacsKeyBinding.dict
Global Emacs Key Bindings for OS X
{
/* Keybindings for emacs emulation. Compiled by Jacob Rus.
*
* This is a pretty good set, especially considering that many emacs bindings
* such as C-o, C-a, C-e, C-k, C-y, C-v, C-f, C-b, C-p, C-n, C-t, and
* perhaps a few more, are already built into the system.
*
* BEWARE:
* This file uses the Option key as a meta key. This has the side-effect
* of overriding Mac OS keybindings for the option key, which generally
@gabrielfalcao
gabrielfalcao / freebsd_on_mbp.md
Created November 25, 2016 06:20 — forked from mpasternacki/freebsd_on_mbp.md
FreeBSD on a MacBook Pro

FreeBSD on a MacBook Pro

Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki

@gabrielfalcao
gabrielfalcao / .profile
Created October 24, 2016 01:46 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@gabrielfalcao
gabrielfalcao / hexspeak
Created July 28, 2016 04:23 — forked from dannyow/hexspeak
Hexspeak word list
00D1E5
0111E
0115
011ED
011F1E1D
011F1E1D5
015E
01AF
01D1E
# basic pfctl control
# ==
# Related: http://www.OpenBSD.org
# Last update: Tue Dec 28, 2004
# ==
# Note:
# this document is only provided as a basic overview
# for some common pfctl commands and is by no means
# a replacement for the pfctl and pf manual pages.
@gabrielfalcao
gabrielfalcao / gist:11c83cdd688ad364a4e9
Last active September 4, 2016 14:07 — forked from sole/gist:1493825
Rotate video counterclockwise with ffmpeg
ffmpeg -i inputfile -vf "rotate=-2" outputfile
This uses mplayer's rotate filter, so the options are the same:
rotate[=<0−7>]
Rotates the image by 90 degrees and optionally flips it. For values between 4−7 rotation is only done if the movie geometry is portrait and not landscape.
0
Rotate by 90 degrees clockwise and flip (default).
1
Rotate by 90 degrees clockwise.
@gabrielfalcao
gabrielfalcao / _.md
Last active June 1, 2016 18:10 — forked from klange/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is written in BSD mandoc.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke. Same for the const correctness.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at least.
In [1]: policy = """{
...: "Statement":[{
...: "Effect":"Allow",
...: "Action":["s3:*"],
...: "Resource":["arn:aws:s3:::mybucket"]}]}"""
In [2]: import boto
In [4]: c = boto.connect_iam()
In [5]: instance_profile = c.create_instance_profile('myinstanceprofile')
In [6]: role = c.create_role('myrole')
In [7]: c.add_role_to_instance_profile('myinstanceprofile', 'myrole')