Skip to content

Instantly share code, notes, and snippets.

View LarryCol's full-sized avatar
🎯
Focusing

LarryCol

🎯
Focusing
View GitHub Profile
@alexpaul
alexpaul / HackerRank-Questions.md
Last active July 28, 2023 05:34
HackerRank Practice Questions

HackerRank Questions / Solutions

Swift Solution

// https://www.hackerrank.com/challenges/missing-numbers/problem
@changjonathanc
changjonathanc / csv.py
Created February 8, 2021 11:58
python mmap to concatenate csv files
❯ rm out.csv
❯ cat 1.py
from glob import glob
import mmap
files = glob("data/*")
files.sort(key=lambda x: int(x.split("/")[-1].split(".")[0]))
write_f = open("out.csv", "w+b")
@LanceMcCarthy
LanceMcCarthy / UltimateListIds.md
Last active August 24, 2025 10:23
List of Package Ids
Name Package Id Version Source
7Zip 7zip.7zip 19.0.0 winget
Altap Salamander salamander choco
Alt-Tab Terminator alt-tab-terminator choco
AutoHotkey Lexikos.AutoHotkey 1.1.33.02 winget
AutoHotkey Store Edition HaukeGtze.AutoHotkeypoweredbyweatherlights.com Latest msstore (via winget)
Carnac
import random
import logging
log = logging.getLogger(__name__)
MAX_NUM_PRISONERS = 12
NUM_PRISONERS = random.randrange(2, MAX_NUM_PRISONERS + 1)
def main():
print(f'Number of prisoners: {NUM_PRISONERS}')
@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
@muff-in
muff-in / resources.md
Last active September 30, 2025 15:52
A curated list of Assembly Language / Reversing / Malware Analysis / Game Hacking-resources
import re
import argparse
def deobfuscate(input_str):
regex_str = r"[\(\{]\s*\"(?P<format>[^\)]*?)\"\s*\-f\s*(?P<params>.*?)[\)\}]"
regex = re.compile(regex_str, re.MULTILINE | re.IGNORECASE)
for match in reversed(list(regex.finditer(input_str))):
format_str = match.group('format')
@tkon99
tkon99 / guide.md
Last active January 12, 2025 19:31
Use Mosh on Windows from the Command Prompt

Hi all. After wanting true color support in Mosh (to use Brow.sh), I also wanted to integrate it more tightly with Windows. Since I reckon more people will be wanting to accomplish this, here is a guide.

  1. Install Linux Subsystem for Windows if you haven't already (https://docs.microsoft.com/en-us/windows/wsl/install-win10) (I use Ubuntu)
  2. Make sure you can execute bash from a CMD prompt.
  3. Go into the bash environment by executing bash ~ in CMD prompt
  4. Install Mosh-dev (for up-to-date version) from https://launchpad.net/~keithw/+archive/ubuntu/mosh-dev by doing sudo add-apt-repository ppa:keithw/mosh-dev then sudo apt-get update
  5. Create a new mosh.bat file on your Desktop with the following contents
@echo off
@joshschmelzle
joshschmelzle / list-ssh-sessions.md
Last active November 16, 2024 19:11
List all connected SSH sessions

How to list all connected SSH sessions

I was curious how to view sessions on a Linux box I had at my desk. Similar to the session table on an Aruba controller (show loginsessions). Here are some ways you can list active SSH sessions; some commands return more output than others. This applies to most modern Linux boxes or say a WLAN Pi.

All examples below are using 2 MobaXterm user sessions from a Windows machine to a Linux 4.14.42-sunxi64 aarch64 (NanoPi NEO2).

w

wlanpi@wlanpi:~$ w
@tkon99
tkon99 / name.js
Last active June 27, 2025 00:12
Random Name Generator for Javascript
/*
(c) by Thomas Konings
Random Name Generator for Javascript
*/
function capFirst(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function getRandomInt(min, max) {