Skip to content

Instantly share code, notes, and snippets.

Filippo Valsorda FiloSottile

Block or report user

Report or block FiloSottile

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jvehent
jvehent / age demo.md
Created Jan 6, 2020
age-encryption.org demo
View age demo.md

Download & install

$ wget https://github.com/FiloSottile/age/releases/download/v1.0.0-beta2/age-v1.0.0-beta2-linux-amd64.tar.gz
$ tar -xzvf age-v1.0.0-beta2-linux-amd64.tar.gz
$ sudo cp age/* /usr/local/bin/

Generate a keypair

$ age-keygen -o ~/.age/(date +%s)-(hostname).key
@pedrovgp
pedrovgp / fetch_stock_prices_for_gnucash.py
Last active Oct 12, 2019
Python script to fetch stock prices for gnucash using http://alphavantage.co/ api. Since Quotes::Finance fetching from Yahoo finance no longer works, it is an alternative.
View fetch_stock_prices_for_gnucash.py
# INSTALL DEPENDENCIES BEFORE RUNNING: pandas, sqlite3, sqlalchemy, requests
# There is one thing you have to do though: gnucash needs to know the price's currency and it needs a guid (unique identifier)
# for this. This guid is unique for each installation, so you need to find yours and assign it to CURRENCY_GUID.
# OR: you can just leave it, and the script will fetch the currency from the last price added
import pandas as pd
import sqlite3
import sqlalchemy
from sqlalchemy import create_engine
import datetime
@rkrzr
rkrzr / auto_tags.py
Last active Dec 20, 2019
Automatically generate ansible tags of the same name for each role in a playbook
View auto_tags.py
"""
This module implements an Ansible plugin that is triggered at the start of a playbook.
The plugin dynamically generates a tag for each role. Each tag has the same name as its role.
The advantage of this is that it saves you some boilerplate, because you don't have to wrap
all tasks of a role in an additional block and assign a tag to that.
Additionally, it works automatically when you add new roles to your playbook.
Usage is exactly the same as without this plugin:
@mimoo
mimoo / curve25519.sage
Created Nov 16, 2017
Curve25519 with sage
View curve25519.sage
# create curve
ec = EllipticCurve(GF(2**255-19), [0,486662,0,1,0])
base_point = ec.lift_x(9)
point_at_infinity = ec(0)
# all elements of order 4
G4s = ec.lift_x(1, True)
G4 = ec.lift_x(1) # just the first element
# the element of order 2
@contra
contra / aoe2hd.md
Last active Jan 8, 2020
Age of Empires II HD - For Mac OSX
View aoe2hd.md

AOE2HD - For Mac OSX

Estimated time: 10 minutes

Notice

PlayOnMac does not work on macOS Catalina, and issues have been reported with the latest version of Steam. Updating is in progress, read more here.

When the updates are released this guide will be updated.

@hdevalence
hdevalence / gist:aac098857248a1c3134eb8101b692547
Created Oct 30, 2016
convert sage integers to little endian byte strings
View gist:aac098857248a1c3134eb8101b692547
# v--- endianness issues here
bytestr_to_arr = lambda s:"[" + ", ".join(['0x'+b+a for a,b in zip(s[0::2], s[1::2])]) + "]"
ZZtobytestr = lambda x: "".join(ZZ(x).digits(16, '0123456789abcdef'))
@joepie91
joepie91 / vpn.md
Last active Jan 15, 2020
Don't use VPN services.
View vpn.md

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

A Russian translation of this article can be found here, contributed by Timur Demin. There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.

Why not?

@cknave
cknave / caenons3.md
Created Mar 21, 2015
Camlistore Encryption on S3
View caenons3.md

Camlistore Encryption on S3

Here's what I found out while setting up Camlistore to sync encrypted blobs to Amazon S3. This works for me, but I'm new to Camlistore so this might not be the best way to do it.

Amazon S3 Config

The encryption handler requires two buckets, one for metadata and one for blobs. In this example, I've created two buckets called my-camlistore-meta and my-camlistore-blob.

@Wack0
Wack0 / gist:17c56b77a90073be81d3
Last active Mar 6, 2018
It's not just superfish that's the problem.
View gist:17c56b77a90073be81d3
Superfish uses an SDK from Komodia to do SSL MITM. That's probably known by now.
Superfish isn't the only product to use that sdk. there's others too.
Each product that uses the Komodia SDK to MITM, has its OWN CA cert and private
key pair. Seems a lot of people think they all use the superfish cert. That is
NOT the case.
First thing I checked was komodia's own parental control software,
Keep My Family Secure. (mentioned on komodia's own website).
@Drakulix
Drakulix / mingw-w64-3.10-osx10.9.sh
Last active Jan 9, 2020
Script to install a Mingw-w64 Cross-Compiler Suite on Mac OS X 10.9
View mingw-w64-3.10-osx10.9.sh
#!/bin/sh
# dependencies
echo "Installing dependencies via Homebrew (http://brew.sh)"
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew update
brew install gcc48
You can’t perform that action at this time.