Skip to content

Instantly share code, notes, and snippets.

View mahendrapaipuri's full-sized avatar
🐿️

Mahendra Paipuri mahendrapaipuri

🐿️
View GitHub Profile
@oscarzhao
oscarzhao / fd_set_linux_amd64.go
Created January 26, 2023 10:49
Go echo server by Select
//go:build amd64 && linux
package fdsetutil
import "syscall"
/**
// filepath: ztypes_linux_amd64.go
type FdSet struct {
Bits [16]int64
@xrat
xrat / sshpingpong
Last active March 16, 2023 21:44
Calculate time needed to send 1 byte back and forth within an SSH connection
#!/bin/bash
#
me=sshpingpong
#
# Measure close to minimal packet latency (RTT) of an SSH connection
#
prgversion="$me * 2022-07-27 (c) Andreas Schamanek"
#
# @author Andreas Schamanek <https://andreas.schamanek.net>
# @license GPL <https://www.gnu.org/licenses/gpl.html>
@mwouts
mwouts / _introducing_itables.md
Last active February 21, 2025 15:06
Pandas DataFrames as interactive HTML DataTables

Pandas DataFrames as interactive HTML DataTables

In Jupyter Notebook, Jupyter Lab, Google Colab, VS Code and PyCharm

Pandas DataFrames are central to Data Analysis in Python. In this post, we introduce the itables Python package that enhances how these DataFrames are displayed, by turning them into interactive HTML DataTables.


Using itables is as simple as

@vomnes
vomnes / a-server.go
Last active September 16, 2025 23:11
Minimalist TCP server/client in Go using only syscalls - Select() to handle file descriptors
package main
import (
"fmt"
"log"
"golang.org/x/sys/unix"
)
// https://www.gnu.org/software/libc/manual/html_node/Sockets.html#Sockets
@ebirn
ebirn / nodelist.py
Created October 1, 2019 15:01
magic slurm node list parser
#!/usr/bin/env python
import re
node_lists = [
"clip-g1-[0-1],clip-g2-[2-3]",
"clip-g1-0,clip-g2-0",
"clip-g1-0,clip-g2-1",
"clip-g1-1",
"clip-a-[1,3,5]",
"clip-b-[1-3,5]",
@orimanabu
orimanabu / decrypt_saml_response.py
Last active November 25, 2024 11:49
SAML Response Decrypter
#!/usr/bin/env python
# Prereq: PyCrypto
# Validation: https://www.samltool.com/decrypt.php
# Usage: ./decrypt_saml_response.py --key PRIVATE_KEY --pretty-print RESPONSE_XML
import sys
import optparse
import base64
@matthewjberger
matthewjberger / instructions.md
Last active November 2, 2025 12:12
Install a nerd font on ubuntu

1.) Download a Nerd Font

2.) Unzip and copy to ~/.fonts

3.) Run the command fc-cache -fv to manually rebuild the font cache

@bowmanmike
bowmanmike / dynamic_function_calls.go
Created February 22, 2017 19:06
Golang Dynamic Function Calling
package main
import (
"fmt"
)
// Use map[string]interface{} to pair functions to name
// Could maybe use anonymous functions instead. Might be clean
// in certain cases
var funcMap = map[string]interface{}{
@ageis
ageis / systemd_service_hardening.md
Last active December 6, 2025 17:05
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@shello
shello / randomEmoji.py
Last active March 12, 2025 19:23
Random Emoji! (for Python 3)
#!/usr/bin/env python3
from itertools import accumulate
from bisect import bisect
from random import randrange
from unicodedata import name as unicode_name
# Set the unicode version.
# Your system may not support Unicode 7.0 charecters just yet! So hipster.
UNICODE_VERSION = 6