Skip to content

Instantly share code, notes, and snippets.

View bohanyang's full-sized avatar

Brent Yang bohanyang

  • Osaka, Japan
  • 15:22 (UTC +09:00)
  • X @brentybh
View GitHub Profile
@bohanyang
bohanyang / docker-compose.yml
Created July 5, 2023 13:57
PostgREST JWKS
services:
jwks-updater:
image: jwks-updater
build:
context: .
dockerfile: ./jwks-updater.Dockerfile
depends_on:
postgres: # Disable this if you are using an external Postgres database
condition: service_healthy
postgrest:
@bohanyang
bohanyang / README.md
Last active September 26, 2022 07:31
Debug with dump() in Blesta

1. Install symfony/var-dumper

php7.4 "$(command -v composer)" require symfony/var-dumper

2. Save debug.php to lib/debug.php

wget -O lib/debug.php 'https://gist.github.com/bohanyang/4d468bd9000d2babbbb7774bd49cb3ed/raw/debug.php'
@bohanyang
bohanyang / for-dualstack.network.ini
Last active May 13, 2024 04:47
systemd-networkd WireGuard configuration of Cloudflare Wrap
[Match]
Name = wg0
[Network]
Address = 172.16.0.2/32
Address = fd01:5ca1:ab1e:8012:3456:789a:bcde:f012/128
[Route]
Gateway = 0.0.0.0
Table = 51820
@bohanyang
bohanyang / repo.sh
Last active November 7, 2021 09:09
#!/bin/sh
# shellcheck shell=dash
set -eu
os_release=
add() {
local repo
repo=$1
<?php
namespace App\EventSubscriber;
use Doctrine\DBAL\Event\ConnectionEventArgs;
use Doctrine\DBAL\Event\Listeners\OracleSessionInit;
class OracleSessionInitSubscriber extends OracleSessionInit
{
public function postConnect(ConnectionEventArgs $args)
@bohanyang
bohanyang / pecl.sh
Last active December 12, 2021 08:57
The proper way to install a PHP extension
#!/bin/bash
set -eu
ver=8.1
api_ver=20210902
sapi=cli
ext=$1
ext_ver=$2
prio=30
param (
[Parameter(Mandatory=$true)][string]$zip,
[string]$dir = "$HOME\Python"
)
if (Test-Path $dir) {
Remove-Item $dir
}
New-Item -Path $dir -ItemType Directory -Force
@bohanyang
bohanyang / README.md
Last active September 14, 2022 13:06
一键生成 CSR

一键生成 CSR

  • 极少见地支持 Windows 下的 Git Bash(MinGW/MSYS)
  • 支持 RSA 和 ECDSA
  • 支持使用已有私钥
  • 支持生成 PKCS #8 格式私钥(-----BEGIN PRIVATE KEY-----
  • 支持自定义 Subject DN(Distinguished Name,如 /C=AU/ST=Some-State/O=Internet Widgits Pty Ltd/CN=example.com
  • 支持不带 CN(Common Name)字段的 Subject DN
  • 支持空白 Subject DN
  • 支持 OCSP Must-Staple
select disk 0
clean
convert gpt
create partition efi size=260
format quick fs=fat32
create partition msr size=16

Keybase proof

I hereby claim:

  • I am bohanyang on github.
  • I am bohanyang (https://keybase.io/bohanyang) on keybase.
  • I have a public key whose fingerprint is DE42 2FCD 0794 F965 4764 04E4 D5E8 04D3 9116 3933

To claim this, I am signing this object: