Skip to content

Instantly share code, notes, and snippets.

View aleks-mariusz's full-sized avatar

aleks mariusz aleks-mariusz

  • Cambridge, UK (formerly, London, UK, and NYC)
  • 22:31 (UTC +01:00)
View GitHub Profile
@aleks-mariusz
aleks-mariusz / Get Lyrics.scpt
Last active August 29, 2015 14:00
Sep 19 2006 - for some non-work related fun, i have a passion for music and so of course had an ipod by the mid-2000's (no i wasn't an early adopter and didn't get in on that bandwagon until the gen5 ipod). One of the great things about the ipod other than its intuitiveness, is support for embedding lyrics. But who wants to sit and copy/paste ly…
set trackers to {}
tell application "iTunes"
if selection is not {} then
set trackers to (get selection)
else if view of front window is not library playlist 1 and special kind of view of front window is «constant eSpKkSpN» then -- iTunes 4.9 or better uses "special kind"
set trackers to every file track of view of front window
end if
end tell
if trackers is not {} then
repeat with i from 1 to number of items in trackers
@aleks-mariusz
aleks-mariusz / drumTabToMIDI.pl
Last active August 29, 2015 14:00
Apr 7 2008 - i tried to take up drumming (as well as motorcycles, but those are less git-friendly) by 2008, and one way to learn something is to practice what already exists in the public domain. enter drum tabs that describe the rhythm/'notes' being played on a drum.. but trying to imagine how a tab sounds just by looking requires someone very …
#!/usr/bin/perl
use MIDI;
use MIDI::Simple;
use Getopt::Std;
$g_chan = 9;
$g_tempo = 200;
$g_vol = 100;
$g_types = 'csrhftt1t2t3t4t5t6ff1f2sb2tm';
@aleks-mariusz
aleks-mariusz / iTunesSplit-v2.pl
Last active August 29, 2015 14:00
Nov 30 2007 - I wasn't ever really thrilled with publicly available mp3-track splitting front-end utilities in terms of flexibility of use, when one has a long hour or more mix that you have as one track (well mp3splt _is_ awesome but requires already pre-determined input, aka .cue files).. So i endeavored to write my own CLI menu-driven utility…
#!/usr/bin/perl
$| = 1;
use strict; # discipline is good
use Getopt::Std; my %optionPassed;
getopts("f:nkchs",\%optionPassed);
&printUsage() if $optionPassed{'h'};
# typical sanity checking
@aleks-mariusz
aleks-mariusz / netaudit_2950-nydc.pl
Created May 1, 2014 04:49
Jul 22 2008 - I got more into network engineering around 2007, but was able to leverage my programming skills to make work i was doing more streamlined. Here's an example, it's a perl script that audits the config of a cisco device, by way of using 'expect' for interacting with the device and querying information on it
#!/usr/bin/perl
$| = 1;
use strict;
use Expect;
use Net::DNS;
use Getopt::Std;
use Data::Dumper;
no strict 'refs';
@aleks-mariusz
aleks-mariusz / linkmon.tcl
Created May 1, 2014 04:52
Oct 15 2008 - i almost forgot i even dabbled a little in tcl to aid my network engineering pursuits. Here i am using the event manager environment capabilities on higher end cisco IOS-based devices to monitor link status and set up alerts
::cisco::eem::event_register_timer watchdog name linkmon time $linkmon_period maxrun 45
# _________________________________________________________________________#
# | |#
# | cogent-monitor |#
# | |#
# | by: Alex Koralewski |#
# | (c) 2008, Forex Capital Markets, LLC. |#
# | |#
# | Version 0.8 03/14/2008 |#
# | Version 1.0 04/03/2008 |#
@aleks-mariusz
aleks-mariusz / parseDAMP-v2.5.pl
Created May 1, 2014 04:55
Nov 8 2007 - Having played a little with SAN engineering, i saw the need to parse some performance based log files (from the Disk Array Management Program) and get a better handle on what they were reporting. Hitatchi of course wanted oodles of monies for digesting the extremely verbose log file their array controllers were generating. I was ask…
#!/usr/bin/perl
#
## NAME: parseDAMP.pl
##
## FUNCTION: Creates graphs from Hitatchi DAMP utility log file
##
## USAGE: cat pfm.txt|./parseDAMP.pl
##
## Can also be run with a progress indicator (takes slightly longer to start up)
@aleks-mariusz
aleks-mariusz / Create Symlink for Analysis.scpt
Created May 1, 2014 04:58
June 28 2010 - After getting a bit into mixing (on a dj-mixer), i was trying to update my music library for being able to mix in-key between tracks and came across the camelot system. I needed a way to get the processed key information into the mp3 track's comments field so i could group them by smart-playlists so all songs of the same key could…
@aleks-mariusz
aleks-mariusz / weruleAgent2.pl
Created May 1, 2014 05:02
Aug 28 2010 - Soon after getting my second iphone (the iPhone 4, yes i was one of those nuts that camped out overnight outside the store), i discovered iOS gaming, one of them being WeRule.. But i wasn't satisfied just playing it, so i wrote this utility after reverse engineering the web-api calls the app was using Charles (best web proxy/analyz…
#!/usr/bin/perl
$| = 1;
use Data::Dumper;
use Fcntl qw(:flock SEEK_END);
use File::Copy;
use HTTP::Request::Common qw(PUT POST);
use HTTP::Cookies;
use HTTP::Status;
use LWP::UserAgent;
@aleks-mariusz
aleks-mariusz / pcon.pl
Created May 1, 2014 05:05
A wise duck once told me, 'Work smarter, not harder!" (if this reference eludes you: http://youtu.be/8jEZraf0eDI) and so i have always loved the 'pconsole' utility, which lets you multiplex your keystrokes to several sessions (presumably into different systems, aka parallel-console's name). But setting up xterms for each session is such a chore,…
#!/ms/dist/perl5/PROJ/core/5.8/bin/perl
#
# Last edited by: $Author: koramari $
# on: $Date: 2010/05/28 21:33:24 $
# Revision: $Revision: 1.5 $
#
# ID: $Id: pcon.pl,v 1.5 2010/05/28 21:33:24 koramari Exp koramari $
#
# this script opens up xterms and attaches pconsole to those xterms
@aleks-mariusz
aleks-mariusz / minerd.py
Created May 1, 2014 05:11
June 1 2011 - I started learning python after hearing some good things about it spring of 2011 and needed some simple projects to get my feet wet. Then after the gawker article made bitcoins famous, i decided to try my hand at mining some. but cpu-mining is so inefficient you need a ton of resources to do it. how does one manage a mining system …
#!/ms/dist/python/PROJ/core/2.7.1/bin/python
import os
import sys
import time
import signal
import shutil
from time import time, sleep
from tempfile import mkdtemp
from subprocess import Popen, PIPE