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 | |
#set -x | |
# Shows you the largest objects in your repo's pack file. | |
# Written for osx. | |
# | |
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# @author Antony Stubbs | |
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output |
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
System Binaries | |
OS X 10.9.5 (the latest stable release at the moment) ships with Bash v3.2.51: | |
$ bash --version | |
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13) | |
Copyright (C) 2007 Free Software Foundation, Inc. | |
You can obtain and recompile Bash as follows, providing that you have Xcode installed: |
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 | |
usage() | |
{ | |
echo "usage: `basename $0` inputfile" | |
} | |
IN=$1 | |
ENDING=".pdf" | |
OPEN="[[" |
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
#include <stdio.h> | |
int main() | |
{ | |
printf("Hello World\n"); | |
return 0; | |
} |
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
ifconfig eth0 | grep 'inet ' | awk '{print $2}' | sed 's/addr://' |
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 | |
function checknet { | |
UP=$(VBoxManage guestproperty enumerate omero-vm | grep "10.0.2.15") | |
} | |
checknet | |
echo "UP :: " $UP |
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 | |
OS=`uname -s` | |
if [ "$OS" == "Darwin" ]; then | |
echo "Mac OS X with Darwin Kernel" | |
elif [ "$OS" == "Linux" ]; then | |
echo "GNU/Linux OS with Linux Kernel" | |
else | |
echo "Not Mac or Linux" |
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 cmd | |
class CmdProcessor(cmd.Cmd): | |
"""A Simple Command Processor.""" | |
def do_greeting(self, line): | |
print "Hello World!" | |
def do_EOF(self, line): | |
return True |
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 optparse | |
def main(): | |
p = optparse.OptionParser() | |
p.add_option('--person', '-p', default="world") | |
options, arguments = p.parse_args() | |
print 'Hello %s' % options.person | |
if __name__ == '__main__': | |
main() |
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
def Evaluate(str): | |
stack = [] | |
pushChars, popChars = "<({[", ">)}]" | |
for c in str : | |
if c in pushChars : | |
stack.append(c) | |
elif c in popChars : | |
if not len(stack) : | |
return False | |
else : |
OlderNewer