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 ngram(words,n): | |
return ["_".join(words[i:i+n]) for i in range(0,len(words)-n+1)] |
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
netstat -tuanp | grep LISTEN | grep (port number) #listening ports using netstat #use -p to list process id also |
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/perl | |
#Format of ip Month/Year/DateThour:minute:seconds | |
use Time::Local; | |
my ($date,$time) = split 'T' , $ARGV[$1]; | |
#print $date."\n".$time."\n"; | |
my ($month, $day, $year) = split '/', $date; | |
$month = $month - 1; #this is because timelocal wants the month to be zero indexed | |
#print $month."\n"; | |
my ($hr, $ |
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/python | |
import sys | |
s = sys.argv[1] | |
n=len(s) | |
print ''.join([s[i] if i%2 == 0 else s[i].upper() for i in range(n-1,-1,-1)]) |
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/python | |
import sys | |
s = sys.argv[1] | |
n=len(s) | |
print ''.join([s[i] for i in range(n-1,-1,-1)]) |
NewerOlder