Skip to content

Instantly share code, notes, and snippets.

@PokeGuys
Last active May 29, 2021 18:49
Show Gist options
  • Save PokeGuys/40efeb353071fcc8275714daf1d45505 to your computer and use it in GitHub Desktop.
Save PokeGuys/40efeb353071fcc8275714daf1d45505 to your computer and use it in GitHub Desktop.
SSH keygen

Android

CA Cert

#!/bin/bash
CERT=$HOME/.mitmproxy/mitmproxy-ca-cert.cer
NAME=$(openssl x509 -in $CERT -subject_hash_old -noout)
cp ${CERT} ${OUT}/system/etc/security/cacerts/${NAME}.0

Security Exception

https://github.com/levyitay/AddSecurityExceptionAndroid

Mount System

mount -o rw,remount /system
mount -o ro,remount /system

Remount system on a dev mode emulator

adb root
adb remount

SSH related command

Common

Copy public key to destination

# Linux only
$ ssh-copy-id -i <public key file> [[user]@]destination

# Windows
$ type $env:USERPROFILE\.ssh\id_rsa.pub | ssh [[user]@]destination "cat >> .ssh/authorized_keys"

# Windows with bash
$ cat ~/.ssh/id_rsa.pub | ssh [[user]@]destination "cat >> .ssh/authorized_keys"

Fallback IdentityKey config

Host *
  IdentityFile ~/.ssh/id_ed25519
  IdentityFile ~/.ssh/id_rsa

Host alias

Command

$ ssh custom

Config file

Host custom
  HostName 192.168.0.1
  User test
  IdentityFile ~/.ssh/id_ed25519
  IdentitiesOnly yes

Key Generation

RSA

$ ssh-keygen -t rsa -b <bit: 4096> -f <file> -C <comment>

Ed25519

$ ssh-keygen -a <iteration: 100> -t ed25519 -f <file> -C <comment>

FFmpeg

Extract all frames

ffmpeg -hwaccel auto -y -i <fileName> -pix_fmt rgba64be "frames/out-%03d.bmp"

Show video details

ffprobe -v quiet -print_format json -show_format -show_streams <fileName>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment