Skip to content

Instantly share code, notes, and snippets.

View debakarr's full-sized avatar
😅
I may be slow to respond.

Debakar Roy debakarr

😅
I may be slow to respond.
View GitHub Profile
@bleungatchromium
bleungatchromium / godzilla-billboard.txt
Created July 5, 2022 13:46
QSI Thunderbolt4 Godzilla Hub Billboard Device - lsusb -v
Bus 001 Device 002: ID 2bef:9065 Quanta Storage Inc. QSI Thunderbolt4 Godzilla Hub
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.01
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x2bef
@victorlin
victorlin / github-delete-stale-branches.js
Last active March 20, 2024 02:27
Delete stale branches from the GitHub repo's stale branches page (github.com/user/repo/branches/stale). Originally from https://stackoverflow.com/a/69089905
// Paste in browser console and run
async function deleteStaleBranches(delay=500) {
var stale_branches = document.getElementsByClassName('js-branch-delete-button');
for (var i = 0; i < stale_branches.length; i++)
{
stale_branches.item(i).click();
await new Promise(r => setTimeout(r, delay));
}
}
@BigNerd
BigNerd / k9s.txt
Last active May 14, 2025 21:54
K9s column descriptions
View: Pods(<namespace>)[number of pods listed]
NAME pod name
READY number of pods in ready state / number of pods to be in ready state
RESTARTS number of times the pod has been restarted so far
STATUS state of the pod life cycle, such as Running | ... | Completed
CPU current CPU usage, unit is milli-vCPU
MEM current main memory usage, unit is MiB
%CPU/R current CPU usage as a percentage of what has been requested by the pod
%MEM/R current main memory usage as a percentage of what has been requested by the pod
import hashlib
from Crypto import Random
from Crypto.Cipher import AES
from base64 import b64encode, b64decode
class AESCipher(object):
def __init__(self, key):
self.block_size = AES.block_size
self.key = hashlib.sha256(key.encode()).digest()
@mazenovi
mazenovi / vault-tree
Last active October 8, 2024 03:39
explore recursively your vault by HashiCorp
#!/usr/bin/env bash
function walk() {
for secret in $(vault list $1 | tail -n +3)
do
if [[ ${secret} == *"/" ]] ; then
walk "${1}${secret}"
else
echo "${1}${secret}"
fi
@swalkinshaw
swalkinshaw / tutorial.md
Last active February 26, 2025 21:15
Designing a GraphQL API
@letientai299
letientai299 / mermaid-pandoc-guide.md
Last active May 21, 2025 11:47
Render PDF from markdown that using mermaid

Render PDF from Markdown that using mermaid

You will need:

This guide is based on Ubuntu, for other OS, use their package manager instead.

GitHub Markup Reference

GitHub supports a number of

@korakot
korakot / colab_download.py
Created November 15, 2017 08:40
Google colab file upload/download
files.download('example.txt') # from colab to browser download
@iankronquist
iankronquist / 0-Programming-Paradigms.md
Last active May 29, 2025 06:50
The Fundamentals of Programming

Programming Paradigms

In programming, a paradigm is an abstract way to understand and solve a problem. A paradigm is like a perspective, a high point from which you can survey the terrain and try to decide the path your journey will take.

Toay, there are three major programming paradigms:

  1. Imperative Programming.
  2. Object Oriented Programming (OOP).
  3. Functional Programming (FP).

In principle any language can be used to program in any paradigm, but in practice certain languages tend to favor certain paradigms.