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
#!/bin/bash
#
# Google Cloud Platform functions.
#
# - All functions act on the default project configured for `gcloud'.
#
# Install the gcloud command line interface.
install_gcloud_cli() {
@ncouture
ncouture / reverse-tether.sh
Created March 15, 2017 17:12 — forked from chrisob/reverse-tether.sh
Android reverse tethering over bridged SSH tap interface
#!/bin/bash
# Based on the scripts written by class101 of xda-developers.com:
# http://forum.xda-developers.com/showpost.php?p=57490025&postcount=205
#
# This script enables a secure tunnel for your android phone to "reverse tether"
# and access the internet/a private network via the following steps:
#
# 1. Establish a level 3 (TAP) tunnel from your local host to a remote server via SSH (tap0)
# 2. Establish a level 3 interface between your local host and your android phone via USB (usb0)
@ncouture
ncouture / pyquery-spider.py
Created November 6, 2016 13:34
This is a re-implementation using PyQuery instead of XPaths for the Scrapy spider tutorial found here: http://doc.scrapy.org/en/latest/intro/tutorial.html#our-first-spider
from scrapy.spider import BaseSpider
# Requires this patch:
# https://github.com/joehillen/scrapy/commit/6301adcfe9933b91b3918a93387e669165a215c9
from scrapy.selector import PyQuerySelector
class DmozSpiderPyQuery(BaseSpider):
name = "pyquery"
allowed_domains = ["dmoz.org"]
start_urls = [
#### Contents of the preconfiguration file (for jessie)
### Localization
# Preseeding only locale sets language, country and locale.
d-i debian-installer/locale string en_US
# The values can also be preseeded individually for greater flexibility.
#d-i debian-installer/language string en
#d-i debian-installer/country string NL
#d-i debian-installer/locale string en_GB.UTF-8
# Optionally specify additional locales to be generated.

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:

{% 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"] %}
#!/usr/bin/python
PAGESPEED_API_KEY='<...>'
import json
import requests
import pprint
from googleapiclient.discovery import build

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.