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 / 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 / ffmpeg-fdk_aac.diff
Created June 29, 2012 15:36
ffmpeg: support libfdk_aac
diff --git a/configure b/configure
index f43a70d..aa0d186 100755
--- a/configure
+++ b/configure
@@ -178,6 +178,7 @@ External library support:
--enable-libdc1394 enable IIDC-1394 grabbing using libdc1394
and libraw1394 [no]
--enable-libfaac enable FAAC support via libfaac [no]
+ --enable-libfdk-aac enable AAC support via libfdk-aac [no]
--enable-libfreetype enable libfreetype [no]
#!/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 / x264_vf_subtitles.diff
Created December 11, 2011 20:07
[x264-patch] Render subtitles in x264 with VSFilter ( --vf subtitles --sub "subtitles.ass" )
diff --git a/Makefile b/Makefile
index cf05d15..a29d37c 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ endif
# Optional module sources
ifneq ($(findstring HAVE_AVS 1, $(CONFIG)),)
-SRCCLI += input/avs.c
+SRCCLI += input/avs.c filters/video/subtitles.c
@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"
@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 / gist:1466956
Created December 12, 2011 12:34
[x264-patch] Force profile
diff -uNrp a/common/common.c b/common/common.c
--- a/common/common.c 2011-11-20 19:59:26 +0000
+++ b/common/common.c 2011-11-20 20:29:52 +0000
@@ -71,6 +71,8 @@ void x264_param_default( x264_param_t *p
param->i_fps_den = 1;
param->i_level_idc = -1;
param->b_level_force = 0;
+ param->i_profile = 0;
+ param->b_profile_force = 0;
param->i_slice_max_size = 0;