This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
declare -a topologies=("full" "2D" "line" "imp2D") | |
for node_num in `seq 100 100 2000`; do | |
printf "$node_num, " | |
for topo in "${topologies[@]}"; do | |
result="$(./project2 $node_num $topo gossip)" | |
printf "$result, " | |
sleep 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
expFiles="META-INF/\n\ | |
META-INF/MANIFEST.MF\n\ | |
cop5556sp17/AST/\n\ | |
cop5556sp17/AST/AssignmentStatement.java\n\ | |
cop5556sp17/AST/ASTNode.java\n\ | |
cop5556sp17/AST/ASTVisitor.java\n\ | |
cop5556sp17/AST/BinaryChain.java\n\ | |
cop5556sp17/AST/BinaryExpression.java\n\ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from RPLCD import CharLCD, cleared, cursor | |
import socket | |
import time, datetime | |
lcd = CharLCD() | |
# load IP address | |
import socket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 627220E7 | |
echo 'deb http://archive.scrapy.org/ubuntu scrapy main' | sudo tee /etc/apt/sources.list.d/scrapy.list | |
sudo apt-get update | |
sudo apt-get install scrapyd | |
sudo apt-get install python-pip python-dev build-essential | |
sudo pip install --upgrade pip | |
sudo apt-get install git | |
sudo pip install -e git+https://github.com/scrapy/scrapyd#egg=scrapyd | |
sudo pip install pyasn1 --upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
let sleepTime="15*60"; | |
while [ 1 ] | |
do | |
if [ $(( $RANDOM % 2)) == 0 ] | |
then | |
echo "switching to NTWRK1"; | |
networksetup -setairportnetwork en1 {NTWRK_NAME} {NTWRK_PSWD} | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# inplace substitution which works on both OSX and Linux | |
if [ -z $1 ] | |
then | |
echo "Fatal: enter file name" | |
else | |
sed -E 's/[ \t]+$//g' "$1" > /tmp/t_rm_wp | |
cp /tmp/t_rm_wp "./$1" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
egrep -oshRI --include \*.php '(\$[a-zA-Z_0-9]+)' ./ | awk -F ':' '{ print length $1}' | sort -gr | head -n 1 | |
#this will output largest PHP variable name | |
egrep -shIRo --include \*.js '(?:[\n\( ])([a-zA-Z_0-9]+) *=' ./ | awk '{ print length, $1}' | sort -gr | head -n 1 | |
#this will output largest JavaScript variable name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
import urllib.request | |
import re | |
import os | |
from os import listdir | |
from os.path import expanduser | |
import sys | |
def lift(currentLocation): | |
req = urllib.request.Request(sourceLocation + currentLocation) |