Skip to content

Instantly share code, notes, and snippets.

View xinyangli's full-sized avatar

Xinyang Li xinyangli

View GitHub Profile
@xinyangli
xinyangli / exiftool.sh
Created March 22, 2023 06:11
Exiftool Cheetsheet
#/bin/sh
# View EXIF
exiftool -all:all <filename>
exiftool -xmp:all <filename> # view information in embedded xmp
# Move file according to capture date
exiftool -if '$datetimeoriginal ge "2023:03:17 00:00:00"' -'FileName<filename' -o <outdir>
# Export ratings to sidecar xmp
@xinyangli
xinyangli / time_based.py
Last active May 6, 2023 08:48
Time-based SQL injection with grequests
import grequests
import requests
from tqdm import tqdm
from urllib3 import Retry
import random
from parse import parse
class ProgressSession():
def __init__(self, urls):
self.pbar = tqdm(total = len(urls), desc = 'Making async requests')
@xinyangli
xinyangli / markdown_gen.sh
Last active November 13, 2023 05:26
Generate a markdown file that presents a table grid of all PNG images in the current directory,
#!/bin/bash
md_filename="vis.md"
cnt=0
echo "| | | | |" >> $md_filename
echo "|-|-|-|-|" >> $md_filename
for file in $(ls | grep png)
do
printf "| ![$file](./$file) &#10; $file" >> $md_filename;
import json
from collections import Counter
SAS = "" # e.g sp=r&st=...
with open("canva.benchmark.json", "r") as f:
data = json.load(f)
print("""
<html>
from diffusers import DiffusionPipeline
from transformers import CLIPTokenizer
import torch
import os
tokenizer = CLIPTokenizer.from_pretrained(
"stabilityai/stable-diffusion-xl-base-1.0", subfolder="tokenizer", device_map="auto"
)
# load both base & refiner
base = DiffusionPipeline.from_pretrained(
import cv2
import json
import math
import random
from io import BytesIO
import numpy as np
import os
import concurrent.futures
import argparse
import pandas as pd
@xinyangli
xinyangli / speedtest-cn.json
Created May 6, 2024 07:30
Speedtest mainland china servers
[
{
"id": 1,
"name": "ustc_ipv4",
"server": "http://test.ustc.edu.cn/backend/",
"dlURL": "garbage.php",
"ulURL": "empty.php",
"pingURL": "empty.php",
"getIpURL": "getIP.php"
},
@xinyangli
xinyangli / userChrome.css
Created August 11, 2024 02:19 — forked from BrianGilbert/userChrome.css
Firefox userChrome to autohide Sideberry panel and hide titlebar tabs, and autohide Page Actions.
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/*
* This style will hide the tab bar. For MacOS Big Sur
*
* Contributor(s): Isaac-Newt, Ivan0xFF, millerdev, AMomchilov
*/