Skip to content

Instantly share code, notes, and snippets.

View lssimoes's full-sized avatar

Lucas Silva Simões lssimoes

View GitHub Profile
@lssimoes
lssimoes / nsquaregraph.jl
Last active August 29, 2015 14:04
Function that creates a N-sized square graph grid
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]
@lssimoes
lssimoes / nonlinear-fit.jl
Last active August 29, 2015 14:22
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 / Plot_Examples.md
Created December 4, 2015 00:24 — forked from gizmaa/Plot_Examples.md
Various Julia plotting examples using PyPlot
@lssimoes
lssimoes / vadown.sh
Created December 29, 2015 22:49 — forked from gabrielsimoes/vadown.sh
Download homiliae from vatican and save as html
#!/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 / gpg-import-and-export-instructions.md
Last active February 12, 2016 19:33 — forked from chrisroos/gpg-import-and-export-instructions.md
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...