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 / cloudSettings
Last active Oct 16, 2021
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2021-10-16T17:27:58.934Z","extensionVersion":"v3.4.3"}
@manashmandal
manashmandal / .block
Created Dec 23, 2016
Concept Network on BD News Analysis
View .block
license: mit
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
@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 / 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:

@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 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 self_ngrok.sh
ssh -i key.pem -R remote_open_port:localhost:local_open_port user@domain