Skip to content

Instantly share code, notes, and snippets.

View sahilbathla's full-sized avatar

Sahil Batla sahilbathla

View GitHub Profile
@sahilbathla
sahilbathla / cowin-book.js
Created May 10, 2021 18:36
Cowin book (Web)
//This script will auto select a vaccination in Delhi center only, To use login to https://selfregistration.cowin.gov.in/appointment and select state as Delhi, Leave District empty and run this script in developer console of your browser. Sit & wait till it finds a slot
let district=-1,seatSelect=()=>setTimeout(()=>(console.log("trying to select seat")||document.querySelectorAll(".slots-box:not(.no-seat):not(.no-available)")[0]?document.querySelectorAll(".slots-box:not(.no-seat):not(.no-available)")[0].click():play())||setTimeout(()=>document.getElementsByClassName("time-slot")[0].click(),1500),2e3),play=()=>(district=(district+1)%11)&document.querySelector(".pin-search .mat-select-arrow").click()||setTimeout(()=>document.querySelectorAll("mat-option")[district].click()||document.querySelector(".pin-search-btn").click()||setTimeout(()=>document.querySelector(".agefilterblock div label").click()||seatSelect(),2500),300);play(),console.log("Credits-sahil@decabits.com");
@sahilbathla
sahilbathla / gist:6891a15e6b026afee365b399c7ba1114
Last active January 9, 2019 11:29
Free up space from Ubuntu (/dev/sda1) : Temp fixes (No space left on device)
# Basic cleaning you can do safely
sudo -i
sudo dpkg --configure -a
apt-get autoremove --purge
apt-get autoclean
apt-get clean
rm -rf /var/cache/apt/archives/*
find /var/log -name '*.gz' -delete