Skip to content

Instantly share code, notes, and snippets.

@rainly
rainly / config_git_use_proxy.md
Created October 27, 2025 08:02 — forked from wgzhao/config_git_use_proxy.md
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@rainly
rainly / word_to_card.py
Created October 27, 2025 08:01 — forked from wgzhao/word_to_card.py
把单词列表转为单写默写卡
"""
单词默写表格生成小工具
读取包含了单词以及中文释义两列的 Excel 文件(也可以是 csv 文件)
然后按照 A4 纸大小排列可这翻折的单词默写表格形式
每页 48 个单词,每个单词都需要默写中文释义以及中文对应的单词
"""
import pandas as pd
import openpyxl
from openpyxl.styles import Alignment, Border, Side
from openpyxl.worksheet.page import PageMargins
@rainly
rainly / configuration.nix
Created May 9, 2025 10:41 — forked from hemashushu/configuration.nix
NixOS configuration reference 2025-05
# Edit this configuration file to define what should be installed on
# your system. Help is available in the configuration.nix(5) man page
# and in the NixOS manual (accessible by running ‘nixos-help’).
{ config, pkgs, lib, ... }:
{
imports = [
# Include the results of the hardware scan.
./hardware-configuration.nix
@rainly
rainly / cleanup_weixin.py
Created August 26, 2024 03:32 — forked from shell909090/cleanup_weixin.py
清理微信公众号链接,用法:python3 cleanup_weixin.py -c == pbpaste | python3 cleanup_weixin.py -i | pbcopy
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'''
@date: 2024-07-22
@author: Shell.Xu
@copyright: 2024, Shell.Xu <[email protected]>
@license: BSD-3-clause
'''
import sys
import argparse
@rainly
rainly / 01.bash_shortcuts_v2.md
Created February 6, 2023 12:51 — forked from tuxfight3r/01.bash_shortcuts_v2.md
Bash keyboard shortcuts

Bash Shortcuts

visual cheetsheet

Moving

command description
ctrl + a Goto BEGINNING of command line
@rainly
rainly / nokia-router-cfg-tool.py
Created May 7, 2022 14:56 — forked from thedroidgeek/nokia-router-cfg-tool.py
Nokia/Alcatel-Lucent router backup configuration tool
#!/usr/bin/env python3
#
# Nokia/Alcatel-Lucent router backup configuration tool
#
# Features:
# - Unpack/repack .cfg files generated from the backup and restore functionnality
# in order to modify the full router configuration
# - Decrypt/encrypt the passwords/secret values present in the configuration
@rainly
rainly / download_talebook.sh
Created April 3, 2022 17:04 — forked from syhily/download_talebook.sh
Download all the books from a talebook website. The https://curl.se/ and https://stedolan.github.io/jq/ are required for using this script.
#!/usr/bin/env bash
# Download metadata, modify these as your needs.
## The directory to save the downloaded files.
download_directory="/volume1/Download/EPUB"
## The website you want to visit.
calibre_site="http://soulseeker.myds.me:25788"
## The formats you want to download. We only download the first present format.
## All the formats should be upper case.
allow_formats=( EPUB MOBI AZW3 )
@rainly
rainly / sunlogin.sh
Created March 17, 2022 07:40 — forked from chenshaoju/sunlogin.sh
auto enable/start sunlogin services and running, disable/stop services when exit sunlogin.
#!/usr/bin/sudo bash
#
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
systemctl enable runsunloginclient.service
systemctl start runsunloginclient.service
# change USERNAME to your current non-root username
sudo -u USERNAME /usr/local/sunlogin/bin/sunloginclient &
0.In my 0th vps (for example Oracle Cloud free tier VPS, ubuntu 20.04, it allow me to create 2 free vps servers):
sudo apt install tailscale(ref: https://tailscale.com/kb/1039/install-ubuntu-2004/)
sudo tailscale up //copy the showed url and authorize google sign-in in the web browser
ip addr show tailscale0 //for example: 100.71.153.9
1. In my 1st vps(in china, for example my linux PC in my home):
sudo apt install tailscale
sudo sysctl net.ipv4.conf.all.forwarding=1
sudo tailscale up --advertise-exit-node --accept-dns=false //copy the showed url and authorize google sign-in in the web browser
//"--advertise-exit-node" to advertise this vps as exit node, "--accept-dns=false" to avoid global dns settings overwriting /etc/resolv.conf in exit node
@rainly
rainly / gist:18a93beae7cd0386a174ac4bd89af3b6
Created April 28, 2021 10:44 — forked from chenshaoju/for_new_version.txt
Oneplus 5T OxygenOS bloatware cleanup.
cd /system/app/
rm -rf Account
rm -rf card
rm -rf Drive
rm -rf Duo
rm -rf GooglePay
rm -rf Gmail2
rm -rf Maps
rm -rf Music2
rm -rf NVBackupUI