Skip to content

Instantly share code, notes, and snippets.

View mikyll's full-sized avatar
πŸ™
Blurring

Michele Righi mikyll

πŸ™
Blurring
View GitHub Profile
@mikyll
mikyll / github_not_following_back.sh
Last active February 13, 2025 14:10
Get a list of users that don't follow you back on GitHub
#!/bin/bash
usage() {
echo -e "Usage: $0 [-k api_key] [-o] username\n\n" \
"This script is used to get a list of users that do not follow you back on GitHub\n\n" \
"Arguments:\n" \
" username Your GitHub username\n\n" \
"Optional arguments:\n" \
" -k api_key GitHub API token (to prevent hitting rate limits)\n" \
" -h Display this help\n" \
@mikyll
mikyll / enable_chrome_dev_tools.bat
Created November 11, 2024 15:18
Enable Chrome Dev Tools on Windows (Needs Administrator Rights)
reg add "HKLM\SOFTWARE\Policies\Google\Chrome" /v DeveloperToolsDisabled /t REG_DWORD /d 0 /f
@mikyll
mikyll / etcd_defrag_test.sh
Last active October 15, 2024 14:06
Etcd defragmentation example
#!/bin/bash
# Check dependencies
if ! [[ $(etcdctl version 2> /dev/null) ]]
then
echo "Command 'etcdctl' not found"
exit 1
fi
if ! [[ $(jq --version 2> /dev/null) ]]
then
@mikyll
mikyll / obfuscated.c
Last active February 16, 2025 12:07
Obfuscated C - Mega stupid stuff you can make with C
#include "obfuscated.h"
______ ________________ ____ ______ ___________ _________ _______ ________ ________ ____________ _____
__
______________ ____ _____________ _____ _
__________ _______________ _
___
╔════════════ void isEven() ═════════════╗
β•‘ β•” for (int i = 0; i < 10; i++) β•— β•‘
@mikyll
mikyll / lua-split.lua
Last active July 10, 2024 09:10
Lua utility to split a string
---Split a string in an array of fields, using sep as separator
---@param str string, is the string to be splitted.
---@param sep string, is the delimiter character that separates the fields (default is ',')
---@param trim_fields boolean, specify if leading and trailing spaces must be removed from fields (default is true)
---@param allow_escapes boolean, specify if the escape behaviour is allowed, i.e. '\' used to prevent special characters behaviour (default is false)
---@param allow_literals boolean, specify if literal strings are allowed, i.e. strings wrapped in single quotes (default is false)
---@return table, an array containing the fields splitted from the initial string.
function split(str, sep, trim_fields, allow_escapes, allow_literals)
local result = {}
local i = 1
@mikyll
mikyll / github_star_history.sh
Last active February 6, 2024 16:44
GitHub Star History API
#!/bin/bash
# GitHub repository details
OWNER="owner_name"
REPO="repository_name"
# GitHub personal access token for authentication (it provides higher rate limit)
TOKEN="github_token"
# Base URL for the GitHub API
@mikyll
mikyll / password_input_tui.cpp
Created August 13, 2022 21:55
Simple C++ program for password input dialog
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <curses.h>
#define MAX_PASSWD_LENGTH 32
#define M1Y 7
#define M1X 8
#define M2Y 7
#define M2X 33
@mikyll
mikyll / password_input_tui.sh
Created August 13, 2022 19:52
Simple shell script for password input dialog
#!/bin/bash
max_pass_length=40
pass_length=30
i=0
password=
prompt=$' \u2502 Passphrase: '
clear
echo -e "\e[32;40m\e[H"