Skip to content

Instantly share code, notes, and snippets.

View gaubert's full-sized avatar

Guillaume Aubert gaubert

View GitHub Profile
@dergachev
dergachev / backup-services.md
Last active October 12, 2023 06:14
Results of my backup services research

backup services research

I googled around, especially with site:news.ycombinator.com for backup recommendations. Here are notes on the top hits.

tarsnap

http://www.tarsnap.com/

  • by prolific HN member; focus on encryption and deduplication
@electronut
electronut / analog-plot.ino
Created May 24, 2013 07:45
Read analog values from A0 and A1 and print them to serial port.
// analog-plot
//
// Read analog values from A0 and A1 and print them to serial port.
//
// electronut.in
#include "Arduino.h"
void setup()
{
@electronut
electronut / showdata.py
Created May 24, 2013 07:44
Display analog data from Arduino using Python (matplotlib)
################################################################################
# showdata.py
#
# Display analog data from Arduino using Python (matplotlib)
#
# electronut.in
#
################################################################################
import sys, serial
@miohtama
miohtama / gist:5389146
Created April 15, 2013 15:56
Decoding emails in Python e.g. for GMail and imapclient lib
import email
def get_decoded_email_body(message_body):
""" Decode email body.
Detect character set if the header is not set.
We try to get text/plain, but if there is not one then fallback to text/html.
:param message_body: Raw 7-bit message body input e.g. from imaplib. Double encoded in quoted-printable and latin-1
@hrwgc
hrwgc / README.md
Last active September 4, 2023 11:15
VIIRS Nighttime Lights 2012 processing
<!DOCTYPE>
<html>
<head>
<title>Dissecting Gmail's Email Attachments - Dropping Files</title>
<style>
.msg {
display: none
}
.dragging .msg {
@tacaswell
tacaswell / euler_rot.py
Created October 29, 2012 01:35
A simple function that implements rotation by Euler angles.
import numpy as np
def euler_rot(XYZ,phi,theta,psi):
'''Returns the points XYZ rotated by the given euler angles'''
ERot = np.array([[np.cos(theta)*np.cos(psi),
-np.cos(phi)*np.sin(psi) + np.sin(phi)*np.sin(theta)*np.cos(psi),
np.sin(phi)*np.sin(psi) + np.cos(phi)*np.sin(theta)*np.cos(psi)],
[np.cos(theta)*np.sin(psi),
np.cos(phi)*np.cos(psi) + np.sin(phi)*np.sin(theta)*np.sin(psi),
@aseemk
aseemk / gist:3905781
Created October 17, 2012 14:23
Wrapper script around gmvault that allows setting default options.
#!/usr/bin/env bash
#
# Wrapper around gmvault binary that sets default options.
GMVAULT_DIR="$HOME/Dropbox/Applications/Utilities/gmvault-v1.7-beta/bin/"
DB_DIR="$HOME/Dropbox/.gmvault-db"
# Run in a sub-shell since we need to change directories:
(
cd $GMVAULT_DIR
@hmason
hmason / test.sh
Created August 21, 2012 22:01
Did you know that bash will reload a script *while it is executing*?!
#!/bin/bash
function addnext {
NUM=$1
sleep 1
echo HI $NUM
NUM=$(expr $NUM + 1)
echo addnext $NUM >> $0
}
@jaseg
jaseg / gist:3334991
Created August 12, 2012 22:32
Password manager without a password manager

Prelude

Since password managers are big and complicated and I currently am pretty bored since I am sitting in a car for a few hours, here is a simple algorithm to generate resource-specific, unique passwords using a master password and no password database.

WARNING

As pointed out here: http://news.ycombinator.com/item?id=4374888 this method is broken.

Usage