Skip to content

Instantly share code, notes, and snippets.

View ncouture's full-sized avatar
🌳
Continuously Growing!

Nicolas Couture ncouture

🌳
Continuously Growing!
View GitHub Profile
(import MockSSH)
(require mockssh.language)
(setv cmds
{"passwd" (command :name "passwd"
:type "prompt"
:output "Password: "
:required-input "1234"
:on-success ["prompt" "hostname#"]
@ncouture
ncouture / climate.weather.gc.ca.txt
Created May 18, 2014 23:35
from 20075000+ lines of csv data :(
# 47 years of historical weather data, for once city
mysql> select count(*) from hist where station_name = "HUNTINGDON";
+----------+
| count(*) |
+----------+
| 17167 |
+----------+
1 row in set (6.24 sec)
mysql>
mysql> select municipality, region, hydrographic_region from stations group by hydrographic_region asc;
+-------------------------+----------------------------------+------------------------------+
| municipality | region | hydrographic_region |
+-------------------------+----------------------------------+------------------------------+
| Rivière-Koksoak | Nord-du-Québec | Baie d'Ungava |
| Saint-Alphonse | Gaspésie--Îles-de-la-Madeleine | Baie des Chaleurs et Percé |
| Pikogan | Abitibi-Témiscamingue | Baies de Hannah et de Rupert |
| Baie-d'Hudson | Nord-du-Québec | Baies James et d'Hudson |
| Pointe-Claire | Montréal | Fleuve Saint-Laurent |
| Lantier | Laurentides | Outaouais et Montréal |
@ncouture
ncouture / setup.md
Created December 16, 2015 18:47 — forked from xrstf/setup.md
Nutch 2.3 + ElasticSearch 1.4 + HBase 0.94 Setup

Info

This guide sets up a non-clustered Nutch crawler, which stores its data via HBase. We will not learn how to setup Hadoop et al., but just the bare minimum to crawl and index websites on a single machine.

Terms

  • Nutch - the crawler (fetches and parses websites)
  • HBase - filesystem storage for Nutch (Hadoop component, basically)
@ncouture
ncouture / tidy.conf
Last active July 29, 2019 20:05 — forked from paultreny/tidy.conf
The config file I use for tidy-html5. $ tidy -config <path/to/tidy.conf> input.html > output.html
# Example tidy-html5 configuration file.
fix-uri: yes
keep-time: yes
hide-comment: yes
indent-cdata: yes
omit-optional-tags: yes
output-encoding: utf8
indent: auto
indent-spaces: 2
@ncouture
ncouture / setup.py
Created May 5, 2016 20:10 — forked from mmerickel/setup.py
SSLOnlyMiddleware
setup(
entry_points={
'paste.filter_app_factory': [
'ssl_only = myapp.middlewares.ssl_only:make_filter',
],
}
)

Google Sign-in implementation for Websauna.

Features

  • Persistent offline access to scope
  • On-the-air installs of android apps
  • Everything supported by Google Sign-in

Implementation

This implementation follows the “Google Sign-In for server-side apps”[fn:1] at the exception of verifying user-submitted code with Google.

#!/usr/bin/python
PAGESPEED_API_KEY='<...>'
import json
import requests
import pprint
from googleapiclient.discovery import build
{% import "path_utils.jinja" as path_utils with context %}
{% set project = env["project"] %}
{% set deployment = env["deployment"] %}
{% set name = "%s-vm-tmpl" % env["name"] %}
{% set instanceName = "%s-vm" % deployment %}
{% set zone = properties["zone"] %}
{% set machineType = properties["machineType"] %}
{% set network = path_utils.networkPath(properties["network"]) %}
{% set subnetwork = properties["subnetwork"] %}

Keybase proof

I hereby claim:

  • Keybase has a public key whose fingerprint is 3343 B3A0 E5BE 82D6 53C6 5E0F 9119 C2EB A497 E212
  • This key's private key is hosted on their server and I do not keep a copy of it

To claim this, Keybase is signing this object: