Skip to content

Instantly share code, notes, and snippets.

@moonblade
moonblade / gist:0c4e696105537dcc041d
Last active August 29, 2015 14:19
compile all c files in a directory
for F in *.c; do cc $F -o ${F%.c}; done
@moonblade
moonblade / OnePassAssembler.cpp
Created January 31, 2016 15:47
One Pass Assembler
#include<fstream>
#include<cstring>
#include<sstream>
#include<iostream>
#include<vector>
#include<iomanip>
#include<list>
#include<stdlib.h>
using namespace std;
fstream f,g;
{
"code": 1,
"buildingList": [{
"buildingId": "1",
"buildingName": "Some name",
"buildingDescription": "Some description",
"floorList": [{
"floorId": "1",
"pictureURL":"www.soomeurl.to/picture/directory/containing/picutres",
"size":{
#!/bin/bash
wget -p -R.js,.css,.gif "http://admin:[email protected]/cgi-bin/webproc?getpage=html/page.htm"
file="192.168.1.1/cgi-bin/webproc?getpage=html%2Fpage.htm&var:page=basic_home"
currentTime=$(date +%s)
printf "{\n"
printf "\t'time':'$currentTime',\n"
printf "\t'macList':[\n\t\t 'DU:MM:YA:DD:RE:SS'\n"
cat $file | grep -i '[0-9A-F]\{2\}\(:[0-9A-F]\{2\}\)\{5\}' | cut -f1 -d. | awk -F'"' '{ print "\t\t,\x27"$2"\x27" }'
printf "\t]\n"
printf "}"
{
"code": 1,
"buildingList": [{
"buildingId": "1",
"buildingName": "Sensomate",
"buildingDescription": "An okay sort of company",
"floorList": [{
"floorId": "1",
"pictureURL": "http://192.168.0.122/sensomate/BLENavigation/pictures/1234/",
"size": {
.model small
.data
matrix1 db 01h,02h,03h,04h,05h,06h,07h,08h,09h
matrix2 db 04h,05h,06h,07h,08h,09h,01h,02h,03h
result db 09h dup(0)
row db 03h
column db 03h
offst db 00
isprime db 00
tocheck db ?
@moonblade
moonblade / burn.py
Last active January 11, 2024 13:29
A python tool to burn iso files to usb disks through interactive menu
#!/usr/bin/env python3
import os
import sys
from glob import iglob
from subprocess import Popen, PIPE
import time
import signal
from decimal import Decimal, localcontext, ROUND_DOWN
@moonblade
moonblade / netcat.py
Created March 14, 2016 12:51
Netcat program done entirely in python
#!/usr/bin/env python3
import socket
import sys
class Connection:
def send(self, hostname, port, content):
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.connect((hostname, int(port)))
commands
A
for assembler
type a and then type the address you want to type the program in, then proceed to type the program
one enter for converting to hex, two enters for save
press . and enter when you wish to leave, or press interupt
U
unassambler
.Mode 0
.start location 1000
.90 is to operate in mode 0 (10010000 -> command word a, and the second 1, port a is input)
MOV AL,90
.write to the command word
OUT C6,AL
.address 1006:
.read input from port a
IN AL,C0
.write the same input to port b