This file contains hidden or 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
from decimal import * | |
import matplotlib.pyplot as plt | |
""" | |
Curiously, the policy does not match the textbook. This may be due to | |
numerical precision, or ties. | |
""" | |
p = Decimal('0.4') | |
θ = Decimal('1e-50') |
This file contains hidden or 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
<html> | |
<body> | |
<video id="remoteVideo" autoplay muted playsinline></video> | |
<script src="alohasdk.js"></script> | |
<script> | |
alohasdk.Call({ | |
deviceId: "xxxxxxxx", | |
authToken: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", | |
remoteVideo: remoteVideo, | |
}).then((pc) => { |
This file contains hidden or 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
state.ALSA { | |
control.1 { | |
iface MIXER | |
name 'PCM Playback Volume' | |
value -2000 | |
comment { | |
access 'read write' | |
type INTEGER | |
count 1 | |
range '-10239 - 400' |
This file contains hidden or 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
""" | |
Tool for fetching and cropping sight images | |
""" | |
import boto3 | |
import os | |
import sys | |
# S3 client | |
s3 = boto3.client('s3') |
This file contains hidden or 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
"""Fetch RDS log file via command line | |
AWS deprecated their RDS command-line utility, and the AWS CLI only includes | |
a subcommand for downloading portion of log file. This downloads full log | |
file, so that it may be analyzed in say pgbadger, for example: | |
pgbadger -A 1 -a 1 -j 4 --prefix '%t:%r:%u@%d:[%p]:' \ | |
--log-duration --outfile postgresql.log-2017-02-09-07.html \ | |
postgresql.log.2017-02-09-07 | |
""" |
This file contains hidden or 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/expect -f | |
############################################################################## | |
# | |
# cameo.tcl | |
# Expect script. Queries camera serial number via serial port and returns it. | |
# | |
# When a camera is connected, it enumerates as a serial device on the machine, | |
# for example /dev/ttyACM0. This is dependent on the order in which cameras | |
# connect, and as there is no identifying information in the USB descriptors, |
This file contains hidden or 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 | |
# | |
# transcoder.py | |
# | |
# Transcodes .ts into .mp4 | |
# | |
# Copyright 2014 Kuna Systems Corporation. All rights reserved. | |
# |
This file contains hidden or 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
// | |
// main.c | |
// usblog | |
// | |
#include <assert.h> | |
#include <stdio.h> | |
#import <IOKit/usb/IOUSBLib.h> |
This file contains hidden or 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 | |
# | |
# Plays the game 24: Given 4 numbers that must each be used exactly once, and | |
# the four basic arithmetic operators (addition, subtraction, multiplication, | |
# division) than may be used any number of times, finds an expression that | |
# evaluates to 24. | |
# | |
# Copyright 2012 Chris Hiszpanski. All rights reserved. | |
# | |
# History: |
This file contains hidden or 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 | |
""" | |
Transcodes list of audio files specified as command-line arguments into | |
standard MP3s. | |
Actual transcoding is done via a subprocess call to ffmpeg. If multiple | |
cores are available, transcoding is parallelized via a pool of workers, each | |
of which transcodes one file at a time. | |
""" |