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
@azumakuniyuki
azumakuniyuki / net-server-mail-smtpd.pl
Created August 20, 2011 12:37
SMTPd on 127.0.0.1 by Net::Server::Mail
#!/usr/local/bin/perl
# SMTPd on 127.0.0.1 by Net::Server::Mail
use Net::Server::Mail::SMTP;
use IO::Socket::INET;
my $server = new IO::Socket::INET( 'Listen' => 1, 'LocalPort' => 2500 );
my $conn = undef();
while( $conn = $server->accept() )
{
@azumakuniyuki
azumakuniyuki / net-smtp-vs-email-sender.pl
Created August 20, 2011 12:51
Net::SMTP vs. Email::Send vs. Email::Sender
#!/usr/bin/perl -w
# Net::SMTP vs. Email::Send vs. Email::Sender
{
package NS1;
use strict;
use warnings;
use Net::SMTP;
sub sendmesg {
@azumakuniyuki
azumakuniyuki / sendgrid587.m4
Created September 1, 2011 03:11
For relaying message to SendGrid via port 587
divert(7)
######################################################################
### sendgrid587 Mailer Specification ###
######################################################################
Msendgrid587, P=[IPC], F=mDFMuXa8, S=EnvFromSMTP/HdrFromSMTP,
R=MasqSMTP, E=\r\n, L=2040, T=DNS/RFC822/SMTP,
A=TCP $h 587
@azumakuniyuki
azumakuniyuki / sendmail-queueid.pl
Created November 25, 2011 16:32
Generate queue identifier of Sendmail
#!/usr/local/bin/perl
use strict;
use warnings;
use Time::Piece;
my $current = new Time::Piece();
my $idchars = []; push( @$idchars , '0'..'9', 'A'..'Z', 'a'..'x' );
my $queueid = {
'Y' => $idchars->[ $current->_year() % 60 ],
'M' => $idchars->[ $current->_mon() ],
@azumakuniyuki
azumakuniyuki / traditional-jp-colors.plist.diff
Created December 24, 2011 04:42
Traditional JP color patch for MacVim
--- /Applications/MacVim.app/Contents/Resources/Colors.plist 2011-12-16 04:52:00.000000000 +0900
+++ /Applications/MacVim.app/Contents/Resources/Colors.plist 2011-12-17 18:23:45.000000000 +0900
@@ -1325,5 +1325,935 @@
<integer>9145088</integer>
<key>yellowgreen</key>
<integer>10145074</integer>
+ <key>Sakurairo</key>
+ <integer>16708852</integer>
+ <key>Azukiiro</key>
+ <integer>9851213</integer>
# $Id: firewall-rules,v 1.2 2009/04/29 13:55:29 ak Exp $
#
# Policy Configuration
# ./trusted-hostからの全てのパケットを通過させる
ALLOW_ANY_CONNECTION_FROM_TRUSTEDHOSTS=0 # Allow any connections from ./trusted-hosts
# ./extroot-hostsからの全てのパケットを通過させる
ALLOW_ANY_CONNECTION_FROM_EXTERNALROOT=0 # Allow any connections from ./extroot-hosts
# ./monitor-hostsからの全てのパケットを通過させる
% /usr/local/bin/figlet 'Blogger'
____ _
| __ )| | ___ __ _ __ _ ___ _ __
| _ \| |/ _ \ / _` |/ _` |/ _ \ '__|
| |_) | | (_) | (_| | (_| | __/ |
|____/|_|\___/ \__, |\__, |\___|_|
|___/ |___/
_ _ _ _
_ __ (_)(_) ___ _____ ____ _ _ __ ___ _ __ | | ___ (_)_ __
| '_ \| || |/ _ \ / _ \ \/ / _` | '_ ` _ \| '_ \| |/ _ \ | | '_ \
| | | | || | (_) | __/> < (_| | | | | | | |_) | | __/_ | | |_) |
|_| |_|_|/ |\___(_)___/_/\_\__,_|_| |_| |_| .__/|_|\___(_)/ | .__/
|__/ |_| |__/|_|
* ADDR: 192.0.2.25
* HTTP: www.example.jp
* MAIL: mx.example.jp, pop.example.jp(110), smtp.example.jp(25)
% /bin/sh /usr/local/bin/showfigfonts Hoge⏎
...
banner3-D : ←フォントの名前
'##::::'##::'#######:::'######:::'########:
##:::: ##:'##.... ##:'##... ##:: ##.....::
##:::: ##: ##:::: ##: ##:::..::: ##:::::::
#########: ##:::: ##: ##::'####: ######:::
##.... ##: ##:::: ##: ##::: ##:: ##...::::
##:::: ##: ##:::: ##: ##::: ##:: ##:::::::
##:::: ##:. #######::. ######::: ########:
% figlet -fsmkeyboard 'Class Methods'⏎
____ ____ ____ ____ ____ _________ ____ ____ ____ ____ ____ ____ ____
||C |||l |||a |||s |||s ||| |||M |||e |||t |||h |||o |||d |||s ||
||__|||__|||__|||__|||__|||_______|||__|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|
出力を確認したらコメント化の#をつけてクリップボードに入れる↓
% figlet -fsmkeyboard 'Class Methods' | sed 's|^|# |g' | pbcopy⏎
% figlet -fsmkeyboard 'smtp1.example.jp'⏎