Skip to content

Instantly share code, notes, and snippets.

Avatar

Lucas Silva Simões lssimoes

View GitHub Profile
@lssimoes
lssimoes / gpg-import-and-export-instructions.md
Last active Feb 12, 2016 — 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...
@lssimoes
lssimoes / vadown.sh
Created Dec 29, 2015 — forked from gabrielsimoes/vadown.sh
Download homiliae from vatican and save as html
View vadown.sh
#!/bin/bash
link=$1
if [[ ! -n $1 ]]
then
link=http://w2.vatican.va/content/francesco/pt/apost_letters/documents/papa-francesco_bolla_20150411_misericordiae-vultus.html
fi
curl $link > .tp1
@lssimoes
lssimoes / Plot_Examples.md
Created Dec 4, 2015 — forked from gizmaa/Plot_Examples.md
Various Julia plotting examples using PyPlot
@lssimoes
lssimoes / nonlinear-fit.jl
Last active Aug 29, 2015
nonlinear-fit.jl
View nonlinear-fit.jl
# Julia Version 0.4.0-dev+5181
# Commit 98c144b (2015-06-03 14:28 UTC)
#
# - PyPlot 1.5.3+ master
# - PyCall 0.8.1+ master
using Calculus, PyPlot, Roots
# function being approximated
# still needing to find a way to remove this redundancy..
@lssimoes
lssimoes / nsquaregraph.jl
Last active Aug 29, 2015
Function that creates a N-sized square graph grid
View nsquaregraph.jl
using Graphs
# This implementation takes too long to create the graphs, so I'm almost sure it's not the best way (certainly is not the only way)
function nsquaregraph(n::Int)
# Creating Vertices Array
newvertices = Array(ExVertex, 0)
for i in 1:n^2
vertice = ExVertex(i,"eletron")
vertice.attributes["spin"] = randspin() # randspin() generates randomically -1 or +1
newvertices = [newvertices, vertice]
You can’t perform that action at this time.