Skip to content

Instantly share code, notes, and snippets.

View shivams's full-sized avatar

shivams

  • Texas A&M University
  • College Station, Texas
View GitHub Profile
@shivams
shivams / hashcat_benchmark_results.txt
Last active April 26, 2024 02:29
Dual 3090 Ti hashcat benchmark inside QEMU Ubuntu VM with GPU Passthrough (amazed to see that it gives the same performance as bare metal)
hashcat (v6.2.5) starting in benchmark mode
Benchmarking uses hand-optimized kernel code by default.
You can use it in your cracking session by setting the -O option.
Note: Using optimized kernel code limits the maximum supported password length.
To disable the optimized kernel code in benchmark mode, use the -w option.
CUDA API (CUDA 12.4)
====================
* Device #1: NVIDIA GeForce RTX 3090 Ti, 23973/24240 MB, 84MCU
@shivams
shivams / summarize_dict.py
Last active December 17, 2023 00:35
Summarize Nested Python Dict
def summarize_dict_structure_v3(d, indent=0):
"""Recursively prints the structure of a nested dictionary, including lists.
If a list has multiple elements, it iterates only over the first element.
IMP NOTE: It assumes that a nested list would have uniform elements of same type,
so it doesn't iterate over the whole list, rather looks at its first element.
"""
for key, value in d.items():
print(' ' * indent + str(key), end=': ')
if isinstance(value, dict):
print("{Dictionary}")
@shivams
shivams / rsync-dry-run-issue.sh
Last active July 27, 2023 12:28
Rsync --dry-run issue
mkdir ~/temp && cd ~/temp
mkdir dir1 dir2
cd ~/temp/dir1
echo Hello > a.txt
echo World > b.txt
cp -p ~/temp/dir1/b.txt ~/temp/dir2
# Now, dir2 contains "b.txt" file from dir1
# Hence, using rsync dry-run, it should only show "a.txt" as the file that is going to be transferred.
@shivams
shivams / http-server.py
Created January 12, 2021 13:04
This is a simple HTTP server developed for Recurse Center's application.
#!/usr/bin/env python
#((2021-01-12)) For Recurse Center
import socket
import re
SERVER_HOST = "localhost"
SERVER_PORT = 4000
server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@shivams
shivams / tic-tac-toe.py
Created December 31, 2020 22:22
This is a game of tic-tac-toe developed for Recurse Center's application.
#!/usr/bin/python
#A game of tic-tac-toe for Recurse Center
#Instead of crosses and zeros, I've used 0's and 1's to depict player-0 and player-1 respectively
import os
def display():
'''
This function displays the board
@shivams
shivams / .XCompose
Last active May 10, 2020 11:46
My `~/.XCompose` file. Modified from the Fabien's version.
#|
#| File : ~/.XCompose
#| Author : Fabien Cazenave
#| Source : https://github.com/fabi1cazenave/dotFiles
#| Licence : WTFPL
#|
include "/usr/share/X11/locale/en_US.UTF-8/Compose"
# These files are worth checking for more ~/.XCompose madness:
@shivams
shivams / textlive-full-beefless.md
Last active December 19, 2023 04:46
`texlive-full` without the beef

TLDR;

On an Debian/Ubuntu-based system, to install texlive-full without docs and language packs, simply do this:

sudo apt install `sudo apt --assume-no install texlive-full | \
		awk '/The following additional packages will be installed/{f=1;next} /Suggested packages/{f=0} f' | \
		tr ' ' '\n' | grep -vP 'doc$' | grep -vP 'texlive-lang' | grep -vP 'latex-cjk' | tr '\n' ' '`

After this, if you wish to install the language packs, selectively install them. E.g.:

@shivams
shivams / zulip.kritsnam.in-1525342157116.log
Created May 3, 2018 10:11
JS Console Log for non-admiin users on zulip.kritsnam.in
ajax.js:71 GET https://zulip.kritsnam.in/static/locale/en/translations.json 404 (Not Found)
r @ ajax.js:71
value @ index.js:82
value @ index.js:75
t.read @ BackendConnector.js:166
e @ BackendConnector.js:236
(anonymous) @ BackendConnector.js:247
(anonymous) @ BackendConnector.js:246
t.load @ BackendConnector.js:247
(anonymous) @ i18next.js:232

Keybase proof

I hereby claim:

  • I am shivams on github.
  • I am shivam (https://keybase.io/shivam) on keybase.
  • I have a public key ASDXZpS04HZ2BKoctkVjbHvD-VyR5NkeGhIejma2Sp63jAo

To claim this, I am signing this object: