Skip to content

Instantly share code, notes, and snippets.

@eqhmcow
eqhmcow / iptables.rules
Last active February 12, 2020 10:35
let me eat cake
# /etc/iptables.rules
# Generated by iptables-save v1.6.1 on Sat Oct 19 09:21:09 2019
*mangle
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:MINIUPNPD - [0:0]
@researcx
researcx / config_audio.md
Last active February 16, 2024 17:36
Linux System-wide Audio Tuning [24bit 192 kHz HD Audio + A=432 Hz Tuning + Equalizer]

24bit 192 kHz HD Audio + A=432 Hz Tuning + Equalizer

High-quality sampling

ALSA

echo 'defaults.pcm.rate_converter "speexrate_best"' | tee -a .asoundrc
sudo alsactl restore

PulseAudio

sudo echo 'default-sample-format = s24le' | sudo tee -a /etc/pulse/daemon.conf
sudo echo 'default-sample-rate = 192000' | sudo tee -a /etc/pulse/daemon.conf
@Thermi
Thermi / Best Practices.md
Last active May 20, 2022 09:01
Summary page of the Netfilter related resources

Best Practices:

  1. Don't use iptables to apply your rules one at a time, use iptables-restore to apply a whole ruleset in one action.
  2. Set your INPUT and FORWARD policy to DROP.
  3. Don't set your OUTPUT policy to DROP unless you really know what you're doing.
  4. If you're going to implement a blacklist or whitelist, you should look at using ipsets if that list is going to be more than two or three addresses, and if it might be dynamic.
  5. Allow all traffic on lo.
  6. You should ALLOW traffic in ctstates of RELATED and ESTABLISHED near the beginning of your rules
  7. Don't use iptables -L
  8. DON'T USE IPTABLES -L
  9. Use iptables-save instead of iptables -L.
@nickfox-taterli
nickfox-taterli / upgrade_raspbian_to_buster.sh
Last active August 11, 2020 21:57
Upgrade Raspbian To Buster
sudo sync
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo sed -i 's/jessie/buster/g' /etc/apt/sources.list
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get -y dist-upgrade
sudo sync
#sudo reboot
@sultanqasim
sultanqasim / zram.sh
Created June 21, 2016 02:41
ZRAM config for Raspberry Pi 3
#!/bin/bash
# Raspberry Pi ZRAM script
# Tuned for quad core, 1 GB RAM models
# put me in /etc/init.d/zram.sh and make me executable
# then run "sudo update-rc.d zram.sh defaults"
modprobe zram
echo 3 >/sys/devices/virtual/block/zram0/max_comp_streams
echo lz4 >/sys/devices/virtual/block/zram0/comp_algorithm
@nonakap
nonakap / fancontrol
Last active September 22, 2020 18:42
fancontrol config file for NEC Express5800/S70 type hf.
# for NEC Express5800/S70 type hf
# FAN1: front, FAN2: CPU, FAN3: rear
INTERVAL=5
DEVPATH=hwmon1=devices/platform/coretemp.0 hwmon2=devices/platform/w83627ehf.2608
DEVNAME=hwmon1=coretemp hwmon2=nct6776
FCTEMPS=hwmon2/device/pwm3=hwmon1/device/temp1_input hwmon2/device/pwm2=hwmon1/device/temp1_input hwmon2/device/pwm1=hwmon1/device/temp1_input
FCFANS=hwmon2/device/pwm3=hwmon2/device/fan3_input hwmon2/device/pwm2=hwmon2/device/fan2_input hwmon2/device/pwm1=hwmon2/device/fan1_input
MINTEMP=hwmon2/device/pwm3=38 hwmon2/device/pwm2=33 hwmon2/device/pwm1=33
MAXTEMP=hwmon2/device/pwm3=73 hwmon2/device/pwm2=73 hwmon2/device/pwm1=73
MINSTART=hwmon2/device/pwm3=10 hwmon2/device/pwm2=50 hwmon2/device/pwm1=50
@gorakhargosh
gorakhargosh / pdnsd.conf
Created August 2, 2011 02:57
pdnsd.conf
// Sample pdnsd configuration file. Must be customized to obtain a working pdnsd setup!
// Read the pdnsd.conf(5) manpage for an explanation of the options.
// Add or remove '#' in front of options you want to disable or enable, respectively.
// Remove '/*' and '*/' to enable complete sections.
global {
perm_cache=999999;
cache_dir="/usr/local/var/cache/pdnsd";
# pid_file = /var/run/pdnsd.pid;
run_as="nobody";
@bradoaks
bradoaks / hfsc-shape.sh
Created April 25, 2011 14:51 — forked from eqhmcow/hfsc-shape.sh
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@eqhmcow
eqhmcow / hfsc-shape.sh
Last active October 22, 2024 13:55
HFSC - linux traffic shaping's best kept secret
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.