Skip to content

Instantly share code, notes, and snippets.

View 0x48piraj's full-sized avatar

Piyush Raj 0x48piraj

View GitHub Profile
@0x48piraj
0x48piraj / MUJ-DMSAuth.py
Last active March 17, 2020 09:41
Manipal University Jaipur DMS Session Authentication Snippet
import requests
from requests.packages.urllib3.exceptions import InsecureRequestWarning
requests.packages.urllib3.disable_warnings(InsecureRequestWarning)
payload = { 'txtUserid': 'studentReg', 'txtpassword': 'studentPassword' }
url = 'https://dms.jaipur.manipal.edu/loginForm.aspx'
requests.Session().post(url, data=payload, verify=False).cookies.get_dict()
@0x48piraj
0x48piraj / 2010.txt
Created March 17, 2020 09:49
Visualization of Indian Institutes of Technology (IITs) MCQ Question Paper Answers (https://medium.com/manipal/jee-mains-analysis-d89387d3a180)
1-1
2-2
3-2
4-3
5-4
6-1
7-2
8-3
9-2
10-3
@0x48piraj
0x48piraj / receive-image.py
Created April 6, 2020 00:40
Receiving Images From a Raspberry Pi via Python Sockets
import io
import socket
import struct
from PIL import Image
# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means all interfaces)
server_socket = socket.socket()
server_socket.bind(('0.0.0.0', 8000))
server_socket.listen(0)
@0x48piraj
0x48piraj / stream.py
Created April 6, 2020 00:42
Video Streaming Raspberry Pi Camera Via Python Sockets & VLC Media Player
import socket
import subprocess
# Start a socket listening for connections on 0.0.0.0:8000 (0.0.0.0 means all interfaces)
server_socket = socket.socket()
server_socket.bind(('0.0.0.0', 8000))
server_socket.listen(0)
# Accept a single connection and make a file-like object out of it
connection = server_socket.accept()[0].makefile('rb')
@0x48piraj
0x48piraj / caesar.sh
Created September 24, 2020 12:56
Bash one-liner for breaking caesar cipher.
#!/bin/bash
tr 'A-Z' 'a-z' < $2 | tr 'a-z' $( echo {a..z} | sed -r 's/ //g' | sed -r "s/(.{$1})(.*)/\2\1/" )
@0x48piraj
0x48piraj / CLOC.sh
Created September 25, 2021 09:37
CLOC: Count the lines of code of any project recursively grouped by file extensions
find ./ -not -path "./.git/*" -type f -exec wc -l {} + |
awk '{print tolower($0)}' |
sed -e '$ d' |
sed -e "s#/.*/##g" |
sed -e "s/\./ \./g" |
awk '
{ if ( NF <= 2 ) { count["none"] += $1 } else { count[$NF] += $1 } }
{ next }
END { for (group in count) printf("%d%s%s\n", count[group], OFS, group) }
' |
@0x48piraj
0x48piraj / tiani.js
Created October 27, 2022 11:34
A small function for creating beautiful ASCII based animations on your website's title.
/*
usage: ASCIIAnimation(param1, param2, param3)
param1 - array of animation 'frames' (strings)
param2 - speed of animation in ms
usage:
var anim = new ASCIIAnimation([":)",":|",":("], 100);
*/
@0x48piraj
0x48piraj / fix-bootloader.ps1
Created September 30, 2023 17:47
Removing GNU GRUB on UEFI Systems After Deleting Ubuntu Partition (without using any removable device techniques)
mountvol S: /S
S:
cd .\EFI\
dir
rd /S Ubuntu
@0x48piraj
0x48piraj / lfs-bandwidth-circumnavigation.md
Created December 11, 2023 20:26
Circumnavigation for fetching/cloning/downloading remote repository with LFS files

Error message

This repository is over its data quota.
Account responsible for LFS bandwidth should purchase more data packs to restore access.

Solution

  1. Fork the target repository.
@0x48piraj
0x48piraj / python-utils.py
Last active December 14, 2023 05:36
Random scripts and procedures in a nice little package.
def citup(lst):
"""
chunk-it-up: break a list into n-sized chunks
"""
return [lst[i:i+n] for i in range(0, len(lst), n)]
mixedlol = [["a", 500, datetime.datetime], ["b", 1000, datetime.datetime], ["C", 1500, datetime.datetime]] # list of lists
def hoelol(mixedlol):