Skip to content

Instantly share code, notes, and snippets.

View donfanning's full-sized avatar
🗃️
Holding up libraries and robbing them blind for the future.

Don Fanning donfanning

🗃️
Holding up libraries and robbing them blind for the future.
View GitHub Profile
@donfanning
donfanning / zyxel2graphite.py
Created July 14, 2020 01:41 — forked from Emantor/zyxel2graphite.py
zyxel2graphite.py
#!/usr/bin/python
"""Copyright 2013 Bryan Irvine
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,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
@donfanning
donfanning / zyxel2graphite.py
Created July 14, 2020 01:41 — forked from Emantor/zyxel2graphite.py
zyxel2graphite.py
#!/usr/bin/python
"""Copyright 2013 Bryan Irvine
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,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
@donfanning
donfanning / get_zyxel_modem_stats.py
Created July 14, 2020 01:40 — forked from shouptech/get_zyxel_modem_stats.py
A script to query a ZyXEL Q100Z modem and output data in a format usable by Cacti
#!/usr/bin/python
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mike Shoup
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@donfanning
donfanning / osx-for-hackers.sh
Created September 11, 2019 13:30 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@donfanning
donfanning / osx-for-hackers.sh
Created September 11, 2019 13:30 — forked from brandonb927/osx-for-hackers.sh
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx
@donfanning
donfanning / whatismyip.bash
Created August 20, 2018 01:10 — forked from codatory/whatismyip.bash
WhatIsMyIP Bash Function
whatismyip() {
IP=`curl --silent http://ip.appspot.com/`
echo "External IP: ${IP}"
}
#!/bin/bash
# Mac Bootstrap Script
# (C) 2011 - @codatory
#
# "It might work for you, too."
pretty_echo(){
echo '--------------------------------'
echo " $*"
# Configuration Constants (move to yaml ?)
HOST = 'ad01.domain.local'
PORT = 636
USER = 'administrator'
PASS = 'password'
BASE = 'dc=domain, dc=local'
DOMAIN = 'domain.local'
SCOPE = '(&(objectCategory=person)(objectClass=user))'
require 'rubygems'
@donfanning
donfanning / .tmux.conf
Created August 20, 2018 01:09 — forked from codatory/.tmux.conf
TMUX Conf
# Switch me back to ^A, thanks
set-option -g prefix C-a
unbind-key C-b
bind-key a send-prefix
# I miss ^A^A and ^ASpace
bind-key C-a last-window
bind-key Space next-window
bind-key C-Space previous-window
# Date formats
Time::DATE_FORMATS.merge!(
:friendly_date => lambda {|d| "#{d.month}/#{d.mday}" }, # 4/25 (no leading zeroes)
:friendly_time => lambda {|t|
date = (t.at_midnight == Time.now.at_midnight) ? '' : "#{t.month}/#{t.mday}@" # 4/25@4PM on other days
"#{date}#{t.strftime('%I').to_i}#{t.strftime('%p')}" # 4PM on same day
},
:year => "%Y", # 2008
:month_year => "%b %Y", # Apr 2008
:ampm_time => "%I:%M %p", # 04:15 PM