Skip to content

Instantly share code, notes, and snippets.

@jinschoi
jinschoi / bitstream-from-sub.py
Created April 17, 2022 18:00
Python script to clean up and recover an OOK bitstream from a Flipper RAW .sub file.
#!/usr/bin/env python
# Find the raw bitstring from a captured Flipper RAW .sub file.
# Must provide the bitlength in ms, and the allowable error which can be tolerated.
import re
import sys
import math
filename = sys.argv[1]
@jinschoi
jinschoi / plot_raw_sub.py
Last active October 6, 2022 01:44
Plot Flipper RAW .sub captures
import plotly.express as px
import pandas as pd
import re
filename = 'Gar.sub'
points = [(0, 0)]
t = 0
with open(filename, 'r') as f:
for line in f:
@Semnodime
Semnodime / filter_signal.py
Created January 30, 2022 11:01
Script to preprocess IQ-signals in-place: Remove noise and combine nearby signal parts into one.
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
import numpy as np
description = """Script to preprocess IQ-signals in-place: Remove noise and combine nearby signal parts into one."""
def list_strong_signal_indices(signal, threshold: int):
"""
Return a list of all indices where the magnitude of the I-part is not smaller than the threshold.
@swinton
swinton / proxy.pac
Created February 11, 2015 02:26
Example proxy.pac, using a SOCKS proxy for certain hosts.
function FindProxyForURL(url, host) {
var useSocks = ["imgur.com"];
for (var i= 0; i < useSocks.length; i++) {
if (shExpMatch(host, useSocks[i])) {
return "SOCKS localhost:9999";
}
}
return "DIRECT";