Skip to content

Instantly share code, notes, and snippets.

@halmartin
halmartin / sds1000xe.py
Created May 22, 2022 18:47
Siglent SDS1000X-E license key recovery
#!/usr/bin/python3
import re
import string
import hashlib
# adapted from https://www.eevblog.com/forum/testgear/unlocking-siglent-sds1104x-e-step-by-step/msg1973306/
def getkeys(scopeid, serialno, memdumpfile):
"""
Parse a memory dump from a Siglent 1000X-E oscilloscope and return a dict containing
license keys. The 'activebw' key is the one that is currently active in the 'scope
@landakram
landakram / removing_nytimes_from_audible.md
Last active October 11, 2023 15:07
Removing 800+ New York Times Audio Digests from Amazon's "Your Content"

Removing 800+ New York Times Audio Digests from Amazon's "Your Content"

I recently started using family sharing to share audiobooks with my family and partner. I wanted to manually select which audiobooks to share by visiting Amazon's "Your content" page.

When I visited that page, to my horror, I had ~800 New York Times Audio Digest "audiobooks", one every day for the past ~2 years, to which I never listened. These entries crowded out my actual audiobooks, making it unfeasible to actually choose and share anything.

Amazon's page also makes it very difficult to clean this up:

@subfuzion
subfuzion / dep.md
Last active July 25, 2024 03:38
Concise guide to golang/dep

Overview

This gist is based on the information available at golang/dep, only slightly more terse and annotated with a few notes and links primarily for my own personal benefit. It's public in case this information is helpful to anyone else as well.

I initially advocated Glide for my team and then, more recently, vndr. I've also taken the approach of exerting direct control over what goes into vendor/ in my Dockerfiles, and also work from isolated GOPATH environments on my system per project to ensure that dependencies are explicitly found under vendor/.

At the end of the day, vendoring (and committing vendor/) is about being in control of your dependencies and being able to achieve reproducible builds. While you can achieve this manually, things that are nice to have in a vendoring tool include:

/* Note: don't run this all at once. There are prompts to run some queries in another session, etc. */
WHILE @@trancount > 0
ROLLBACK
GO
USE master;
GO
IF DB_ID('lockingtest') IS NOT NULL
@mpneuried
mpneuried / Makefile
Last active August 29, 2025 08:17
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@AWMooreCO
AWMooreCO / AdvancedWindowSnap.ahk
Last active April 19, 2025 18:27
Advanced Window Snap is a script for AutoHotKey that expands upon Windows built-in window-snapping hotkeys.
/**
* Advanced Window Snap
* Snaps the Active Window to one of nine different window positions.
*
* @author Andrew Moore <andrew+github@awmoore.com>
* @version 1.0
*/
/**
* SnapActiveWindow resizes and moves (snaps) the active window to a given position.
@depressiveRobot
depressiveRobot / git-function.sh
Last active June 6, 2020 13:21
bash function to override git init/clone commands
function git() {
for i do
lastArgument=$i # last argument can be the directory or the repository url
done
/usr/local/bin/git $@
if [[ $? -eq 0 ]] # only show prompt if git command was successful
then
@depressiveRobot
depressiveRobot / git-email-prompt.sh
Last active June 6, 2020 13:21
prompt for email address to use for current git repository
#!/bin/bash
# bash prompt which asks for email address
# to configure for current git repository
# set your available emails
MAILS=(private@example.com work@example.com phd@example.com)
# prompt for email
echo
@nicktoumpelis
nicktoumpelis / repo-rinse.sh
Created April 23, 2014 13:00
Cleans and resets a git repo and its submodules
git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
git submodule update --init --recursive