Skip to content

Instantly share code, notes, and snippets.

View thpham's full-sized avatar

Thomas Kim Pham thpham

View GitHub Profile
@thpham
thpham / myweechat.md
Created June 20, 2021 22:35 — forked from pascalpoitras/config.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

You need at least WeeChat 3.2-dev

Enable mouse

/mouse enable

@thpham
thpham / HADOOP-ON-K8S.md
Created April 13, 2021 18:52 — forked from TeemuKoivisto/HADOOP-ON-K8S.md
How to install Hadoop to your local Kubernetes cluster

How to install Hadoop on your local Kubernetes cluster

Okey this is not the easiest way of running Hadoop on your local computer and probably you should instead just install it locally.

However if you really insist doing this here's how:

  1. Install kubectl, minikube and Docker if you don't already have it. I recommend using package-manager like Chocolatey. Minikube should install with VirtualBox as default driver which I recommend. When starting minikube we should increase its memory limit since our Hadoop node's pods need at least 2GB: minikube --memory 4096 --cpus 2 start (minikube's default is 1GB). NOTE: actually the Hadoop cluster by default uses about 10GB in memory limits and about 3GB running memory. From what I looked my k8s will overprovision to 300% of its capacity limits but use far less.
  2. Install helm. Then run helm init.
  3. Now you
#!/bin/bash
# !!WARNING!!
# This will DELETE all efforts you have put into configuring nix
# Have a look through everything that gets deleted / copied over
nix-env -e '.*'
rm -rf $HOME/.nix-*
rm -rf $HOME/.config/nixpkgs
###########################################################
# Automation of Everything #
# How To Combine Argo Events, Workflows, CD, and Rollouts #
# https://youtu.be/XNXJtxkUKeY #
###########################################################
# Requirements:
# - k8s v1.19+ cluster with nginx Ingress
# Replace `[...]` with the GitHub organization or the username
import math
class Node:
def __init__(self, name, x, y, indexloc=None):
self.name = name
self.x = x
self.y = y
self.index = indexloc

Keybase proof

I hereby claim:

  • I am thpham on github.
  • I am thpham (https://keybase.io/thpham) on keybase.
  • I have a public key ASCd3T9dbXe-wHz-vuyelTDv_S7Jnj2lvFvqy9xW-yE-6wo

To claim this, I am signing this object:

@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 / 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 / nixos.md
Created February 29, 2020 11:11 — forked from martijnvermaat/nixos.md
Installation of NixOS with encrypted root
@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/