Skip to content

Instantly share code, notes, and snippets.

View aminPial's full-sized avatar
:octocat:
constantly failing!

Amin Pial aminPial

:octocat:
constantly failing!
View GitHub Profile
#!/usr/bin/env python3
from sys import argv, stderr, stdout, version_info
from functools import partial
eprint = partial(print, file=stderr)
import io
import zlib
import struct
import argparse
@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
@lmyyao
lmyyao / sqlalchemy_bind_two_database.py
Created September 14, 2016 06:39
sqlalchemy bind multiple databases
from sqlalchemy import (String,
Integer,
engine_from_config,
Column)
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
Base_1 = declarative_base()
Base_2 = declarative_base()