Skip to content

Instantly share code, notes, and snippets.

Chris Dzombak cdzombak

Block or report user

Report or block cdzombak

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cdzombak
cdzombak / 10-banner
Last active Sep 26, 2019
automatic figlet based banner
View 10-banner
#!/bin/sh
figlet -f big "$(hostname --fqdn)" | grep -v "^ *$"
View rewrite.md

collected links on rewriting software (or not)

View lightweight-healthcheck.sh
#!/usr/bin/env bash
set -u
THING_DESC="dzombak.com"
EMAIL_SUBJECT="[dzombak.com] Website"
LASTSTATUS_FILE="$HOME/.website-healthcheck-status"
EMAIL_TO="chris@example.com"
SMS_TO="+1xxxxxxxxxx"
TWILIO_NUMBER="+1xxxxxxxxxx"
@cdzombak
cdzombak / mastodon-streaming-healthcheck.sh
Created Jun 11, 2019
Mastodon health checks, run every minute via cron on a separate server
View mastodon-streaming-healthcheck.sh
#!/usr/bin/env bash
set -u
NOW=$(date +"%F %T %Z")
OK=
if curl -s https://a2mi.social/api/v1/streaming/health | grep -c OK > /dev/null ; then
OK="1"
else
OK="0"
@cdzombak
cdzombak / listening
Created May 31, 2019
simple cross-platform wrapper for lsof/netstat to tell what processes are listening for network connections
View listening
#!/usr/bin/env python3
import argparse
import platform
import subprocess
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
View sidekiq.chart.sh
# sidekiq.chart.sh by codl <codl@codl.fr>
#
# put this in /usr/libexec/netdata/charts.d
# chown root:netdata and chmod +x
sidekiq_update_every=5
sidekiq_priority=9000
sidekiq_check() {
redis-cli get 'stat:processed' > /dev/null 2> /dev/null
@cdzombak
cdzombak / youtube-dl-wrapper.sh
Last active Oct 9, 2019
youtube-dl wrapper for downloading videos direct to the correct Plex collection on my plex Mac Mini
View youtube-dl-wrapper.sh
#!/bin/bash
# all sorts of more advanced features are available, but this is a start:
# https://github.com/ytdl-org/youtube-dl/blob/master/README.md#output-template-examples
if [ -z $1 ]; then
echo "Syntax: $0 VIDEO_URL"
exit 1
fi
VIDEO_URL="$1"
@cdzombak
cdzombak / bookmarklet.js
Last active Sep 26, 2019
Bookmarklet which builds a Markdown link to the current page
View bookmarklet.js
javascript:!function(){var%20e=window.getSelection().toString(),t=document.title.replace(%22%20-%20Jira%22,%22%22),n=e%3Fe:t,o=%22[%22+n+%22](%22+location.href+%22)%22;(function(e){var%20t=document.createElement(%22textarea%22),n=document.getSelection();t.textContent=e,document.body.appendChild(t),n.removeAllRanges(),t.select(),document.execCommand(%22copy%22),n.removeAllRanges(),document.body.removeChild(t)})(o)}();
View apple-iphone-batteries-slack-transcript.txt
it makes sense, and I suspect you’d see something similar on any device with a worn battery (edited)
basically everything battery powered changes clock speeds based on battery voltage level and whether you’re plugged in (_edit:_ also based on workload, so you’re not running at full speed and burning battery power when you’re not doing anything) (edited)
you can’t run a CPU at full speed when the battery voltage is low (edited)
so it follows that when the battery is worn out (and its top voltage is presumably lower), performance is consistently lower
the phone knows about battery age/wear, and takes that into account for the user-facing battery percentage meter
@cdzombak
cdzombak / cdz.dump1090.plist
Created Jan 29, 2017
launchd plists for dump1090 and the QEMU Pi emulator. Will require changing to use your OS X username. See: https://www.dzombak.com/blog/2017/01/Monitoring-aircraft-via-ADS-B-on-OS-X.html
View cdz.dump1090.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>Label</key>
You can’t perform that action at this time.