Skip to content

Instantly share code, notes, and snippets.

Luís Bianchin labianchin

View GitHub Profile
@labianchin
labianchin / tree_level_order.py
Created Nov 7, 2013
Print a binary tree of integers in level order.
View tree_level_order.py
#!/usr/bin/python
class Node:
def __init__(self, value, children=[]):
self.children = children
self.value = value
def tree_level_order(self):
level = [self]
@labianchin
labianchin / setgetbit.py
Last active Apr 28, 2018
Bit Set, Bit Get
View setgetbit.py
#!/usr/bin/python
def getbit(n, i):
"""
>>> getbit(4, 0)
False
>>> getbit(4, 1)
False
>>> getbit(4, 2)
True
@labianchin
labianchin / gpg-import-and-export-instructions.md
Created Nov 3, 2015 — forked from chrisroos/gpg-import-and-export-instructions.md
Instructions for exporting/importing (backup/restore) GPG keys
View gpg-import-and-export-instructions.md

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...
View dicas_docker.md

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 / creating_keys.md
Created Aug 1, 2016 — forked from colinstein/creating_keys.md
Using OpenSSL to create keys for Mac OS X.
View creating_keys.md

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:

You can’t perform that action at this time.