Skip to content

Instantly share code, notes, and snippets.

View demosdemon's full-sized avatar
🏠
Working from home

Joachim Brandon LeBlanc demosdemon

🏠
Working from home
View GitHub Profile
@demosdemon
demosdemon / convert.py
Created September 10, 2020 16:14
Convert Betterment Cost Basis report into a format importable by Yahoo Finance Portfolios.
#!/usr/bin/env python
import sys
import argparse
import csv
import operator
import logging
import datetime
@demosdemon
demosdemon / install.sh
Created August 3, 2019 00:38
Install drobo apps
#!/bin/sh
sudo /usr/bin/DroboApps.sh install
APPS_PATH="/mnt/DroboFS/Shares/DroboApps/"
find "$HOME/bin" -type l | while read -r link; do
dest="$(readlink "$link")"
case "$dest" in
$APPS_PATH*) ;;
@demosdemon
demosdemon / getcertnames.sh
Last active December 27, 2018 17:07
Show all the names (CNs and SANs) listed in an SSL certificate for a given domain
#!/usr/bin/env bash
# Show all the names (CNs and SANs) listed in the SSL certificate
# for a given domain
function getcertnames() {
local domain host tmp certText cn san
domain=$1
host=${2:-$1}
if [ -z "$host" ]; then
@demosdemon
demosdemon / terminalsize.py
Last active August 27, 2018 14:53 — forked from jtriley/terminalsize.py
Get current terminal size on Linux, Mac, and Windows
#!/usr/bin/env python
import os
import platform
import shlex
import struct
import subprocess
def get_terminal_size():
""" getTerminalSize()
@demosdemon
demosdemon / ssdp.py
Created November 15, 2016 02:34 — forked from derflocki/ssdp.py
# Copyright 2014 Dan Krause
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@demosdemon
demosdemon / DbContextHelper.cs
Last active November 4, 2016 20:10
EF6 Execute Stored procedure, automatic parameters
using System;
using System.Data.Entity;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Collections.Generic;
using System.Data.SqlClient;
public static class DbContextHelper
{
/// <summary>
@demosdemon
demosdemon / keybase.md
Created July 7, 2016 23:06
keybase prove github

Keybase proof

I hereby claim:

  • I am demosdemon on github.
  • I am demosdemon (https://keybase.io/demosdemon) on keybase.
  • I have a public key ASCBfqEI2MzXJWKh-dmTVeDvoKhMR-hwZV4WcpBiioKb2wo

To claim this, I am signing this object:

#!/usr/bin/env bash
# Find the fastest apt mirror
# Adapted from http://askubuntu.com/questions/39922/how-do-you-select-the-fastest-mirror-from-the-command-line/141536#141536
IFS=$'\n' read -d '' -r -a HOSTS < <(
wget -q -O- https://launchpad.net/ubuntu/+archivemirrors |
grep -P -B8 'statusUP|statusSIX' |
grep -o -P '(f|ht)tp[^"]*"' | sed 's/"$//'
)