Skip to content

Instantly share code, notes, and snippets.

View thpham's full-sized avatar

Thomas Kim Pham thpham

View GitHub Profile
@thpham
thpham / btrfs-nixos-install.sh
Created February 21, 2020 15:19 — forked from alcol80/btrfs-nixos-install.sh
nixos install (boot + btrfs root + btrfs docker)
gdisk /dev/sda # make 1 partition
mkfs.vfat -n BOOT /dev/sda1
mkfs.btrfs -L root /dev/sdb
mkfs.btrfs -L docker /dev/sdc
mount -t btrfs -o noatime,discard,ssd,autodefrag,compress=lzo,space_cache /dev/sdb /mnt/
btrfs subvolume create /mnt/nixos
umount /mnt/
mount -t btrfs -o noatime,discard,ssd,autodefrag,compress=lzo,space_cache,subvol=nixos /dev/sdb /mnt/
@thpham
thpham / operator.logs
Created February 17, 2020 13:26
mm2 identity replication
io.strimzi.operator.cluster.operator.assembly.ConnectRestException: PUT /connectors/kafkazk-1-source->kafkazk-2-target.MirrorSourceConnector/config returned 400 (Bad Request): Connector configuration is invalid and contains the following 1 error(s):
Invalid value ch.ithings.strimzi.mm2.IdentityReplicationPolicy for configuration replication.policy.class: Class ch.ithings.strimzi.mm2.IdentityReplicationPolicy could not be found.
You can also find the above list of errors at the endpoint `/{connectorType}/config/validate`
at io.strimzi.operator.cluster.operator.assembly.KafkaConnectApiImpl.lambda$null$2(KafkaConnectApi.java:101) ~[io.strimzi.cluster-operator-0.18.0-SNAPSHOT.jar:0.18.0-SNAPSHOT]
at io.vertx.core.http.impl.HttpClientResponseImpl$BodyHandler.notifyHandler(HttpClientResponseImpl.java:292) ~[io.vertx.vertx-core-3.8.4.jar:3.8.4]
at io.vertx.core.http.impl.HttpClientResponseImpl.lambda$bodyHandler$0(HttpClientResponseImpl.java:193) ~[io.vertx.vertx-core-3.8.4.jar:3.8.4]
at io.vertx.core.http.impl.
@thpham
thpham / kind-metrics-server.yaml
Created December 11, 2019 23:22 — forked from hjacobs/kind-metrics-server.yaml
Metrics Server API deployment manifests for Kubernetes kind
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: system:aggregated-metrics-reader
labels:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rules:
- apiGroups: ["metrics.k8s.io"]
@thpham
thpham / configuration-snippet.nix
Created June 21, 2019 19:37 — forked from fadenb/configuration-snippet.nix
Change wireless network interface MAC at boot using macchanger on NixOS
systemd = {
services = {
"macchanger-wireless" = {
description = "Changes MAC of my wireless interface for privacy reasons";
wants = [ "network-pre.target" ];
wantedBy = [ "multi-user.target" ];
before = [ "network-pre.target" ];
bindsTo = [ "sys-subsystem-net-devices-wlp3s0.device" ];
after = [ "sys-subsystem-net-devices-wlp3s0.device" ];
script = ''
@thpham
thpham / xtensa-esp-32-elf.nix
Created June 17, 2019 13:52 — forked from wirew0rm/xtensa-esp-32-elf.nix
ESP32 Toolchain for nixos
{ stdenv, fetchgit, fetchurl, writeText, automake, autoconf, aria, coreutils, curl, cvs, gcc, git, python, which, bison, flex, gperf, help2man, libtool, ncurses, texinfo, wget, file }:
stdenv.mkDerivation {
name = "xtensa-esp32-elf";
version = "1.22.x";
src = fetchgit {
url = "https://github.com/espressif/crosstool-NG.git";
# branch = "xtensa-${version}";
rev = "6c4433a51e4f2f2f9d9d4a13e75cd951acdfa80c";
sha256 = "03qg9vb0mf10nfslggmb7lc426l0gxqhfyvbadh86x41n2j6ddg6";
@thpham
thpham / docker-compose.yaml
Last active December 20, 2018 23:09
Kafka stream data pipeline
version: "3.2"
services:
zk:
image: confluentinc/cp-zookeeper:5.1.0
hostname: zk
container_name: zk
restart: unless-stopped
ports:
- "2181:2181"
environment:
@thpham
thpham / DI.m3u
Created April 21, 2018 13:57 — forked from sim642/DI.m3u
Digitally Imported premium streams
#EXTM3U
#EXTINF:-1,Digitally Imported - Ambient
http://pub1.diforfree.org:8000/di_ambient_hi
#EXTINF:-1,Digitally Imported - Big Room House
http://pub1.diforfree.org:8000/di_bigroomhouse_hi
#EXTINF:-1,Digitally Imported - Breaks
http://pub1.diforfree.org:8000/di_breaks_hi
@thpham
thpham / dockerhost.sh
Created March 5, 2018 21:00 — forked from TheDauthi/dockerhost.sh
Dockerhost detection
#!/usr/bin/env sh
# The default hostname to set
DEFAULT_DOCKER_HOSTNAME=${DEFAULT_DOCKER_HOSTNAME-dockerhost.internal}
# A comma-delimited list of extra hostnames to add as aliases
EXTRA_DOCKER_HOSTNAMES=${EXTRA_DOCKER_HOSTNAMES-}
# Whether to export variables
EXPORT_DOCKERHOST=${EXPORT_DOCKERHOST-1}
@thpham
thpham / Jenkinsfile
Created September 14, 2017 09:38 — forked from bvis/Jenkinsfile
Jenkin pipeline definition example to be integrated with Docker Swarm cluster in our CI/CD environment
pipeline {
agent { node { label 'swarm-ci' } }
environment {
TEST_PREFIX = "test-IMAGE"
TEST_IMAGE = "${env.TEST_PREFIX}:${env.BUILD_NUMBER}"
TEST_CONTAINER = "${env.TEST_PREFIX}-${env.BUILD_NUMBER}"
REGISTRY_ADDRESS = "my.registry.address.com"
SLACK_CHANNEL = "#deployment-notifications"
@thpham
thpham / bluetooth_commands.txt
Last active August 14, 2017 19:40
Feber RC Car hack bluetooth commands
FRONT = "AA588180000000FDFF";
BACK = "AA5801800000007DFF";
LEFT = "AA588081000000FDFF";
RIGHT = "AA5880010000007DFF";
STOP = "AA588080000000FEFF";
FRONT_LEFT = "AA588181000000FCFF";
FRONT_RIGHT = "AA5881010000007CFF";
BACK_LEFT = "AA5801810000007CFF";
BACK_RIGHT = "AA580101000000FCFF";