Skip to content

Instantly share code, notes, and snippets.

View mohnkhan's full-sized avatar
🎯
Focusing on Artificial Intelligence powered Automation

Mohiuddin Khan Inamdar mohnkhan

🎯
Focusing on Artificial Intelligence powered Automation
View GitHub Profile
@mohnkhan
mohnkhan / clonewebsite.sh
Created August 21, 2024 08:53
CloneWebsite for scraping using commandline
wget --server-response \
--no-verbose \
--adjust-extension \
--convert-links \
--force-directories \
--backup-converted \
--compression=auto \
-e robots=off \
--restrict-file-names=unix \
--timeout=60 \

Checking out Source

  • clone latest source repository by git clone https://www.github.com/openwrt/openwrt -b branch_name
  • Now change directory to openwrt by cd openwrt.This is our <buildroot dir> for this guide.

Updating Feeds

  • Update feeds: ./scripts/feeds update -a
  • Make downloaded package(s) available in make menuconfig:
    • single package : ./scripts/feeds install <PACKAGENAME>
    • all packages : ./scripts/feeds install -a

Image Configuration

@mohnkhan
mohnkhan / LogitechF310_Macbook.MD
Created March 24, 2024 15:25 — forked from jackblk/LogitechF310_Macbook.MD
Getting Logitech F310 to work with Macbook USB-C port

Connect & use Logitech F310 with Macbook

Since my Macbook Pro only has USB-C port, I used an USB-A to USB-C adapter to connect my F310 to it, but it does not work (pressing MODE button does not turn on the LED).

How to

To make it work:

  • Disconnect F310 from Mac
  • On F310: switch X-input to D-input
  • Hold Logitech button (in the middle)
  • Connect F310 to Mac via adapter, now you can release the Logitech button.
@mohnkhan
mohnkhan / AutoCompeteSentence.py
Created November 28, 2023 15:15
Auto Compete Sentence Python GPT2 and Python - Predict next word
# -*- coding: utf-8 -*-
"""
@author:
"""
# Import required libraries
import torch
from pytorch_transformers import GPT2Tokenizer, GPT2LMHeadModel
# Load pre-trained model tokenizer (vocabulary)
@mohnkhan
mohnkhan / gist:5877db5db95a5595ca12961bfdb13ed6
Created November 16, 2023 22:01
Connecting Logitech Gamepad F310 to Mac OS Arm or AMD64
# Connect & use Logitech F310 with Macbook
Since my Macbook Pro only has USB-C port, I used an USB-A to USB-C adapter to connect my F310 to it, but it does not work (pressing MODE button does not turn on the LED).
## How to
To make it work:
* Disconnect F310 from Mac
* On F310: switch X-input to D-input
* Hold **Logitech** button (in the middle)
* Connect F310 to Mac via adapter, now you can release the Logitech button.
@mohnkhan
mohnkhan / Deep Learning.txt
Created November 9, 2020 14:08
Deep Learning Online Courses and Tutorials
https://cds.nyu.edu/deep-learning/
@mohnkhan
mohnkhan / gist:25f0f89ddda98c281d820a3010c50c62
Created October 20, 2020 14:48 — forked from paulirish/gist:5558557
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

@mohnkhan
mohnkhan / nginx-Anti-DoS-Attack.conf
Created June 23, 2020 16:24
Anti DoS Attack Nginx.conf
user nginx;
# one(1) worker or equal the number of _real_ cpu cores. 4=4 core cpu
worker_processes 4;
# renice workers to reduce priority compared to system processes for
# machine health. worst case nginx will get ~25% system resources at nice=15
worker_priority -5;
@mohnkhan
mohnkhan / htaccess re-directs
Created June 1, 2020 11:31
Common useful htaccess redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
#!/bin/bash
## INSTALLATION: script to copy in your Xcode project in the same directory as the .xcodeproj file
## USAGE: ./run-sonar.sh
## DEBUG: ./run-sonar.sh -v
## WARNING: edit your project parameters in sonar-project.properties rather than modifying this script
#
trap "echo 'Script interrupted by Ctrl+C'; stopProgress; exit 1" SIGHUP SIGINT SIGTERM
function startProgress() {