Skip to content

Instantly share code, notes, and snippets.

View thpham's full-sized avatar

Thomas Kim Pham thpham

View GitHub Profile
@thpham
thpham / zookeeper-kafka
Created June 28, 2016 12:14 — forked from mesonoxian/zookeeper-kafka
Simple Zookeeper and Kafka init.d Startup Script
#! /bin/bash
### BEGIN INIT INFO
# Provides: kafka
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: kafka service
### END INIT INFO
@thpham
thpham / gist:ae62739c226ead06e320ad318f629565
Created April 25, 2017 12:21 — forked from ruckus/gist:2293434
Basic setup of WAL-E for continuous archiving and recovery

WAL-E needs to be installed on all machines, masters and slaves.

How to install WAL-E

Only one machine, the master, writes WAL segments via continuous archiving. The configuration for the master postgresql.conf is:

archive_mode = on
archive_command = 'envdir /etc/wal-e.d/env wal-e wal-push %p'
archive_timeout = 60
@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

version: '2'
services:
redis:
image: redis:alpine
restart: always
container_name: redis
ports:
- "6379"
emqtt:
@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 / 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 / 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 / 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 / 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 / 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"