Skip to content

Instantly share code, notes, and snippets.

View cheungpat's full-sized avatar

Kwok-kuen Cheung cheungpat

View GitHub Profile
@cheungpat
cheungpat / com.cheungpat.dropbox-sync.plist
Created June 5, 2017 02:36
Make launchd run Dropbox and keep it running
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key><string>com.cheungpat.dropbox</string>
<key>ProgramArguments</key>
<array>
<string>/Applications/Dropbox.app/Contents/MacOS/Dropbox</string>
</array>
<key>RunAtLoad</key><true/>
#!/bin/bash
# Copied from
# https://github.com/kubernetes-incubator/kube-aws/blob/master/core/controlplane/config/templates/cloud-config-controller
TIMESTAMP=$(date +%Y-%m-%d_%H-%M-%S)
DUMP_DIR=tmp ;
mkdir -p ${DUMP_DIR} ;
RESOURCES_OUT_NAMESPACE=( namespaces persistentvolumes nodes storageclasses clusterrolebindings clusterroles ) ;
for r in ${RESOURCES_OUT_NAMESPACE[@]};do
# -----------------------------
# PostgreSQL configuration file
# -----------------------------
#
# This file consists of lines of the form:
#
# name = value
#
# (The "=" is optional.) Whitespace may be used. Comments are introduced with
# "#" anywhere on a line. The complete list of parameter names and allowed
@cheungpat
cheungpat / docker-compose.yml
Created July 31, 2016 00:07
Docker Compose for roundcube with imapproxy
version: '2'
services:
imapproxy:
image: cheungpat/imapproxy
environment:
SERVER_HOSTNAME: imap.gmail.com
roundcube:
image: robbertkl/roundcube
@cheungpat
cheungpat / 0_reuse_code.js
Created May 15, 2016 14:45
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cheungpat
cheungpat / Dockerfile
Created May 7, 2016 03:23
Dockerfile-node-6.1
FROM node:6.1
ENV TINI_VERSION v0.9.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ENTRYPOINT ["/tini", "--"]
@cheungpat
cheungpat / get-kube-local.sh
Last active April 21, 2016 08:02
Run Kubernetes locally with Docker and bind apiserver to 0.0.0.0
#!/bin/bash
# Copyright 2015 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@cheungpat
cheungpat / Dockerfile
Last active February 13, 2016 15:05
fluentd-s3
FROM fluent/fluentd:latest
MAINTAINER Kwok-kuen Cheung <me@cheungpat.com>
RUN gem install fluent-plugin-s3

Keybase proof

I hereby claim:

  • I am cheungpat on github.
  • I am cheungpat (https://keybase.io/cheungpat) on keybase.
  • I have a public key whose fingerprint is B5BD 21ED DFBB 4835 75FE BC1E 617D 7093 12CD A17C

To claim this, I am signing this object:

@cheungpat
cheungpat / Dockerfile
Created November 27, 2014 10:41
rq-scheduler Dockerfile
FROM python:3
MAINTAINER cheungpat <me@cheungpat.com>
RUN pip install rq-scheduler==0.5.0
ENTRYPOINT rqscheduler