This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import argparse | |
import datetime | |
import math | |
import json | |
import os | |
import subprocess | |
import threading | |
import time | |
import typing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from cgi import parse_header, parse_multipart | |
from http.server import BaseHTTPRequestHandler, HTTPServer | |
class handler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
self.send_response(200) | |
self.send_header("Content-type", "text/html") | |
self.end_headers() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
import argparse | |
from fnmatch import fnmatchcase | |
from rosbag import Bag | |
def main(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Allows the user to select one of the coredumps from the journal using fzf, | |
places the coredump at the given path (default /tmp/coredump), | |
links the related program binary to the given path (default /tmp/coredump-program), | |
and optionally attaches gdb. | |
""" | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install device tree for Android P - this is needed for TWRP P to run | |
fastboot flash dtbo dtbo_op6-P.img (https://kremowka.xyz/files/op_dtbo/dtbo_op6-P.img) | |
# boot TWRP P - can take a few seconds to come up. TWRP P is needed to install the stock image | |
fastboot boot twrp-3.3.1-18-enchilada-Pie-mauronofrio.img (https://sourceforge.net/projects/mauronofrio-twrp/files/Enchilada/twrp-3.3.1-18-enchilada-Pie-mauronofrio.img/download) | |
# upload the stock image installer | |
adb push <oos10> /tmp (https://oneplus.com/support/softwareupgrade) | |
# install the stock image. this is needed to get the device tree for Android Q | |
adb shell twrp install /tmp/<oos10> | |
adb reboot bootloader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import re | |
import subprocess | |
def tmppath(what): | |
return "/tmp/machcode-" + what | |
def tool(which, prefix="arm-none-eabi-"): | |
return prefix + which |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
CLI script for setting display modes through xrandr. | |
""" | |
from argparse import ArgumentParser | |
from collections import OrderedDict | |
import re | |
from subprocess import call, Popen, PIPE | |
from shlex import quote | |
from time import sleep |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# the code is rather dirty but hey it works and it looks pretty amazing | |
import math | |
import itertools | |
import argparse | |
cli = argparse.ArgumentParser() | |
cli.add_argument('ypos', type=float) | |
cli.add_argument('freq', type=float) | |
cli.add_argument('amp', type=float) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import os | |
import subprocess | |
import time | |
def main(): | |
while True: | |
subprocess.call(['beep']) | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from gi.repository import Gtk | |
class FileChooserError(Exception): | |
pass | |
class FileChooser(Gtk.FileChooserDialog): |
NewerOlder