Skip to content

Instantly share code, notes, and snippets.

View dictcp's full-sized avatar

Dick Tang dictcp

View GitHub Profile
@dictcp
dictcp / gist:29fb96d1fe388c2a68de37c3a36698b7
Created June 27, 2022 17:31
Step to setup GitHub Runner in Mac M1
https://github.com/hkratz/gha-runner-osx-arm64/pull/2
https://github.com/dotnet/runtime/issues/64103
```
export COMPlus_ReadyToRun=0
git clone https://github.com/hkratz/gha-runner-osx-arm64.git -b macos-arm64
cd gha-runner-osx-arm64/src/
./dev.sh layout
cd ../_layout/
./config.sh --url {repo-url} --token AA... # use your repo URL and your runner registration token
@dictcp
dictcp / README.sh
Created December 3, 2021 03:30
Replace Docker for Mac with colima
brew install lima colima
colima start --cpu 2 --memory 4 --disk 60
# create new context to test colima
# with persisted setting like DOCKER_HOST=unix://$HOME/.colima/docker.sock
docker context create colima --docker host=unix://$HOME/.colima/docker.sock
docker context use colima
docker version | grep ubuntu
@dictcp
dictcp / README-Build-Sysbox-on-arm64.md
Last active October 21, 2021 03:08
(reference only, it won't work per sysbox feedback)
  1. assume you are under ubuntu 20.04 arm64 platform
  2. install docker, git, make and jq
  3. download the arm64.patch at $HOME
  4. execute
git clone --recursive https://github.com/nestybox/sysbox -b v0.4.1
cd sysbox
patch -p1 < ~/arm64.patch
make sysbox
ls build/ubuntu_20.04/arm64/
@dictcp
dictcp / docker-compose.yml
Created September 5, 2021 09:13
docker-compose starting Apache with custom vhost config
version: '2'
services:
web:
image: httpd
volumes:
- ./vhost.conf:/usr/local/apache2/conf/extra/vhost.conf
ports:
- "8082:80"
@dictcp
dictcp / README.md
Last active March 23, 2021 03:56
Quick demo on Fluentd logging driver in Docker

It is a demo on how to leverage on docker logs option to send logs to another server

docker-compose up -d

docker-compose restart web

docker-compose logs

## you will see the stdout from podinfo and go to fluentd stdout (due to the fluentd config), like
## fluentd_1  | 2021-03-23 03:51:58.000000000 +0000 7a3c12568bff: {"log":"Error to open config file, stat config.yaml: no such file or directory","container_id":"7a3c12568bff77f17a3909d63074401328af851e5d763a2b75b1e7e273c6ef33","container_name":"/test_web_1","source":"stdout"}
cask "1password"
cask "aws-vault"
cask "balenaetcher"
cask "coconutbattery"
cask "docker"
cask "dupeguru"
cask "evernote"
cask "ferdi"
cask "finicky"
cask "gimp"
@dictcp
dictcp / pritunl-install.sh
Last active February 24, 2021 15:16
Install Pritunl (with built-in MongoDB) under Ubuntu 18.04
#!/bin/bash
# from `host azure.archive.ubuntu.com`
echo -e '\n20.189.76.178 archive.ubuntu.com\n' | sudo tee -a /etc/hosts
sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list << EOF
deb https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse
EOF
sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
@dictcp
dictcp / wowza-local-dev-env.md
Last active August 4, 2020 08:11
Setting up a local Wowza development environment
  1. Run local wowza instance (under trial license) via
docker run -d --name wowza --restart always \
  --publish 1935:1935 --publish 8086:8086 --publish 8087:8087 --publish 8088:8088 \
  --entrypoint /sbin/entrypoint.sh \
  wowzamedia/wowza-streaming-engine-linux:4.8.5
  1. Visit admin panel located at http://127.0.0.1:8088 (Username: wowza, password: wowza)
@dictcp
dictcp / README.md
Last active June 23, 2021 02:27
Automating Kubernetes with GitOps Workshop
@dictcp
dictcp / cloudflare-warp-wireguard-client.sh
Last active April 1, 2020 15:14
generate cloudflare wrap+ profile
#!/bin/bash
echo "deb http://deb.debian.org/debian buster-backports main" >> /etc/apt/sources.list
apt update && apt -y install wireguard-tools
export PATH="/usr/local/bin:$PATH"
/usr/local/bin/pip install poetry
git clone https://github.com/ViRb3/cloudflare-warp-wireguard-client
cd cloudflare-warp-wireguard-client/
sed -i 's/input("Do you agree? (y\/N): ").lower()/"y"/g' wgcf.py
poetry install