Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / CF-U1-BIOS.md
Created January 31, 2020 22:07 — forked from en4rab/CF-U1-BIOS.md
Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

Recovering the BIOS password from a Panasonic CF-U1 mk2 (AMI Aptio UEFI)

A mess of my own making

While messing with a CF-U1 handheld PC that I bought off ebay I managed to mess up the BIOS and it seems it reverted to previous settings which included an unknown BIOS password, it would however still boot into windows. Since I could still boot windows I was able to dump the bios flash using AFUWINGUI.EXE the version I used was 3.09.03.1462 which is available here:
https://ami.com/en/?Aptio_4_AMI_Firmware_Update_Utility.zip

@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 / 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/
@Manouchehri
Manouchehri / bgpd.conf
Created September 14, 2017 06:14 — forked from heri16/bgpd.conf
AWS VPC VPN StrongSwan Virtual Tunnel Interface (VTI)
#@ /etc/quagga/bgpd.conf (Centos & Ubuntu)
hostname <Local OS hostname>
password <Any random phrase>
enable password <Any random phrase>
!
log file /var/log/quagga/bgpd
!debug bgp events
!debug bgp zebra
debug bgp updates
@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 / 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")
@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 / optimal_mtu.md
Created July 12, 2022 16:37 — forked from nitred/optimal_mtu.md
Wireguard Optimal MTU

About

  • I faced bandwidth issues between a WG Peer and a WG server. Download bandwidth when downloading from WG Server to WG peer was reduced significantly and upload bandwidth was practically non existent.
  • I found a few reddit posts that said that we need to choose the right MTU. So I wrote a script to find an optimal MTU.
  • Ideally I would have liked to have run all possible MTU configurations for both WG Server and WG Peer but for simplicity I choose to fix the WG Server to the original 1420 MTU and tried all MTUs from 1280 to 1500 for the WG Peer.

Testing

  • On WG server, I started an iperf3 server
  • On WG peer, I wrote a script that does the following:
    • wg-quick down wg0
  • Edit MTU in the /etc/wireguard/wg0.conf file