Skip to content

Instantly share code, notes, and snippets.

import httplib2, re
import MySQLdb
from BeautifulSoup import BeautifulSoup
entries = []
h = httplib2.Http('.cache')
URL = 'http://www.worldofwarcraft.co.kr/news/notice/index.do?currpage=%s'
for seq in range(1, 4):
try:
@saillinux
saillinux / gist:787581
Created January 20, 2011 08:30
anyevent non-blocking port check template
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Socket;
use constant INTERVAL => 1;
my ($host, $port) = @ARGV;
@saillinux
saillinux / gist:787660
Created January 20, 2011 09:47
anyevent more proper port checking with given interval.
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Socket;
use constant INTERVAL => 1;
use constant COOLTIME => 300;
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent::Socket;
use constant THROTTLE => 3; # Number of count alert will be sent out and die
use constant INTERVAL => 60; # Interval for polling health check
use constant COOLTIME => 600; # once host down is detected cooldown for amount of time
@saillinux
saillinux / gist:1715451
Created February 1, 2012 06:16
HFT switch list
IBM BNT RackSwitch G8264
(http://www-03.ibm.com/systems/x/options/networking/bnt8264/index.html)
Fulcrum FM4224
(http://www.fulcrummicro.com/products/focalpoint/fm4000.htm)
Broadcom BCM56820
(http://www.broadcom.com/products/Switching/Data-Center/BCM56820)
Gnodal GS-Series
@saillinux
saillinux / DbcpActiveConnectionMonitor.java
Created March 9, 2012 04:28 — forked from benelog/ConnectionMonitor.java
Btrace scripts to monitor DBCP
import static com.sun.btrace.BTraceUtils.*;
import java.lang.reflect.Field;
import java.util.Map;
import com.sun.btrace.BTraceUtils.Sys;
import com.sun.btrace.annotations.BTrace;
import com.sun.btrace.annotations.OnEvent;
import com.sun.btrace.annotations.OnMethod;
import com.sun.btrace.annotations.Self;
@saillinux
saillinux / tree.pl
Created May 10, 2012 07:28 — forked from gypark/tree.pl
substr과 재귀호출 vs 정규표현식 벤치마크
#!/usr/bin/env perl
use strict;
use warnings;
use Benchmark qw/:all/;
# 입력 (A,(B,(D,(d,_,_),_),(E,_,_)),(C,(F,_,(f,_,_)),(G,(g,_,_),_)))
# 위 입력을 받아 A를 root로 하는 트리 구조를 구성
#
# G
# g
@saillinux
saillinux / gist:5631771
Created May 22, 2013 23:31
BIRD patch for select() -> poll()
--- bird-1.3.9/sysdep/unix/io.c 2013-01-11 05:53:16.000000000 -0800
+++ /home/hkim/bird-1.3.9/sysdep/unix/io.c 2013-05-20 02:34:36.780698000 -0700
@@ -14,6 +14,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
+#include <sys/poll.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#!/usr/bin/env perl
use 5.016;
use common::sense;
use utf8::all;
# Use fast binary libraries
use EV;
use Web::Scraper::LibXML;
use YADA 0.039;
@saillinux
saillinux / amoc_scheduler.pl
Last active December 31, 2015 11:59
Graph를 이용한 DAG 빌드 및 스케쥴링 타스크
use strict;
use warnings;
use Graph;
use Data::Dumper;
use Capture::Tiny ':all';
use constant {
WAITING => 0,
RUNNING => 1,
DONE => 2,