This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Why must you tempt me with that image. You can't buy the Trackman Marble FX any more. Not for atleast 8 years. It fetches a handsome price on eBay as well. This was the apex of trackball input devices. What I wouldn't give to have one of these today. The Trackman Marble I use now is very nice but its not as perfectly sculpted as the FX. Maybe 3d printing can bring this masterpiece back to us. | |
In other "i am super persnickety about my input peripherals" news: the new elongated nubbules on the bottom of the Dual Shock 4 controller dig into my palms and cause crazy amounts of fatigue-- something I never experienced with the same button layout but with a Dual Shock 3 controller with much smaller protuberances. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
pq. its like jq, you know, but for python. | |
caution: super hackey. | |
""" | |
import json | |
import sys | |
import atexit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 'notify-host-by-email' command definition | |
define command{ | |
command_name notify-host-by-email | |
command_line aws ses send-email --from [email protected] --to $CONTACTEMAIL$ --text "***** dev1 Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Host: $HOSTNAME$ State: $HOSTSTATE$ Address: $HOSTADDRESS$ Info: $HOSTOUTPUT$ Date/Time: $LONGDATETIME$" --subject "dev1 $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$" --region us-west-2 | |
} | |
# 'notify-service-by-email' command definition | |
define command{ | |
command_name notify-service-by-email | |
command_line aws ses send-email --from [email protected] --to $CONTACTEMAIL$ --text "***** dev1 Nagios ***** Notification Type: $NOTIFICATIONTYPE$ Service: $SERVICEDESC$ Host: $HOSTALIAS$ Address: $HOSTADDRESS$ State: $SERVICESTATE$ Date/Time: $LONGDATETIME$ Additional Info: $SERVICEOUTPUT$" --subject "dev1 $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$" --region us-west-2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
import pprint | |
with open('salesdata.csv', 'r') as f: | |
cars = [{k: v for k, v in row.items()} for row in csv.DictReader(f, skipinitialspace=True)] | |
fords = filter(lambda x: x['Make'] == 'FORD', cars) | |
v8 = filter(lambda x: '5.8' in x['Engine'], fords) | |
zips = open('zips.txt', 'r').read().strip().split(',') | |
local = filter(lambda x: x['Location ZIP'] in zips, v8) | |
if local: | |
pprint.pprint(local) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ephem | |
import datetime | |
# ephem.localtime(ephem.next_summer_solstice('2019-1-1')) | |
s = ephem.Sun() | |
o = ephem.city('Boston') | |
yesterday_len = 0 | |
for i in range(0, 365): | |
d = datetime.datetime(2019,1,1,16,0) + datetime.timedelta(i) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Shame people using too much disk. Good for your /etc/update-motd.d | |
# Lol what is this the 90s? | |
PCENT=$(df --output=pcent /home | tr -dc '0-9') | |
if (( $PCENT > 90 )); then | |
echo -e "\033[5mDisk usage has exceeded 90%\033[0m" | |
df -h /home | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> def spengbob(s): | |
... return "".join([c.lower() if i % 2 == 0 else c.upper() for i, c in enumerate(s)]) | |
... | |
>>> spengbob("massachusetts") | |
'mAsSaChUsEtTs' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn main() { | |
let height: [i8; 12] = [0,1,0,2,1,0,1,3,2,1,2,1]; | |
let len = height.len(); | |
let mut left_highest: i8; | |
let mut right_highest: i8; | |
let mut sum_ground: i8 = 0; | |
let mut sum_gwater: i8 = 0; | |
let mut gwater_here: i8; | |
let mut left_i: usize; | |
let mut right_i: usize; |
OlderNewer