Skip to content

Instantly share code, notes, and snippets.

View ethinx's full-sized avatar
🏠
Working from home

York Wong ethinx

🏠
Working from home
View GitHub Profile
@ethinx
ethinx / lotw-callsign-helper.js
Created June 5, 2025 02:04
make callsign clickable and redirect to qrz.com/db/{callsign}
// ==UserScript==
// @name LOTW QSO Callsign Link
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Convert callsign to QRZ.com link
// @match https://lotw.arrl.org/lotwuser/qsos*
// @grant none
// ==/UserScript==
(function() {
openssl genrsa -out ca.key 4096
openssl req -new -key ca.key -out ca.csr -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CACommonName"
openssl x509 -req -in ca.csr -signkey ca.key -out ca.crt -days 3650
openssl genrsa -out key.pem 4096
openssl req -new -key key.pem -out csr.pem -subj "/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonName"
openssl x509 -req -in csr.pem -CA ca.crt -CAkey ca.key -CAcreateserial -out cert.pem -days 365
@ethinx
ethinx / balancer_cache.js
Created July 18, 2023 06:32
consistent hash based on the _hash within cache ttl
(
(
_balancerArray = new Array(100).fill().map((_,i)=>i++),
_balancer = new algo.RoundRobinLoadBalancer(_balancerArray),
_service = {
cache: new algo.Cache(
()=>_balancer.next(),
null,
{
ttl: 10,
// This example plots a rotated Sprite to the screen using the pushRotated()
// function. It is written for a 240 x 320 TFT screen.
// Two rotation pivot points must be set, one for the Sprite and one for the TFT
// using setPivot(). These pivot points do not need to be within the visible screen
// or Sprite boundary.
// When the Sprite is rotated and pushed to the TFT with pushRotated(angle) it will be
// drawn so that the two pivot points coincide. This makes rotation about a point on the
// screen very simple. The rotation is clockwise with increasing angle. The angle is in
pipy({
_file: null
})
.listen(1080)
.demuxHTTP().to('proxy')
.pipeline('proxy')
.muxHTTP().to(
$=>$.connect(()=>'192.168.66.147:8080')
)
apiVersion: apps/v1
kind: Deployment
metadata:
name: pipy-ok
labels:
app: pipy-ok
spec:
replicas: 1
selector:
matchLabels:
@ethinx
ethinx / dump.sh
Last active June 24, 2024 03:22
dump and init pipy repo
#!/bin/bash
# ./dump.sh http://localhost:6060/repo/ft01/
URL=$1
repo_name=$(basename $URL)
if [ ! -d $repo_name ]
then
mkdir -p $repo_name
@ethinx
ethinx / README
Created March 23, 2023 05:11 — forked from jmatsushita/README
Setup nix, nix-darwin and home-manager from scratch on an M1 Macbook Pro
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs).
# So here's a minimal Gist which worked for me as an install on a new M1 Pro.
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration
#
# Some people are coming directly to this Gist from search results and not the original post[1]. If that sounds like you, you should also know there is a video[2] that accompanies this.
#
# [1] https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834
# [2] https://www.youtube.com/watch?v=KJgN0lnA5mk
#
@ethinx
ethinx / log.txt
Created May 24, 2022 08:23
Unknown CMake command "target_link_options".
[test@loongson1 pipy]$ ./build.sh -s
mkdir: 无法创建目录 “/home/test/pipy/build”: File exists
-- The C compiler identification is Clang 8.0.1
-- The CXX compiler identification is Clang 8.0.1
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
@ethinx
ethinx / titleUrlMarkdownClip.js
Last active October 11, 2021 02:47 — forked from idelem/titleUrlMarkdownClip.js
Bookmarklet to copy current page title and url in Markdown format to clipboard, like [title](url) - Usual for posting links to resources in README.md files
javascript:(function() {
function copyToClipboard(text) {
if (window.clipboardData && window.clipboardData.setData) {
/*IE specific code path to prevent textarea being shown while dialog is visible.*/
return clipboardData.setData("Text", text);
} else if (document.queryCommandSupported && document.queryCommandSupported("copy")) {
var textarea = document.createElement("textarea");
textarea.textContent = text;