Skip to content

Instantly share code, notes, and snippets.

@ogmkp
ogmkp / gist:776f8780529896652c919122ea6cc684
Created October 22, 2024 13:03 — forked from tayvano/gist:6e2d456a9897f55025e25035478a3a50
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
@ogmkp
ogmkp / edit-init-rc.md
Created July 3, 2024 20:15 — forked from ashutosh-mishra/edit-init-rc.md
How to run custom script from init.rc, How to Extract Android Kernel And Modify The Boot Ramdisk(Android 4+)

init.rc changes

init.rc changes to run any script Can be used to start any android application, service

on property:dev.bootcomplete=1
    exec - system system -- /system/bin/sh <custom script path>
    # exec - system system -- /system/bin/sh /data/local/bootscript/testservice.sh

Script can contains applications start, stop commands

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