Skip to content

Instantly share code, notes, and snippets.

View pansila's full-sized avatar

Lix Zhou pansila

View GitHub Profile
@pansila
pansila / aarch53.cfg
Last active April 17, 2024 02:12
openocd script for debug aarch53
adapter driver jlink
set _CHIPNAME xxxxx
set _DAP_TAPID 0x6BA00477
adapter speed 10000
transport select jtag
bindto 0.0.0.0
reset_config trst_and_srst
telnet_port 4444
gdb_port 2331
# create tap
@pansila
pansila / check_ieee802111_ie.py
Created February 2, 2024 00:47
A scaffold script to check ieee80211 sniffer trace for specified IEs
##!/usr/bin/env python3
import os
import sys
import argparse
import random
from pathlib import Path
from multiprocessing import Pool
import gzip
from scapy.all import *
@pansila
pansila / create-service.sh
Created January 24, 2024 14:38
helper script to create a simple systemd service
#!/usr/bin/env bash
# Check for help flag
if [ "$1" == "-h" ] || [ "$1" == "--help" ]
then
echo "Create a systemd service file"
echo "Usage: ./create-service.sh -s <service name> -c <command> -w <working directory> -E <run service at startup>"
exit 0
fi
@pansila
pansila / update_geodb.py
Last active December 29, 2023 12:30
helper to download v2ray daily updated rules
#-*- coding: UTF-8 -*-
import os
import sys
import time
import logging
import socket
import urllib.request
import base64
import hashlib
import tempfile
@pansila
pansila / cut.py
Last active December 14, 2023 08:57
cut large file, faster than system's cut by seeking to the target position instead of by chars or lines
#!/usr/bin/env python3
import os, sys
import argparse
try:
from tqdm import tqdm
except ModuleNotFoundError:
def tqdm(it):
return it
@pansila
pansila / main.ahk
Created October 3, 2023 11:23
my autohotkey script
#\::{
SendMessage 0x0112, 0xF140, 0, , "Program Manager"
Sleep 1000
SendMessage 0x0112, 0xF170, 2, , "Program Manager"
}
#+p::run "shutdown.exe /r /fw /t 0" ; reboot to bios
#+r::run "explorer.exe ::{645FF040-5081-101B-9F08-00AA002F954E}" ; Recycle bin
#+s::run "explorer.exe shell:startup"
@pansila
pansila / BingWallpaper.py
Last active June 9, 2023 14:18
Yet another Bing Wallpaper updater, support super resolution. You can run it manually or automatically by Task Scheduler, adding the appropriate triggers, like "At log on", "At startup", "On workstation unlock", etc.
#-*- coding: UTF-8 -*-
import sys
import time
import urllib.request
import urllib.error
import ctypes
import logging
import argparse
import datetime
@pansila
pansila / list_by_size.py
Created April 16, 2022 14:27
List all Git repository objects by size
import subprocess
from tqdm import tqdm
files = []
commitSHA1 = subprocess.check_output(['git', 'rev-list', '--all'], text=True)
for c in tqdm(commitSHA1.splitlines()):
files.extend(subprocess.check_output(['git', 'ls-tree', '-r', '--long', c], text=True).splitlines())
@pansila
pansila / huorong.json
Created February 9, 2022 13:38
一个火绒的防止流氓软件安装的规则
{
"ver":"5.0",
"tag":"hipsuser",
"data":[
{
"id":54,
"power":1,
"name":"禁垃圾软件",
"procname":"*",
"treatment":3,
@pansila
pansila / cnn_10_maker.py
Last active May 22, 2021 08:06
Download srt and video file from CNN offical website for subs2srs to make Anki cards.
import os
import sys
import argparse
import requests
import shutil
from bs4 import BeautifulSoup
from urllib.parse import urlparse
from vtt_to_srt import vtt_to_srt
OUTPUT_DIR = 'output'