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
dig +nocmd $DOMAIN MX +noall +answer | awk '{print $5 " " $6}' | sort -n | awk '{print substr($2,1,length($2)-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
if (top != self) { | |
//framed | |
} else { | |
// stand-alone | |
} |
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
/** | |
* Calculate the age from birth date | |
* @param birth the birth date | |
* @return the age | |
*/ | |
public static int getAge(Calendar birth) { | |
Calendar today = Calendar.getInstance(); | |
int age = today.get(Calendar.YEAR) - birth.get(GregorianCalendar.YEAR); | |
if ( | |
today.get(Calendar.MONTH) < birth.get(GregorianCalendar.MONTH) || |
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
CREATE VIEW V_UTIL_CONSTANTS AS | |
SELECT 1 AS ONE, 2 AS TWO, 3 AS THREE | |
SELECT ONE FROM V_UTIL_CONSTANTS |
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
date -d @1208941833 +"%Y-%m-%d %H:%M:%S" | |
# 2008-04-23 11:10:33 | |
date +%s | |
# 1208941833 |
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
function stringHash(s) { | |
var hash = 0, | |
i = 0, | |
char; | |
if (s.length === 0) { | |
return hash; | |
} | |
for (i = 0; i < s.length; i++) { | |
char = s.charCodeAt(i); | |
hash = 31*hash+char; |
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
telnet server.com 25 | |
telnet-ssl server.com 465 | |
HELO server.com | |
MAIL FROM: <me@mine.com> | |
RCPT TO: <you@your.com> | |
RCPT TO: <he@your.com> | |
DATA | |
From: me@mine.com | |
To: you@your.com |
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
ping 1.1.1 -w 10 >/null |
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
public static GregorianCalendar getDateFromCF(String cf) { | |
GregorianCalendar date = new GregorianCalendar(); | |
int anno = Integer.parseInt("19" + cf.substring(6, 8)); | |
date.set(GregorianCalendar.YEAR, anno); | |
int month = 0; | |
switch (Character.toUpperCase(cf.charAt(8))) { | |
case 'A': | |
month = GregorianCalendar.JANUARY; | |
break; |
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
# one line response | |
whois `host $DOMAIN | grep "has address" | head -n 1 | sed 's/.* address //'` | grep desc | head -n 1 | sed 's/.*: *//' | |
# detail | |
whois `host $DOMAIN | grep "has address" | head -n 1 | sed 's/.* address //'` | grep desc | sed 's/.*: *//' | |
# full detail | |
whois `host $DOMAIN | grep "has address" | head -n 1 | sed 's/.* address //'` | |
#ps: check for mirrors: | |
host $DOMAIN | grep "has address" |
OlderNewer