Skip to content

Instantly share code, notes, and snippets.

View thpham's full-sized avatar

Thomas Kim Pham thpham

View GitHub Profile
@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 / 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 / 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 / nixos-install.md
Created February 29, 2020 10:02 — forked from kuznero/nixos-install.md
Installing NixOS behind corporate proxy

In order to install NixOS behind corporate proxy do the usual stuff but before running nixos-install set this environment variable:

export CURL_NIX_FLAGS="-x http://user:password@proxy:port/"

In addition in case you have ties to cloning from GitHub (like vim plugins), you should export proxy related variables:

export HTTP_PROXY=http://user:password@proxy:port/
@thpham
thpham / nixos.md
Created February 29, 2020 11:11 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root
@thpham
thpham / 00-cloud-config.yml
Created March 8, 2020 17:56 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
#cloud-config
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease).
hostname: myhost
# Authorize SSH keys for the `rancher` sudoer user
ssh_authorized_keys:
- ssh-rsa AAA...ZZZ example1@rancher
@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 / it930x.nix
Created April 26, 2020 20:22 — forked from gtgteq/it930x.nix
px4_drv.nix
{ stdenv, fetchFromGitHub, fetchzip }:
stdenv.mkDerivation rec {
pname = "it930x-firmware";
version = "1";
src = fetchFromGitHub {
owner = "nns779";
repo = "px4_drv";
rev = "90e0a4b30b812e7e5fff4483144f165de8914157";
@thpham
thpham / instructions.txt
Created August 4, 2017 14:44
Huawei E3276s-150 4G/LTE USB modem
Bus 001 Device 004: ID 12d1:14fe Huawei Technologies Co., Ltd.
usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'
'55534243123456780000000000000011062000000100000000000000000000'
'55534243123456780000000000000011062000000101000100000000000000'
/etc/udev/rules.d/70-usb-modeswitch.rules
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="14fe", RUN+="/usr/sbin/usb_modeswitch -v 12d1 -p 14fe -M '55534243123456780000000000000011062000000100000000000000000000'"
@thpham
thpham / mongoStatsToGraphite.py
Created February 17, 2014 22:04
python script to send mongodb stats to graphite
import commands
import time
import sys
from socket import socket
import argparse
import os
import pymongo
from pymongo import Connection
import yaml