Skip to content

Instantly share code, notes, and snippets.

@laixintao
laixintao / decent_request.py
Last active January 18, 2025 08:12
Send HTTP requests using python-requests with timeout, tcp reuse(session) and retry.
from requests.adapters import HTTPAdapter, Retry
from requests import Session
retries = Retry(
total=5, backoff_factor=1, status_forcelist=[502, 503, 504]
)
session = Session() # reuse tcp connection
session.mount("http://", HTTPAdapter(max_retries=retries))
session.mount("https://", HTTPAdapter(max_retries=retries))
@Natetronn
Natetronn / directus-flow-for-mulitple-unique-indexes.md
Last active July 5, 2024 22:10
Directus Flow for Multiple Unique Indexes

Directus Flow for Multiple Unique Indexes

Context:

  • owners collection

  • sellers collection

  • countries collection

@oasisfeng
oasisfeng / verify_google_ips.sh
Created April 28, 2023 16:29
Shell script to verify connectable Google IPs
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <IP>[/subnet]"
exit 1
fi
for ip in $(nmap -sL $1 | awk '/Nmap scan report/{print $NF}'); do {
ip=$(echo $ip | tr -d '()')
output=$(curl --connect-to :443:$ip:443 --connect-timeout 5 --verbose --head https://www.google.com.hk 2>&1)

Install Android SDK CLI Ubuntu 20.04 WSL2 (Work in Progress)

Install Java 8

sudo apt install openjdk-8-jdk-headless

Android SDK

@awerlang
awerlang / README
Last active June 24, 2024 15:50
A zypper wrapper that maximizes network throughput
zypper-download
===============
Downloads packages using any amount of available openSUSE mirrors.
Installation
------------
Copy both files to the following locations:
@larsenv
larsenv / pbskids.py
Last active February 5, 2025 16:30
PBS Kids Video Downloader
import json
import requests
import subprocess
import re
home = requests.get("https://content.services.pbskids.org/v2/kidspbsorg/home/").text
home = json.loads(home)
shows = {}
episodes = {}
@domaingood
domaingood / cloudflare_batch.php
Created February 4, 2020 17:40 — forked from thiagotalma/cloudflare_batch.php
Cloudflare Batch Edit
<?php
// Form a list of all CF IP zones
// For each zone, grab all A records and TXT records matching $oldip
// For each matching record, update it to the new IP address
// Does not deal with paginated zone results so there's currently
// a maximum of 50 zones managed by this tool
$authemail = "YOU @ YOUR EMAIL . COM";
$authkey = "YOUR CLOUDFLARE API KEY";
@himself65
himself65 / undefined
Last active May 24, 2021 07:33
Weibo
Pin 完善低龄未成年人犯罪规定
1 何炅 419151
2 买到核酸阳性食品是否会被传染 259536
3 迪丽热巴 黄景瑜 171031
4 英国疫情 113204
5 郭德纲 不收女徒弟是因为尊重 108208
6 有翡 103028
7 顶楼 71276
8 伦敦 63130
9 送你一朵小红花预售破5000万 58755
@epcim
epcim / kubernetes_pods_docker_disk_usage.md
Last active February 20, 2025 20:07
docker disk space introspection kubernetes docker overlay

identify big pods/containers

investigage big files

DST=/mnt
find /var/lib -type f -size +1G -exec ls -lh {} \; | tee  $DST/bigfiles_var_lib_$(date "+%H%M").log
find /var/lib -type f -size +1G -exec ls -lh {} \; | awk '{ print $5 ": " $9 }' | sort -rh > $DST/bigfiles_var_lib_$(date "+%H%M").sorted.log

misbehave processes