This file contains hidden or 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 | |
ORG_FILE=$1 | |
WORD_TO_CUT=$2 | |
WORD_TO_FIND=$3 | |
zcat ${ORG_FILE} | sed 's/'${WORD_TO_CUT}'/'${WORD_TO_CUT}'\n/g' | grep ${WORD_TO_FIND} |
This file contains hidden or 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
# color my terminal | |
export CLICOLOR=1 | |
export LSCOLORS=ExGxFxdxCxDxDxBxBxExEx | |
#sets up the prompt color (currently a green similar to linux terminal) | |
export PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;36m\]\w\[\033[00m\]\$ ' | |
#sets up proper alias commands when called | |
alias ls='ls -G' | |
alias ll='ls -hl' | |
alias subln='/Applications/Sublime\ Text\ 2.app/Contents/SharedSupport/bin/subl -n' |
This file contains hidden or 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 | |
read -a words | |
SA_FILE=${words[0]} | |
echo $SA_FILE | |
printf "%9s%9s%9s%9s%9s%10s%10s\n" "Start" "End" "%user" "%system" "%iowait" "RX" "TX" | |
while read -a words; do | |
CPU=`sar -f $SA_FILE -s ${words[0]} -e ${words[1]} | grep Average | awk '{print $3" "$5" "$6}'` | |
NETWORK=`sar -n DEV -f $SA_FILE -s ${words[0]} -e ${words[1]} | grep Average | grep em3 | awk '{print $5" "$6}'` | |
printf "%9s%9s%9s%9s%9s%10s%10s\n" ${words[0]} ${words[1]} ${CPU[0]} ${CPU[1]} ${CPU[2]} ${NETWORK[0]} ${NETWORK[1]} |
This file contains hidden or 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
python -c 'import BaseHTTPServer; import CGIHTTPServer; import sys; import socket; s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM); s.connect(("www.google.com",8000)); ipaddr = s.getsockname()[0]; s.close(); print "="*36 ; print "Access: " + ipaddr +":"+str(9999); print "="*36 ; server=BaseHTTPServer.HTTPServer ; handler = CGIHTTPServer.CGIHTTPRequestHandler; server_address = ("",int(9999)); httpd = server(server_address, handler); httpd.serve_forever()' |
This file contains hidden or 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/python | |
import BaseHTTPServer | |
import CGIHTTPServer | |
import sys | |
import socket | |
def get_local_ip_address(target): | |
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
s.connect((target,8000)) | |
ipaddr = s.getsockname()[0] |
NewerOlder