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 python | |
import socket | |
import threading | |
import select | |
import sys | |
import time | |
import subprocess | |
import os | |
from datetime import datetime |
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
#!/bin/bash | |
set -e | |
# https://llvm.org/docs/Benchmarking.html | |
# https://smalldatum.blogspot.com/2024/10/managing-cpu-frequency-for-amd-on.html | |
# sudo apt install linux-tools-common linux-tools-generic linux-cloud-tools-generic cpuset | |
# disable hyper threading | |
for i in $(seq 16 31); do | |
echo 0 | sudo tee /sys/devices/system/cpu/cpu$i/online |
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
#!/bin/bash | |
set -e | |
# ๆฏ3ๅ้ๅพช็ฏๆฃๆต | |
while true; do | |
running_containers=$(docker ps -q) # ่ทๅๆๆๆญฃๅจ่ฟ่ก็ๅฎนๅจID | |
if [ -z "$running_containers" ]; then | |
echo "ๆฒกๆๆญฃๅจ่ฟ่ก็ๅฎนๅจ๏ผ่ทณๅบๅพช็ฏ" |
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
#!/bin/bash | |
export HTTP_PROXY=http://10.12.190.56:8010 | |
export HTTPS_PROXY=http://10.12.190.56:8010 | |
if [ $# -ne 1 ]; then | |
echo "็จๆณ: $0 <image_name[:tag]>" | |
exit 1 | |
fi |
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 struct | |
import sys | |
def parse_hex_data(file_path): | |
entries = [] | |
try: | |
with open(file_path, 'rb') as f: | |
data = f.read() | |
if len(data) < 4: |
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
#!/bin/bash | |
# creates a symbolic link from bin-x.x to bin | |
# This just strips off last 3 characters when creating a link | |
LLVMFILES=/usr/bin/llvm* | |
CLANGFILES=/usr/bin/clang* | |
LLC=/usr/bin/llc-17 | |
OPT=/usr/bin/opt-17 | |
LLD=/usr/bin/lld-17 |
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 python3 | |
import argparse | |
import smtplib | |
import sys | |
from email.header import Header | |
from email.mime.text import MIMEText | |
from email.utils import parseaddr, formataddr | |
def send_email(from_addr, to_addr, subject, message, smtp_server, smtp_port, username, password, use_ssl): | |
""" |
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
# /etc/systemd/system/frpc.service | |
[Unit] | |
# ๆๅกๅ็งฐ๏ผๅฏ่ชๅฎไน | |
Description = frp client | |
After = network.target syslog.target | |
Wants = network.target | |
StartLimitIntervalSec=0 | |
[Service] | |
Type = simple |
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
#!/bin/bash | |
cd /tmp | |
# argument 1 local url | |
# argument 2 port | |
if [ -z "$1" ]; then | |
echo "Please give the script first argument: IP:port to the http site. Do not add http:// prefix. For example: ./wrap-https.sh 127.0.0.1:7865 5002" | |
exit -1 | |
fi |
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
from multiprocessing import Pool, Manager | |
import os | |
import subprocess | |
import pickle | |
import signal | |
def big_query_info_analysis(arg): | |
res_list, result_queue = arg | |
for res in res_list: | |
key, value = do_something() |
NewerOlder