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

microk8s & fluxcd

(optional) prepare the server

# install at https://multipass.run/
multipass launch --name microk8s-flux --mem 2G
multipass shell microk8s-flux

# assume ubuntu with snap installed, if not install it via
apt install snapd
@dictcp
dictcp / Dockerfile
Last active January 23, 2022 16:00
a docker-compose stack to demonstrate Rundeck + oauth2_proxy (as SSO) + ACL role injection
FROM rundeck/rundeck:3.1.2
RUN cd ./libext && wget https://github.com/rundeck-plugins/rundeck-s3-log-plugin/releases/download/v1.0.8/rundeck-s3-log-plugin-1.0.8.jar
RUN cd ./libext && wget https://github.com/rundeck-plugins/rundeck-ec2-nodes-plugin/releases/download/v1.5.12/rundeck-ec2-nodes-plugin-1.5.12.jar
RUN cd ./libext && wget https://github.com/rundeck-plugins/slack-incoming-webhook-plugin/releases/download/v1.2.5/slack-incoming-webhook-plugin-1.2.5.jar
RUN cd ./libext && wget https://github.com/rundeck-plugins/kubernetes/releases/download/1.0.12/kubernetes-plugin-1.0.12.zip
RUN chown -R rundeck:root ./libext
@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 / slack-get-channels-guest.php
Last active May 18, 2019 16:12
Get the list of the Slack channel member who are the guests
<?php
//
// Usage:
// php slack-get-channels-guest.php | jq '.[] | [ .name, (.member[] | .name) ] | flatten | @csv' -r | pbcopy
//
$TOKEN = getenv('SLACK_TOKEN');
$user_json = json_decode(file_get_contents("https://slack.com/api/users.list?token=$TOKEN&pretty=1"), true);
#!/bin/sh
sudo ros install -f -d /dev/sda --no-reboot
sleep 30
sudo nohup bash -c "sleep 2; reboot" &
#!/bin/sh
exit 0
@dictcp
dictcp / ssh-key-updater.sh
Last active March 12, 2019 15:38
command to keep ssh keys updated
docker run -d -t -u $(id -u):$(id -g) --name ssh-key-updater -v $HOME/.ssh:/.ssh dictcp/utils:ubuntu watch -n 600 curl -o /.ssh/authorized_keys https://github.com/dictcp.keys
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Org Chart Editor</title>
<meta name="description" content="An organization chart editor -- edit details and change relationships." />
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Copyright 1998-2019 by Northwoods Software Corporation. -->
<script src="https://gojs.net/latest/samples/../release/go.js"></script>