Skip to content

Instantly share code, notes, and snippets.

View CN-CODEGOD's full-sized avatar
😏
share my thought

CN-CODEGOD

😏
share my thought
View GitHub Profile
@CN-CODEGOD
CN-CODEGOD / md
Created December 9, 2025 12:01
网络vps的ssh卡顿
关于这个问题,我是非常头疼的
因为我搭的节点十分差,不能使用ssh来解决
所以我半路去整了个别的IP结果不是IP问题
是这个线路问题
线路会导致ssh假死卡顿
但是如果你用节点来代理ssh,这个问题会变得十分简单,只需要用vpn来代理这个ssh
@CN-CODEGOD
CN-CODEGOD / ps1
Created October 10, 2025 19:06
powershell key read
for ($i = 0; $i -eq 0) {
#鎸塃nter 鑾峰彇浣犵殑鍏綉IP...
Write-Host "鎸塃nter 鑾峰彇浣犵殑鍏綉IP..."
$x = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
Write-Host "姝e湪鑾峰彇鍏綉IP..."
$ip = (Invoke-WebRequest -Uri "http://ipinfo.io/ip").Content
Write-Host "浣犵殑鍏綉IP鏄? $ip"
}
Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') }
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{
#选择路径
InitialDirectory = [Environment]::GetFolderPath('Desktop')
#filter 后缀
Filter = 'Documents (*.docx)|*.docx|SpreadSheet (*.xlsx)|*.xlsx'
}
$Null = $FileBrowser.ShowDialog()
import-xml 的类存储在整个系统的类,直接在powershell启动时import
还有一种类是环境类。这种类只在程序/模组里启用
pip install pyinstaller
pyinstaller --onefile main.py
# Python 3
python3 -m http.server 8000
1.sudo apt install python3.12-venv
2.python3 -m venv /var/www/server/
利用flask简单做一个API 网页
1.
pip install flask
2.
from flask import Flask
import subprocess
app = Flask(__name__)
npm config set proxy=http://127.0.0.1:7890
@CN-CODEGOD
CN-CODEGOD / gist:e7f65abf875f7476d80cc13546985d89
Created April 22, 2025 09:37
powershell export class from modules
# Define the types to export with type accelerators.
$ExportableTypes =@(
[DefinedTypeName]
)
# Get the internal TypeAccelerators class to use its static methods.
$TypeAcceleratorsClass = [psobject].Assembly.GetType(
'System.Management.Automation.TypeAccelerators'
)
# Ensure none of the types would clobber an existing type accelerator.
# If a type accelerator with the same name exists, throw an exception.