Skip to content

Instantly share code, notes, and snippets.

View nileshevrywhr's full-sized avatar
🍉
juicing watermelons

Nilesh Kumar nileshevrywhr

🍉
juicing watermelons
View GitHub Profile
@nileshevrywhr
nileshevrywhr / createToken.py
Last active July 20, 2020 15:03
JWT using RS256
import base64
import rsa
import hashlib
(pubkey, privkey) = rsa.newkeys(512)
with open('private.key','wb') as keyfile:
keyfile.write(privkey._save_pkcs1_pem())
with open('public.key','wb') as keyfile:
keyfile.write(pubkey._save_pkcs1_pem())
@nileshevrywhr
nileshevrywhr / getHighlights.sh
Last active July 22, 2021 06:46
IG highlights dl
jq --raw-output '.log.entries | .[].request | select(.url|test("^https://instagram.fdel*")) .url' stories.har > highlights.txt
while IFS= read -r line; do wget $line; done < highlights.txt
@nileshevrywhr
nileshevrywhr / save_free_daily.py
Created May 9, 2021 12:11
save the free daily blinkist offline in markdown format
import requests
from bs4 import BeautifulSoup
host = "https://www.blinkist.com"
headers = {"User-Agent": "Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0"}
free_daily = requests.get("https://www.blinkist.com/en/nc/daily", headers=headers)
html = BeautifulSoup(free_daily.content, 'html.parser')
headline = html.find("h3", class_="daily-book__headline").get_text()
author = html.find(class_="daily-book__author")