Skip to content

Instantly share code, notes, and snippets.

@sric0880
sric0880 / showdf.bat
Created March 22, 2024 03:20
open dataframe pickle file from double click!
powershell.exe -ExecutionPolicy ByPass -NoExit -Command "& 'C:\ProgramData\Anaconda3\shell\condabin\conda-hook.ps1' ; conda activate 'C:\ProgramData\Anaconda3' " ; python D:\lzq\showdf.py %1 ; pause
#!/bin/bash
mysql -uzabbix -pzabbix -e"
use zabbix;
truncate table history;
optimize table history;
truncate table history_log;
optimize table history_log;
truncate table history_str;
optimize table history_str;
truncate table history_uint;
#!/bin/bash
declare -a bgpids
cleanup() {
for pid in ${bgpids[@]}; do
echo kill $pid
kill $pid
done
}
trap "cleanup" SIGINT SIGTERM
@sric0880
sric0880 / gracefully_quit_multiprocessing_pool.py
Last active June 21, 2024 18:48
interrupt or sigterm multiprocessing pool gracefully
import os
import sys
import time
import signal
from multiprocessing import Pool
def int_handler(signum, frame):
print('(%s) int_handler' % os.getpid())
raise KeyboardInterrupt()
@sric0880
sric0880 / pac
Created June 6, 2019 16:01
代理pac文件
function isMatchProxy(url, pattern) {
try {
return new RegExp(pattern.replace('.', '\\.')).test(url);
} catch (e) {
return false;
}
}
function FindProxyForURL(url, host) {
var Proxy = 'PROXY 127.0.0.1:10800';
@sric0880
sric0880 / master.cfg
Last active July 23, 2017 08:34
change branch master to dev, master is used for github
# -*- python -*-
# ex: set filetype=python:
from buildbot.plugins import *
import subprocess
import re
import os
# This is a sample buildmaster config file. It must be installed as
# 'master.cfg' in your buildmaster's base directory.