Skip to content

Instantly share code, notes, and snippets.

View tab1293's full-sized avatar

Tom Berger tab1293

View GitHub Profile
@tab1293
tab1293 / test.py
Created February 11, 2019 20:42
Attempt to record GRPC response time
from tornado.ioloop import IOLoop
from tornado.gen import Future
def _fwrap(f, gf, ioloop, start_time):
try:
gf_result = gf.result()
response_time = ioloop.time() - start_time
f.set_result(gf_result)
except Exception as e:
f.set_exception(e)
@tab1293
tab1293 / affinity.go
Last active October 15, 2019 00:55
Failed Kubernetes job node pool selector
j := &batch.Job{
Spec: batch.JobSpec{
Template: core.PodTemplateSpec{
Spec: core.PodSpec{
Affinity: &core.Affinity{
NodeAffinity: &core.NodeAffinity{
RequiredDuringSchedulingIgnoredDuringExecution: &core.NodeSelector{
NodeSelectorTerms: []core.NodeSelectorTerm{
{
MatchExpressions: []core.NodeSelectorRequirement{
@tab1293
tab1293 / description.txt
Created January 5, 2020 22:07
Idle kuberenetes node description not being brought down down scaled
Name: gke-project-dev-dl-n1-2-pvm-9443c1df-rqwk
Roles: <none>
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/fluentd-ds-ready=true
beta.kubernetes.io/instance-type=n1-standard-2
beta.kubernetes.io/os=linux
cloud.google.com/gke-nodepool=dl-n1-2-pvm
cloud.google.com/gke-os-distribution=cos
cloud.google.com/gke-preemptible=true
failure-domain.beta.kubernetes.io/region=us-east4
@tab1293
tab1293 / main.go
Created January 19, 2020 22:14
Anacrolix torrent panic with SOCKS 5 proxy
package main
import (
"log"
"github.com/anacrolix/torrent"
)
func main() {
cfg := torrent.NewDefaultClientConfig()
@tab1293
tab1293 / list.txt
Created March 29, 2020 23:07
FFMPEG subtitle codec image/text list breakdown
TEXT ..S... arib_caption ARIB STD-B24 caption
TEXT DES... ass ASS (Advanced SSA) subtitle (decoders: ssa ass ) (encoders: ssa ass )
IMAGE DES... dvb_subtitle DVB subtitles (decoders: dvbsub ) (encoders: dvbsub )
IMAGE ..S... dvb_teletext DVB teletext
IMAGE DES... dvd_subtitle DVD subtitles (decoders: dvdsub ) (encoders: dvdsub )
TEXT D.S... eia_608 EIA-608 closed captions (decoders: cc_dec )
IMAGE D.S... hdmv_pgs_subtitle HDMV Presentation Graphic Stream subtitles (decoders: pgssub )
TEXT ..S... hdmv_text_subtitle HDMV Text subtitle
TEXT D.S... jacosub JACOsub subtitle
TEXT D.S... microdvd MicroDVD subtitle
@tab1293
tab1293 / download_ok.log
Created June 9, 2020 14:25
Not seeing peer connections occasionally on download start anacrolix/torrent issue logs
This file has been truncated, but you can view the full file.
2020-06-09T13:53:49+0000 NONE upnp.go:154: Starting discovery of device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0
2020-06-09T13:53:49+0000 NONE upnp.go:154: Starting discovery of device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0
2020-06-09T13:53:49+0000 NONE upnp.go:175: Sending search request for device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0
2020-06-09T13:53:49+0000 NONE upnp.go:189: Listening for UPnP response for device type urn:schemas-upnp-org:device:InternetGatewayDevice:1 on eth0
2020-06-09T13:53:49+0000 NONE upnp.go:175: Sending search request for device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0
2020-06-09T13:53:49+0000 NONE upnp.go:189: Listening for UPnP response for device type urn:schemas-upnp-org:device:InternetGatewayDevice:2 on eth0
2020-06-09T13:53:50+0000 NONE torrent.go:1527: "Torrent Name": hashed piece 0 (passed=false)
2020-06-09T13:53:50+0000 NONE torrent.go:1092: "Torrent Name": piece 0
@tab1293
tab1293 / nack_race.log
Created February 1, 2021 19:09
Pion NACK interceptor race
==================
WARNING: DATA RACE
Read at 0x00c00037601a by goroutine 103:
github.com/pion/interceptor/pkg/nack.(*sendBuffer).get()
/go/pkg/mod/github.com/pion/interceptor@v0.0.8/pkg/nack/send_buffer.go:64 +0x8b
github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).resendPackets.func1()
/go/pkg/mod/github.com/pion/interceptor@v0.0.8/pkg/nack/responder_interceptor.go:104 +0x59
github.com/pion/rtcp.(*NackPair).Range()
/go/pkg/mod/github.com/pion/rtcp@v1.2.6/transport_layer_nack.go:64 +0x54
github.com/pion/interceptor/pkg/nack.(*ResponderInterceptor).resendPackets()
@tab1293
tab1293 / publisher.html
Created February 5, 2021 17:16
ION SFU example
<html>
<head>
<script src="/ion.min.js"></script>
<script src="/json-rpc.min.js"></script>
</head>
<body>
<video id="video" src="test.mp4" width="1280px" height="720px" controls />
</body>
<script>
const v = document.getElementById("video");
@tab1293
tab1293 / custom_build_run_instructions.md
Last active May 18, 2021 14:10
Custom build run instructions

Custom build run instructions

Make sure any previous Playback folders or zip files are removed in your Downloads folder before doing the following steps

  1. Download custom build to your Downloads folder : https://storage.googleapis.com/playback-cdn/dynamic-sys-info-build/Playback-darwin-x64.zip
  2. Unzip in your Downloads folder
  3. Open terminal
  4. Run in terminal rm ~/Library/Logs/Playback/main.log
  5. Run in terminal xattr -dr com.apple.quarantine ~/Downloads/Playback-darwin-x64/Playback.app
  6. Run in terminal ~/Downloads/Playback-darwin-x64/Playback.app/Contents/MacOS/Playback > ~/Downloads/playback.log 2>&1
  7. Make sure your webcam is off
  8. Open a few different streams in the app that have different resolutions. Let each stream resolution play for about a minute. This is a good Youtube video to use: https://youtu.be/4oTrssAn7xI?t=106
@tab1293
tab1293 / error.log
Last active August 13, 2021 15:34
GORM Circular Foreign Key Issue
2021/08/13 09:58:54 /Users/tom/go/pkg/mod/gorm.io/driver/postgres@v1.1.0/migrator.go:157 ERROR: relation "logins" does not exist (SQLSTATE 42P01)
[16.528ms] [rows:0] CREATE TABLE "users" ("id" varchar(36),"name" text,"last_login_id" varchar(36),PRIMARY KEY ("id"),CONSTRAINT "fk_users_last_login" FOREIGN KEY ("last_login_id") REFERENCES "logins"("id"))
2021/08/13 09:58:54 Failed to auto migrate, but got error ERROR: relation "logins" does not exist (SQLSTATE 42P01)