Skip to content

Instantly share code, notes, and snippets.

View SeanPlusPlus's full-sized avatar

Sean Stephenson SeanPlusPlus

View GitHub Profile
#command to spoof mac en1 address
sudo ifconfig en0 lladdr 00:e2:e3:e4:e5:e6
@SeanPlusPlus
SeanPlusPlus / test.rb
Created March 6, 2011 03:27
test file
#!/usr/bin/ruby
puts 'hello mikey'
@SeanPlusPlus
SeanPlusPlus / gist:885863
Created March 24, 2011 20:57
list de-duplication in ipython
% cat users.dupes
rocci
mikey
jamie
diana
rocci
glen
jesse
% ipython
@SeanPlusPlus
SeanPlusPlus / ReadFromFileWriteToArray.sh
Created April 18, 2011 18:05
reads lines from a file and echos those lines to your terminal
#!/bin/bash
#
# ReadFromFileWriteToArray.sh
#
# pass a file as a param to this command
declare -a listOfThings
i=0
while read line ; do
@SeanPlusPlus
SeanPlusPlus / renameUs.sh
Created April 19, 2011 19:20
appends '.jpg' to a set of files in a directory
\ls *-jpg | awk '{print "mv", $1, $1".jpg"}'
\ls *-jpg | awk '{print "mv", $1, $1".jpg"}' | sh
@SeanPlusPlus
SeanPlusPlus / i_POSTFIX.cpp
Created April 19, 2011 23:33
i_POSTFIX.cpp
#include <iostream>
using namespace std;
int main()
{
int i = 10;
cout << "i: " << i << endl;
cout << "i++: " << i++ << endl;
@SeanPlusPlus
SeanPlusPlus / i_PREFIX.cpp
Created April 19, 2011 23:36
i_PREFIX.cpp
#include <iostream>
using namespace std;
int main()
{
int i = 10;
cout << "i: " << i << endl;
cout << "++i: " << ++i << endl;
@SeanPlusPlus
SeanPlusPlus / loopExample.cpp
Created April 20, 2011 02:03
Loop With Postfix
#include <iostream>
using namespace std;
int main()
{
int TOTAL = 9;
for ( int i = 0 ; i < TOTAL ; i++ )
{
cout << "i: " << i << endl;
@SeanPlusPlus
SeanPlusPlus / loopExample_2.cpp
Created April 20, 2011 02:04
Loop With Prefix
#include <iostream>
using namespace std;
int main()
{
int TOTAL = 9;
for ( int i = 0 ; i < TOTAL ; ++i )
{
cout << "i: " << i << endl;
@SeanPlusPlus
SeanPlusPlus / SequentialNumGen.py
Created April 20, 2011 20:12
SequentialNumGen.py accepts exactly two integers as arguments, and prints the range between them to terminal
#!/usr/bin/env python
#
# SequentialNumGen.py
#
# accepts exactly two integers as arguments,
# and prints the range between them to terminal
from sys import exit
import optparse