Skip to content

Instantly share code, notes, and snippets.

View dictcp's full-sized avatar

Dick Tang dictcp

View GitHub Profile
@dictcp
dictcp / 00.imgproxy_vs_alternatives.md
Created March 3, 2020 09:17 — forked from DarthSim/00.imgproxy_vs_alternatives.md
imgproxy vs alternatives benchmark

imgproxy vs alternatives benchmark

Setup

  • c5.xlarge AWS instance: 4 CPUs, 8 GB RAM
  • Ubuntu 18.04
  • Go 1.12
  • Python 2.7
  • Vips 8.7.4
@dictcp
dictcp / encode.sh
Created August 7, 2019 16:19 — forked from mikoim/README.md
YouTube recommended encoding settings on ffmpeg (+ libx264)
#/bin/sh
ffmpeg -i input -c:v libx264 -preset slow -profile:v high -crf 18 -coder 1 -pix_fmt yuv420p -movflags +faststart -g 30 -bf 2 -c:a aac -b:a 384k -profile:a aac_low output
http -v -j POST https://hkt-mobile-api.nowtv.now.com/09/1/getLiveURL mode=prod format=HLS callerReferenceNo=20190707123320 channelno=332 deviceType=5 deviceId=7634de3e186676d537OA
http -v -j POST https://api.viu.now.com/p8/2/getLiveURL mode=prod format=HLS callerReferenceNo=20190707123320 channelno=100 deviceType=5 deviceId=7634de3e186676d537
@dictcp
dictcp / EC2-Tag-Assets-Lambda.py
Last active October 14, 2022 07:51 — forked from mlapida/EC2-Tag-Assets-Lambda.py
A lambda function that will copy EC2 tags to all related Volumes and Network Interfaces. A full writeup can be found on my site http://mlapida.com/thoughts/tagging-and-snapshotting-with-lambda
import boto3
def lambda_handler(event, context):
is_test = context.function_name == 'test' # this value is injected by SAM local
instances = boto3.resource('ec2').instances.all()
copyable_tag_keys = ["Team", "Billing", "BillingTag", "Env", "Project"]
for instance in instances:
copyable_tags = [t for t in instance.tags

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

http://www.oreilly.com/data/free/files/2014-data-science-salary-survey.pdf
http://www.oreilly.com/data/free/files/2015-data-science-salary-survey.pdf
http://www.oreilly.com/data/free/files/Data_Analytics_in_Sports.pdf
http://www.oreilly.com/data/free/files/advancing-procurement-analytics.pdf
http://www.oreilly.com/data/free/files/ai-and-medicine.pdf
http://www.oreilly.com/data/free/files/analyzing-data-in-the-internet-of-things.pdf
http://www.oreilly.com/data/free/files/analyzing-the-analyzers.pdf
http://www.oreilly.com/data/free/files/architecting-data-lakes.pdf
http://www.oreilly.com/data/free/files/being-a-data-skeptic.pdf
http://www.oreilly.com/data/free/files/big-data-analytics-emerging-architecture.pdf
@dictcp
dictcp / 6_mar_2018_k8s_workshop_notes.md
Created March 7, 2018 14:17 — forked from foray1010/6_mar_2018_k8s_workshop_notes.md
6 Mar 2018 - Kubernetes (k8s) workshop notes

6 Mar 2018 - Kubernetes (k8s) workshop notes

workshop github guideline: https://github.com/aws-samples/aws-workshop-for-kubernetes

if you wanna follow the guideline, make sure you:

  1. setup cloud9, follow the instructions under the heading: Create AWS Cloud9 Environment
  2. setup Kubernetes multi master cluster, follow the instructions under the heading: Create a Kubernetes Cluster with kops and Kubernetes Cluster Context. Suggest to create a multi-master cluster as the examples will be easier to follow.

Concepts

  1. Pod
#!/bin/sh
# The bandwidth to simulate, here about 56kilobit per second. This is layer 2 bandwidth, so TCP/UDP and IP overhead will apply
BW="56kbps"
# _Half_ the latency that we aim for. Since this applies to both the WAN port and Wi-Fi, the delay is applied twice, so this actually puts it at around 120+ms
LATENCY="60ms"
# Chance of packet loss. Also applied to both interfaces, so it is 1%.
LOSS="0.5%"
# The device name of your wifi device.
WIFI="wlan0"
#!/bin/bash
#
# template script for generating CentOS container for LXC
#
#
# lxc: linux Container library
# Authors:
@dictcp
dictcp / gist:6079944
Last active December 20, 2015 05:39
Install Ruby 2, Rail 4 on Ubuntu 12.04 LTS
#install required packages
apt-get update
apt-get upgrade -y
apt-get install -y git curl build-essential libssl-dev libcurl4-openssl-dev nodejs
#optional
apt-get install libsqlite3-dev sqlite3