Skip to content

Instantly share code, notes, and snippets.

View pramitbiswas's full-sized avatar

Pramit Biswas pramitbiswas

View GitHub Profile
@pramitbiswas
pramitbiswas / create-iso.sh
Created May 30, 2017 07:42 — forked from julianxhokaxhiu/create-iso.sh
Simple bash script to create a Bootable ISO from macOS Sierra Install Image from Mac App Store
#!/bin/bash
#
# Credits to fuckbecauseican5 from https://www.reddit.com/r/hackintosh/comments/4s561a/macos_sierra_16a238m_install_success_and_guide/
# Adapted to work with the official image available into Mac App Store
#
# Enjoy!
hdiutil attach /Applications/Install\ macOS\ Sierra.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
hdiutil create -o /tmp/Sierra.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sierra.cdr.dmg -noverify -nobrowse -mountpoint /Volumes/install_build
@pramitbiswas
pramitbiswas / LaTex.gitignore
Last active September 24, 2018 18:00
Gitignore for Tex (LaTex)
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
@pramitbiswas
pramitbiswas / concat.bat
Last active October 5, 2018 08:11
Download YouTube playlist into a folder (using youtube-dl), merge/concatenate all videos in to one (using ffmpeg), remove all files except final full video
ren *.mp4 ???????.*
powershell -noexit "& "".\rmSpaceScript.ps1"""
(for %i in (*.mp4) do @echo file '%i') > fileList.txt
ffmpeg -f concat -i fileList.txt -c copy Full.mp4
for /f %F in ('dir /b /a-d ^| findstr /vile "op.mp4"') do del "%F"
@pramitbiswas
pramitbiswas / latestUserAgent.py
Created August 4, 2020 18:03
Give user-agent as per installed chrome browser, and check for updated user-agent after every six months
from dateutil import relativedelta
from os import path
import json
import datetime
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
def getUA():
driver = webdriver.Chrome(ChromeDriverManager().install())
@pramitbiswas
pramitbiswas / loadCsvOhlcvData.py
Created April 25, 2021 14:59
Load OHLCV data from csv file to a dataframe with given datetime range
import pandas as pd
import datetime as dt
startDateTime="2019-01-01"
endDateTime="2021-04-13"
# Get Data
df=pd.read_csv('myfile.csv')
# "Date" loaded as str, converted to datetime
df["Date"]=df["Date"].apply(lambda s: dt.datetime.strptime(s,"%Y-%m-%d"))