Skip to content

Instantly share code, notes, and snippets.

@gboudreau
gboudreau / mount_shares_locally
Last active September 14, 2020 03:57
mount_shares_locally for Fedora/CentOS
#!/bin/bash
#
### BEGIN INIT INFO
# Provides: mount_shares_locally
# Required-Start: $network $local_fs $remote_fs smb mysqld
# Required-Stop: $network $local_fs $remote_fs smb
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: mount Samba shares locally
### END INIT INFO
@gboudreau
gboudreau / flickr-api-proxy.php
Created April 8, 2012 11:09
Flickr API proxy for Apple TV - Details: http://www.pommepause.com/blog/?p=530
<?php
$served_by = '';
if ($_GET['method'] == 'flickr.photos.search') {
if (strpos($_GET['text'], 'group:') === 0) {
$group_name = trim(substr($_GET['text'], 6));
$served_by = 'group.' . str_replace(' ', '_', $group_name) . '.';
$xml = file_get_contents('http://api.flickr.com/services/rest/?method=flickr.groups.search&api_key=' . $_GET['api_key'] . '&text=' . urlencode($group_name));
$xml = simplexml_load_string($xml);
$attr = $xml->groups->group->attributes();
@gboudreau
gboudreau / saved_plan.js
Created May 17, 2012 21:36
OTP display saved API response
// bougu@Netlift: this allows us to display the OTP UI with a predefined apiResponse (XML)
otp.planner.Forms.prototype.submitSuccessXML = function(response)
{
var responseXML;
if (window.DOMParser)
{
var parser=new DOMParser();
responseXML=parser.parseFromString(response,"text/xml");
}
else // Internet Explorer
@gboudreau
gboudreau / gh-du.php
Last active October 13, 2015 09:18
Greyhole Disk Usage Report Browser
<?php
# How to use: https://github.com/gboudreau/Greyhole/wiki/How-to-visualize-used-disk-space-in-your-storage-pool
header('Content-Type: text/html; charset=utf8');
setlocale(LC_CTYPE, "en_US.UTF-8");
if (!file_exists('/usr/share/greyhole/gh-disk-usage.log')) {
die("Error: /usr/share/greyhole/gh-disk-usage.log file not found.<br/>You need to run 'greyhole --fsck --disk-usage-report' to generate this file.");
}
@gboudreau
gboudreau / gist:5206966
Created March 20, 2013 18:03
Correctly handle errors with valid SSL certificates in cURL/PHP. Use this if you have problems connecting to https websites using PHP cURL extension. If the certificate is not signed by a CA listed in cURL's cacert.pem, you can use this technique to verify the certificate: http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssl…
<?php
// [...]
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE); // for security this should always be set to true.
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // for security this should always be set to 2.
// Update cacert.pem (valid CA certificates list) from the cURL website once a month
$curl_cainfo = sys_get_temp_dir() . DIRECTORY_SEPARATOR . 'cacert.pem';
$last_month = time()-30*24*60*60;

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:

@gboudreau
gboudreau / greyhole-custom-debug.sh
Last active August 29, 2015 14:02
Greyhole debugging
#!/bin/sh
{
ls -la /mnt/GreyholeHDDs/*/GH/Media/TV\ Shows/Breaking\ Bad/Season\ 01
ls -la /mnt/GreyholeHDDs/1TbSeagate/LZ/Media/TV\ Shows/Breaking\ Bad/Season\ 01
} > /tmp/greyhole_sysinfo_3
echo "Here's the URL you will need to give the to person who's helping you:"
cat /tmp/greyhole_sysinfo_3 | curl -F 'sprunge=<-' http://sprunge.us
echo
@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

Keybase proof

I hereby claim:

  • I am gboudreau on github.
  • I am gboudreau (https://keybase.io/gboudreau) on keybase.
  • I have a public key whose fingerprint is EEEC EA5D AB9D BA25 21C6 5248 4536 901B F6B0 FCFA

To claim this, I am signing this object:

@gboudreau
gboudreau / Sample of Übersicht.txt
Created June 17, 2014 18:41
Sample of Übersicht - Application Not Responding
Sampling process 64900 for 3 seconds with 1 millisecond of run time between samples
Sampling completed, processing symbols...
Analysis of sampling Übersicht (pid 64900) every 1 millisecond
Process: Übersicht [64900]
Path: /Applications/Übersicht.app/Contents/MacOS/Übersicht
Load Address: 0x1075a4000
Identifier: tracesOf.Uebersicht
Version: 0.1 (5)
Code Type: X86-64
Parent Process: launchd [616]