Skip to content

Instantly share code, notes, and snippets.

View thpham's full-sized avatar

Thomas Kim Pham thpham

View GitHub Profile
@thpham
thpham / Readm.md
Created May 15, 2017 18:55 — forked from jeroenvandijk/Readm.md
Instructions to test Logstash with Kafka

Test Logstash with Kafka

Setup Kafka

Download Kafka from:

https://www.apache.org/dyn/closer.cgi/incubator/kafka/kafka-0.7.2-incubating/kafka-0.7.2-incubating-src.tgz

Install Kafka

@thpham
thpham / docker-compose.yml
Created May 23, 2017 04:53
Portus Docker Registry v2
version: '2'
services:
nginx-proxy:
image: jwilder/nginx-proxy
restart: always
container_name: nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
@thpham
thpham / repoAssetLister.groovy
Created July 19, 2017 11:07 — forked from kellyrob99/repoAssetLister.groovy
List all assets in a given repository that have been updated after a specific time
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.Query
import org.sonatype.nexus.repository.storage.StorageFacet
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
def request = new JsonSlurper().parseText(args)
assert request.repoName: 'repoName parameter is required'
assert request.startDate: 'startDate parameter is required, format: yyyy-mm-dd'
@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";
@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 / install.txt
Created July 11, 2017 18:49
spinnaker install procedure
curl -O https://raw.githubusercontent.com/spinnaker/halyard/master/install/stable/InstallHalyard.sh
sudo bash InstallHalyard.sh
hal config deploy edit --type localdebian
hal config storage edit --type redis
echo "host: 0.0.0.0" | tee \
@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:
version: '2'
services:
redis:
image: redis:alpine
restart: always
container_name: redis
ports:
- "6379"
emqtt:
@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 / 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 = ''