Skip to content

Instantly share code, notes, and snippets.

:shipit:
What's happening?

Allan Lei allanlei

:shipit:
What's happening?
Block or report user

Report or block allanlei

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@allanlei
allanlei / ffmpeg-blurout.sh
Last active Sep 7, 2019
FFmpeg Filtergraph to generate Blur Out
View ffmpeg-blurout.sh
ffmpeg -i source.mp4 -filter_complex \
"[0:v]split=2[base][blurred]; \
[blurred]boxblur=luma_radius=50:chroma_radius=25:luma_power=1[blurred]; \
[blurred]fade=type=in:start_time=5:duration=1:alpha=1[blurred-with-fadein]; \
[base][blurred-with-fadein]overlay[blurout]" \
-map "[blurout]" blurout.mp4
@allanlei
allanlei / filter-complex-fadein.sh
Last active Sep 7, 2019
FFmpeg Filtergraph to fade in a video
View filter-complex-fadein.sh
ffmpeg -i source.mp4 -filter_complex \
"[0:v]fade=type=in:start_time=1:duration=8[fadein]" \
-map "[fadein]" fadein.mp4
@allanlei
allanlei / filter-complex-blur.sh
Last active Sep 7, 2019
FFmpeg Filtergraph to blur a video
View filter-complex-blur.sh
ffmpeg -i source.mp4 -filter_complex \
"[0:v]boxblur=luma_radius=10:chroma_radius=10:luma_power=1[blurred]" \
-map "[blurred]" blurred.mp4
@allanlei
allanlei / filter-complex-split.sh
Created Sep 7, 2019
FFmpeg Filtergraph to split inputs (with scaling)
View filter-complex-split.sh
ffmpeg -i source.mp4 -filter_complex \
"[0:v]split=2[360p][720p]; \
[360p]scale=-2:360[360p]; \
[720p]scale=-2:720[720p]" \
-map "[360p]" 360p.mp4 \
-map "[720p]" 720p.mp4
@allanlei
allanlei / daemonset.yaml
Last active Sep 2, 2019
Kubernetes sysctl daemonset for tuning Transparent Huge Pages
View daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
name: sysctl
spec:
selector:
matchLabels:
app: sysctl
template:
View stunnel.conf
#STUNNEL CONFIG
client = yes
[postgres-serverB]
protocol = pgsql
accept = 0.0.0.0:5432 # host:port to listen to on serverA
connect = SERVER_B_POSTGRES_HOST:SERVER_B_POSTGRES_PORT
options = NO_TICKET
retry = yes
@allanlei
allanlei / kernel-tuner.yaml
Created Sep 15, 2018
Kubernetes THP tuner daemonset
View kernel-tuner.yaml
kind: DaemonSet
apiVersion: apps/v1
metadata:
namespace: kube-system
name: kernel-tuner
labels:
app: kernel-tuner
spec:
selector:
matchLabels:
@allanlei
allanlei / Dockerfile
Last active Jan 7, 2019
Running cron in Docker via compiled image
View Dockerfile
FROM alpine
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
# run: docker run -it --rm IMAGE "* * * * * echo hello"
@allanlei
allanlei / mounted-volume.sh
Last active Jan 7, 2019
Running cron in Docker via mounted volume
View mounted-volume.sh
docker run -it --rm -v tasks.cron:/tasks.cron alpine:3.5 sh -c "crontab /tasks.cron && crond -f -L /dev/stdout"
@allanlei
allanlei / singleline.sh
Last active Jan 7, 2019
Running cron in Docker via command
View singleline.sh
docker run -it --rm alpine sh -c "echo \"* * * * * echo hello\" | crontab - && crond -f -L /dev/stdout"
You can’t perform that action at this time.