Skip to content

Instantly share code, notes, and snippets.

View rizemon's full-sized avatar
🇸🇬

rizemon rizemon

🇸🇬
View GitHub Profile
#!/bin/bash
WORKING_DIRECTORY="/home/kali/Desktop/"
cd $WORKING_DIRECTORY
mkdir -p "$WORKING_DIRECTORY/logs/
DATE=`date +%d.%m.%y`
TIME=`date +%H.%M.%S`
// Win32 API Contants
const FILE_ATTRIBUTES = {
"FILE_ATTRIBUTE_ARCHIVE": 0x20,
"FILE_ATTRIBUTE_HIDDEN": 0x2,
"FILE_ATTRIBUTE_NORMAL": 0x80,
"FILE_ATTRIBUTE_NOT_CONTENT_INDEXED": 0x2000,
"FILE_ATTRIBUTE_OFFLINE": 0x1000,
"FILE_ATTRIBUTE_READONLY": 0x1,
@rizemon
rizemon / ColorMyWSA.js
Last active August 15, 2022 12:31
Automatically adds color-coded level information (Apprentice, Practitioner, Expert) to PortSwigger's Web Security Academy "All labs" page
/*
Inspired by this post https://www.deepfryd.com/burp-academy-apprentice/
How to use:
1) Browse to https://portswigger.net/web-security/all-labs.
2) Open your web browser's Developer tools by pressing 'F12' on your keyboard.
3) Click on the console tab.
4) Paste the following Javascript code into the console's prompt and hit 'Enter' on the keyboard.
5) Wait for all the labs to be updated with their respective levels (Tested ~12s)
@rizemon
rizemon / build.sh
Last active January 8, 2022 18:51
Script used to construct the submission zip file according to the assignment requirement (v2)
#!/bin/bash
# CS2106 Lab Assignment 1 Zip Build Script v2 by @rizemon
# Improvements added:
# - No longer requires creation of temp directory to house copies of necessary files
# - Now checks for missing files and reports them
# - Add reminder for student to check whether they have entered their information into the files
# Modify this
NUSNET_ID=""
@rizemon
rizemon / build.sh
Created August 25, 2021 03:19
Script used to construct the submission zip file according to the assignment requirement (v1)
#!/bin/bash
# CS2106 Lab Assignment 1 Zip Build Script v1 by @rizemon
# ----------------------------------
# Colors (From https://gist.github.com/jonsuh/3c89c004888dfc7352be)
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
@rizemon
rizemon / singletable.py
Created April 25, 2021 07:03
Generate State table (if given boolean equation for output and flip flop inputs)
from rich.console import Console
from rich.table import Table
from itertools import product
class InvalidInputException(Exception):
pass
def JK_flop(Q, J, K):
# Returns Q+ and Q+'
@rizemon
rizemon / column.py
Last active May 14, 2021 16:32
Reorders literals for easier comparison with output
from rich.console import Console
from rich.table import Table
import sys
from itertools import product
from math import ceil
def main():
if len(sys.argv) != 3:
print("Command: python3 column.py <literals> <minterms>")
print("e.g python3 column.py A,D,B,C 4,7,3,1")
from math import log2
from sys import argv
from rich.console import Console
from rich.table import Table
########## CHANGE THIS ###########
NWAY = 2 # 1/2/4
# Number of bytes
WORD = 4 # 4 bytes (Probably no need to change this)
@rizemon
rizemon / vector.py
Created April 14, 2021 15:10
Library for Vector-related calculations
#!/usr/bin/env python
# Do `python3 -i vector.py` to use it interactively
from vpython import vector as v
from vpython import *
from typing import Union, Type
import sympy as sym
from fractions import Fraction
def man():
@rizemon
rizemon / gcd.py
Created April 14, 2021 15:09
Calculate GCD between 2 numbers and shows the working behind it
import sys
if len(sys.argv) < 3:
print("Usage: python test.py A B")
sys.exit(1)
A,B = int(sys.argv[1]), int(sys.argv[2])
if B < 0:
print("B should be positive.")