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/bash | |
# gist id: a6e0b75a356e1aa451de971317962441 | |
# Exit on any error | |
set -e | |
BACKED_UP=false | |
backup_firmware () { | |
if [[ $BACKED_UP != true ]]; then |
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 bash | |
## Uses transmission-remote to remove public torrents only | |
## This keeps private torrents up to keep seeding | |
TORRENTS=$(transmission-remote -t all -i | \ | |
grep -e 'Id:' -e 'Name:' -e 'Percent Done:' -e 'Public torrent:' | \ | |
cut -d':' -f2 | sed -e 's/^[[:space:]]*//' | \ | |
paste -sd '\t\t\t\n') |
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 python3 | |
import socket | |
import uuid | |
import paho.mqtt.client as mqtt | |
import trio | |
client_id = 'paho-mqtt-python/issue72/' + str(uuid.uuid4()) | |
topic = client_id | |
print("Using client_id / topic: " + client_id) |
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 bash | |
HEADER=" | |
127.0.0.1 localhost | |
# The following lines are desirable for IPv6 capable hosts | |
::1 ip6-localhost ip6-loopback | |
fe00::0 ip6-localnet | |
ff00::0 ip6-mcastprefix | |
ff02::1 ip6-allnodes |
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 bash | |
TRACKPOINT_NAME="DualPoint Stick" | |
TRACKPAD_NAME="AlpsPS/2 ALPS GlidePoint" | |
POLL_INTERVAL=1.0s | |
point_xid=$(xinput --list --id-only "$TRACKPOINT_NAME") | |
pad_xid=$(xinput --list --id-only "$TRACKPAD_NAME") | |
is_enabled() { |
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
fsdf |
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 bash | |
TRACKPOINT_NAME="DualPoint Stick" | |
TRACKPAD_NAME="AlpsPS/2 ALPS GlidePoint" | |
POLL_INTERVAL=1.0s | |
point_xid=$(xinput --list --id-only "$TRACKPOINT_NAME") | |
pad_xid=$(xinput --list --id-only "$TRACKPAD_NAME") | |
is_enabled() { |
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 bash | |
TRACKPOINT_NAME="DualPoint Stick" | |
TRACKPAD_NAME="AlpsPS/2 ALPS GlidePoint" | |
POLL_INTERVAL=1.0s | |
point_xid=$(xinput --list --id-only "$TRACKPOINT_NAME") | |
pad_xid=$(xinput --list --id-only "$TRACKPAD_NAME") | |
is_enabled() { |
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 olap.xmla.xmla as xmla | |
provider = xmla.XMLAProvider() | |
con = provider.connect(location='http://{server}/OLAP/msmdpump.dll'.format(server='YOUR SERVER IP')) | |
# Verify that we are connected | |
print c.getMDSchemaCubes() | |
# Write MDX query | |
cmd = """SELECT NON EMPTY { [Measures].[Count] } ON COLUMNS FROM [OLAP]""" | |
cur = con.Execute(cmd) |
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 numpy as np | |
import matplotlib as mpl | |
mpl.use('pgf') | |
def figsize(scale): | |
fig_width_pt = 469.755 # Get this from LaTeX using \the\textwidth | |
inches_per_pt = 1.0/72.27 # Convert pt to inch | |
golden_mean = (np.sqrt(5.0)-1.0)/2.0 # Aesthetic ratio (you could change this) | |
fig_width = fig_width_pt*inches_per_pt*scale # width in inches | |
fig_height = fig_width*golden_mean # height in inches |
NewerOlder