Skip to content

Instantly share code, notes, and snippets.

ramast

Block or report user

Report or block ramast

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
@ramast
ramast / pulse-recorder.py
Created Jul 23, 2019
Record a program's output with PulseAudio
View pulse-recorder.py
#!/usr/bin/env python3
import re
import subprocess
import sys
import os
import signal
from time import sleep
INDEX_RE = re.compile(r'[0-9]+$')
APP_NAME_RE = re.compile(r'"([^"]+)"')
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
ramast / pulse-recorder.bash
Last active Jul 23, 2019
Record pulseaudio output to mp3 file
View pulse-recorder.bash
#!/bin/bash
# Credit: This code is based on answers provided by Waschtl and KrisWebDev
# https://askubuntu.com/questions/60837/record-a-programs-output-with-pulseaudio
# NOTE: An improved script written in python can be found here https://gist.github.com/ramast/c47bd5e57586e9c2deb74975e27089f0
cleanup(){
if [ -z "$module_id" ]
then
exit 3
fi
@ramast
ramast / aws_utils.py
Last active Sep 19, 2016 — forked from amertkara/aws_utils.py
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…
View aws_utils.py
# -*- 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"
SNS_MESSAGE_TYPE_NOTIFICATION = "Notification"
You can’t perform that action at this time.