Skip to content

Instantly share code, notes, and snippets.

View aleks-mariusz's full-sized avatar

aleks aleks-mariusz

  • London, UK (formerly NYC)
View GitHub Profile
@aleks-mariusz
aleks-mariusz / gist:c3056c0fe49c4f485e65
Last active August 29, 2015 14:00
Feb 28 2000 - ASSGN2.ASM - This was an assignment from a course i took in assembly at the turn of the century.. Pretty basic stuff (as far as x86 asm goes).. Sadly I haven't done much with assembler since then other than the occasional software crack here and there..
title Course Assignment 2 for cs205 (assgn2.asm)
; Alex Koralewski
; id# 0019480
; This program encrypts a string based on predefined rules
;
.model small ; allocate 64k max for code seg & 64k for data seg
.stack 10h ; allocate 16 bytes for stack seg
.data
@aleks-mariusz
aleks-mariusz / Hw4.cpp
Last active August 29, 2015 14:00
May 2 2001 - Another sample of coursework i did for a class on OpenGL using C++ (circa 2001). Neither of these i can say i know like the back of my hand, but at least one can say i'm familiar with the fundamental concepts :-) I definitely had a new found appreciation after this piece for experts on either!
/*
** Alex Koralewski
** 0019480
** Assignment 4
**
** Written with a 2-button mouse in mind when dealing with menu requirement.
**
** Please note, due to linked list usage, the vertex/edge/triangle linked lists
** store the information backwards from what was read; therefore, the normal
** vectors are negated to compensate.
@aleks-mariusz
aleks-mariusz / domstatsum2.pl
Last active August 29, 2015 14:00
June 1 2001 - After getting comfortable with perl by mid-2001 i tried my hand at some CGI programming (didn't someone say Perl was the glue of the web?).. This utility basically aggregates statistics generated by http-analyze in one nice central place. This was part of some work i was doing at an internet provider that did among other things, a …
#!/usr/bin/perl -w
#
# written from scratch by Alex Koralewski
# time spent (so far): approximately 12 Hours (whew!)
#
# this program collects domain statistics created by http-analyze
# and summaries them into one pretty page.
#
use CGI qw/:standard/;
@aleks-mariusz
aleks-mariusz / check_thresholds.sh
Last active August 29, 2015 14:00
Aug 9 2001 - Back before there was any sophisticated monitoring/log analysis software suites, we had to roll our own. Here's an example of early some shell scripting work i did at an internet hosting company that alerted when folks were using 'too much traffic' (that was defined by management of course)
#!/usr/local/bin/bash
CONFDIR="/home/cricket/mrtg/threshold/conf"
LOGDIR="/home/cricket/mrtg/threshold/logs"
MRTG_HOME="/home/cricket/mrtg/devices"
EMAILLIM=1
EMAIL="thold@nyi.net"
#EMAIL="cynikal@cynikal.net"
#EMAIL="none"
TMP="/tmp/.$(basename $0).$$"
@aleks-mariusz
aleks-mariusz / newindex-new.c
Last active August 29, 2015 14:00
Nov 20 2001 - I fell in love with regular expressions pretty early on (before i knew how expensive they could be).. Here is some side work i did on a really ancient web server that was choking up trying to serve requests handled by perl, required me to dig deep in my coding knowledge and muster up this C code (because compiled code usually is ty…
#include <stdio.h>
#include <pcre.h>
int main() {
pcre *re; pcre_extra *extra = NULL;
char *httpHost; const char *error; const char **stringlist;
int offsets[45]; int offsetsSize = sizeof(offsets)/sizeof(int);
int erroroffset, count, start_offset;
@aleks-mariusz
aleks-mariusz / disassemble.sh
Last active August 29, 2015 14:00
Nov 22 2003 - Having a basic understanding of x86 assembly helped me get semi-comfortable with program cracking on the ppc (not x86) platform (http://www.macserialjunkie.com/forum/viewtopic.php?f=56&t=1371).. But to get at the code, rather than get used to some fancy IDE with ton of bells and whistles i didn't need, i decided to roll my own disa…
#!/usr/local/bin/bash
#
# this script disassembles a Mac OS X executable binary. It does some interesting
# translation for Obj C calls (thanks to the leet work done at www.afront.be I
# loosely based this on)
FILE="$1"
TMP="/tmp/.$(basename $0)_$$"
if [ ! -r "$FILE" ]
@aleks-mariusz
aleks-mariusz / rewalk.sh
Last active August 29, 2015 14:00
Mar 10 2004 - There's a decent amount one can accomplish with basic shell scripting, though you reach your limits eventually with what you can do with sed/awk and so some perl code sneaks into here.. which is a network management utility i wrote while at an internet service provider for creating index pages from a set of mrtg-monitored devices
#!/usr/local/bin/bash
if [ X"$(whoami)" != "Xroot" ]
then
echo "This program now must be run as root.."
exit
fi
INTERFACES='cs1 cs2 cs3 cs4 cs5 cs7 cs8 cs9 cs10 cs11 cs12 cs13 cs14 cs15 cs20 cs20b cs21 cs22 cs23 cs24 cs25 cs30 cs30b cs40b csmarigold core01 core02 core04 core05 core06'
WALKDIR="/home/cricket/walk"
@aleks-mariusz
aleks-mariusz / parsePerfsh-solaris_v2.pl
Last active August 29, 2015 14:00
May 17 2005/June 17 2005 - When working for the city of new york, we had a lot of systems we needed a better way to get a handle on their utilization. i threw together this perl script over the course of a week or so to parse the output of sar (on solaris) and create some basic excel spreadsheets for easier consumption of usage statistics.. The …
#!/usr/bin/perl
$| = 1;
BEGIN { unshift(@INC, "/usr/perl5/site_perl/5.005" ); };
use strict;
use Time::ParseDate;
use Spreadsheet::WriteExcel;
@aleks-mariusz
aleks-mariusz / jsManager-withmetasupport.pl
Last active August 29, 2015 14:00
Jul 28 2005 - It's a bit fun when one can use ordinary systems such as a laptop for an import task one has to do in the lab commonly. Case in point, I was able to use my powerbook at work and at the same time needed to install a decent amount of solaris systems. So i wrote a script to turn it into and manage it as a jumpstart server for netbooti…
#!/usr/bin/perl
$| = 1;
#
# jumpstartManager.pl
#
# This script (along with the support files) will turn any powerbook/ibook
# running Tiger into a portable jumpstart server.
#
# v1.0 - July 24th, 2005 -
# written by: Alex Koralewski (akoralewski@doitt.nyc.gov)
@aleks-mariusz
aleks-mariusz / apc-config.kermit
Last active August 29, 2015 14:00
May 4 2006 - You'll come to a point where the tools you're familiar/most comfortable with just aren't enough and you have to learn new ones.. Here i had to configure several dozen APC power strips.. fortunately they had rs232 serial ports, and i had my powerbook with a kensington usb-serial adapter (the one not based on the prolific pl2302 chips…
#!/usr/local/bin/kermit.real +
# Usage: apc-config [ hostname ] [ ip address ]
#
# written in spring 2006..
#
# .file := \fcontents(\%1) # Eval one level deep in case of backslashes
#} else while not def file { # Prompt for it if not given
# ask file " Log file name: "
#}