Skip to content

Instantly share code, notes, and snippets.

@wastee
wastee / main.py
Created March 5, 2024 16:02 — forked from stewartadam/main.py
Simple Python proxy server based on Flask and Requests with support for GET and POST requests.
"""
A simple proxy server, based on original by gear11:
https://gist.github.com/gear11/8006132
Modified from original to support both GET and POST, status code passthrough, header and form data passthrough.
Usage: http://hostname:port/p/(URL to be proxied, minus protocol)
For example: http://localhost:5000/p/www.google.com
"""
import re
@wastee
wastee / Colorful X16Pro Laptop (AKA Clevo PExxRNx) Linux Tips.md
Last active November 1, 2023 08:32
Colorful X16Pro Laptop (AKA Clevo PExxRNx) Linux Tips

Everything works out of the box on Arch Linux, but there are some tweaks and tips you might find useful.

Sound Card

If you encounter issues with your sound card (no sound), you can create a file with any name (e.g., alsafix.conf) in the directory /etc/modprobe.d/. The full path is /etc/modprobe.d/alsafix.conf.

Next, add the following line to this file: options snd-hda-intel model=clevo-p950, and then reboot your system. This should resolve the problem.

Fan and Keyboard Lights

@wastee
wastee / you-get-retry.sh
Created February 10, 2022 06:07 — forked from able8/you-get-retry.sh
下载出错,就重新执行下载。在bilibili下载时,经常会出错下载中断,需要重新运行命令才行。该脚本可以自动重试下载,直到下载完成后结束。
#!/bin/bash
url='https://www.bilibili.com/video/av17981530'
# 一行写法
while true; do you-get $url && { echo ok完成; break; } || { echo err出错,重试; sleep 5; }; done
while true; do you-get $url --playlist && { echo ok完成; break; } || { echo err出错,重试; sleep 5; }; done
@wastee
wastee / 视频去重.ipynb
Created October 19, 2021 06:57
使用 FFmpeg 和 Python,根据视频内容来找出重复的视频
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@wastee
wastee / add fx & click.lua
Created September 28, 2021 00:24
REAPER 使用 reascript 添加 fx + 点击 fx 窗口示范
-- fx_name 为 vst 文件名字,避免 vst 和 vst3 重名
fx_name = "Ozone 9 Match EQ.dll"
-- fx_name_query 为用于查询有无添加,查询不能写 vst 文件名字
fx_name_query = "Ozone 9 Match EQ"
-- 按钮的坐标
button_x = 685
button_y = 385
-- 播放的秒数
@wastee
wastee / hide_window_titlebar.sh
Created July 31, 2021 15:01
Hide window title bar by name in X11.
#!/bin/bash
# regex for extracting hex id's
grep_id='0[xX][a-zA-Z0-9]\{7\}'
xprop -spy -root _NET_ACTIVE_WINDOW | grep --line-buffered -o $grep_id |
while read -r id; do
win_title="`xprop -id $id | awk '/_NET_WM_NAME/ {print $3$4$5; exit;}' `"
if [ -n "$id" ] && [ -n "$win_title" ]; then
if [[ $win_title =~ "Kate" ]]; then
xprop -id $id -f _MOTIF_WM_HINTS 32c -set _MOTIF_WM_HINTS "0x2, 0x0, 0x0, 0x0, 0x0"
import os
import subprocess
import datetime
import tarfile
# 备份路径
NGINX_DIR = '/etc/nginx'
WEB_DIR = '/var/www'
SUPERV_DIR = '/etc/supervisor'
LETS_DIR = '/etc/letsencrypt'
@wastee
wastee / empty items to subtitle track.py
Created January 14, 2021 01:42
REAPER自动化字幕生成脚本
import os
import re
import uuid
from reaper_python import *
from pathlib import Path
RPR_Undo_BeginBlock()
RPR_ClearConsole()
@wastee
wastee / update_linvst_files.py
Created December 23, 2018 06:04
use it when you upgraded linvst
from shutil import copy
from glob import glob
from os import remove
# Original linvst.so file
ori_file = '/usr/lib/vst/linvst.so'
# IMPORTANT
# your wine vst folder
# delete this value and fill in
@wastee
wastee / show fx from receive.py
Created July 8, 2018 09:29
reascript show fx from receive. need sws.
from reaper_python import *
from sws_python import *
import sys
sys.argv=["Main"]
def msg(m):