# Install dependencies
$ sudo apt install make gcc git libsecret-1-0 libsecret-1-dev libglib2.0-dev
# Compile binary
$ sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
# Configure git to use binary as credential storage
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Website you intended to retrieve for users. | |
const upstream = 'api.openai.com' | |
// Custom pathname for the upstream website. | |
const upstream_path = '/' | |
// Website you intended to retrieve for users using mobile devices. | |
const upstream_mobile = upstream | |
// Countries and regions where you wish to suspend your service. |
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:
- clash as the proxy software
- online subconverter and crontab to periodically update config file.
- ACL4SSR to provide GFW rules.
You can go to github gist to download all files mentioned in this article.
Notes
- If your local network use public IP ranges instead of private ones, make sure to add respecive
RETURN
rules to iptables to prevent looping issue - Set clash as DHCP's only DNS server to allow domain-based filter (shunting) rules work
- Use
lsof -i udp:53
to check if clash's DNS module work fine, otherwise you may have to killsystemd-resolved
and any other processes occupying the UDP 53 port - The given scripts will NOT hangle the traffic of gateway itself since it is not recommend to do so. If you want to redirect the egress traffic of the gateway, the following material may be useful
Reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
GNOME comes with libsecret. You can use libsecret to store your git credentials:
sudo apt install libsecret-1-0 libsecret-1-dev libglib2.0-dev
sudo make --directory=/usr/share/doc/git/contrib/credential/libsecret
git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret
Setup etcdctl using the instructions at https://github.com/etcd-io/etcd/releases/tag/v3.4.13 (changed path to /usr/local/bin
):
Note: if you want to match th etcdctl binaries with the embedded k3s etcd version, please run the curl command for getting the version first and adjust ETCD_VER
below accordingly:
curl -L --cacert /var/lib/rancher/k3s/server/tls/etcd/server-ca.crt --cert /var/lib/rancher/k3s/server/tls/etcd/server-client.crt --key /var/lib/rancher/k3s/server/tls/etcd/server-client.key https://127.0.0.1:2379/version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: python:alpine | |
variables: | |
PIP_CACHE_DIR: $CI_PROJECT_DIR/.cache/pip | |
APK_CACHE_DIR: $CI_PROJECT_DIR/.cache/apk | |
PIP_PACKAGES: | |
mkdocs | |
mkdocs-material | |
mkdocs-git-revision-date-localized-plugin | |
cache: | |
paths: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
for d in `docker ps -a | awk '{print $1}' | tail -n +2`; do | |
d_name=`docker inspect -f {{.Name}} $d` | |
echo "=========================================================" | |
echo "$d_name ($d) volumes:" | |
VOLUME_IDS=$(docker inspect -f "{{.Config.Volumes}}" $d) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import sys | |
from decimal import Decimal | |
from datetime import datetime | |
try: | |
import requests | |
import simplejson as json |
NewerOlder