Skip to content

Instantly share code, notes, and snippets.

View azureru's full-sized avatar
🌎
.....................................

Erwin Maulana Saputra azureru

🌎
.....................................
View GitHub Profile
@azureru
azureru / Audio and Video.md
Last active October 22, 2021 03:47
FFMPEG stream to Janus stream plugin

FFMPEG stream to Janus Server stream-plugin from Video Capture Device

FFMPEG

Using ffmpeg for windows from gyan.dev at https://www.gyan.dev/ffmpeg/builds/, it is executed in WSL shell (in case you are wondering with all the shell syntax - for cmd or PowerShell just change it to windows path)

To List DirectShow Capture Devices

See https://trac.ffmpeg.org/wiki/DirectShow

@azureru
azureru / gist:719b894c7ae615e1626529694d9a509f
Last active April 26, 2022 09:22
Go get to private self-hosted git repo with custom port.md

So one day I get unknown revision error after running go get command from private repo

The easiest solution is to just add alias to force to use ssh (so credential will use our underlying ~/.ssh)

[url "ssh://git@theprivaterepo.com:2222/"]
	insteadOf = https://theprivaterepo.com/

Some recomend to use .netrc or use git credential provider

@azureru
azureru / Redis Cheatsheets.md
Last active February 9, 2021 18:09
Eval Redis Cheatsheets

Delete Keys By Pattern

If for example your redis instance disable flushall or flushdb

# using LUA in redis-cli
eval "for _,k in ipairs(redis.call('keys','flag:*')) do redis.call('del',k) end" 0

Keybase proof

I hereby claim:

  • I am azureru on github.
  • I am azureru (https://keybase.io/azureru) on keybase.
  • I have a public key whose fingerprint is 9395 B8CA C51B FD8E 9BB2 6419 5DCD 4150 C59E AA8C

To claim this, I am signing this object:

@azureru
azureru / rotate.sh
Last active June 24, 2020 01:38
Log Rotate
#!/bin/bash
### User Pass Mysql ###
USER=backup
PASS=backup
DBNAME=project_sql
BACKUP_DIR="/root/backup"
DST_HOST="user@host"
REMOTE_DST_DIR="/root/backup"
BACKUP_DAILY=true # if set to false backup will not work
@azureru
azureru / k8.md
Last active March 17, 2018 19:40
Kubernetes Cheatsheet

Starting Up

If you manage it everyday - add this to your .basrc or .bash_profile or cloud-console. If not then all k in this cheatsheet means kubectl

alias k="kubectl"
To gain access to a pod
@azureru
azureru / Bash-Cheatsheet
Last active November 9, 2017 10:21
Feeding FTP using Image from Internet
#!/bin/bash
wget https://image
ftp -n <<EOF
open ftp.example.com
user user secret
put my-local-file.txt
EOF
@azureru
azureru / ffmpeg-time-lapse.bash
Last active November 9, 2017 09:54
FFMPEG Time Lapse
# concat images
ffmpeg -r 30 -f image2 -s 1920x1080 -i end%05d.png -vcodec libx264 -crf 25 -pix_fmt yuv420p part0.mp4
# concat videos
for f in ./part*.mp4; do echo "file '$f'" >> mylist.txt; done
fmpeg -f concat -safe 0 -i mylist.txt -c copy output.mp4
@azureru
azureru / digital-ocean DNS on node-red.js
Last active May 27, 2017 15:58
Node-red Dyndns using digitalocean
// the node-script
var request = global.get('request');
var accessToken = "YOURACCESSTOKEN";
var domain = "YOURDOMAIN";
var record = "YOURDNSRECORD";
var ip = msg.payload;
var options = {