2014/10/24
Try::Tiny::Retry
#!/usr/bin/env perl
use Try::Tiny::Retry;
my $current = 1;
sub get_next {
return $current++;
}
retry {
print get_next() . "\n" and die;
}
catch {
print "catched\n";
}
finally {
print "finally\n";
}
use Try::Tiny::Retry;
my $current = 1;
sub get_next {
return $current++;
}
retry {
print get_next() . "\n" and die;
}
catch {
print "catched\n";
}
finally {
print "finally\n";
}
2014/10/23
ssh proxy
$ ssh -D 8080 myssh.server.com
Firefox: SOCKS proxy: 127.0.0.1 8080
http://whatismyip.com
Traffic goes like this:
local:8080 -> myssh.server.com -> internet -> myssh.server.com -> local:8080
Firefox: SOCKS proxy: 127.0.0.1 8080
http://whatismyip.com
Traffic goes like this:
local:8080 -> myssh.server.com -> internet -> myssh.server.com -> local:8080
2014/10/09
Skype statuses
Perl вдалося зробити те, чого не вдалося Java (незважаючи на неспівмірну наявність коштів та кадрів): священний Грааль "напиши раз ─ запускай де завгодно" (write once ─ run anywhere)
Найбільшою перевагою Perl є його спільнота
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live
cd /usr/ports && make srach
make: don't know how to make srach. Stop
If you feel the urge to shoot yourself in the foot by using multiple inheritance, Perl is not going to stop you
В умовах сучасного аутсорсу, на запитання "Які патерни ООП Ви знаєте?" слід відповідати:
- Костилювання, Інкостиляція та Полікостилізм
The only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle
In my opinion, it is embarrassing that humans spend so much time in school learning to execute algorithms that, quite literally, require no intelligence
Найбільшою перевагою Perl є його спільнота
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live
cd /usr/ports && make srach
make: don't know how to make srach. Stop
If you feel the urge to shoot yourself in the foot by using multiple inheritance, Perl is not going to stop you
В умовах сучасного аутсорсу, на запитання "Які патерни ООП Ви знаєте?" слід відповідати:
- Костилювання, Інкостиляція та Полікостилізм
The only way to do great work is to love what you do. If you haven't found it yet, keep looking. Don't settle
In my opinion, it is embarrassing that humans spend so much time in school learning to execute algorithms that, quite literally, require no intelligence
Bash server
Server:
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; } | nc -l 8080; done
Client:
nc localhost 8080
while true; do { echo -e 'HTTP/1.1 200 OK\r\n'; } | nc -l 8080; done
Client:
nc localhost 8080
Subscribe to:
Posts (Atom)