Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / rfc3161.txt
Last active May 3, 2024 21:50
List of free rfc3161 servers.
https://rfc3161.ai.moda
https://rfc3161.ai.moda/adobe
https://rfc3161.ai.moda/microsoft
https://rfc3161.ai.moda/apple
https://rfc3161.ai.moda/any
http://rfc3161.ai.moda
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
@Manouchehri
Manouchehri / cloudflare.sh
Last active April 21, 2024 21:55
Allow CloudFlare only
# Source:
# https://www.cloudflare.com/ips
# https://support.cloudflare.com/hc/en-us/articles/200169166-How-do-I-whitelist-CloudFlare-s-IP-addresses-in-iptables-
for i in `curl https://www.cloudflare.com/ips-v4`; do iptables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
for i in `curl https://www.cloudflare.com/ips-v6`; do ip6tables -I INPUT -p tcp -m multiport --dports http,https -s $i -j ACCEPT; done
# Avoid racking up billing/attacks
# WARNING: If you get attacked and CloudFlare drops you, your site(s) will be unreachable.
iptables -A INPUT -p tcp -m multiport --dports http,https -j DROP
@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
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 / 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 / cpuinfo.txt
Created June 5, 2022 02:44
c7g.medium AWS
processor : 0
BogoMIPS : 2100.00
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 sve asimdfhm dit uscat ilrcpc flagm ssbs paca pacg dcpodp svei8mm svebf16 i8mm bf16 dgh rng
CPU implementer : 0x41
CPU architecture: 8
CPU variant : 0x1
CPU part : 0xd40
CPU revision : 1
@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
sudo dd if=/dev/zero of=/swapfile0 bs=1M count=4096 status=progress # not right for btrfs? Should disable compression too?
sudo chmod 600 /swapfile0
# old kernels need more swapfiles
sudo lvcreate -l +100%FREE ubuntu-vg -n zram0
# edit the other two files in this gist first
sudo /usr/bin/init-zram-swapping
sudo sysctl -p
@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