Skip to content

Instantly share code, notes, and snippets.

View labianchin's full-sized avatar

Luís Bianchin labianchin

View GitHub Profile
@labianchin
labianchin / creating_keys.md
Created August 1, 2016 12:32
Using OpenSSL to create keys for Mac OS X.

Creating Keys

This is a brief guide to creating a public/private key pair that can be used for OpenSSL. While the "easy" version will work, I find it convenient to generate a single PEM bundle and then export the private/public key from that as needed. This document also covers how to add and remove a password from your private key and how to make sure that keychain will automatically unlock it when you sign in.

Just make it work

Generate an ssh key-pair:


layout: post category : tips tagline: "Some tips about running and building with docker" tags : [docker,tips,tools,devops]

Você já sabe o básico de Docker, mas quando começa a usar com mais frequência, alguns desconfortos surgem. Como qualquer ferramenta, Docker tem seu próprio conjunto de boas práticas e dicas para ser efetivo.

@labianchin
labianchin / gpg-import-and-export-instructions.md
Created November 3, 2015 13:05 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@labianchin
labianchin / setgetbit.py
Last active April 28, 2018 13:51
Bit Set, Bit Get
#!/usr/bin/python
def getbit(n, i):
"""
>>> getbit(4, 0)
False
>>> getbit(4, 1)
False
>>> getbit(4, 2)
True
@labianchin
labianchin / tree_level_order.py
Created November 7, 2013 21:13
Print a binary tree of integers in level order.
#!/usr/bin/python
class Node:
def __init__(self, value, children=[]):
self.children = children
self.value = value
def tree_level_order(self):
level = [self]