Skip to content

Instantly share code, notes, and snippets.

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

Erwin Maulana Saputra azureru

🌎
.....................................
View GitHub Profile
@azureru
azureru / extract android kernel.md
Last active March 17, 2024 21:54
How to Extract Android Kernel And Modify The Boot Ramdisk (Android 4.4) on Allwinner based Processor

Extracting Existing Kernel + Ramfs

Enter the machine using adb shell

Run cat /proc/partitions

  #  Path                     Purpose        Size
  0 /dev/block/mmcblk0                       7761920
  1 /dev/block/mmcblk0p1      data           6085631
@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 / 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 / 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
@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

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 / install.sh
Created May 20, 2017 20:30
Node-Red On Armbian
# remove repo versions
sudo apt-get remove -y nodered nodejs nodejs-legacy npm
sudo apt-get autoremove -y
# use nodesource
curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -
# necessary dependencies (e.g for node-gyp) and ofcourse the node itself
sudo apt-get install -y build-essential python-dev nodejs
@azureru
azureru / depops-cheatsheet.md
Last active July 2, 2019 10:58
Devops Cheat Sheet

Permission Cheat Sheet

You will use this one a lot in Wordpress :P

   chown -R www-data:www-data ./
   // set the proper owner
@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