Skip to content

Instantly share code, notes, and snippets.

View zhiyue's full-sized avatar
🌻
just do it.

zhiyue zhiyue

🌻
just do it.
View GitHub Profile
@noobnooc
noobnooc / cloudflare-worker-proxy.js
Last active June 25, 2024 09:44
cloudflare-worker-proxy
// 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.
{
echo "Loaded kernel extensions:";
kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}';
echo $'\n'"Loaded user agents:";
launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)|\.[0-9]+$/{print $3}';
echo $'\n'"Inserted libraries:";
launchctl getenv DYLD_INSERT_LIBRARIES;
echo $'\n'"User cron tasks:";
crontab -l;
echo $'\n'"System launchd configuration:";
@abersheeran
abersheeran / proxy.worker.js
Last active April 13, 2024 08:45
A proxy download cloudflare worker
addEventListener("fetch", (event) => {
event.respondWith(
handleRequest(event.request).catch(
(err) => new Response(err.stack, { status: 500 })
)
);
});
async function handleRequest(request) {
const url = getUrl(request)
@Lulalaby
Lulalaby / xiaoxiao_tts.py
Created December 3, 2021 00:48 — forked from Dobby233Liu/xiaoxiao_tts.py
superb edit of an old parameterless script
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""Edge Microsoft TTS for Python."""
import sys
from ws4py.client.threadedclient import WebSocketClient
import binascii
import argparse
import json
import requests
import re
@a1994sc
a1994sc / cloudflared.yaml
Created November 9, 2021 03:13
cloudflared - k3s
---
apiVersion: apps/v1
#kind: Deployment
kind: DaemonSet
metadata:
name: cloudflared
namespace: ingress
labels:
group: cloudflare
spec:
@version-control
version-control / Enable UDP RDP Windows
Last active February 2, 2023 13:32
Enable UDP RDP Windows
Admin Priv
VM / Remote Machine
Enable-NetFirewallRule -DisplayName "Remote Desktop - User Mode (TCP-In)"
Enable-NetFirewallRule -DisplayName "Remote Desktop - User Mode (UDP-In)"
Laptop - Local Remote User
Set-ItemProperty 'HKLM:/Software/Policies/Microsoft/Windows NT/Terminal Services/Client' 'fClientDisableUDP' 0
@sxiii
sxiii / resize-sdcard-partitions.md
Last active December 5, 2022 10:48
Resize linux partition that was written by DD or similar instrument to use all available space

Please run the following commands to resize a partition.
IMPORTANT NOTE: Don't forget to change partition address from /dev/sdb2 to your actual partition!
CHANGES ARE DONE IN TWO OR THREE PLACES.
Example below are for /dev/sdb2 partition which is called like "/dev/sdb 2" for growpart
and like "/dev/sdb2" for resize2fs & e2fsck.
Requirements: * growpart; * resize2fs; * e2fsck if disk requires checking.
Install growpart in arch/manjaro: pikaur -S growpart (resize2fs and e2fsck are usually bundled with OS)

sudo growpart /dev/sdb 2
TypeScript 31 hrs 53 mins ██████████████████░░░ 86.2%
JSON 1 hr 8 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.1%
CSS 1 hr 2 mins ▌░░░░░░░░░░░░░░░░░░░░ 2.8%
Lua 1 hr ▌░░░░░░░░░░░░░░░░░░░░ 2.7%
JavaScript 48 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.2%
@blanboom
blanboom / tmcleanup.md
Last active December 3, 2023 07:19 — forked from linjer/tmcleanup.md
Script to automatically remote old Mac OSX Time Machine Backups older than a specified number of days

Prerequisites

  • gfind (via brew install findutils)
  • Time Machine drive mounted on your computer (or you can change path from standard /Volume/Time\ Machine\ Backups/Backups.backup.db/
  • Admin/sudo access in the OSX terminal

Script

  • Be sure to set the correct machine name. You can check the actual folder things are going into by looking in the backup location.
  • By default, it erases all backups older than 30 days. Adjust as desired.
@fanfare
fanfare / gist:d6539fa15ced86811313cb6fb1b0597e
Last active January 18, 2020 03:44
EMERGENCY STYLESHEET TO MAKE GOOGLE RESULTS LOOK LESS MESSED UP
/* warning not yet stable.. messed up on video results pages.. need to fix.. */
div.g .r a {
pointer-events:none
}
div.g a h3 {
pointer-events:all!important
}
div.g h3 {
transform:translateY(-22px) translateX(-1px);