Skip to content

Instantly share code, notes, and snippets.

View RealTong's full-sized avatar
♥️
Coding with love.

RealTong RealTong

♥️
Coding with love.
View GitHub Profile
@RealTong
RealTong / fix-chinese.sh
Created March 20, 2024 16:30
Using Raycast scripts fix chinese
#!/usr/bin/env bash
# Add spaces between Chinese and English, number or symbols.
#
# Dependency: This script requires the `https://www.npmjs.com/package/pangu` package.
# Install it via `pip install pangu` or `pnpm install -g pangu` or `npm install -g pangu`.
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title Fix Chinese
@RealTong
RealTong / install-singbox.py
Created March 18, 2024 05:58
Install Singbox script for python
import os
import subprocess
import tarfile
import json
SING_BOX_DIR = "/root/sing-box"
CERTS_DIR = "/root/certs"
DOMAIN = "sjc.realtong.cn"
HYSTERIA2_PORT = 18090
TROJAN_PORT = 18082
@RealTong
RealTong / traffic-to-discord.py
Created March 3, 2024 07:26
将流量使用情况发送到 Discord
import requests
import psutil
import datetime
import pytz
# Discord Webhook URL
WEBHOOK_URL = 'https://discord.com/api/webhooks/'
# Your timezone
YOUR_TIMEZONE = 'Asia/Shanghai'
@RealTong
RealTong / copy-captcha-from-mail.py
Created March 2, 2024 06:01
从 Mail.app 中拷贝验证码
#!/usr/bin/env python3
# Copy the verification code from Mail.
#
# Dependency: This script requires the `emlx` package.
# Install it via `pip install emlx`.
#
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title CaptchaFromMail
@RealTong
RealTong / network-status.sh
Created March 2, 2024 05:57
show network status in Raycast
#!/bin/bash
# Required parameters:
# @raycast.schemaVersion 1
# @raycast.title SSID Name
# @raycast.mode inline
# @raycast.refreshTime 1m
# Optional parameters:
# @raycast.icon 🛜
@RealTong
RealTong / screen-checkpoint.js
Created February 18, 2024 15:57
TailwindCSS-screen-checkpoint plugin
module.exports = function ({ addComponents, theme }) {
const screens = theme('screens')
const ignoredScreens = theme('debugScreens.ignore', ['dark'])
const selector = theme('debugScreens.selector', '.debug')
const components = {
[`${selector}::before`]: Object.assign({
position: 'fixed',
zIndex: '50',
width: 6,
height: 6,
@RealTong
RealTong / get_fingerprint.sh
Created February 18, 2024 11:18
获取证书指纹
openssl x509 -noout -fingerprint -sha256 -inform pem -in your.pem
@RealTong
RealTong / check_gpu.py
Created February 18, 2024 07:26
检测 GPU 是否可用
检测GPU是否可用
python
>>> import torch
>>> torch.cuda.is_available()
True
>>> torch.cuda.current_device()
0
>>> torch.cuda.get_device_name(0)
'NVIDIA GeForce RTX 3090'
>>>
@RealTong
RealTong / fix-macos-to-iphone-clipboard-not-work.sh
Last active February 18, 2024 07:21
修复 macOS 和 iPhone 剪切板不工作
sudo update_dyld_shared_cache -force
@RealTong
RealTong / send_traffic_to_telegram.sh
Last active February 17, 2024 03:43
发送接口流量使用信息到 Telegram
#!/bin/bash
network_interface=ens5
bot_token=""
user_id=""
traffic=$(vnstat -m $network_interface | grep "estimated" | awk '{print $8}')
unit=$(vnstat -m $network_interface | grep "estimated" | awk '{print $9}')
curl -s -X POST "https://api.telegram.org/bot$bot_token/sendMessage" \