Skip to content

Instantly share code, notes, and snippets.

Avatar

David Manouchehri Manouchehri

View GitHub Profile
@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
View mitmproxy_requests_to_csv.py
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")
View s3-providers.txt
IDrive - $0.004/GB - $0 for download bandwidth - 1:3 upload:download ratio allowed
Backblaze - $0.005/GB - $0 for download bandwidth if through Worker (or $0.01/GB)
Wasabi - $0.0059/GB - $0 for download bandwidth - 1:1 and billed for 90 days
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
@Manouchehri
Manouchehri / get_ephemeral_port.sh
Created January 12, 2023 18:04
Get a random ephemeral port number
View get_ephemeral_port.sh
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.
View intel_x520_patcher.py
#!/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 / registries.conf
Last active July 25, 2022 18:54
/etc/containers/registries.conf
View registries.conf
unqualified-search-registries = ['docker.io']
[[registry]]
prefix = "docker.io"
location = "registry-1.docker.io"
[[registry.mirror]]
location = "mirror.gcr.io"
[[registry.mirror]]
location = "registry.ipv6.docker.com"
@Manouchehri
Manouchehri / lscpu.1.txt
Created July 22, 2022 17:45
GCP GCE t2a-standard-4
View lscpu.1.txt
dave@dave-arm-dev-1:~$ lscpu
Architecture: aarch64
CPU op-mode(s): 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
Vendor ID: ARM
Model name: Neoverse-N1
Model: 1
Thread(s) per core: 1
View gist:58590c034f63ee34d88ad387668c615e
List of pre-defined events (to be used in -e):
cpu-cycles OR cycles [Hardware event]
alignment-faults [Software event]
bpf-output [Software event]
cgroup-switches [Software event]
context-switches OR cs [Software event]
cpu-clock [Software event]
cpu-migrations OR migrations [Software event]
@Manouchehri
Manouchehri / perf.list.txt
Created July 20, 2022 19:58
Asahi Linux on M1
View perf.list.txt
[dave@dave-mac ~]$ sudo perf list
List of pre-defined events (to be used in -e):
alignment-faults [Software event]
bpf-output [Software event]
cgroup-switches [Software event]
context-switches OR cs [Software event]
cpu-clock [Software event]
cpu-migrations OR migrations [Software event]
@Manouchehri
Manouchehri / perf.list.txt
Created July 20, 2022 19:56
inside qemu kvm on Asahi Linux
View perf.list.txt
alignment-faults [Software event]
bpf-output [Software event]
cgroup-switches [Software event]
context-switches OR cs [Software event]
cpu-clock [Software event]
cpu-migrations OR migrations [Software event]
dummy [Software event]
emulation-faults [Software event]
major-faults [Software event]
minor-faults [Software event]