Skip to content

Instantly share code, notes, and snippets.

View gomasy's full-sized avatar

Gomasy gomasy

View GitHub Profile
<?php
declare(strict_types=1);
/**
* WebFinger (RFC 7033) — OpenID Connect Issuer Discovery endpoint.
*
* GET https://example.com/.well-known/webfinger?resource=acct:alice@example.com
* -> 200 application/jrd+json
* {"subject":"acct:alice@example.com","links":[{"rel":"...issuer","href":"..."}]}
*
<?php
/**
* Plugin Name: Cloudflare Access SSO
* Description: Cloudflare Access の JWT を検証し、認証済みメールアドレスに対応する WordPress ユーザーへ自動ログインします。
* Version: 2.0.0
* Requires PHP: 7.2
*
* 設置場所: wp-content/mu-plugins/cf-access-sso.php
*
* --- 必須 ---
@gomasy
gomasy / cpuinfo.new.txt
Created March 18, 2026 14:18
さくらのVPS 新/proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 143
model name : Intel Xeon Processor (SapphireRapids)
stepping : 4
microcode : 0x1
cpu MHz : 2000.000
cache size : 16384 KB
physical id : 0
@gomasy
gomasy / cpuinfo.old.txt
Last active March 18, 2026 14:18
さくらのVPS 旧/proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 85
model name : Intel(R) Xeon(R) Gold 6212U CPU @ 2.40GHz
stepping : 7
microcode : 0x1
cpu MHz : 2400.000
cache size : 4096 KB
physical id : 0
@gomasy
gomasy / ndproxy.sh
Last active June 5, 2025 01:35
NDProxy and prefix translation service
#!/bin/sh
SRC_IF=$1
SRC_PREFIX=$2
DST_IF=$3
DST_PREFIX=$4
DST_IF_IP=$(ifconfig $DST_IF | grep $4 | awk '{print $2}')
# インターフェイスの ND Proxy を有効にする
sysctl net.ipv6.conf.$1.proxy_ndp=1 &> /dev/null
-- UNRELATED ACCOUNT ONLY
DELETE FROM statuses WHERE local IS false AND id NOT IN (SELECT status_id FROM status_pins) AND id NOT IN (SELECT status_id FROM favourites) AND id NOT IN (SELECT status_id FROM bookmarks) AND id NOT IN (SELECT id FROM statuses WHERE id IN (SELECT reblog_of_id FROM statuses WHERE reblog_of_id IS NOT NULL AND (account_id <= 10 OR account_id IN (SELECT target_account_id FROM follows WHERE account_id <= 10)))) AND id NOT IN (SELECT activity_id FROM notifications WHERE type = 'reblog') AND id NOT IN (SELECT status_id FROM mentions WHERE id IN (SELECT activity_id FROM notifications WHERE type = 'mention')) AND account_id NOT IN (SELECT target_account_id FROM follows WHERE account_id <= 10) AND created_at < '';
-- ALL
DELETE FROM statuses WHERE local IS false AND id NOT IN (SELECT status_id FROM status_pins) AND id NOT IN (SELECT status_id FROM favourites) AND id NOT IN (SELECT status_id FROM bookmarks) AND id NOT IN (SELECT id FROM statuses WHERE id IN (SELECT reblog_of_id FROM statuses
@gomasy
gomasy / tailscaled
Last active May 4, 2024 00:20
Test implementation of /etc/init.d/tailscaled
#!/bin/bash
#
# tailscaled Start up the Tailscale server daemon
#
# description: A mesh VPN that makes it easy to connect your devices, wherever they are.
#
# processname: tailscaled
### BEGIN INIT INFO
# Provides: tailscaled
diff --git a/configure.ac b/configure.ac
index 82e8bb7..a431e05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4870,6 +4870,30 @@ AC_SUBST([GSSLIBS])
AC_SUBST([K5LIBS])
AC_SUBST([CHANNELLIBS])
+# Check whether user wants systemd support
+SYSTEMD_MSG="no"
package main
import (
"bufio"
"fmt"
"log"
"net"
"strconv"
"golang.org/x/text/transform"
.status__wrapper .status {
padding: 8px 10px 8px 8px;
}
.status__wrapper .status__content {
line-height: 20px;
margin-left: 56px;
margin-top: -34px;
}