Skip to content

Instantly share code, notes, and snippets.

Avatar
☁️
-native

Thomas Kim Pham thpham

☁️
-native
View GitHub Profile
@thpham
thpham / it930x.nix
Created Apr 26, 2020 — forked from gtgteq/it930x.nix
px4_drv.nix
View it930x.nix
{ stdenv, fetchFromGitHub, fetchzip }:
stdenv.mkDerivation rec {
pname = "it930x-firmware";
version = "1";
src = fetchFromGitHub {
owner = "nns779";
repo = "px4_drv";
rev = "90e0a4b30b812e7e5fff4483144f165de8914157";
@thpham
thpham / 00-cloud-config.yml
Created Mar 8, 2020 — forked from janeczku/00-cloud-config.yml
Annotated RancherOS Cloud-init configuration snippets
View 00-cloud-config.yml
#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 / nixos.md
Created Feb 29, 2020 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root
View nixos.md
@thpham
thpham / nixos-install.md
Created Feb 29, 2020 — forked from kuznero/nixos-install.md
Installing NixOS behind corporate proxy
View nixos-install.md

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 / btrfs-nixos-install.sh
Created Feb 21, 2020 — forked from alcol80/btrfs-nixos-install.sh
nixos install (boot + btrfs root + btrfs docker)
View btrfs-nixos-install.sh
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 Feb 17, 2020
mm2 identity replication
View operator.logs
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 Dec 11, 2019 — forked from hjacobs/kind-metrics-server.yaml
Metrics Server API deployment manifests for Kubernetes kind
View kind-metrics-server.yaml
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 Jun 21, 2019 — forked from fadenb/configuration-snippet.nix
Change wireless network interface MAC at boot using macchanger on NixOS
View configuration-snippet.nix
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 Jun 17, 2019 — forked from wirew0rm/xtensa-esp-32-elf.nix
ESP32 Toolchain for nixos
View xtensa-esp-32-elf.nix
{ 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 Dec 20, 2018
Kafka stream data pipeline
View docker-compose.yaml
version: "3.2"
services:
zk:
image: confluentinc/cp-zookeeper:5.1.0
hostname: zk
container_name: zk
restart: unless-stopped
ports:
- "2181:2181"
environment:
You can’t perform that action at this time.