Skip to content

Instantly share code, notes, and snippets.

介绍

由于GFW的域名黑名单是不断变化的,如果所有DNS查询都走VPN会丧失CDN加速功能,经常出现本地电信线路,但是却访问网站的联通线路,而且当VPN线路不稳定的时候,会影响所有网站的访问。如果使用域名白名单或黑名单,对于经常访问外国网站的用户,体验很不好,需要用户自己维护域名列表。 该文章介绍如何通过判断并丢弃包含特征IP的DNS包来防止DNS污染,但是又不会失去本地DNS的CDN加速功能,而且还不需要VPN。

前期准备

  • 一台Openwrt路由器
  • 使用dnsmasq作为Openwrt的dns服务器
  • 安装 dig (opkg install bind-dig bind-libs)
  • 安装 iptables 的 string 模块及对应的内核模块 (opkg install iptables-mod-filter kmod-ipt-filter)
@nxtreaming
nxtreaming / Convert audio to video with ffmpeg - examples.md
Created January 14, 2023 10:19 — forked from Neurogami/Convert audio to video with ffmpeg - examples.md
A list of examples on how you can use filters to make visual representations of audio using ffmpeg

Convert audio to video with ffmpeg - examples

ffmpeg -i input.mp3 -filter_complex "[0:a]avectorscope=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a avectorscope.mp4
ffmpeg -i input.mp3 -filter_complex "[0:a]showcqt=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a showcqt.mp4
ffmpeg -i input.mp3 -filter_complex "[0:a]ahistogram=s=1920x1080,format=yuv420p[v]" -map "[v]" -map 0:a ahistogram.mp4
@nxtreaming
nxtreaming / ffmppeg-advanced-playbook-nvenc-and-libav-and-vaapi.md
Created October 13, 2020 06:49 — forked from Brainiarc7/ffmppeg-advanced-playbook-nvenc-and-libav-and-vaapi.md
FFMpeg's playbook: Advanced encoding options with hardware-accelerated acceleration for both NVIDIA NVENC's and Intel's VAAPI-based hardware encoders in both ffmpeg and libav.

FFmpeg and libav's playbook: Advanced encoding options with hardware-based acceleration, NVIDIA's NVENC and Intel's VAAPI-based encoder.

Hello guys,

Continuing from this guide to building ffmpeg and libav with NVENC and VAAPI enabled, this snippet will cover advanced options that you can use with ffmpeg and libav on both NVENC and VAAPI hardware-based encoders.

For ffmpeg:

@nxtreaming
nxtreaming / ffmpeg-web-video-guide.md
Created October 13, 2020 02:33 — forked from jaydenseric/ffmpeg-web-video-guide.md
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@nxtreaming
nxtreaming / keybase.md
Created November 13, 2019 17:33
My keybase

Keybase proof

I hereby claim:

  • I am nxtreaming on github.
  • I am phantun (https://keybase.io/phantun) on keybase.
  • I have a public key ASDuu3oDkWY6TSFLLiCalBgn4E8krjrGy4ZSLRPdQcta6Qo

To claim this, I am signing this object:

Add-Type -TypeDefinition @'
using System;
using System.Runtime.InteropServices;
namespace ProcessInfo
{
public class NativeMethods
{
[DllImport("User32.dll", SetLastError = true)]
public static extern bool CloseDesktop(
@nxtreaming
nxtreaming / get_macs.yml
Created May 3, 2019 07:58 — forked from tbondarchuk/get_macs.yml
Ansible: Get mac addresses of all interfaces except local
---
- hosts: all
tasks:
- name: Get mac addresses of all interfaces except local
debug:
msg: "{{ ansible_interfaces | difference(['lo']) | map('regex_replace', '^(.*)$', 'ansible_\\1' ) | map('extract', hostvars[inventory_hostname], 'macaddress') | list }}"
commit abc0cd221fcfe81c5bd44880e863b26d6481b230
Author: removed-email
Date: Sun Apr 22 12:30:20 2018 +0800
fix typo
diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index e0b1bc4..426fdfb 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
commit 8f30bc5614b4d83ce8c6dfe78a2706f34ba41c87
Author: removed-email
Date: Sun Apr 22 01:29:17 2018 +0800
libsrt new option: pkt_size
diff --git a/libavformat/libsrt.c b/libavformat/libsrt.c
index 0f9529d..e0b1bc4 100644
--- a/libavformat/libsrt.c
+++ b/libavformat/libsrt.c
@nxtreaming
nxtreaming / squid.conf
Created April 9, 2018 06:06 — forked from hardikdangar/squid.conf
squid.conf
# General
http_port 3130
http_port 3128 intercept
https_port 3129 intercept ssl-bump cert=/etc/squid/ssl_cert/srtpl.pem generate-host-certificates=on dynamic_cert_mem_cache_size=4MB
acl DiscoverSNIHost at_step SslBump1
acl NoSSLIntercept ssl::server_name_regex -i "/etc/squid/url.nobump"
ssl_bump splice NoSSLIntercept
ssl_bump peek DiscoverSNIHost