Skip to content

Instantly share code, notes, and snippets.

@SeverTopan
SeverTopan / Creator.md
Last active November 7, 2018 07:20
Casting Away the Private Constructor std::make_shared Boilerplate

A common problem that I have come across exists when attempting to create shared pointers of objects which have protected constructors. The following class design details a class that can only be accessed through a shared reference.

class A
{
protected:
    A(int foo)
        : _foo(foo)
    {
 }
@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...