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 / git-auto-sign-commits.sh
Created February 4, 2020 16:53 — forked from mort3za/git-auto-sign-commits.sh
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
### Keybase proof
I hereby claim:
* I am minlaxz on github.
* I am minlatt (https://keybase.io/minlatt) on keybase.
* I have a public key whose fingerprint is 70D1 7220 3C47 18D8 DC48 E3DD 3392 CF36 2148 2DE1
To claim this, I am signing this object:
@minlaxz
minlaxz / jupyter-lab.service-systemd
Last active November 12, 2023 12:03
Jupyter lab auto start or restart ( crash or server stopped ) on nvidia jetson nano or ubuntu.
# create a file and (name your wish) , then add this content to the file.
# OR
# sudo vim /etc/systemd/system/jupyter-lab.service
# paste code below
# Esc , shift z z
[Unit]
Description=Start Jupyter Lab Server at Boot
[Service]
@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:

@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 / 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 > TensorRT-7.2.1.6.Ubuntu-18.04.x86_64-gnu.cuda-11.0.cudnn8.0.tar.gz

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

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