This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests, re | |
filename='Books.txt' | |
def gzlib(q): | |
url=f'https://opac.gzlib.org.cn/opac/search?q={q}&searchWay=title' | |
response = requests.get(url) | |
bookrecno = set(re.findall(r'bookDetail\((\d+)', response.text)) | |
if len(bookrecno) == 1: | |
bookrecno = bookrecno.pop() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re, requests | |
from lxml import html | |
url = 'https://support.juniper.net/support/eol/software/junos/' | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3' | |
} | |
response = requests.get(url, headers=headers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function clickButton() { | |
const button = document.querySelector('.oui-savant__Panel--Footer .oui-button-primary') | |
if (button) { | |
button.click(); | |
console.log('Button clicked successfully at ' + new Date().toLocaleTimeString()); | |
} else { | |
console.log('Button not found - check if .divclass .buttonclass exists'); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tshark -r xyz.pcapng -Y "tcp.port != 445" -T fields -e tcp.stream -e frame.time_relative -e ip.src -e ip.dst -e _ws.col.info | sort -V | awk 'BEGIN { | |
prev = 0; | |
count = 0; | |
} { | |
buffer[NR % 11] = $0; | |
if ($1 != prev) { | |
for (i = NR-count; i<NR; i++) | |
print buffer[i % 11]; | |
print ""; | |
prev = $1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'> | |
<!-- ... --> | |
<qemu:commandline> | |
<qemu:arg value='-acpitable'/> | |
<qemu:arg value='file=/some/path/slic.bin'/> | |
<qemu:arg value='-acpitable'/> | |
<qemu:arg value='file=/some/path/msdm.bin'/> | |
<qemu:arg value='-smbios'/> | |
<qemu:arg value='file=/some/path/smbios_type_0.bin'/> | |
<qemu:arg value='-smbios'/> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hashlib, os, sqlite3, sys | |
con = sqlite3.connect("hash.db") | |
cur = con.cursor() | |
cur.execute("delete from files") | |
for root, dirs, files in os.walk(sys.argv[1]): | |
for file in files: | |
filename = root + "/" + file | |
with open(filename, 'br') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
;; babashka/clojure | |
(import 'java.security.MessageDigest) | |
(def SCAN_DIRS ["."]) | |
(def MIN_FILE_SIZE (* 1)) | |
(def SHA256_CHUNK_SIZE (* 1024 8)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[02/22/2025] | |
Refs: | |
1. http://mirror.cs.pitt.edu/archlinux/iso/2023.09.01/archlinux-bootstrap-2023.09.01-x86_64.tar.gz | |
2. https://dl-cdn.alpinelinux.org/alpine/v3.18/releases/x86_64/alpine-virt-3.18.0-x86_64.iso | |
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely | |
4. https://www.debian.org/releases/bookworm/amd64/apds03.en.html | |
See also: | |
1. Convert to Debian https://gist.github.com/zengxinhui/ee0ad6b7c7f99e2ead6cd0d2bd6641fd |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$usageQueue = @() | |
while ($true) { | |
$currentDateTime = Get-Date -Format "yyyy-MM-dd HH:mm:ss" | |
$cpuUsage = Get-Counter '\Processor(_Total)\% Processor Time' | |
$cpuUsageValue = $cpuUsage.CounterSamples.CookedValue | |
$usageQueue += $cpuUsageValue | |
if ($usageQueue.Count -eq 13) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[02/25/2025] | |
Refs: | |
1. http://os.archlinuxarm.org/os/ArchLinuxARM-aarch64-latest.tar.gz | |
2. https://dl-cdn.alpinelinux.org/alpine/v3.21/releases/aarch64/alpine-virt-3.21.3-aarch64.iso | |
3. https://wiki.alpinelinux.org/wiki/Replacing_non-Alpine_Linux_with_Alpine_remotely | |
4. https://wiki.archlinux.org/index.php/installation_guide#Configure_the_system | |
5. https://archlinuxarm.org/platforms/armv8/generic | |
See also: |
NewerOlder