Skip to content

Instantly share code, notes, and snippets.

View sammdu's full-sized avatar

Samm Du sammdu

View GitHub Profile
#!/bin/bash
#Make sure the screen package is installed.
#Adjust the cow path accrding to your setip.
screen -dmSL cow /usr/bin/cow
@sammdu
sammdu / enable-tcp-bbr.sh
Last active September 19, 2023 16:27
Significantly increase TCP throughput (and thus network speed) of your Linux server. When I tried it on a VPS I own, the wget average went from 394KB/s to 1.37MB/s!
#!/usr/bin/env bash
# This is a crazy feature of the Linux kernel that will DRAMATICALLY increase
# the TCP throughput (and thus network speed) of your Linux server.
# When I tried it on a VPS I own, the wget average went from 394KB/s to 1.37MB/s!
# Further reading: https://medium.com/google-cloud/tcp-bbr-magic-dust-for-network-performance-57a5f1ccf437
# check if kernel supports TCP BBR
if ! grep 'CONFIG_TCP_CONG_BBR' /boot/config-"$(uname -r)" | grep -q 'CONFIG_TCP_CONG_BBR'; then
@sammdu
sammdu / ytdl.py
Last active September 10, 2020 00:16
[ytdl.py] Download a list of songs from YouTube, at the best audio quality. Can optionally download videos as well.
#!/usr/bin/env python3
import subprocess
from argparse import ArgumentParser
from pathlib import Path
from sys import exit, stderr
# [1/3] COMMAND LINE ARGUMENTS
@sammdu
sammdu / mprocs.yaml
Created May 31, 2022 17:53
mprocs sunco yaml config
procs:
ngrok:
shell: ngrok start --all
containers:
shell: >-
if [ -z "`pgrep Docker`" ]; then open -g -j -a /Applications/Docker.app &&
touch .docker_starting.tmp && sleep 25; fi; npm run containers:down;
npm run containers
typescript:
shell: >-