Skip to content

Instantly share code, notes, and snippets.

View allanlei's full-sized avatar
:shipit:
What's up?

Allan Lei allanlei

:shipit:
What's up?
View GitHub Profile
@allanlei
allanlei / README.md
Created March 23, 2023 15:51
GKE nvidia driver installer with driver version control

Find the corresponding nvidia driver for COS

  1. gsutil ls gsutil ls gs://cos-tools-asia/${COS_VERSION}/extensions/gpu
  2. Pick an available version and update annotations.version

Creating a Node pool with a specific driver

  1. Create nodepool with taint nvidia.com/gpu-driver-version=DRIVER_VERSION_MAJOR
  2. Create corresponding daemonset driver installer with nvidia.com/gpu-driver-version=DRIVER_VERSION_MAJOR
@allanlei
allanlei / blur.sh
Last active September 7, 2022 18:34
Pulsating Blur
ffmpeg -stream_loop -1 -i bbb.mp4 -filter_complex "\
[0:v]split=2[base][overlay];
[overlay]gblur=5,format=yuva444p,geq=r='r(X,Y)':a='abs(255*sin(T))'[overlay];
[base][overlay]overlay[out]" \
-map "[out]" output.mp4
@allanlei
allanlei / README.md
Last active September 9, 2021 15:50
openssl smime sign with `nodetach`

This is the rough equivalent of

openssl smime -sign
    -signer cert.crt
    -inkey cert.key
    -certfile intermediate.pem 
    -nodetach 
    -outform der 
    -in mdm.mobileconfig 
 -out mdm-signed.mobileconfig
@allanlei
allanlei / daemonset-preloaded.yaml
Created June 26, 2020 05:40
Custom Driver Install for NVIDIA on GKE
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nvidia-driver-installer-cos
namespace: kube-system
labels:
k8s-app: nvidia-driver-installer-cos
spec:
selector:
matchLabels:
@allanlei
allanlei / ffmpeg-scale-npp
Created June 26, 2020 05:04
FFMPEG using scale_npp
ffmpeg \
-vsync 0 \
-hwaccel cuvid -c:v h264_cuvid \
-i https://twitch-event-engineering-public.s3.amazonaws.com/sync-footage/Sync-Footage-V1-H264.mp4 \
-filter_complex " \
[0:v]scale_npp=1280:720[out]
" -map '[out]' -y -c:v h264_nvenc -y output.mp4
@allanlei
allanlei / ffmpeg-blurout.sh
Last active September 24, 2021 02:24
FFmpeg Filtergraph to generate Blur Out
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 September 7, 2019 07:54
FFmpeg Filtergraph to fade in a video
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 September 7, 2019 06:51
FFmpeg Filtergraph to blur a video
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 September 7, 2019 06:27
FFmpeg Filtergraph to split inputs (with scaling)
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 / xfs-detector.yaml
Created September 16, 2018 15:07
Kubernetes XFS support detector
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
name: xfs-detector
labels:
app: xfs-detector
spec:
selector:
matchLabels: