Skip to content

Instantly share code, notes, and snippets.

View thpham's full-sized avatar

Thomas Kim Pham thpham

View GitHub Profile
@thpham
thpham / merge_fonts.py
Created January 15, 2025 22:12
Create a custom font file and copy missing glyphs from source font.
import fontforge
# Open the source and target fonts
source_font = fontforge.open("fa-brands-400.ttf")
target_font = fontforge.open("original.ttf")
# Define the list of missing glyphs (for simplicity, you can define them manually)
missing_glyphs = ["x-twitter", "square-x-twitter"] # Add your missing glyphs here
# Iterate over each missing glyph
import * as cdk from '@aws-cdk/core';
import * as ec2 from '@aws-cdk/aws-ec2'; // import ec2 library
import * as iam from '@aws-cdk/aws-iam';
import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
import * as elbvtargets from '@aws-cdk/aws-elasticloadbalancingv2-targets';
import * as ssm from '@aws-cdk/aws-ssm';
import * as kms from '@aws-cdk/aws-kms';
export class InfraCdkappMysqlStack extends cdk.Stack {
@thpham
thpham / patch.sh
Created October 27, 2024 20:29 — forked from XT-Martinez/patch.sh
Arcadyan AW1000 Openwrt Improvement Patches
#!/bin/sh
# Script by Christian Joel Martinez
# Setup NSS PBUF memory profile
cat << 'EOF' > /etc/config/pbuf
config general opt
# option memory_profile 'off'
# option memory_profile 'auto'
option memory_profile '1gb'
# option memory_profile '512mb'
@thpham
thpham / eks-blueprint.ts
Created June 3, 2024 17:17
Re-Implementation of https://github.com/aws-quickstart/cdk-eks-blueprints to make it works with an AWS Service Catalog product.
import { IVpc } from "aws-cdk-lib/aws-ec2";
import { Construct } from "constructs";
import {
BlueprintPropsConstraints,
DEFAULT_VERSION,
EksBlueprintProps,
utils,
MngClusterProvider,
} from "@aws-quickstart/eks-blueprints";
import { VpcProvider } from "../eks-blueprints/resource-providers/vpc";
@thpham
thpham / .gitconfig
Created January 27, 2024 10:00 — forked from arnauldvm/.gitconfig
Git sync all local tracking branches with remotes
[alias]
tracking = "!f() { git for-each-ref --format '%(refname:short):%(upstream:short)' 'refs/heads' | egrep -v ':$'; }; f"
is-clean-workdir = "!f() { git diff --stat --exit-code || { echo \"Workdir dirty\"; exit 1; }; }; f"
is-clean-index = "!f() { git diff --stat --cached --exit-code || { echo \"Index dirty\"; exit 2; }; }; f"
is-clean = "!f() { git is-clean-workdir && git is-clean-index; }; f"
co-merge = "!f() { local=\"$1\"; remote=\"$2\"; git checkout \"$local\"; git merge --ff-only \"$remote\"; }; f"
current-branch = rev-parse --abbrev-ref HEAD
sync = "!f() { git is-clean || { echo Aborting sync.; exit 1; }; current=$(git current-branch); git fetch --all; git tracking | while IFS=: read local remote; do echo \"Merging $local with $remote\"; git co-merge \"$local\" \"$remote\"; done 3>&1 1>&2 2>&3 | egrep -i --color 'fatal|$' 3>&1 1>&2 2>&3; git checkout \"$current\"; }; f"
@thpham
thpham / flake.nix
Created October 26, 2023 21:17 — forked from mausch/flake.nix
llama-vicuna.nix
{
description = "llama.cpp running vicuna";
inputs = {
llama.url = "github:ggerganov/llama.cpp/aaf3b23debc1fe1a06733c8c6468fb84233cc44f";
flake-utils.url = "github:numtide/flake-utils/033b9f258ca96a10e543d4442071f614dc3f8412";
nixpkgs.url = "github:NixOS/nixpkgs/d9f759f2ea8d265d974a6e1259bd510ac5844c5d";
};
outputs = { self, flake-utils, llama, nixpkgs }:
@thpham
thpham / lima-on-m1-mac-installation-guide.md
Created October 3, 2022 18:00 — forked from toricls/lima-on-m1-mac-installation-guide.md
Using Lima to run containers with containerd and nerdctl (without Docker Desktop) on M1 Macs

Lima (Linux virtual machines, on macOS) installation guide for M1 Mac.

Sep. 27th 2021 UPDATED

Now we can install patched version of QEMU via Homebrew (thank you everyone for the info!). Here is the updated instruction with it:

Used M1 Mac mini 2020 with macOS Big Sur Version 11.6.

1. Install QEMU & Lima