Skip to content

Instantly share code, notes, and snippets.

View aero's full-sized avatar

aero aero

  • Seoul, Republic of Korea
View GitHub Profile
# UNIX
perl -MLWP::Simple -e 'foreach my $n (227180..227196){ my @imgs = (my $t=get("http://gall.dcinside.com/list.php?id=racinggirl&no=$n")) =~ m!(http://dcimg1.dcinside.com/viewimage.php[^'"'"']+)!g; foreach (0..$#imgs) { print "Getting -> $imgs[$_]\n"; getstore($imgs[$_], $n."_".$_.".jpg") } }'
# Windows
perl -MLWP::Simple -e "foreach my $n (227180..227196){ my @imgs = (my $t=get(qq{http://gall.dcinside.com/list.php?id=racinggirl&no=$n})) =~ m!(http://dcimg1.dcinside.com/viewimage.php[^']+)!g; foreach (0..$#imgs) { print qq/Getting -> $imgs[$_]\n/; getstore($imgs[$_], $n.'_'.$_.'.jpg') } }"
diff -uNr /usr/local/opsview-web.bak/lib/Opsview/Web/ControllerBase/WrapCGI.pm /usr/local/opsview-web/lib/Opsview/Web/ControllerBase/WrapCGI.pm
--- /usr/local/opsview-web.bak/lib/Opsview/Web/ControllerBase/WrapCGI.pm 2010-09-27 11:09:44.000000000 +0900
+++ /usr/local/opsview-web/lib/Opsview/Web/ControllerBase/WrapCGI.pm 2010-10-07 11:27:13.000000000 +0900
@@ -161,7 +161,8 @@
if ( $c->stash->{div_id} ) {
$body_data = '<div id="' . $c->stash->{div_id} . '">' . $body_data . "</div>";
}
- $c->stash( cgi_output => $body_data );
+ use Encode qw/encode decode/;
+ $c->stash(cgi_output => decode('utf8',$body_data));
diff -uNr /usr/local/nagios/lib.bak/Opsview/Keyword.pm /usr/local/nagios/lib/Opsview/Keyword.pm
--- /usr/local/nagios/lib.bak/Opsview/Keyword.pm 2010-09-27 12:06:20.000000000 +0900
+++ /usr/local/nagios/lib/Opsview/Keyword.pm 2010-10-07 10:52:12.000000000 +0900
@@ -26,6 +26,8 @@
__PACKAGE__->table("keywords");
+__PACKAGE__->utf8_columns( qw/description/ );
+
__PACKAGE__->columns( Primary => qw/id/ );
#!/usr/bin/env perl
use strict;
use warnings;
use IO::Socket;
use threads;
use Thread::Queue;
my $count : shared;
my $hostcnt : shared;
set nocompatible
source $VIMRUNTIME/vimrc_example.vim
"source $VIMRUNTIME/mswin.vim
"behave mswin
"------------------ my config start ------------------
syntax on
set fencs=ucs-bom,utf-8,cp949
"매치하는 괄호를 보여준다.
#!/usr/bin/env perl
# 사용법
# chmod a+x kspell.pl
# ./kspell.pl "안뇽하세요? 방갑습니다."
use strict;
use warnings;
use WebService::KoreanSpeller;
use Encode qw/encode decode/;
my $text = decode('utf8', $ARGV[0]);
#!/usr/bin/env perl
use strict;
use warnings;
use LWP::UserAgent;
use Encode qw/encode decode from_to/;
my $ua = LWP::UserAgent->new;
my $text = $ARGV[0];
my $unitext = decode('utf8', $text);
use MooseX::Declare;
class Person {
has 'position' => (is => 'ro', isa => 'Int');
has 'alive' => (is => 'rw', isa => 'Bool', default => 1);
has 'succ' => (is => 'rw', isa => 'Person', default => undef);
# Create a chain of people
method createChain(Int $n) {
return $self unless $n > 0;
my $succ = Person->new( position => $self->position+1 );
package Person;
use Moose;
has 'position' => (is => 'ro', isa => 'Int');
has 'alive' => (is => 'rw', isa => 'Bool', default => 1);
has 'succ' => (is => 'rw', isa => 'Person', default => undef);
# Create a chain of people
sub createChain {
my ($self, $n) = @_;
return $self unless $n > 0;
package Person;
use parent 'Class::Accessor::Fast';
__PACKAGE__->mk_accessors(qw/position alive succ/);
# Create a new, living Person with the given position
sub new {
my ($class, $args) = @_;
return $class->SUPER::new( { %{$args}, alive => 1 } );
}