Skip to content

Instantly share code, notes, and snippets.

@lightdiscord
lightdiscord / README.md
Last active August 8, 2026 07:19
Proof of concept to use HAProxy to route traffic to relevant Minecraft server (not thoroughly tested)

Proof of concept to use HAProxy to route traffic to relevant Minecraft server (not thoroughly tested)

  • Currently using static IP addresses in Map file, if using DNS name they need to be resolved
@lightdiscord
lightdiscord / script.js
Created February 22, 2022 01:29
antiwordle.com word finder
const allWords = ["BUNCH","TABLE","GUEST","WATCH","SALES","OFTEN","MORAL","BENCH","MAYOR","STARE","LABOR","CLASS","STILL","WOMAN","REPLY","ENJOY","CLEAN","SOUTH","SAUCE","BRAIN","QUICK","WHERE","SHAKE","VALUE","NERVE","MAYBE","LIGHT","KNIFE","SPORT","WRITE","GRAVE","TASTE","CREAM","SOUND","TRACK","APPLE","JOINT","ADMIT","TROOP","POUND","GIVEN","AWARE","STAIR","FLESH","THERE","DRESS","THROW","ASIDE","HEART","BRUSH","SMOKE","LUNCH","GUARD","EVENT","BRAND","PAUSE","RIGHT","ANGER","STYLE","PROVE","CHEAP","GLOVE","MOUNT","MONTH","SALAD","TERMS","TODAY","ORDER","GRADE","TOUGH","COACH","SWING","MATCH","WOULD","BOARD","TEACH","MODEL","SOLID","FIFTH","GRASS","PIANO","BLOCK","SHELF","FAITH","CHILD","STAFF","NOVEL","TIRED","YOUNG","REACT","ADAPT","DRINK","ALBUM","CIVIL","CHART","QUOTE","STRIP","FUNNY","YOURS","WORLD","ALIVE","WHEEL","TRIAL","WHOLE","EARTH","RIFLE","IDEAL","CRACK","SCOPE","CLEAR","NAKED","PLANT","HUMAN","FIGHT","WORTH","YOUTH","DOZEN","AFTER","WATER","SUPER","SOLVE","LATER","FIELD","PLACE","PLANE","DRAMA
@lightdiscord
lightdiscord / script.js
Last active February 21, 2022 18:12
nerdlegame.com decode response to plaintext
// Decode the response from the server
function decode(plain) {
return String.fromCharCode(...[...plain].map((c) => (c.charCodeAt(0) + 113) % 126))
}
@lightdiscord
lightdiscord / console.sh-session
Last active January 13, 2022 13:49
Use bytes stored near other when pointer points to a bigger type.
$ clang -Wall -Wextra -g3 ./main.c -o main && ./main
deadbeef
@lightdiscord
lightdiscord / main.cpp
Last active October 6, 2021 23:17
Solution to the enum and union without union because of destructors problem (sad c++98 noises), solution using templates.
#include <iostream>
#include <stdexcept>
#include <vector>
#include <string>
template <class T> struct size_of {
static const int size = sizeof(T);
};
template <> struct size_of<void> {
@lightdiscord
lightdiscord / README.md
Last active October 3, 2021 12:13
Writeup TSG2021 - Begginer's reverse

writeup-tsg-2021

beginner's reverse

The challenge is a crackme, it asks for an argument of 32 chars and gives it to a check function.

This check function fork the program multiple times and redirect the stdout of the child to /dev/null.

@lightdiscord
lightdiscord / main.c
Created September 16, 2021 15:37
Observation on signal accumulation
#include <unistd.h>
#include <signal.h>
#include <assert.h>
#include <stdio.h>
#include <sys/wait.h>
void handle_sender(pid_t receiver) {
for (int i = 0; i < 10; i++) {
usleep(100);
puts("Signal sent");
@lightdiscord
lightdiscord / README.md
Last active September 30, 2021 02:06
Troobleshooting of controller hot plugging for steam-run

Every command is done under a nix-shell opened with the following command.

$ nix-shell -p gcc SDL2 steam-run

First thing compile the executable to debug controller hot plugging.

$ gcc ./main.c -o ./main -lSDL2
@lightdiscord
lightdiscord / main.cpp
Last active August 31, 2021 13:20
Checking if vector re-allocation invoke the copy constructor of each element
#include <iostream>
#include <vector>
class Item {
private:
char identifier;
public:
Item(char identifier) : identifier(identifier) {
std::cout << "Item's " << identifier << " constructor called" << std::endl;

POC: Duplication of variable in headers

$ gcc -o a.out *.c && ./a.out
one: 4
two: 4
one: 42
two: 4