Skip to content

Instantly share code, notes, and snippets.

View Ran-Xing's full-sized avatar
💭
I may be slow to respond.

星冉 Ran-Xing

💭
I may be slow to respond.
View GitHub Profile
@Ran-Xing
Ran-Xing / pre-commit.yaml
Created January 6, 2024 05:56
Github Action Commit to PR
name: PR 预处理
on:
push:
branches:
- 'feature/**'
permissions:
pull-requests: write
jobs:
@Ran-Xing
Ran-Xing / cli.yaml
Created January 6, 2024 05:55
Github CICD
name: 编译测试
# 该脚本仅在 PR MERGE 的时候进行测试,不建议 将测试结果上传到 github
# 可以通过变量来判断,比如 PR close 的时候 发布 github release & tag
on:
pull_request:
branches:
- master # 正式版本
types:
- synchronize
@Ran-Xing
Ran-Xing / testNetWork.sh
Last active August 2, 2023 13:36
testNetWork.sh
if curl -s -m 5 -o /dev/null -w "%{http_code}" www.google.com | grep -q "200"; then
echo "true"
else
echo "false"
fi
@Ran-Xing
Ran-Xing / Dockerfile
Created March 22, 2023 12:40
openwrt builder docker lede
FROM ubuntu:20.04
WORKDIR /app
RUN apt-get -qq update \
&& apt-get -qq upgrade \
&& ln -sf "/usr/share/zoneinfo/${TZ}" /etc/localtime \
&& echo "${TZ}" > /etc/timezone \
&& ln -sf "$(which bash)" "$(which sh)" \
&& apt-get -qq full-upgrade \
@Ran-Xing
Ran-Xing / main.go
Created October 15, 2022 02:17
Full platform network test
module testnetwork
go 1.18
require github.com/fatih/color v1.13.0
require (
github.com/mattn/go-colorable v0.1.9 // indirect
github.com/mattn/go-isatty v0.0.14 // indirect
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8 // indirect
@Ran-Xing
Ran-Xing / curl.sh
Created August 14, 2022 16:14
Batch modify github code
TOKEN="ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
USER_NAME="Ran-Xing"
jq '.[].ssh_url' <(curl \
-s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token $TOKEN" \
"https://api.github.com/users/$USER_NAME/repos?type=all&sort=&direction=&per_page=100&page=") \
| grep $USER_NAME
@Ran-Xing
Ran-Xing / change.ps1
Last active November 10, 2022 17:24
Change Remote Desktop Port
$portvalue = 33891
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp' -name "PortNumber" -Value $portvalue
New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Program "%SystemRoot%\system32\svchost.exe" -Profile Any -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvalue
New-NetFirewallRule -DisplayName 'RDPPORTLatest-UDP-In' -Program "%SystemRoot%\system32\svchost.exe" -Profile Any -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp' -name "PortNumber"
@Ran-Xing
Ran-Xing / brew.sh
Last active December 13, 2023 08:11
HomeBrew proxy Install
#!/usr/bin/env bash
/bin/bash -c "$(curl -fsSL https://mirror.ghproxy.com/https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | sed -e "s|https://github.com|https://mirror.ghproxy.com/https://github.com|g;s|https://raw.githubusercontent.com|https://mirror.ghproxy.com/https://raw.githubusercontent.com|g")"
@Ran-Xing
Ran-Xing / TransferGithub.sh
Created May 5, 2022 10:56
Transfer Github Repo To Other Owner
#!/usr/bin/env bash
#set -ex
Owner="$1"
GITHUB_API_TOKEN="$2"
NewOwner=$3
REPOS="$(
curl -s -H "Authorization: token $GITHUB_API_TOKEN" \