Skip to content

Instantly share code, notes, and snippets.

@gboudreau
gboudreau / nest-api-php-workaround-login.php
Last active January 15, 2020 04:38
Manually create cache file required for nest-api to work with Nest accounts (not Google accounts). Ref: https://github.com/gboudreau/nest-api/issues/110
<?php
echo "\nInstructions:\n";
echo " - Login to https://home.nest.com in your browser\n";
echo " - Once logged in, using the same tab, go to https://home.nest.com/session\n";
echo " - Copy-paste the text (JSON) here (then press ENTER):\n\n";
$json = readline();
$o = json_decode($json);
echo "\nThanks!\n\n";
@gboudreau
gboudreau / greyhole-system-info.sh
Last active December 1, 2019 16:09
Greyhole System Infos
#!/bin/sh
{
echo "## System information"
uname -a 2>&1
echo
echo "## Samba version"
/usr/sbin/smbd --version
@gboudreau
gboudreau / _etc_ssh_sshd_config
Created May 11, 2016 20:10
Fix GitKraken not being able to pull/push from my gogs.io repos
# GitKraken needs diffie-hellman-group14-sha1
#KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256
KexAlgorithms curve25519-sha256@libssh.org,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha1
@gboudreau
gboudreau / NissanConnectEncryption.java
Created March 18, 2016 13:57
Nissan Connect API encryption using Java
package me.netlift.mobile.activities;
import android.util.Base64;
import java.security.Key;
import javax.crypto.Cipher;
import javax.crypto.spec.SecretKeySpec;
public class NissanConnectEncryption {
@gboudreau
gboudreau / duplicacy-monitoring.php
Last active May 19, 2018 02:43
duplicacy monitoring of incoming backups - email notifications when 3d / 7d without backup
#!/usr/bin/php
<?php
/*
Instructions:
- Download this script from : https://gist.githubusercontent.com/gboudreau/91b8866e3adb19965897ecd80a12525b/raw/duplicacy-monitoring.php
- Make it executable: chmod +x duplicacy-monitoring.php
- Obtain the Duplicacy CLI from https://github.com/gilbertchen/duplicacy/releases
- Configure the script by modifying the variables below.
# HG changeset patch
# Parent 60085c8f01fe4eb19a1c38a2d27fd77698b5a5ec
Issue #24363: Add policy flag to avoid parsing HTTP header as email body
diff -r 60085c8f01fe Lib/email/errors.py
--- a/Lib/email/errors.py Thu Sep 08 22:37:34 2016 -0400
+++ b/Lib/email/errors.py Mon Jan 23 23:39:53 2017 +0000
@@ -55,8 +55,9 @@
class MissingHeaderBodySeparatorDefect(MessageDefect):
@gboudreau
gboudreau / nissan-connect-encryption.html
Created March 18, 2016 13:55
Nissan Connect API encryption using Javascript
<script src="http://sladex.org/blowfish.js/ext/blowfish.js"></script>
<script>
var password = 'a';
var key = 'uyI5Dj9g8VCOFDnBRUbr3g';
var encrypted_password = blowfish.encrypt(password, key, {cipherMode: 0, outputType: 0});
console.log("Encrypted password: " + encrypted_password);
</script>
@gboudreau
gboudreau / fix_files.php
Last active February 29, 2016 15:24
Script to fix files copied from a dying hard drive that would sometimes read bytes as 0x10 less than what they are. Ref: https://www.pommepause.com/2016/02/the-case-of-the-dying-hard-drive-that-flipped-bits/
<?php
/**
* Use this script to check and fix a list of files that were copied, using rsync, from a bad (BAD!) hard drive to another hard drive (let's call that one the savior drive).
* Since the bad drive is so bad, the data that was copied off that drive might have been corrupted.
* So we'll find which of the listed files are wrong (different MD5 checksum on both drives), and fix them.
*
* Lucky for us, the dying drive is SO BAD that it never generates the same read errors, and when it does generate errors, the byte it reads is always exactly 0x10 (decimal 16) less than it should be.
* This very particular way of dying allows us to detect which of the two drive has the correct byte, and thus write a correct file on the savior drive.
* Hooray!
@gboudreau
gboudreau / test_checksum.php
Last active February 29, 2016 15:24
Calculate the MD5 checksum of a file over and over, clearing the disk cache between each read, to try to identify read errors that are happening on a hard drive. Ref: https://www.pommepause.com/2016/02/the-case-of-the-dying-hard-drive-that-flipped-bits/
<?php
$file = '/mnt/hdd5/persistent-app-data/downloading/vvgoor1586DSFGKL.part10.rar';
while (TRUE) {
exec("sync ; sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'");
$data1 = file_get_contents($file);
exec("sync ; sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'");
$data2 = file_get_contents($file);

I'm writing in response to events that have recently come to light involving a sexual assault at a tech conference. Background information can be found [here][1], [here][2], and [here][3] as well as on twitter and google.


I've been watching this from the sidelines, and I've been wrestling with several questions that I can't seem to shake and that I really don't have answers to.

I wear many hats, both in the tech community and others. I'm a coder, a speaker, a user group organizer, a conference organizer, and even a boss. Each of those roles colors how I see this, but there's one role that is overpowering in my reaction.

See, I'm a Dad. A dad of two beautiful and innocent girls who are 3 and 2. They have their whole lives in front of them and so the questions I'm struggling with are: