Skip to content

Instantly share code, notes, and snippets.

ramast /
Last active Nov 19, 2020
Record a program's output with PulseAudio
#!/usr/bin/env python3
# Based on code from these stackoverflow answers:
import re
import subprocess
import sys
import os
import signal
from time import sleep
View gist:58633c352ad78e240c2ecc96965d48ed

How to unbrick an Amazon Kindle Paperwhite™

This guide instructs you in how to unbrick an Amazon Kindle Paperwhite. The consequences of following it are your own responsibility. This method (opening the Kindle and using the serial interface) should be a last resort and should only be considered if other methods fail

The Guide

  1. Pry open Kindle using a prying tool
  2. Unscrew the screen and remove it from the base. Note that there's a screw hidden under the adhesive at the top in the middle
  3. Solder tin wire to serial ports on the bottom
  4. Attach tin wire to USB TTY device (order is ground, RX, TX, from the kindle's perspective, where GND is the smallest pad) and plug USB TTY device into your computer
  5. Open Putty on your computer in serial mode, with the serial port specified as your USB device and baud configured to 115200
ramast / pulse-recorder.bash
Last active Feb 17, 2021
Record pulseaudio output to mp3 file
View pulse-recorder.bash
# Credit: This code is based on answers provided by Waschtl and KrisWebDev
# NOTE: An improved script written in python can be found here
if [ -z "$module_id" ]
exit 3
ramast /
Last active Sep 19, 2016 — forked from amertkara/
Amazon SNS Notification Verification with Python, M2Crypto. When the SNS pushes a notification, a receiver should verify the origin/integrity of the push notification (AWS) using the signature and certificate provided in the notification data. The function `verify_sns_notification` below takes the request object and verifies the origin/integrity…
# -*- coding: utf-8 -*-
import json
import urllib2
import re
from base64 import b64decode
from M2Crypto import X509
from M2Crypto.Err import M2CryptoError
SNS_MESSAGE_TYPE_SUB_NOTIFICATION = "SubscriptionConfirmation"