Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@junxy
junxy / README.md
Created January 7, 2024 05:46 — 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.

@junxy
junxy / AnnotationExtUtils.java
Created September 8, 2022 09:41
find annotation recursively
package com.demo.util;
import lombok.NonNull;
import lombok.experimental.UtilityClass;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.lang.Nullable;
import java.lang.annotation.Annotation;
import java.lang.reflect.Method;
@junxy
junxy / BeanUtils2.java
Last active December 28, 2020 06:22
Bean属性复制 忽略空值/空白字符
package test;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import java.beans.PropertyDescriptor;
import java.util.HashSet;
import java.util.Set;
@junxy
junxy / Test4.java
Last active December 9, 2020 03:48
Java queryString to obj Example sample 两行代码(使用已有工具库)实现QueryString转对象,拒绝硬编码
package test;
import lombok.Data;
import lombok.NonNull;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.http.NameValuePair;
import org.apache.http.client.utils.URLEncodedUtils;
import org.junit.Test;
@junxy
junxy / nginx_proxy_updates.jenkins-ci.org.conf
Last active April 22, 2020 12:28
nginx 反向代理 Jenkins 插件安装源,国内源 http://mirrors.tuna.tsinghua.edu.cn/jenkins/
server {
listen 80;
server_name updates.jenkins-ci.org;
server_name mirrors.jenkins-ci.org;
# https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/
location /download/ {
proxy_redirect off;
proxy_pass http://mirrors.tuna.tsinghua.edu.cn/jenkins/;
proxy_connect_timeout 60s;
class Sslscan2Beta < Formula
desc "Test SSL/TLS enabled services to discover supported cipher suites"
homepage "https://github.com/rbsec/sslscan"
url "https://github.com/rbsec/sslscan/archive/2.0.0-beta1.tar.gz"
version "2.0.0-beta1"
sha256 "4a77ddfd0dad740fa1f830feab24702f9ecea8881cfc26d08e82573a4d141023"
head "https://github.com/rbsec/sslscan.git"
bottle do
cellar :any_skip_relocation
@junxy
junxy / aliyun-CentOS-Base.repo
Last active December 10, 2019 10:18
Centos8 国内源
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
if type pactl > /dev/null 2>&1 || type xvinfo > /dev/null 2>&1; then
# detect WSL host
if type systemd-detect-virt > /dev/null 2>&1 && test "$(systemd-detect-virt -c)" != wsl -a -e /etc/resolv.conf; then
WSL_HOST=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null)
fi
WSL_HOST=${WSL_HOST:-localhost}
# set DISPLAY if there is an X11 server running
@junxy
junxy / post-WSL.md Installing node via windows subsystem for linux

Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL)

Windows just released the windows subsystem for linux feature to the public with its latest windows fall creator update, if you are not familiar with this feature it allows you to run linux binaries natively on windows - F.A.Q.

Enabling WSL

The feature is not enabled by default and you need to activate it, you can do it via powershell (with admin rights):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux

Or you can open: Control-Panel -> Programs -> Turn Windows feature on ro off, and click the "windows subsystem for linux (beta)" button.

@junxy
junxy / ddns_dnspod.sh
Created March 24, 2019 11:51
ddns(dnspod.com) update script
#!/bin/sh
# get public ip
myip=$(dig +short myip.opendns.com @resolver1.opendns.com)
echo "My IP: $myip"
curl -X 'POST' 'https://api.dnspod.com/Record.Ddns' \
-H 'Content-Type: application/x-www-form-urlencoded; charset=utf-8' \
--data-urlencode 'format=json' \
--data-urlencode 'sub_domain=xxx' \