Skip to content

Instantly share code, notes, and snippets.

View chrissng's full-sized avatar

Chris Sng chrissng

View GitHub Profile

Keybase proof

I hereby claim:

  • I am chrissng on github.
  • I am chrissng (https://keybase.io/chrissng) on keybase.
  • I have a public key ASD95oqVuVCUImbR16U0LmO2LB2WcgMGjwcqIzuYxEuDIQo

To claim this, I am signing this object:

@chrissng
chrissng / helm3-status.sh
Created February 14, 2020 05:58
helm3 status
#!/bin/bash
ns=$1
name=$2
helm3 get -n "${ns}" manifest "${name}" | kubectl get -n "${ns}" -f -
echo
kubectl get pods -n "${ns}" -l release="${name}"
@chrissng
chrissng / check-cluster-versions.sh
Last active September 13, 2019 07:08
Check K8s cluster master and worker versions
#!/bin/bash
for ctx in $(kubectl config get-contexts -o name)
do
echo '------------------------------------------------------------------------------------------'
echo 'Cluster: ' $ctx
echo 'Master: ' $(kubectl version --context $ctx -o json | jq -r '.serverVersion.gitVersion')
echo
kubectl get nodes --context $ctx -o custom-columns=KUBELET:.status.nodeInfo.kubeletVersion,KUBEPROXY:.status.nodeInfo.kubeProxyVersion,NAME:.metadata.name
echo
@chrissng
chrissng / Setting up a GPU Enabled Kubernetes for Deep Learning.md
Created November 14, 2018 07:42
Setting up a GPU Enabled Kubernetes for Deep Learning

Setting up a GPU Enabled Kubernetes for Deep Learning

Kubernetes spread like a wildfire in 2017, No kidding! Here are some numbers from Scott's post:

“For companies with more than 5000 employees, Kubernetes is used by 48% and the primary orchestration tool for 33%.”

“79% of the sample chose Docker as their primary container technology.”

Riding the wave of Kubernetes, 2017 was a particular fun year for Infrastructure/DevOps folks. Finally we have some cool tools to play with after years of darkness. We started thinking what we could do with such paradigm shift. We tried to optimize the developer velocity with Jenkins and Helm Chart and many other more to come :D

One thing I hold dear in my heart is democratizing Kubernetes for Data team. It's a well known fact that today's Data teams have to muster an array of bleeding edge technologies in or

Keybase proof

I hereby claim:

  • I am chrissng on github.
  • I am chrissng (https://keybase.io/chrissng) on keybase.
  • I have a public key ASBmYzJDr09wcxhv3vS4oqL9oN-9OHEnj1TS1o8D7sO22go

To claim this, I am signing this object:

@chrissng
chrissng / autohotkey_media_controls.ahk
Last active March 15, 2017 07:29
autohotkey media controls
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#f12::Volume_Up
#f11::Volume_Down
#f10::Volume_Mute
#]::Media_Next
#Pause::Media_Prev
@chrissng
chrissng / extract_staypoint.py
Created December 28, 2016 04:21 — forked from RustingSword/extract_staypoint.py
extract stay point from Geolife
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# extract stay points from a GPS log file
# implementation of algorithm in
# [1] Q. Li, Y. Zheng, X. Xie, Y. Chen, W. Liu, and W.-Y. Ma, "Mining user similarity based on location history", in Proceedings of the 16th ACM SIGSPATIAL international conference on Advances in geographic information systems, New York, NY, USA, 2008, pp. 34:1--34:10.
import time
import os
import sys
@chrissng
chrissng / PGRestAPI Installation.md
Created November 4, 2016 09:00 — forked from hallahan/installation.md
SpatialServer Installation Instructions

Preliminary Packages

Make sure you have done sudo apt-get update and sudo apt-get upgrade on your fresh install. This guide is geared toward Ubuntu 14.04 LTS (Trusty Tahr). Most of the guide will work for earlier versions of Ubuntu with some slight changes, but 14.04 is advised.

Enable the root user

sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/
@chrissng
chrissng / docker-cartodb.txt
Created September 30, 2016 02:21 — forked from chriswhong/docker-cartodb.txt
Steps to get docker-cartodb working with a real domain
#Notes for getting docker-cartodb to run on a digitalocean droplet
As of 21 June 2016, the Dockerfile at sverhoeven/docker-cartodb is not up to date, and the build will fail. It seems to fail at step 39, when it goes to create a user, but was not able to update it to get it working. Hopefully someone else can get it going with the latest cartodb code.
`https://hub.docker.com/r/sverhoeven/cartodb/`
However, running `docker run -d -p 3000:3000 -p 8080:8080 -p 8181:8181 sverhoeven/cartodb` will pull a complete docker image that is a few months old.
Running this image will get you a container that expects to run at the domain `cartodb.localhost`, and per the installation instructions you are told to update your hosts file to point cartodb.localhost to the IP of your docker host.
I wanted to run this with a real domain, so here are some notes on the steps involved.
- run the image using `docker run -d -p 3000:3000 -p 8080:8080 -p 8181:8181 sverhoeven/cartodb`
@chrissng
chrissng / README.md
Last active August 29, 2015 14:28 — forked from joyrexus/README.md
Team Oracle path to victory

Oracle Team USA won its eighth consecutive race to overtake Emirates Team New Zealand and retain the America’s Cup. A look at how the final race unfolded, with Oracle winning by 44 seconds.

A NYT interactive graphic by MIKE BOSTOCK and SHAN CARTER