Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / build-cpio
Created February 26, 2024 16:57 — forked from krasCGQ/build-cpio
Scripts to build static-PIE binary of the following; only works on Alpine Linux and other Musl libc based Distros, as some may segfault when done with Glibc.
#!/usr/bin/env dash
#
# SPDX-License-Identifier: Unlicense
#
CC=clang
LD=ld.lld
STRIP=llvm-strip
# -fuse-ld= tells compiler to use specific linker above
@Manouchehri
Manouchehri / pip.md
Created July 27, 2023 18:27 — forked from sillyfrog/pip.md
pip in Jython

To use pip, you must be running Jython v2.7.1 (downloaded from here: http://search.maven.org/remotecontent?filepath=org/python/jython-standalone/2.7.1/jython-standalone-2.7.1.jar). This is not compatible with Esper, so be sure to remove all of these files before upgrading, ie:

rm -rf ./automation/jsr223/000_components/000_Esper.py ./automation/lib/python/esper

With v2.7.1 installed, we can run the Jython from the openHAB installation to install pip

java -jar /openhab/conf/automation/jython/jython-standalone-2.7.1.jar -m ensurepip
@Manouchehri
Manouchehri / mkv_to_mov_hevc.sh
Created July 9, 2023 14:49
Convert a OBS Capture (in HEVC) to a .mov that Apple Keynote and Final Cut Pro can import
#!/bin/bash
# sudo nano /usr/local/bin/mkv_to_mov_hevc.sh
# paste all of this text into that file
# sudo chmod +x /usr/local/bin/mkv_to_mov_hevc.sh
# now you can run: mkv_to_mov_hevc.sh your_obs_screencap.mkv
# you'll end up with a your_obs_screencap.mov that Final Cut Pro and Apple Keynote can import
# Define a function that takes an input file, converts it, and saves it as a .mov
convert_to_mov() {
@Manouchehri
Manouchehri / SSH_Authentication_TPM2_PKCS11_Arch_Linux.md
Created April 10, 2023 17:47 — forked from p7cq/SSH_Authentication_TPM2_PKCS11_Arch_Linux.md
SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

SSH Authentication with TPM 2.0 and PKCS#11 on Arch Linux

Hardware: a TPM 2.0 module based on Infineon SLB9665 cryptographic processor available in the system as /dev/tpmrm0.

Installation

Required software:

# pacman -S tpm2-tools tpm2-pkcs11
@Manouchehri
Manouchehri / hook.js
Created April 7, 2023 02:15 — forked from tony0x59/hook.js
frida script for modify device info in Any iOS App
if (ObjC.available) {
try {
// list methods
// ObjC.classes.XXXClassName.$ownMethods.forEach(function (m) {
// console.log('method: ' + m);
// })
// watch method callstack
// if (1) {
// // -[NSTimeZone secondFromGMT]
@Manouchehri
Manouchehri / mitmproxy_requests_to_csv.py
Created March 14, 2023 19:12 — forked from jasonmfehr/mitmproxy_requests_to_csv.py
Writes mitmproxy data in CSV format to a file
import mitmproxy
from datetime import datetime
import math
class RequestsToCSV:
def load(self, loader):
#
# note: update this path to change the data file name and/or location
#
self.file_handle = open("requests-" + datetime.now().isoformat().split(".")[0] + ".csv", "w")
IDrive - $0.004/GB - $0 for download bandwidth - 1:3 upload:download ratio allowed <- questionable data privacy - custom domains offered - no audit logging
Backblaze - $0.006/GB - $0 for download bandwidth if through Worker (or $0.01/GB) <- decent data privacy record - no custom domains - no audit logging
Wasabi - $0.0069/GB - $0 for download bandwidth - 1:1 and billed for 90 days <- cheapest with audit logging - no custom domains and no CORS support
Storj - $0.004/GB - $0.007/GB for download
Cloudflare R2 - $0.015/GB - $4.50 / million for uploads and $0.36 / million for downloads
DigitalOcean - $0.020/GB - $0.01/GB for download
@Manouchehri
Manouchehri / get_ephemeral_port.sh
Created January 12, 2023 18:04
Get a random ephemeral port number
shuf -i 49152-60999 -n1
# This obeys:
# RFC 6335 49152-65535 - https://www.rfc-editor.org/rfc/rfc6335.html
# Linux 32768-60999 - https://github.com/torvalds/linux/blob/1f5abbd77e2c1787e74b7c2caffac97def78ba52/net/ipv4/af_inet.c#L1833-L1834
# Windows 49152-65535 - https://learn.microsoft.com/en-US/troubleshoot/windows-server/networking/default-dynamic-port-range-tcpip-chang
# Why does this matter? Naively, this gives us the best chance of not having our port changed when going through NAT.
# In reality, it probably doesn't help.
@Manouchehri
Manouchehri / 1_smime-clients.md
Created January 10, 2023 23:28 — forked from rmoriz/1_smime-clients.md
S/MIME is the industry standard for secure E-Mail and build into every relevant mail client. From Outlook to Thunderbird, from Blackberry to Apple Mail on OSX and iOS. http://smime.io/
@Manouchehri
Manouchehri / intel_x520_patcher.py
Created September 14, 2022 17:37 — forked from ixs/intel_x520_patcher.py
Intel x520 EEPROM Patcher allows to unlock the x520 network card to work with non-intel branded SFP modules.
#!/usr/bin/env python3
#
# Simple Intel x520 EEPROM patcher
# Modifies the EEPROM to unlock the card for non-intel branded SFP modules.
#
# Copyright 2020,2021,2022 Andreas Thienemann <andreas@bawue.net>
#
# Licensed under the GPLv3
#
# Based on research described at https://forums.servethehome.com/index.php?threads/patching-intel-x520-eeprom-to-unlock-all-sfp-transceivers.24634/