Skip to content

Instantly share code, notes, and snippets.

View azumakuniyuki's full-sized avatar
🐈
On vacation

azuma, kuniyuki azumakuniyuki

🐈
On vacation
View GitHub Profile
#!/usr/bin/perl
use strict;
use Data::Dumper;
use Email::Simple;
use Term::ANSIColor qw(:constants);
use MIME::Base64;
use Digest::SHA1 qw(sha1 sha1_hex sha1_base64);
use Digest::SHA qw(sha256_hex sha256);
use Socket qw(:crlf);
use Getopt::Long;
@xtetsuji
xtetsuji / maillog-hashnize.pl
Last active October 11, 2022 08:08
enhancement of "pflog" for parsing maillog of postfix 2.3 or higher version.
#!/usr/bin/perl
# "pflog" enhancement for parsing maillog of postfix 2.3 or higher version.
# "pflog" see: http://www.tmtm.org/ruby/pflog/pflog-0.3
use strict;
use warnings;
use Time::Local;
use Getopt::Long;
#use Data::Dumper;
@zigorou
zigorou / pp_with_pipe.pl
Created December 20, 2011 10:53
For mandy
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump qw(dump);
use IO::Pipe;
use Parallel::Prefork;
use Time::HiRes;
@jboner
jboner / latency.txt
Last active July 30, 2024 02:24
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@xtetsuji
xtetsuji / colorsyslog.pl
Created November 5, 2015 09:41
Portable utility of coloring Syslog format and same kind class, e.g. Postfix.
#!/usr/bin/perl
# xtetsuji 2015/11/05
use v5.10;
use strict;
use warnings;
use Term::ANSIColor;
my $syslog_re = qr/^(?<date>\w\w\w [ \d]\d) (?<time>\d\d:\d\d:\d\d) (?<host>\S+) (?<process>\S+): (?<message>.*)/;
@joker1007
joker1007 / esm_drinkup_sake_list.md
Last active December 20, 2015 06:48
Rubykaigi2015 ESM drinkupで提供予定の日本酒一覧

ESM Drinkup で提供予定のお酒一覧

  • いづみ橋 恵 青ラベル 純米吟醸 1800ml
  • いづみ橋 桃色黒とんぼ きもと純米酒 1800ml
  • 七本鎗 無有(むう) 無農薬純米 1800ml
  • 七本鎗 純米吟醸 "吟吹雪" 1800ml
  • 七田 純米吟醸 雄町50 1800ml
  • 三井の寿(みいのことぶき) 純米吟醸 酒未来 福岡県産 1800ml
  • 上喜元 純米 "雄町" 1800ml
  • 作 雅乃智(純米大 吟醸中取り) 1.8L
@hiroyuki-sato
hiroyuki-sato / error1.txt
Created February 5, 2016 01:30
Embulk v0.8.2 error
org.embulk.exec.PartialExecutionException: org.jruby.exceptions.RaiseException: (ConcurrencyError) Detected invalid array contents due to unsynchronized modifications with concurrent users
at org.embulk.exec.BulkLoader$LoaderState.buildPartialExecuteException(org/embulk/exec/BulkLoader.java:363)
at org.embulk.exec.BulkLoader.doRun(org/embulk/exec/BulkLoader.java:572)
at org.embulk.exec.BulkLoader.access$000(org/embulk/exec/BulkLoader.java:33)
at org.embulk.exec.BulkLoader$1.run(org/embulk/exec/BulkLoader.java:374)
at org.embulk.exec.BulkLoader$1.run(org/embulk/exec/BulkLoader.java:370)
at org.embulk.spi.Exec.doWith(org/embulk/spi/Exec.java:25)
at org.embulk.exec.BulkLoader.run(org/embulk/exec/BulkLoader.java:370)
at org.embulk.EmbulkEmbed.run(org/embulk/EmbulkEmbed.java:180)
at java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:483)
@damusix
damusix / aws_iam_secret_to_smtp_password.md
Last active May 12, 2024 03:23
Convert AWS IAM credentials to AWS SMTP credentials

Convert AWS IAM credentials to AWS SMTP credentials

If you do, or want to, use AWS to deploy your apps, you will end up using AWS SES via SMTP when you're launching an app that sends out emails of any kind (user registrations, email notifications, etc). For example, I have used this configuration on various Ruby on Rails apps, however, it is just basic SMTP configurations and crosses over to any framework that supports SMTP sendmail.

There are two ways to go about this:

Luckily, you found this MD file and the NOT SO EASY WAY is suddenly copy-pasta... sudo yum....

@xtetsuji
xtetsuji / qqns.pl
Last active October 26, 2016 16:12
Querying and logging qq.com MX to qq.com all NSes continuously.
#!/usr/bin/perl
# xtetsuji 2016/10/26
# qqns.pl - qq.com の MX を qq.com の NS 群全部に問い合わせをして、その記録を取る
#
# 何も考えず雑に書いたのでかなり適当です
# qq.com の NS のうち複数が返答しない場合があるらしく、その調査観察を行うためのスクリプトです
use v5.10;
use strict;
use warnings;