Skip to content

Instantly share code, notes, and snippets.

View gmag11's full-sized avatar

Germán Martín gmag11

View GitHub Profile
"""
Change the constants below.
"""
fileName = "INSERT FILENAME"
API = "INSERT API-WRITE-KEY"
nodeID = 13
urlString = "http://emoncms.org/input/bulk.json?time=%d&apikey=%s&data=["
import pandas as pd
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@dropmeaword
dropmeaword / browser_history.md
Last active April 5, 2024 17:37
Playing around with Chrome's history

Browser histories

Unless you are using Safari on OSX, most browsers will have some kind of free plugin that you can use to export the browser's history. So that's probably the easiest way. The harder way, which seems to be what Safari wants is a bit more hacky but it will also work for other browsers. Turns out that most of them, including Safari, have their history saved in some kind of sqlite database file somewhere in your home directory.

The OSX Finder cheats a little bit and doesn't show us all the files that actually exist on our drive. It tries to protect us from ourselves by hiding some system and application-specific files. You can work around this by either using the terminal (my preferred method) or by using the Cmd+Shft+G in Finder.

Finder

Once you locate the file containing the browser's history, copy it to make a backup just in case we screw up.

# This script work on any system using systemd as the init process.
# It works on Debian/Raspbian Jessie.
# If you have Debian/Rapbian Wheezy and want to use this script with systemd
# follow the information here : https://wiki.debian.org/systemd
# To easily download, install and set at startup:
# wget -O /tmp/download https://gist.github.com/Belphemur/3f6d3bf211b0e8a18d93/download && sudo tar -zxf /tmp/download --strip-components 1 -C /etc/systemd/system/ && sudo systemctl --reload-daemon && sudo systemctl enable Node-RED
# To consult the log : journalctl -u Node-RED
[Unit]
@jjfajardo
jjfajardo / quicksort.cpp
Created February 2, 2012 19:54
Implementación del algoritmo de ordenación Quicksort en C++.
/*Códigos correspondientes al trabajo realizado para el ISUM 2012.
* Test de rendimiento de los algoritmos de ordenamiento Quicksort,
* Mezcla y burbuja implementados en C++, Fortran y Python.
* Guanajuato, Guanajuato, México (14-16 de Marzo 2012)
*
* Programa: quicksort.cpp
* compilar: gcc -Wall -O quicksort.cpp -o quicksort
* Uso: $./quicksort 1000.dat
* El tamaño del array se toma del nombre del archivo (1000.dat)
* Salida: