Skip to content

Instantly share code, notes, and snippets.

View gmazzo's full-sized avatar

Guillermo Mazzola gmazzo

  • Glovo
  • Barcelona
  • 07:32 (UTC +01:00)
  • Instagram gmazzo65
View GitHub Profile
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
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...

@gmazzo
gmazzo / logger.kt
Last active February 2, 2018 15:20
A lightweight Kotlin extension for java.util.logging.Logger simple support
/**
* A lightweight Kotlin extension for java.util.logging.Logger simple support
*
* Usage:
*
* At top level add:
* private val log = logger<MyClass>()
*
* Then on class body:
* log.info "Some log"
@gmazzo
gmazzo / JsoupConverterFactory.kt
Created February 2, 2018 15:19
A Jsoup body converter for Retrofit
/**
* A Jsoup body converter for Retrofit
*
* Sample usage (with Rx):
* Retrofit.Builder()
* .addCallAdapterFactory(RxJava2CallAdapterFactory.createAsync())
* .addConverterFactory(JsoupConverterFactory)
* .build()
*
* Then you can declare in you Retrofit interface return type: