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:

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.

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 setgetbit.py
#!/usr/bin/python
def getbit(n, i):
"""
>>> getbit(4, 0)
False
>>> getbit(4, 1)
False
>>> getbit(4, 2)
True
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]