Skip to content

Instantly share code, notes, and snippets.

@jimilinuxguy
jimilinuxguy / proxy.pac
Created September 5, 2019 06:22 — forked from swinton/proxy.pac
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";
@jimilinuxguy
jimilinuxguy / bitstream-from-sub.py
Created April 18, 2022 20:23 — forked from jinschoi/bitstream-from-sub.py
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]
@jimilinuxguy
jimilinuxguy / create_sub.py
Created April 29, 2022 12:45 — forked from jinschoi/create_sub.py
Python script to generate Flipper RAW .sub files from OOK bitstreams
#!/usr/bin/env python3
from typing import Iterable, Union, Any
# freq: frequency in Hz
# zerolen: length of space bit in μs
# onelen: length of mark bit in μs
# repeats: number of times to repeat sequence
# pause: time to wait in μs between sequences
# bits: string of ones and zeros to represent sequence
@jimilinuxguy
jimilinuxguy / filter_signal.py
Created December 27, 2022 14:36 — forked from Semnodime/filter_signal.py
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.