Skip to content

Instantly share code, notes, and snippets.

@aliasgwynplaine
aliasgwynplaine / getstr.c
Created January 21, 2025 21:38
C outils
/*
* buf is meant to be initialized with
* size at most sz. There are some things
* you may want to change before using
* this.
*/
char * getstr(char * buf, size_t sz) {
char * p;
char c;
p = fgets(buf, sz, stdin);
@aliasgwynplaine
aliasgwynplaine / find_redundant_files_n_rename.sh
Created December 24, 2023 15:16
Find files in a folder with the same information, leave just one renamed by its hash and stores their names.
#!/bin/bash
for file in *; do
if [ -f "$file" ]; then
filename=$(md5sum $file | cut -f 1 -d ' ')
mv $file $filename
echo $file >> $filename.names
fi
done
@aliasgwynplaine
aliasgwynplaine / sort_pics.sh
Created November 14, 2023 19:53
little script to sort my photos by date and move them into different folders
#!/bin/bash
if [ $# -lt 2 ]; then
echo "No args passed"
echo "-s <src-folder>"
exit 1
fi
while getopts s:d: flag
do

Keybase proof

I hereby claim:

  • I am aliasgwynplaine on github.
  • I am gwynplaine (https://keybase.io/gwynplaine) on keybase.
  • I have a public key ASAM2UU7lTSssX9W3t7-24sMTLj8PPF12ej0Qo_IgJDQLwo

To claim this, I am signing this object:

@aliasgwynplaine
aliasgwynplaine / gethosts.sh
Last active June 10, 2022 04:16
Host and port enumeration
#!/bin/bash
trap ctrl_c INT
function ctrl_c () {
echo -e "\n\n[*] Exiting...\n"
exit
}
for i in $(seq 1 255); do
@aliasgwynplaine
aliasgwynplaine / debug.h
Created September 22, 2021 17:31
Debug files
#ifndef _DEBUG_H
#define _DEBUG_H
#ifdef _DEBUG
#define debug(fmt, args...) \
do { \
printf("%s %s %d: " fmt "\n", __FILE__, __FUNCTION__, __LINE__, ## args); \
} while (0)
@aliasgwynplaine
aliasgwynplaine / nqueens.py
Created May 10, 2021 22:23
nqueens sol generator using backtracking
# -*- coding: utf-8 -*-
import sys
def check(queen, n, i) :
for f in range(len(queen)) :
if f == n or queen[f] == i:
return False
if f - queen[f] == n - i :
return False
if f + queen[f] == i + n:
@aliasgwynplaine
aliasgwynplaine / ll.py
Created May 10, 2021 22:20
Just to see a n vs time plot related to the push operation on a simple linked list
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from random import random
from time import time
class Node :
def __init__(self, val, nxt=None) :
self.value = val
self.next = nxt
@aliasgwynplaine
aliasgwynplaine / ctf-notes.md
Last active February 16, 2020 22:44
Notes and stuff to remember in order to use for CTF challenges

CTF NOTES - gwynplaine

python libs

  • scapy
  • pwntools
  • requests
  • re

Ports numbers

@aliasgwynplaine
aliasgwynplaine / givemyjson.py
Created October 13, 2019 00:10
Just a script to download information in json format from remote server.
# -*- coding: utf-8 -*-
import requests
import threading
import sys
import json
from queue import Queue
from time import time
target_url = '' # Must include get parameter for the original case.