Skip to content

Instantly share code, notes, and snippets.

View TheFlash2k's full-sized avatar
😎
Running

Ali Taqi Wajid TheFlash2k

😎
Running
View GitHub Profile
@TheFlash2k
TheFlash2k / log.c
Created July 24, 2023 02:37
possibly the most simplest log2cli macros. (with colors too :))))
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <time.h>
#pragma warning (disable : 4005)
#pragma warning (disable : 4172) // Line 22
#define TIME_BUFFER_SIZE 20
char timeBuffer[TIME_BUFFER_SIZE];
@TheFlash2k
TheFlash2k / endian.py
Last active July 7, 2023 02:38
A simple script to convert an hex to bytes based on endianess.
#!/usr/bin/env python3
import argparse
import struct
def pack_address(address, arch, byte_order):
_ = { 'x64' : { 'little' : '<Q', 'big' : '>Q' }, 'x86' : { 'little' : '<I', 'big' : '>Q' } }
return struct.pack(_[arch][byte_order], address)
def main():
@TheFlash2k
TheFlash2k / space
Created June 22, 2023 16:13
A simple bash utility to finding the free space. (idk tbh)
#!/bin/bash
# Finding the base drive
drive_name=`df -h | rev | grep -E '^/\s' | rev | cut -d ' ' -f 1 | rev | cut -d '/' -f 1 | rev`
if [[ $# == 1 ]]; then
drive_name=$1
fi
res=`df -h | grep $drive_name`
/*
logger.hpp - A Single Logging solution.
Author: @TheFlash2k
*/
#pragma once
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <stdlib.h>
@TheFlash2k
TheFlash2k / random-password
Created June 2, 2023 12:33
Generates a random string where length of the string is passed as an argument
#!/bin/bash
_len=10
if [[ $# == 1 ]]; then
_len=$1
fi
tr -dc A-Za-z0-9 </dev/urandom | head -c $_len ; echo ''
@TheFlash2k
TheFlash2k / localip
Created June 2, 2023 12:32
Lists local IP of an interface
#!/bin/bash
if [[ $# != 1 ]]; then
echo "No interface specified!"
exit 1
fi
ip a s $1 | grep inet | cut -d $'\n' -f 1 | cut -d ' ' -f 6 | cut -d '/' -f 1
@TheFlash2k
TheFlash2k / ctfd-register-teams-with-user.py
Last active October 24, 2023 21:24
CSV: team_name,user_1,user_2
import requests
import random
import string
import csv
import os
from pprint import pprint
token = "<TOKEN_GOES_HERE>"
headers = {
"Authorization": f"Token {token}",
@TheFlash2k
TheFlash2k / fill.js
Last active January 6, 2025 08:19
Air University Student Portal Fill QEC Form
/* COURSE EVALUATION FORM */
function CourseEvaluation() {
option = 1; // A = 1, B = 2, C = 3, D = 4
var baseOpts = document.querySelector("#ctl00_ContentPlaceHolder2_cmb_courses");
if(baseOpts.length == 1) {
console.log("Completed. Returning to home..");
document.querySelector("#ctl00_ContentPlaceHolder2_linkBack").click();
}
baseOpts.options[1].selected = true; // Selecting the first available value
selector = "#ctl00_ContentPlaceHolder2_q{VAR}_{OPTION}";
@TheFlash2k
TheFlash2k / brightness.sh
Created December 1, 2022 14:14
Increase or decrease the brightness of your monitor using arguments to this script
#!/bin/bash
#############################
#### Author: @TheFlash2k ####
#############################
###########################################################################
###### Change this to the amount of brightness you want to inc/dec ########
base=0.1
###########################################################################
import requests
import re
url = "http://192.168.0.130:8000/"
def download(file_name):
r = requests.get(url + file_name, allow_redirects=True)
print(f"[+] Downloading {file_name}", end='')
try:
with open(file_name, 'wb') as f: