Skip to content

Instantly share code, notes, and snippets.

View Manouchehri's full-sized avatar
🦆

David Manouchehri Manouchehri

🦆
View GitHub Profile
@Manouchehri
Manouchehri / registries.conf
Last active July 25, 2022 18:54
/etc/containers/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
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
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
[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
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]
@Manouchehri
Manouchehri / perf.list.txt
Created July 18, 2022 22:44
t2a-standard-4
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]
@Manouchehri
Manouchehri / dmesg.txt
Created July 18, 2022 16:50
GCP GCE t2a-standard-4
[ 0.000000] Booting Linux on physical CPU 0x0000000000 [0x413fd0c1]
[ 0.000000] Linux version 5.15.0-1013-gcp (buildd@bos02-arm64-029) (gcc (Ubuntu 11.2.0-19ubuntu1) 11.2.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #18-Ubuntu SMP Sun Jul 3 05:04:03 UTC 2022 (Ubuntu 5.15.0-1013.18-gcp 5.15.39)
[ 0.000000] efi: EFI v2.70 by EDK II
[ 0.000000] efi: SMBIOS=0xffff0000 TPMFinalLog=0x4385e0000 ACPI 2.0=0x4385d0018 MEMATTR=0x43a366418 MOKvar=0x43a43a000 TPMEventLog=0x43815b018 RNG=0x43bfdee18 MEMRESERVE=0x4384fca18
[ 0.000000] efi: seeding entropy pool
[ 0.000000] random: fast init done
[ 0.000000] secureboot: Secure boot disabled
[ 0.000000] ACPI: Early table checksum verification disabled
[ 0.000000] ACPI: RSDP 0x00000004385D0018 000024 (v02 Google)
[ 0.000000] ACPI: XSDT 0x00000004385DFE98 000074 (v01 Google GOOGFACP 00000001 01000013)
@Manouchehri
Manouchehri / parallel
Created July 14, 2022 17:42 — forked from mjambon/parallel
bash: Run parallel commands and fail if any of them fails
#! /usr/bin/env bash
#
# Run parallel commands and fail if any of them fails.
#
set -eu
pids=()
for x in 1 2 3; do
@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
@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