Skip to content

Instantly share code, notes, and snippets.

View mumblepins's full-sized avatar

Daniel Sullivan mumblepins

  • Twin Cities, MN
View GitHub Profile
@mumblepins
mumblepins / docker-compose.yaml
Created January 4, 2019 05:41
docker compose for squid
version: '3.7'
networks:
squid-macvlan:
driver: macvlan
name: squid-macvlan
driver_opts:
parent: ${MACVLAN_PARENT}
ipam:
config:
@mumblepins
mumblepins / change_fs_zfs.sh
Last active September 25, 2017 18:14
moving a folder to a new filesystem, rsync, change mount point, move to temporary folder, zfs
rsync -avh /var/log/ /tmp/var/log/ \
&& umount /tmp/var/log \
&& sed -i 's|/tmp/var/log|/var/log|' /etc/fstab \
&& mv /var/log /var/logbak \
&& mkdir /var/log \
&& mount /var/log
@mumblepins
mumblepins / CLion_Ninja.md
Created September 15, 2017 17:58 — forked from nevkontakte/CLion_Ninja.md
Ninja support for CLion IDE

Ninja support for CLion IDE

This script enables Ninja-powered builds in CLion IDE by wrapping around CMake, which it uses. See my blog post for details.

Disclaimer

This script is provided AS IS with no guarantees given or responsibilities taken by the author. This script relies on undocumented features of CLion IDE and may lead to instability of build and/or IDE. Use it on your own risk under WTFPL terms.

@mumblepins
mumblepins / 0_reuse_code.js
Created September 13, 2017 16:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mumblepins
mumblepins / realfeel.py
Created July 20, 2016 00:46
Accuweather Realfeel temperature calculator
# Based on patent https://www.google.com/patents/US7251579
# Not responsible if you use this for anything other than personal use
from math import sqrt
def realfeel(W, #windspeed mph
A, #pressure mb
T, # temperature F
UV, # UV Index
D, # Dew Point F
P2, # preciptation Factor from 0-5
@mumblepins
mumblepins / weather_monitor.py
Last active July 20, 2016 01:44
UDP WeatherStation (WS-1400-IP) Parser->Influxdb
#!/usr/bin/python
import socket, sys, json, urllib2
from pprint import pprint
from urlparse import parse_qs, urlparse
import time
import calendar
from math import exp,log, pow, sqrt
import requests
@mumblepins
mumblepins / ParticleToolchainInstaller.sh
Created July 15, 2015 14:29
Ubuntu Particle Toolchain Installer
#!/bin/bash
# From here:
# http://askubuntu.com/questions/293838/shell-script-to-conditionally-add-apt-repository
add_ppa() {
grep -h "^deb.*$1" /etc/apt/sources.list.d/* > /dev/null 2>&1
if [ $? -ne 0 ]
then
echo "Adding ppa:$1"
@mumblepins
mumblepins / timer.test.ino
Created August 13, 2014 23:31
Timer test
#include "application.h"
unsigned long time0;
unsigned long time1;
unsigned long time2;
#define MILLIS 1
#define NUMBER 1200
void setup() {
Serial.begin(115200);
double avgDelay;
double totalDelay;
unsigned long timer1;
unsigned long timer2;
int count=0;
void setup() {
Spark.variable("AvgDelay",&avgDelay,DOUBLE);
Serial.begin(115200);
while (!Serial.available()) SPARK_WLAN_Loop();
void setup() {
Serial.begin(115200);
while (!Serial.available()) SPARK_WLAN_Loop();
}
double avgDelay;
double totalDelay;
unsigned long timer1;
unsigned long timer2;
int count=0;