Skip to content

Instantly share code, notes, and snippets.

View Vaisakhkm2625's full-sized avatar

Vaisakh K M Vaisakhkm2625

View GitHub Profile
@Vaisakhkm2625
Vaisakhkm2625 / sastra-lms-pdf-downloader.md
Last active July 11, 2026 10:55
Sastra uni LMS pdf downloader

Copy following bookmarklet and add to browser as a bookmark. click on it after opening lms content page.

javascript:(function(){function walk(r,d){if(d>8)return;try{var q=r.querySelectorAll('*');for(var i=0;i<q.length;i++){var e=q[i];if(e.shadowRoot){var f=walk(e.shadowRoot,d+1);if(f)return f}if(e.contentDocument){var f=walk(e.contentDocument,d+1);if(f)return f}}}catch(e){}try{var w=r.defaultView||r.ownerDocument.defaultView;if(w.PDFViewerApplication&&w.PDFViewerApplication.pdfDocument)return w.PDFViewerApplication.pdfDocument}catch(e){}try{var e=r.querySelector('d2l-pdf-viewer');if(e&&e._pdfDocument)return e._pdfDocument}catch(e){}return null}var p=walk(document,0);if(p){p.getData().then(function(b){var u=URL.createObjectURL(new Blob([b],{type:'application/pdf'}));var a=document.createElement('a');a.href=u;a.download='document.pdf';a.click()})}else{alert('Could not access PDF data')}})();
@Vaisakhkm2625
Vaisakhkm2625 / create_virtual_tailscale_netoworks.py
Created February 3, 2026 20:08
run mulitiple tailscale instances in same system, by creating virutal networks namespaces in linux
#!/usr/bin/env python3
"""
Creates an isolated network namespace with:
- veth pair + NAT for real internet access
- simple HTTP server
- tailscaled in userspace-networking mode
- joins Tailscale using ephemeral tagged auth key
Requires: root privileges, tailscale installed, requests library, iptables
"""
@Vaisakhkm2625
Vaisakhkm2625 / set-java.bat
Created November 26, 2025 09:37
swtich java version
@echo off
set "JAVA8=C:\Program Files\Eclipse Adoptium\jdk-8.0.472.8-hotspot"
set "JAVA21=C:\Program Files\Eclipse Adoptium\jdk-21.0.9.10-hotspot"
set "JAVA17=C:\Program Files\Eclipse Adoptium\jdk-17.0.17.10-hotspot"
if "%~1" == "21" (
set "JAVA_HOME=%JAVA21%"
setx JAVA_HOME "%JAVA21%"
) else if "%~1" == "17" (
set "JAVA_HOME=%JAVA17%"
@Vaisakhkm2625
Vaisakhkm2625 / a.nix
Last active November 5, 2024 14:26
non free allow nix
let
supportedSystems = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; config.allowUnfree = true; };
});
in
@Vaisakhkm2625
Vaisakhkm2625 / cloneallrepo.sh
Created September 1, 2024 17:13
clone all repo from github
eval "$(ssh-agent -s)" # Start the ssh-agent
ssh-add ~/.ssh/id_rsa # Add your SSH key:
gh repo list --json=sshUrl --limit 1000 -q ".[].sshUrl" | xargs -n1 git clone
linode
setup fedora vm
```
useradd vaisakh
passwd vaisakh
usermod -a-G wheel vaisakh
su vaisakh
sudo dnf update
@Vaisakhkm2625
Vaisakhkm2625 / starpatternsin.py
Created July 6, 2024 21:53
star-pattern-sinwave
for i in range(1,10000):
print(round(35+35*math.sin(i/5))*" ","*")