Skip to content

Instantly share code, notes, and snippets.

View alchen99's full-sized avatar

Alice Chen alchen99

View GitHub Profile
@alchen99
alchen99 / itstool.rb
Last active December 3, 2025 07:01
Fixed icu4c dependency in Itstool Homebrew formula
class Itstool < Formula
desc "Make XML documents translatable through PO files"
homepage "https://itstool.org/"
url "https://files.itstool.org/itstool/itstool-2.0.7.tar.bz2"
sha256 "6b9a7cd29a12bb95598f5750e8763cee78836a1a207f85b74d8b3275b27e87ca"
license "GPL-3.0-or-later"
revision 2
livecheck do
url "https://itstool.org/download.html"
class PgCron < Formula
desc "Run periodic jobs in PostgreSQL 17"
homepage "https://github.com/citusdata/pg_cron"
url "https://github.com/citusdata/pg_cron/archive/refs/tags/v1.6.7.tar.gz"
sha256 "d950bc29155f31017567e23a31d268ff672e98276c0e9d062512fb7870351f03"
license "PostgreSQL"
bottle do
rebuild 1
sha256 cellar: :any, arm64_tahoe: "09735afcd85669a8b3c460864d987b45a85efa861b23d13d091d0a3044b9d65e"
{
"apps": [
{
"id": "io.ente.photos.independent",
"url": "https://github.com/ente-io/ente",
"author": "ente-io",
"name": "Ente Photos",
"installedVersion": "photos-v1.0.0",
"latestVersion": "photos-v1.0.0",
"apkUrls": "[[\"ente-photos-v1.0.0.apk\",\"https://api.github.com/repos/ente-io/ente/releases/assets/240872214\"]]",
@alchen99
alchen99 / retain-local-path-sc.yaml
Created April 4, 2025 23:24
Rancher local-path StorageClass with reclaimPolicy of Retain
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: n8n-local-path
provisioner: rancher.io/local-path
parameters:
pathPattern: "{{ .PVC.Namespace }}/{{ .PVC.Name }}"
volumeBindingMode: WaitForFirstConsumer
reclaimPolicy: Retain
@alchen99
alchen99 / k8-dashboard.user.yaml
Created February 24, 2025 21:12
Kubernetes Dashboard User
apiVersion: v1
kind: ServiceAccount
metadata:
name: admin-user
namespace: kubernetes-dashboard
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: admin-user
@alchen99
alchen99 / k8-dashboard.values.yaml.tmpl
Last active February 24, 2025 21:11
Kubernetes Dashboard v7 Helm values
app:
ingress:
enabled: true
hosts:
# Keep 'localhost' host only if you want to access Dashboard using 'kubectl port-forward ...' on: https://localhost:8443
# - localhost
# - kubernetes.dashboard.domain.com
- HOSTNAME
ingressClassName: nginx
issuer:
@alchen99
alchen99 / ingress-nginx-custom-error.yaml
Created January 10, 2025 05:35
ConfigMap of custom errors for ingress-nginx
# Custom error page configMap
---
apiVersion: v1
kind: ConfigMap
metadata:
name: custom-error-pages
data:
404: |
<!DOCTYPE html>
<html>
@alchen99
alchen99 / ingress-nginx-values.yaml
Last active April 4, 2025 21:06
Values file for ingress-nginx
controller:
extraArgs:
default-ssl-certificate: "cert-manager/app-tls"
service:
externalTrafficPolicy: Local
config:
allow-snippet-annotations: "true"
annotations-risk-level: Critical
block-user-agents: '~*Go-http-client.*,~*python.*,~*Custom-AsyncHttpClient.*,~*l9explore.*'
custom-http-errors: "404,500"
@alchen99
alchen99 / oauth2-proxy-values.yaml.tmpl
Last active January 7, 2025 05:36
OAuth2 Proxy Helm Value template
# helm repo add oauth2-proxy https://oauth2-proxy.github.io/manifests
# helm repo update
# Generate cookie-secret by running : openssl rand -base64 32 | head -c 32 | base64 . Add to config.cookieSecret.
# Add client secret to config.clientSecret
# helm install oauth2-proxy oauth2-proxy/oauth2-proxy --values oauth2-proxy-values.yaml
config:
cookieName: MY_COOKIE
clientID: MY_CLIENT_ID # Replace with your provider's client ID
configFile: |
provider = "MY_PROVIDER"
@alchen99
alchen99 / create-pg-user.sql.tmpl
Last active February 17, 2025 23:47
Create a new PostgreSQL user in CloudSQL. Substitute $NEW_USER for new username. Substitute $NEW_PASSWORD for new password name.
CREATE USER $NEW_USER WITH PASSWORD '$NEW_PASSWORD' NOSUPERUSER CREATEDB CREATEROLE LOGIN;
GRANT USAGE, CREATE ON SCHEMA public TO app;
GRANT SELECT, INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO $NEW_USER;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT, INSERT, UPDATE, DELETE ON TABLES TO $NEW_USER;
-- Grant Sequence permissions
GRANT USAGE ON ALL SEQUENCES IN SCHEMA public TO $NEW_USER;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT USAGE ON SEQUENCES TO $NEW_USER;
-- Grant existing users access to $NEW_USER role/user (Optional)
GRANT $NEW_USER to postgres;
GRANT $NEW_USER to pgadmin;