Skip to content

Instantly share code, notes, and snippets.

--- a/examples/Devices/Keyboardio/Model100/Model100.ino
+++ b/examples/Devices/Keyboardio/Model100/Model100.ino
@@ -100,6 +100,9 @@
// Support for the GeminiPR Stenography protocol
#include "Kaleidoscope-Steno.h"
+// Support for Autoshifting
+#include <Kaleidoscope-AutoShift.h>
+
/** This 'enum' is a list of all the macros used by the Model 100's firmware
@victortrac
victortrac / bq.sql
Last active August 18, 2022 15:30
BigQuery to find changelog updates to GCP services ordered by last update
SELECT max(published_at) as last_update,
min(published_at) as first_update,
DATE_DIFF(max(published_at),min(published_at),DAY) as age_days,
product_name FROM `bigquery-public-data.google_cloud_release_notes.release_notes`
GROUP BY product_name
ORDER BY last_update asc
# ~/.config/polybar/config
[module/pulseaudio-devices]
type = custom/script
label = "%output%"
label-font = 2
interval = 2.0
exec = ~/.config/polybar/sound.sh
click-right = exec pavucontrol &
click-left = ~/.config/polybar/sound.sh mute &
scroll-up = ~/.config/polybar/sound.sh up &
@victortrac
victortrac / brightness.sh
Last active February 8, 2021 22:47
sync laptop and external monitor brightness
#!/bin/bash
# This script syncs the brightness on my laptop screen as well as my
# Dell 2720QM external usb-c monitor
# References:
# https://blog.tcharles.fr/ddc-ci-screen-control-on-linux
# Steps
# 1. Add udev rules to /etc/udev/rules.d/45-ddcutil-i2c.rules:
@victortrac
victortrac / pvc.yaml
Created October 16, 2017 04:33
k8s dynamic PVC
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: jenkins
labels:
app: jenkins
annotations:
volume.alpha.kubernetes.io/storage-class: default
spec:
accessModes:
@victortrac
victortrac / tag_release.sh
Created July 6, 2016 03:38
git tag a release with commit messages
#!/bin/bash
# Check out production branch and bring it up to date.
git fetch origin
git checkout production
git reset --hard origin/production
# Create a name for the new tag.
NEW_TAG=$(date +"%Y%m%d-%H%M")
@victortrac
victortrac / gce_igreplace.py
Created June 9, 2016 21:49
Replace instances in a GCE Managed Instance Group when Templates are updated
#!/usr/bin/env python
import sys
import time
from googleapiclient import discovery
from oauth2client.client import GoogleCredentials
def get_google_auth(service, version='v2'):
credentials = GoogleCredentials.get_application_default()
service_conn = discovery.build(service, version, credentials=credentials)
#!/bin/bash
#
# reload haproxy, but avoid losing existing connections
#
# briefly reject connection (SYN) TCP packets during port switch, so that
# connections are retried
#
# see:
# https://medium.com/@Drew_Stokes/actual-zero-downtime-with-haproxy-18318578fde6
# http://engineeringblog.yelp.com/2015/04/true-zero-downtime-haproxy-reloads.html

Keybase proof

I hereby claim:

  • I am victortrac on github.
  • I am victortrac (https://keybase.io/victortrac) on keybase.
  • I have a public key whose fingerprint is 370F E276 C958 C190 CA3A FFF7 6648 CA71 555B F03F

To claim this, I am signing this object:

@victortrac
victortrac / gist:b5780c09df2a0a5852f0
Created July 4, 2014 14:38
cyanogenmod 11-20140703-NIGHTLY dialer crashing
I/Timeline( 1187): Timeline: Activity_launch_request id:com.android.dialer time:5116983
I/ActivityManager( 654): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.android.dialer/.DialtactsActivity bnds=[48,773][282,1035]} from pid 1187
W/BroadcastQueue( 654): Permission Denial: receiving Intent { act=com.android.launcher3.action.LAUNCH flg=0x10 (has extras) } to com.google.android.googlequicksearchbox/com.google.android.search.core.summons.icing.InternalIcingCorporaProvider$ApplicationLaunchReceiver requires com.android.launcher3.permission.RECEIVE_LAUNCH_BROADCASTS due to sender com.cyanogenmod.trebuchet (uid 10020)
V/Zygote (26212): Switching descriptor 33 to /dev/null
V/Zygote (26212): Switching descriptor 10 to /dev/null
I/ActivityManager( 654): Start proc com.android.dialer for activity com.android.dialer/.DialtactsActivity: pid=26212 uid=10015 gids={50015, 3003, 1028, 1015, 1006, 3010, -1}
D/ActivityThread(26212): handleBindApplication:com.androi