Skip to content

Instantly share code, notes, and snippets.

View gabrielfalcao's full-sized avatar

Gabriel Falcão gabrielfalcao

View GitHub Profile
@encoreshao
encoreshao / Dockerfile
Created April 28, 2017 09:26
PostgreSQL 9.6 Dockerfile
FROM ubuntu
# MAINTAINER email#dot.com
# Add the PostgreSQL PGP key to verify their Debian packages.
# It should be the same key as https://www.postgresql.org/media/keys/ACCC4CF8.asc
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
# Add PostgreSQL's repository. It contains the most recent stable release
# of PostgreSQL, ``9.6``.
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
@nicowilliams
nicowilliams / fork-is-evil-vfork-is-good-afork-would-be-better.md
Last active March 14, 2025 02:50
fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid

I recently happened upon a very interesting implementation of popen() (different API, same idea) called popen-noshell using clone(2), and so I opened an issue requesting use of vfork(2) or posix_spawn() for portability. It turns out that on Linux there's an important advantage to using clone(2). I think I should capture the things I wrote there in a better place. A gist, a blog, whatever.

This is not a paper. I assume reader familiarity with fork() in particular and Unix in general, though, of course, I link to relevant wiki pages, so if the unfamiliar reader is willing to go down the rabbit hole, they should be able to come ou

How to contact me

After some stalking problems I stopped using these accounts. I will repost when I have new info.

# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import sys
import time
from itertools import chain
reload(sys)
sys.setdefaultencoding('utf-8')
import Cocoa
class ViewController: NSViewController {
var statusBar = NSStatusBar.system()
var statusBarItem : NSStatusItem = NSStatusItem()
var leMenu : NSMenu = NSMenu()
var openMenuItem : NSMenuItem = NSMenuItem()
var exitMenuItem : NSMenuItem = NSMenuItem()
override func awakeFromNib() {
@shanielh
shanielh / readme.md
Last active November 21, 2016 18:35
Witch!

Usage

./witch.sh terraform

Result

 _________________________________________
@axelborja
axelborja / profiling_python.py
Last active June 13, 2023 03:57
Profile your python code using CProfile or Yappi and KCachegrind / QCachegrind
################
# CPROFILE #
#############################################################################
# 1 - Profile myfunc() from ipython
import cProfile
filename = 'filename.prof'
cProfile.run('myfunc()', filename)
# 2 - Convert your file to a usable kcachegrind file in your shell
@ViktorNova
ViktorNova / rotate-video.sh
Created August 8, 2016 21:33
Rotate a video with FFmpeg (100% lossless, and quick)
$INPUTVIDEO='input.mp4'
$OUTPUTVIDEO='output.mp4'
ffmpeg -i $INPUTVIDEO -metadata:s:v rotate="-90" -codec copy $OUTPUTVIDEO
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 6, 2025 20:45
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@gabrielfalcao
gabrielfalcao / create-a-ca.md
Last active November 18, 2018 02:29
How to create a CA to emit SSL certificates (transcription to markdown from https://www.phildev.net/ssl/creating_ca.html)

Creating a CA

Creating a Certificate Authority is easy. There are many scripts out there to do it for you. However, creating a CA that is easy to manage can be tricky. This should walk you through creating a CA and explain all the pieces.

Note: This page takes an extra step to make a fairly PKIX-compliant Certificate Authority. In pariticular, it ensures that the email address associated with your CA is in the SubjectAltName extension rather than in the DN. The former is the PKIX and X509v3 standard way of presenting an email address while the later is the old X509v1 way.

Initial Preparation

1. Create the directory your CA will live in