Skip to content

Instantly share code, notes, and snippets.

View jarkkojs's full-sized avatar

Jarkko Sakkinen jarkkojs

View GitHub Profile
➜ Desktop (master) ✗ cat tld.py
import pytesseract
import opcodes
import subprocess
from PIL import Image
CONFIG="-c tessedit_char_whitelist=ABCDEFGHIJKLMNOPQRSTUVWXYZ"
if __name__ == "__main__":
image = Image.open('EdhXlaiWAAEiElZ.png')
import sys
from elftools.elf.elffile import ELFFile
PAGE_SIZE = 0x1000
if __name__ == '__main__':
flags2str = ['---', '--x', '-w-', '-wx', 'r--', 'r-x', 'rw-', 'rwx']
if len(sys.argv) != 2:
sys.exit(1)
from matplotlib import pyplot as plt
from matplotlib import style
from scipy import signal
import numpy as np
FREQUENCY = 440 # A3
RATE = 44100
DURATION = 2 # seconds
NR_SAMPLES = DURATION * RATE
#!/usr/bin/bash
git clean -f -d -x
make tinyconfig && cat >> .config <<EOF
CONFIG_64BIT=y
CONFIG_CRYPTO=y
CONFIG_CRYPTO_SHA256=y
CONFIG_X86_SGX=y
CONFIG_DEBUG_INFO=y
@jarkkojs
jarkkojs / jack_init
Created December 12, 2020 21:45
In JACK2, command-line is the sanest interface.
#!/bin/sh
SOUND_CARD=$1
SAMPLE_RATE=$2
FRAMES_PER_INT=$3
FRAME_SIZE=$4
# Use the ALSA backend.
jack_control ds alsa
kr:x509_check_for_self_signed
{
printf("%d\n", retval);
}
# 0x01 view
# Ox02 read
# 0x04 write
# 0x08 search
# 0x10 link
# 0x20 setattr
#
# A key default permissions: 0x3f010000
# A keyring default permissions: 0x3f3f0000
@jarkkojs
jarkkojs / fix-home-directory-permissions.sh
Last active April 8, 2021 07:17
Fix home directory permissions
#!/bin/bash
find $HOME -perm /o=rwx -type f -not -path "$HOME/pCloudDrive/*" -print0 | xargs -0 chmod o-rwx
find $HOME -perm /o=rwx -type d -not -path "$HOME/pCloudDrive/*" -print0 | xargs -0 chmod o-rwx
@jarkkojs
jarkkojs / 89-pulseaudio.rules
Last active April 13, 2021 19:45
/etc/udev/rules.d/89-pulseaudio.rules
# Audient EVO4
ATTRS{idVendor}=="2708", ATTRS{idProduct}=="0006", ENV{PULSE_IGNORE}="1"
# Intel Corporation Comet Lake PCH cAVS
ATTRS{vendor}=="0x8086", ATTRS{device}=="0x06c8", ENV{PULSE_IGNORE}="1"
# NVIDIA Corporation TU106 High Definition Audio Controller
ATTRS{vendor}=="0x10de", ATTRS{device}=="0x10f9", ENV{PULSE_IGNORE}="1"
@jarkkojs
jarkkojs / date_tag.sh
Created April 22, 2021 20:12
A date tag for various scripts
date +"%Y%m%d_%k"