Skip to content

Instantly share code, notes, and snippets.

0. Don't have a SIM card in when you're updating radio firmware or it will bomb out partway through as it changes from internal IP to IP passthrough
1. Disable external IP passthrough mode: Network Setting -> Broadband -> Cellular APN -> #1 -> Modify icon -> "IP Passthrough" slider to off
2. Use "management" Wi-Fi AP as general Wi-Fi AP (with limitations) -> Network Setting -> Bridge1 -> Modify icon -> Move the Wi-Fi AP interface to the pane on the right alongside LAN1
NOTE: by default, once you do the above, the router will happily pass traffic from devices on the Wi-Fi AP to other devices on the LAN1 subnet, but will block traffic originating from the Wi-Fi AP from exiting to the Internet via the LTE side of the device. You can clumsily hack around this by setting another device, e.g. another Wi-Fi AP or Raspberry Pi or Cray supercomputer, as the default gateway for the LAN1 subnet in your DHCP server config, and pointing *that* device at the Zyxel as *its* default GW. This adds additional hops, but enabl
@ogmkp
ogmkp / rclocal
Created February 1, 2024 15:32 — forked from cdgraff/rclocal
Ifconfig to tunning network card Queue
# increase txqueuelen for 10G NICS
/sbin/ifconfig p5p1 txqueuelen 10000
@ogmkp
ogmkp / limit.conf
Created February 1, 2024 15:32 — forked from cdgraff/limit.conf
HLS Tunning limit.conf
* soft nproc 1048576
* hard nproc 1048576
* soft nofile 1048576
* hard nofile 1048576
* soft stack 1048576
* hard stack 1048576
* soft memlock unlimited
* hard memlock unlimited
@ogmkp
ogmkp / etc.sysctl.d.20-streaming-tuning.conf
Created February 1, 2024 15:32 — forked from cdgraff/etc.sysctl.d.20-streaming-tuning.conf
sysctl conf setting for Ubuntu 14.04.1
fs.file-max=1048576
fs.inotify.max_user_instances=1048576
fs.inotify.max_user_watches=1048576
fs.nr_open=1048576
net.core.netdev_max_backlog=1048576
net.core.rmem_max=16777216
net.core.somaxconn=65535
net.core.wmem_max=16777216
net.ipv4.tcp_congestion_control=htcp
net.ipv4.ip_local_port_range=1024 65535
@ogmkp
ogmkp / gist:81cd9c7ee36e138e38429ef06a962829
Created January 27, 2024 15:33 — forked from zakkak/gist:ab08672ff9d137bbc0b2d0792a73b7d2
Resizing a filesystem using qemu-img and fdisk

Occasionally we will deploy a virtual instance into our KVM infrastructure and realize after the fact that we need more local disk space available. This is the process we use to expand the disk image. This process assumes the following:

  • You're using legacy disk partitions. The process for LVM is similar and I will describe that in another post.
  • The partition you need to resize is the last partition on the disk.

This process will work with either a qcow2 or raw disk image. For

@ogmkp
ogmkp / perf.md
Created October 24, 2023 15:12 — forked from martinus/perf.md
perf config

/etc/sysctl.conf

kernel.perf_event_paranoid = -1
kernel.perf_cpu_time_max_percent = 5
kernel.perf_cpu_time_max_percent=10000
@ogmkp
ogmkp / nginx-tuning.md
Created September 12, 2023 08:53 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@ogmkp
ogmkp / main.sh
Created August 15, 2023 13:24 — forked from pojntfx/main.sh
QEMU Android-X86 with 3D hardware acceleration, audio & webcam support
# Without webcam access
sudo GDK_SCALE=1 qemu-system-x86_64 -enable-kvm -m 4096 -smp $(nproc) -cpu host -device ac97 -audiodev alsa,id=snd0,out.buffer-length=500000,out.period-length=726 -device virtio-mouse-pci -device virtio-keyboard-pci -net nic -net user -device virtio-vga,virgl=on -display gtk,gl=on -hda android-x86.img -cdrom android-x86.iso
# With webcam access (requires sudo; change hostbus=2,hostaddr=4 to match your webcam's USB address).
sudo pulseaudio -D --system
sudo GDK_SCALE=1 qemu-system-x86_64 -enable-kvm -m 4096 -smp $(nproc) -cpu host -device ac97 -audiodev alsa,id=snd0,out.buffer-length=500000,out.period-length=726 -device virtio-mouse-pci -device virtio-keyboard-pci -net nic -net user -device virtio-vga,virgl=on -usb -device usb-ehci,id=ehci -device usb-host,hostbus=2,hostaddr=4 -display gtk,gl=on -hda android-x86.img -cdrom android-x86.iso
# More information on changing things like the screen resolution: See https://web.archive.org/web/20210117124628/https://linuxhint.com/android_qem
@ogmkp
ogmkp / VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
Created July 9, 2023 05:57 — forked from Brainiarc7/VAAPI-hwaccel-encode-Linux-Ffmpeg&Libav-setup.md
This gist contains instructions on setting up FFmpeg and Libav to use VAAPI-based hardware accelerated encoding (on supported platforms) for H.264 (and H.265 on supported hardware) video formats.

Using VAAPI's hardware accelerated video encoding on Linux with Intel's hardware on FFmpeg and libav

Hello, brethren :-)

As it turns out, the current version of FFmpeg (version 3.1 released earlier today) and libav (master branch) supports full H.264 and HEVC encode in VAAPI on supported hardware that works reliably well to be termed "production-ready".

@ogmkp
ogmkp / pipewire-out-default-switch.sh
Created May 16, 2023 09:44 — forked from miyl/pipewire-out-default-switch.sh
Pipewire default sink (output) switching (Pulseaudio pactl)
#! /usr/bin/env sh
# Removing pulseaudio means removing pacmd, so this is an attempt at switching the default via pactl instead.
# This script switches between whatever sinks exist.
# Sinks can be specified by name or index. Index changes sometimes when you disconnect and reconnect, restart or whatever, so names are better as they are persistent.
# Annoyingly the command used to switch audio over to a new sink cannot take a name as its argument, otherwise I'd only need the name here.
# TODO: Trigger a zenity or dmenu dialog with entr that asks whether to switch monitor and/or sound to hdmi? Could do
# the same for mounting.