Skip to content

Instantly share code, notes, and snippets.

View qoopooh's full-sized avatar

Phuchit Kanjanakhan qoopooh

View GitHub Profile
@qoopooh
qoopooh / duckduckgo_cf_luogu.py
Created June 18, 2025 12:09
A Python command-line utility that searches for Luogu (洛谷) articles using DuckDuckGo's search engine. This tool is particularly useful for competitive programming enthusiasts who want to find articles related to specific problems or topics on the Chinese competitive programming platform Luogu.
#!/usr/bin/env python3
"""
Installation:
pip install duckduckgo-search
Usage:
python duckduckgo_cf_luogu.py <keyword>
Example:
python duckduckgo_cf_luogu.py CF1980C
@qoopooh
qoopooh / sd-git-pull.sh
Last active May 20, 2023 00:52
Pull all git repositories when we connect VPN
#!/bin/bash
# Pull all SD repositories
#
SD_PROJS=(
SDAndroidApp
YornameApp
android-screenshot
babel
certbot-service
@qoopooh
qoopooh / grepr
Created August 31, 2022 02:37
Grep recurisve
#! /bin/sh
grep $1 * -R
@qoopooh
qoopooh / du-size.sh
Created August 31, 2022 02:28
Check disk usage in current folder
#!/bin/bash
du -hs * | sort -h > /tmp/du-size
cat /tmp/du-size
cp /tmp/du-size du-size
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get autoremove -y && sudo apt-get autoclean
@qoopooh
qoopooh / batt.sh
Created August 22, 2022 06:28
Check MacBook battery with command line
#! /bin/sh
#
# Check battery on macbook air 2017
#
UNAME=$(uname)
if [ "$UNAME" = "Linux" ]; then
# find a battery
#! /bin/sh
adb shell pm clear com.android.providers.telephony
#adb reboot # optional
@qoopooh
qoopooh / adb-screen
Last active November 6, 2017 09:12
Mac captures Android screen via adb
#! /bin/sh
#
# This is macos script that capturescreen of android devices
# and save the png file on current directory
#
# You can add argument to set file name
# ex. adb-screen pic # output is pic.png
#
if [ $# -eq 0 ]; then
#! /bin/sh
HOST=$1
DATA="$2"
# post $HOST "$DATA"
function post {
curl -iX POST -H 'Content-Type: application/json' -d "$2" $1
}
#!/bin/sh
### BEGIN INIT INFO
# Provides: readcan.sh
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Read can message
# Description: Listen message on can interface channel can0