Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View manashmandal's full-sized avatar
👨‍💻
Probably Coding || ! Probably Coding

Manash Kumar Mandal manashmandal

👨‍💻
Probably Coding || ! Probably Coding
View GitHub Profile
@manashmandal
manashmandal / disable-nouveau.sh
Created September 13, 2019 14:03
Disable Nouveau Driver
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
[
{
"Name": "chevrolet chevelle malibu",
"Miles_per_Gallon": 18,
"Cylinders": 8,
"Displacement": 307,
"Horsepower": 130,
"Weight_in_lbs": 3504,
"Acceleration": 12,
"Year": "1970-01-01",
@manashmandal
manashmandal / script.sh
Created August 22, 2019 09:35
Bash hacks
# Change extension of files
for f in $(ls); do mv $f $(echo $f | cut -d "." -f 1).jpeg ; done
@manashmandal
manashmandal / cloudSettings
Last active October 16, 2021 17:28
Visual Studio Code Settings Sync Gist
{"lastUpload":"2021-10-16T17:27:58.934Z","extensionVersion":"v3.4.3"}
@manashmandal
manashmandal / egghead_downloader.py
Last active May 27, 2019 20:51
Egghead Course Download Script
from lxml import html
import requests
import os
import json
from tqdm import tqdm
COURSES = """https://egghead.io/courses/cycle-js-fundamentals
https://egghead.io/courses/use-d3-v3-to-build-interactive-charts-with-javascript
@manashmandal
manashmandal / mongodb.sh
Last active April 21, 2019 16:23
Mongo Installation
manash@XPS:/opt/robo3t$ sudo ln -s /opt/robo3t/bin/robo3t /usr/bin/robo3t
manash@XPS:/opt/robo3t$ nano ~/.local/share/applications/robo3t.desktop
[Desktop Entry]
Encoding=UTF-8
Name=Robo3t
Exec=robo3t
Icon=/opt/robo3t/bin/logo-256x256.png
Terminal=false
Type=Application
@manashmandal
manashmandal / script.py
Created March 12, 2019 06:15
Asyncio send concurrent requests and save responses in mongo
import asyncio
import aiohttp
import motor.motor_asyncio
client = motor.motor_asyncio.AsyncIOMotorClient()
db = client['async_db']
async_collection = db['async_collection']
async def send_request(session):
@manashmandal
manashmandal / script.py
Last active March 4, 2019 05:46
Batch Delete GitHub Forked Repository
# Install tqdm and requests to run this script
import requests
from tqdm import tqdm
ACCESS_TOKEN = "ACCESS_TOKEN_WITH_DELETE_ACCESS"
USERNAME = "your-github-username"
LIST_REPOSITORY = "https://api.github.com/users/your-github-username/repos?page={}"
API_DELETE_REPO = "https://api.github.com/repos/your-github-username/{}"
def crop(image, ws=2, margin=7, scale_factor=0.5):
actual_border = None
img = np.copy(image)
hist = np.sum(img, axis=0)
# Keep only left half
hist = hist[ : len(hist) // 3 ]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.