Skip to content

Instantly share code, notes, and snippets.

@nharitov-godaddy
nharitov-godaddy / linux-vms-on-apple-m1-with-networking.md
Created July 5, 2024 16:15 — forked from max-i-mil/linux-vms-on-apple-m1-with-networking.md
Short summary to run Linux VMs on an Apple M1 host using QEMU, libvirt and HVF with a working network setup

Linux Virtual Machines with Private Network on an Apple M1 Device

Background

The aim was to be able to:

  1. Run multiple Linux VMs on an Apple M1/ARM device
  2. Use Apple's HVF for native performance speeds
  3. Configure VMs to allow network access to each other
  4. Configure VMs to allow access to the internet
  5. Not rely on custom modifications of software

Using strace and lsof to debug blocked processes

You can use strace on a specific pid to figure out what a specific process is doing, e.g.:

strace -fp <pid>

You might see something like:

select(9, [3 5 8], [], [], {0, 999999}) = 0 (Timeout)

@nharitov-godaddy
nharitov-godaddy / fstab
Created May 3, 2024 10:47 — forked from phaneesh/fstab
hadoop-os-tuning
/dev/sdb1 /data/hdp01 xfs defaults,noatime,nodiratime,nobarrier 1 2
/dev/sdc1 /data/hdp02 xfs defaults,noatime,nodiratime,nobarrier 1 2

Kernel entries for Hadoop - Tuning

Should be added to either /etc/sysctl.conf or /etc/sysct.conf.d/99-hadoop.conf

File contents:

# Sysctl for hadoop nodes

net.core.netdev_max_backlog = 4000
net.core.somaxconn = 4000
@nharitov-godaddy
nharitov-godaddy / curl.md
Created May 19, 2022 12:58 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.