Skip to content

Instantly share code, notes, and snippets.

@M0LTE
M0LTE / userconf.txt
Created January 17, 2024 09:36
Raspberry Pi userconf
Create a file named user userconf (or userconf.txt) containing the following:
pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0
Place userconf (or userconf.txt) plus an empty file named ssh (or ssh.txt) in the BOOT (FAT32) partition of the SD card.
Insert the SD card in the Raspberry Pi and it should boot with access to user 'pi' (password : raspberry) via SSH.
@tykurtz
tykurtz / grokking_to_leetcode.md
Last active May 18, 2024 19:07
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@makelariss
makelariss / popshellslikeitsasaturday.py
Last active May 18, 2024 19:06
NT AUTHORITY\SYSTEM through Token Impersonation using Python
# -*- coding: UTF-8 -*-
# All credits go to: https://github.com/joren485/PyWinPrivEsc/blob/master/RunAsSystem.py
from ctypes.wintypes import *
from ctypes import *
from enum import IntEnum
# These libraries have the APIs we need
kernel32 = WinDLL('kernel32', use_last_error=True)
advapi32 = WinDLL('advapi32', use_last_error=True)
psapi = WinDLL('psapi.dll', use_last_error=True)
@tzmartin
tzmartin / m3u8-to-mp4.md
Last active May 18, 2024 19:05
m3u8 stream to mp4 using ffmpeg

1. Copy m3u8 link

Alt text

2. Run command

echo "Enter m3u8 link:";read link;echo "Enter output filename:";read filename;ffmpeg -i "$link" -bsf:a aac_adtstoasc -vcodec copy -c copy -crf 50 $filename.mp4
@umayr
umayr / recover-deleted-branch.sh
Created April 1, 2016 11:41
How to recover a deleted branch
## Pre-requisite: You have to know your last commit message from your deleted branch.
git reflog
# Search for message in the list
# a901eda HEAD@{18}: commit: <last commit message>
# Now you have two options, either checkout revision or HEAD
git checkout a901eda
# Or
git checkout HEAD@{18}

Setup for MC Waterfall Server

sudo apt update && sudo apt upgrade
mkdir /home/server/games/minecraft/ && mkdir /home/server/games/minecraft/waterfall/ & mkdir /home/server/games/minecraft/project-1/ & mkdir /home/server/games/minecraft/project-2/ & mkdir /home/server/games/minecraft/project-3/ & mkdir /home/server/games/minecraft/lobby/ & mkdir /home/server/games/minecraft/survival/ & mkdir /home/server/games/minecraft/test-world/
@kmoppel
kmoppel / 2-col.sql
Last active May 18, 2024 18:59
Tables to test effect of different data types on joins with 5m rows
create unlogged table int4_aa (id int, id2 int, col1 int, col2 int, col3 text, col4 text, col5 timestamptz, col6 timestamptz);
create unlogged table int4_bb (id int, id2 int, col1 int, col2 int, col3 text, col4 text, col5 timestamptz, col6 timestamptz);
insert into int4_aa
select i, i, i, i, i, i, now(), now()
from generate_series(1, 5*1e6) i;
insert into int4_bb
select * from int4_aa;
@juanbrujo
juanbrujo / PlayStationBIOSFilesNAEUJP.md
Last active May 18, 2024 18:59
Files for PlayStation BIOS Files NA-EU-JP
@sz763
sz763 / docker_wsl2.md
Last active May 18, 2024 19:06
How to run tests with TestContainers in WSL2 without Docker Desktop

Install docker

in case you haven't docker installed, please follow this instruction https://docs.docker.com/engine/install/ubuntu/

Expose docker port

First way

Create daemon.json file in /etc/docker, with content:

{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}

Second way suggested by @maireadmccabe-fire

@seleb
seleb / roll20 map save.js
Last active May 18, 2024 18:56
script for exporting roll20 maps to an image
/**
script for exporting roll20 maps to an image
how to use:
1. open your roll20 game to the page you want to save
2. open your browser's developer tools
3. copy-paste this entire file in the console
4. hit enter
5. wait for map to save and appear in top-left
6. right-click -> save as... to export