Skip to content

Instantly share code, notes, and snippets.

@astrataro
astrataro / uninstall-ghostscript.sh
Created October 8, 2019 05:24 — forked from gwerbin/uninstall-ghostscript.sh
Uninstall Ghostscript that comes with MacTex
#!/usr/bin/env bash
# The MacTex website (https://www.tug.org/mactex/uninstalling.html) says it's "difficult"
# to uninstall Ghostscript, as installed by MacTex. Their suggestion is to:
# open the MacTeX-2015 install package and select "Show Files" from the resulting "File" menu of Apple's installer
# and then:
# Find files related to Ghostscript and remove them.
# which is exactly what this script does. It also prints the names of the deleted files, and moves the files to
# the user's Trash instead of actually deleting them. This can help you roll back the effects of the script in
# case something goes wrong.
@astrataro
astrataro / android-captive.sh
Last active October 24, 2018 05:03 — forked from tonyseek/android-captive.sh
Overrides the captive portal settings of Android in the People's Republic China Mainland
#!/usr/bin/env sh
adb shell "settings put global captive_portal_http_url http://dl.google.com/generate_204"
adb shell "settings put global captive_portal_https_url https://dl.google.com/generate_204"
adb shell "settings put global captive_portal_fallback_url https://www.qualcomm.cn/generate_204"
adb shell "settings put global captive_portal_other_fallback_urls https://connect.rom.miui.com/generate_204,https://captive.v2ex.co/generate_204,https://developers.google.cn/generate_204,https://www.google.cn/generate_204"
#!/bin/bash
# Author: Alexander Rodin <rodin.alexander@gmail.com>
# License: MIT
BUILD_DIR=build
while getopts "hp:s:r:b:o:c:nd:" opt; do
case $opt in
h)
echo "Usage: $0 [options]"
@astrataro
astrataro / linux_tsunami.diff
Created December 19, 2017 21:07
tcp_tsunami.c is not supplied. cp ./net/ipv4/tcp_bbr.c ./net/ipv4/tcp_tsunami.c and apply diff is recommended.
diff -uNrp a/net/ipv4/Kconfig b/net/ipv4/Kconfig
--- a/net/ipv4/Kconfig 2017-12-17 09:08:14.000000000 -0500
+++ b/net/ipv4/Kconfig 2017-12-19 15:28:11.931956723 -0500
@@ -675,6 +675,13 @@ config TCP_CONG_BBR
bufferbloat, policers, or AQM schemes that do not provide a delay
signal. It requires the fq ("Fair Queue") pacing packet scheduler.
+config TCP_CONG_TSUNAMI
+ tristate "Tsunami TCP"
+ default n
--- ./tcp_bbr.c 2017-09-06 14:32:38.000000000 +0800
+++ ./tcp_tsunami.c 2017-09-06 14:38:50.000000000 +0800
@@ -121,9 +121,9 @@ struct bbr {
#define CYCLE_LEN 8 /* number of phases in a pacing gain cycle */
/* Window length of bw filter (in rounds): */
-static const int bbr_bw_rtts = CYCLE_LEN + 2;
+static const int bbr_bw_rtts = CYCLE_LEN + 7;
/* Window length of min_rtt filter (in sec): */
-static const u32 bbr_min_rtt_win_sec = 10;
#!/bin/bash
################################
# OS X Install ISO Creater #
# #
# Author: shela #
################################
#######################################
# Declarations
@astrataro
astrataro / geoip.conf
Created February 20, 2017 19:03
Surge GEOIP ruleset
# According to [ISO 3166 Country Codes](https://dev.maxmind.com/geoip/legacy/codes/iso3166/) and [ISO 3166 Country Codes with Associated Continent](https://dev.maxmind.com/geoip/legacy/codes/country_continent/)
# Official documents can be found [here](https://www.iso.org/iso/home/standards/country_codes.htm) and [here](https://www.iso.org/obp/ui/#search)
# China
GEOIP, CN, 🇨🇳CNProxy
# Africa
GEOIP, AO, 🇿🇦AFProxy // Angola, AF
GEOIP, BF, 🇿🇦AFProxy // Burkina Faso, AF
GEOIP, BI, 🇿🇦AFProxy // Burundi, AF
GEOIP, BJ, 🇿🇦AFProxy // Benin, AF
@astrataro
astrataro / lavf-build.sh
Last active August 29, 2015 14:05
build and update LAVFilters
#!/usr/bin/env bash
# determine which ramdisk to use
for VOL_NAME in A B X; do
VOL_SIZE=$(df 2>nul | grep -i "${VOL_NAME}:" | awk '{print $4}')
if [ -n "$VOL_SIZE" ] && [ $VOL_SIZE -ge 921600 ]; then
RAMD=/${VOL_NAME}/
break
fi
done
@astrataro
astrataro / x264_tMod-clone.sh
Created March 12, 2013 09:55
Just for people who need it. Note that I haven't pushed rev2273/2274 on GitHub ( only available as patches on my blog ), as I'm still wait for L-SMASH's *official* merge to avoid messing up revision numbers. So right now you may not get full codes using this script.
#!/usr/bin/env bash
# Originally for L-SMASH project.
# Modified for tMod.
# I do not claim any further copyright.
# This file is part of L-SMASH project.
# http://github.com/silverfilain/x264_L-SMASH
# Copyright (C) 2010-2013 L-SMASH project
#!/usr/bin/env bash
# Originally for L-SMASH project.
# Modified for tMod.
# I do not claim any further copyright.
# This file is part of L-SMASH project.
# http://github.com/silverfilain/x264_L-SMASH
# Copyright (C) 2010-2013 L-SMASH project