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 / 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

@minlaxz
minlaxz / modern_js.md
Created October 26, 2020 12:30 — forked from gaearon/modern_js.md
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@minlaxz
minlaxz / minification.md
Created October 26, 2020 09:40 — forked from gaearon/minification.md
How to Set Up Minification

In production, it is recommended to minify any JavaScript code that is included with your application. Minification can help your website load several times faster, especially as the size of your JavaScript source code grows.

Here's one way to set it up:

  1. Install Node.js
  2. Run npm init -y in your project folder (don't skip this step!)
  3. Run npm install terser

Now, to minify a file called like_button.js, run in the terminal: