Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍💻
Probably Coding || ! Probably Coding

Manash Kumar Mandal manashmandal

👨‍💻
Probably Coding || ! Probably Coding
View GitHub Profile
@manashmandal
manashmandal / download.sh
Created May 3, 2020
Download Asset from Private Repo
View download.sh
curl -L -H 'Accept: application/octet-stream' -H "Authorization: token $TOKEN" 'https://api.github.com/repos/:owner/:repo/releases/assets/:asset_id' --output output.format
@manashmandal
manashmandal / fetch.py
Created Apr 28, 2020
Asyncio Concurrent Request
View fetch.py
# Need at least Python 3.7 To Run this code
import asyncio
import aiohttp
endpoint = "https://randomuser.me/api/"
num_concurrent_requests = 20
async def fetch(session, url):
async with session.get(url) as response:
@manashmandal
manashmandal / index.js
Created Apr 27, 2020
Concurrent Requests Using NodeJs
View index.js
const axios = require("axios");
const endpoint = "https://randomuser.me/api";
const totalRequests = 20;
(async () => {
let requests = [];
for (let i = 0; i < totalRequests; i++) {
requests.push(axios.get(endpoint));
}
Promise.all(requests)
.then((responses) => {
View self_ngrok.sh
ssh -i key.pem -R remote_open_port:localhost:local_open_port user@domain
@manashmandal
manashmandal / variable_rnn_torch.py
Created Feb 10, 2020 — forked from dolaameng/variable_rnn_torch.py
Variable Length Sequence for RNN in pytorch Example
View variable_rnn_torch.py
import torch
import torch.nn as nn
from torch.autograd import Variable
batch_size = 3
max_length = 3
hidden_size = 2
n_layers =1
# container
View commands.sh
sudo apt-get install -y python3.8 python3.8-dev
rm -rf /app/tradingbot/venv
cd /app/tradingbot
virtualenv venv --python /usr/bin/python3.8
@manashmandal
manashmandal / letsencrypt_2019.md
Created Oct 23, 2019 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)
View letsencrypt_2019.md

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

View disable-nouveau.sh
sudo bash -c "echo blacklist nouveau > /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo bash -c "echo options nouveau modeset=0 >> /etc/modprobe.d/blacklist-nvidia-nouveau.conf"
sudo update-initramfs -u
View carsData.json
[
{
"Name": "chevrolet chevelle malibu",
"Miles_per_Gallon": 18,
"Cylinders": 8,
"Displacement": 307,
"Horsepower": 130,
"Weight_in_lbs": 3504,
"Acceleration": 12,
"Year": "1970-01-01",
View script.sh
# Change extension of files
for f in $(ls); do mv $f $(echo $f | cut -d "." -f 1).jpeg ; done