Skip to content

Instantly share code, notes, and snippets.

View garywill's full-sized avatar
🌴
This year spending even less time on Github. Will reply but don't expect soon!

Garry W garywill

🌴
This year spending even less time on Github. Will reply but don't expect soon!
View GitHub Profile
@garywill
garywill / app.py
Created November 26, 2023 12:05
gradio
#!/usr/bin/python3.11
import sys, os
os.system('uname -a')
os.system('id')
os.system('cat /etc/os-release')
from datetime import datetime
app_start_time = datetime.now().strftime("%y-%m-%d_%H:%M:%S_%f")
print('App start time: ', app_start_time)
@garywill
garywill / har2csv.py
Last active January 9, 2025 14:57
convert .har (Firefox browser log) to csv
#!/usr/bin/python3
import json
import csv
json_file_text = ""
with open('INPUTHARJSONFILE') as file:
json_file_text = file.read()
j_obj = json.loads(json_file_text)
@garywill
garywill / main.cpp
Created December 18, 2022 12:24
Qt5 log to both stdout/stderr and textEdit with qInfo qDebug etc
#include "mainwindow.h"
#include <QApplication>
#include <QDateTime>
void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg);
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
@garywill
garywill / zypper_history_analyze.txt
Created September 14, 2022 09:20
zypper history file analyze (/var/log/zypp/history)
https://en.opensuse.org/openSUSE:Libzypp_history
第1列 时间
第2列
留 command install remove
去 patch radd rremove (trim)
command:
第3列
root@install 只在第一行,安装系统时
@garywill
garywill / gcc-ver-alternative.sh
Created September 1, 2022 09:14
Switch (manually update alternative) gcc version on openSUSE Linux
#!/bin/bash
CHOOSE_VER=11
cd /usr/bin
declare -a LINK_FILES
LINK_FILES=(
"gcov"
"gcov-dump"

Today I am telling about another multiple-search-engines browser extension BigSearch (source code on Github), which can do more than other similar tools.

Did you know, GET/POST are not enough in browser web search

I - Add some search engines to browser search bar - GET method

Bob wants to add many websites to his browser search bar. Some are added, but the browser search bar supports only GET (HTTP GET)

II - Add more search engines - POST method

@garywill
garywill / get_icloud_filenames.js
Created May 14, 2022 12:06
In iCloud folder view webpage, get currently seen files filenames
var divs = Array.from(
document.querySelectorAll("html.firefox.gecko body div ui-main-pane div.cw-pane-container div div.drive-ui.root.underlay-pane div.tab-content.mouse-style div.navigation div.container div.cw-collection-view.grid.files.cw-list-view.cw-ui-collections-collection-view div div.cw-list-item-view.cw-ui-collections-list-item-view")
);
for (var i=0; i<divs.length; i++) {
var span = divs[i].querySelector("div.body div.title-container div.link.cw-button span.title");
console.log(span.textContent);
}
@garywill
garywill / multiple-search-tool-list.md
Created February 26, 2022 06:00
List / Comparison / Alternatives of open source web searching (multiple search engines) tools

List / Comparison / Alternatives of open source web searching (multi-engines) tools

Here can be outdated. See up-to-date list

Browser Extensions / Addons

Browser addon Web app Build-in engines Categorize engines Search history reuse & manage HTTP POST Websites showing results by Ajax Provide input box User-custom engines Use browser-installed engines Context Menu Search Omnibox Drag to search In-web float panel Use many engines at once Sync settings by browser
Firefox's searchbar - - <10 🟢 ? 🟢 🟠 🟢 🟠 🟢
Big Search 🟢 Cross-browser 🟢 Desktop / Mobile 50+ 🟢 🟢 🟢 🟢 Use web inputbox / button's querySelector 🟢 Multi-line support 🟢 Extra features: 1. Multi-buttons in a engine. 2. Cross-
@garywill
garywill / batch_compress_photo.sh
Last active April 11, 2024 07:03
imagemagick batch compress jpg photo, output to another path. Keep original folder and sub-folders structure. And video (ffmpeg h265)
#!/bin/bash
# 用法 usage:
# shell置于总放照片的目录之上 put this shell in a path containing original photos (photos are here or in subfolders)
# 脚本 目标文件夹 源文件夹1 源文件夹2 源文件夹3 .....
# scriptname <dest> <source1> <source2> <source3> ....
function get_filename_from_path()
{
echo ${1##*/}
@garywill
garywill / fd_w_f.sh
Created November 21, 2018 03:43
bash get fd with temporary file in memory linked
#!/bin/bash
get_fd() {
local x
local tmpfile
local _fd_var=$1
for x in $(seq 10 $(ulimit -n)); do
if [[ ! -a "/proc/$BASHPID/fd/$x" ]]; then
tmpfile=$(mktemp /dev/shm/XXX.tmp)