Skip to content

Instantly share code, notes, and snippets.

View ander94lakx's full-sized avatar
💻
Hacking stuff

Ander ander94lakx

💻
Hacking stuff
View GitHub Profile
@ander94lakx
ander94lakx / 3xplus1.py
Created February 13, 2022 13:52
Transform your computer into a radiator with this problem that our friend Collatz left us. Useful for nothing except for stress tests
from functools import cache, lru_cache
from pynput import keyboard
import time
stop = False
def on_press(key):
global stop
print(key)
if key == keyboard.Key.esc:
@ander94lakx
ander94lakx / spotify_top_songs_and_artists.py
Last active February 13, 2022 13:48
Takes Spotify JSON history and gives the top X listened songs and artists
"""Spotify Top X Artists and Songs
This script takes data from StreamingHistory[x].json files exported from Spotify
and gives the most listened songs and artists based on that data
Args:
top (int): The length of the most listened artists and songs
(default is 10)
"""
@ander94lakx
ander94lakx / ssdeep_nist_nsrl_lookup.sh
Created August 24, 2021 15:23
Given a file, looks for similar files in NSRL (NIST) using ssdeep datasets
#!/bin/bash
absdir=$(realpath "$1")
echo $absdir
mkdir NSRL_Corp
cd NSRL_Corp
rm *.zip
rm *.ssd
curl https://s3.amazonaws.com/docs.nsrl.nist.gov/morealgs/ssdeep_2.10/NSRL_corp.0[0-1][0-9].0.zip -o "NSRL_corp.0#1#2.0.zip"
curl https://s3.amazonaws.com/docs.nsrl.nist.gov/morealgs/ssdeep_2.10/NSRL_corp.0[0-1][0-9].5.zip -o "NSRL_corp.0#1#2.5.zip"
@ander94lakx
ander94lakx / yara_linux_install.sh
Last active May 3, 2023 00:39
YARA install script for linux systems (with crypto support
# Download YARA (Modify if a different version is needed)
wget https://github.com/VirusTotal/yara/archive/refs/tags/v4.1.2.tar.gz
tar -zxf yara-4.1.2.tar.gz
cd yara-4.1.2
./bootstrap.sh
# Prerequisites
sudo apt install automake libtool make gcc pkg-config libssl-dev
# Build with make
@ander94lakx
ander94lakx / ApiClient.cs
Created May 6, 2020 09:38
Modified version of CallApi() Method from swagger-codegen generated C# client that allows using Cookie headers
/// <summary>
/// Makes the HTTP request (Sync).
/// </summary>
/// <param name="path">URL path.</param>
/// <param name="method">HTTP method.</param>
/// <param name="queryParams">Query parameters.</param>
/// <param name="postBody">HTTP body (POST request).</param>
/// <param name="headerParams">Header parameters.</param>
/// <param name="formParams">Form parameters.</param>
/// <param name="fileParams">File parameters.</param>
@ander94lakx
ander94lakx / DatabaseTest.py
Created October 9, 2018 06:48
A simple database load test with tables with random values
import mysql.connector
import random
import sys
import time
import threading
DB_host="localhost"
DB_port="3307"
DB_user="root"
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
void bistaratuAlderantziz(char *str);
int main()
{
char hitza[15];
TTF_Font* Sans = TTF_OpenFont("Sans.ttf", 24); //this opens a font style and sets a size
SDL_Color White = {255, 255, 255}; // this is the color in rgb format, maxing out all would give you the color white, and it will be your text's color
SDL_Surface* surfaceMessage = TTF_RenderText_Solid(Sans, "put your text here", White); // as TTF_RenderText_Solid could only be used on SDL_Surface then you have to create the surface first
SDL_Texture* Message = SDL_CreateTextureFromSurface(renderer, surfaceMessage); //now you can convert it into a texture
SDL_Rect Message_rect; //create a rect
Message_rect.x = 0; //controls the rect's x coordinate
@ander94lakx
ander94lakx / funtzioak.c
Last active September 4, 2017 09:20
PruebasSDL2
#include "Funtzioak.h"
#include <stdio.h>
#include <time.h>
#include <stdlib.h>
void inicializar()
{
double pi = 3.1415926535;
int NumGrado = rand() % 360;
@ander94lakx
ander94lakx / funtzioak.c
Last active June 15, 2017 18:16
Pianoa grabatzen/erreproduzitzen
/*
* funtzioak.c
*
* Created on: 30 may. 2017
* Author: alex
*/
#include <string.h>
#include <time.h>
#include <unistd.h>