Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:
What's happening?

Allan Lei allanlei

:shipit:
What's happening?
View GitHub Profile
@allanlei
allanlei / daemonset-preloaded.yaml
Created Jun 26, 2020
Custom Driver Install for NVIDIA on GKE
View daemonset-preloaded.yaml
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 Jun 26, 2020
FFMPEG using scale_npp
View ffmpeg-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 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 / xfs-detector.yaml
Created Sep 16, 2018
Kubernetes XFS support detector
View xfs-detector.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
namespace: kube-system
name: xfs-detector
labels:
app: xfs-detector
spec:
selector:
matchLabels:
@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 / rbac.yaml
Created Sep 15, 2018
Kubernetes Node Labeling permissions
View rbac.yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: node-labeler
rules:
- apiGroups: [""]
resources: ["node"]
verbs: ["list", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1beta1
@allanlei
allanlei / redis.yaml
Created Sep 15, 2018
Kubernetes System THP nodeAffinity
View redis.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
template:
You can’t perform that action at this time.