Skip to content

Instantly share code, notes, and snippets.

View liaohuqiu's full-sized avatar
🎯
Focusing

Huqiu Liao liaohuqiu

🎯
Focusing
View GitHub Profile
@liaohuqiu
liaohuqiu / gist:4ee77b9b03afcdecc80252252378d367
Created June 9, 2016 00:38
Find out the full duration time of a YouTube playlist
var list = document.getElementsByClassName('pl-video-time');
var time = 0;
function toS(hms) {
var a = hms.split(':');
while (a.length < 3) {
a.unshift(0);
}
var seconds = (+a[0]) * 60 * 60 + (+a[1]) * 60 + (+a[2]);
return seconds;
# using route
route del default gw 192.168.0.1
route add default gw 192.168.0.4
# or using ip
ip route del default
ip route add default via 192.168.0.4
public class ImageUrlManager {
private static final String HTTP = "http";
private static final String GIF = ".gif";
private static final String KEY_IMAGEMOGR2 = "?imageMogr2";
/**
* Refer to: https://portal.qiniu.com/myTickets/ticketDetail?id=36037
* There is one bug in qiniu.com, they may fail to convert gif to
sourceServer=172.16.1.121
function syncusers() {
scp $sourceServer:/etc/passwd /tmp/passwd.$sourceServer
scp $sourceServer:/etc/group /tmp/group.$sourceServer
scp $sourceServer:/etc/shadow /tmp/shadow.$sourceServer
# First, make a list of non-system users that need to be moved.
local UGIDLIMIT=500
function exe_cmd() {
echo $1
eval $1
}
function ensure_dir()
{
if [ ! -d $1 ]; then
exe_cmd "mkdir -p $1"
fi
package kxi.rpc.test.basic;
class MergeSortSolution {
private static void merge(int arr[], int left, int mid, int right) {
int leftCount = mid - left + 1;
int rightCount = right - mid;
int leftArr[] = new int[leftCount];
int rightArr[] = new int[rightCount];
#define OPENCL_PLATFORM_UNKNOWN 0
#define OPENCL_PLATFORM_AMD 1
#define OPENCL_PLATFORM_CLOVER 2
#define OPENCL_PLATFORM_NVIDIA 3
#define OPENCL_PLATFORM_INTEL 4
#ifdef cl_clang_storage_class_specifiers
#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable
#endif
@liaohuqiu
liaohuqiu / README.md
Created August 4, 2024 13:29 — forked from cld4h/README.md
Bypass the GFW; clash fake-ip and tproxy; iptables and transparent proxy on Linux; 在Linux上通过 iptables 以及 clash 配置透明代理用于本机及局域网翻墙网关; Linux 翻墙路由器配置

This article show you the ultimate way to set up a transparent proxy on Linux using clash and iptables to bypass the GFW in China.

We use:

You can go to github gist to download all files mentioned in this article.