フォルダからPDFを作る.workflow
- フォルダを受け取る
- 内包する画像を全て破壊的にjpgへ変換する
- 名前順でソートする
- 名前順ページでPDFを作成する
- 「
${フォルダ名}.pdf
」にリネームする - Growlで通知する
webでちょろっと探したけど5番をやってる人が意外といらっしゃらなかったので投稿します。 詳しい中身はworkflowを参照してください。
relay-mta.auone-net.jpが終了していた件
新鯖でPostfix:Submission + Dovecot:IMAPS
なメール鯖を構築していた時のこと。
Dec 16 15:57:16 ubuntu postfix/smtp[17779]: CE9284A005F: to=<**@**>, relay=none, delay=0.19, delays=0.02/0.01/0.16/0, dsn=4.3.5, status=deferred (Host or domain name not found. Name service error for name=relay-mta.auone-net.jp type=A: Host not found)
relay-mta.auone-net.jp: Host not found
( ꒪⌓꒪)
恐ろしい事にau-oneの代理配送サービスが終了していた。
というわけでmain.cfを修正した
< relayhost = relay-mta.auone-net.jp --- > relayhost = [割当SMTPサーバ]:587 ---
smtpにも認証周りの設定を施す。
smtp_use_tls = yes smtp_sasl_mechanism_filter = plain smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/submission smtp_sasl_tls_security_options = noanonymous smtp_sasl_mechanism_filter = plain
hash:/etc/postfix/submission
←ここのパスは任意、元々au-oneのサブミッション設定をしていた人はそのままで問題ない、postmapもしなくてよい。
する人はこちら。
echo '割当SMTPサーバ ユーザ名:パスワード' > /etc/postfix/submission postmap /etc/postfix/submission service postfix reload
これで正常に送信できた。
UIWebViewでiOSインターフェースを構築する
ためにいろいろと調査した結果ログ。
よくまとまってた。
長押しでの選択を無効にする
CSSでハンドルする。
-webkit-touch-callout: none; -webkit-user-select: none;
overflow: scroll;な要素でスムーズスクロール・バウンスを有効にする
-webkit-overflow-scrolling: touch;
ピンチでの拡大を停止する
<meta name='viewport' content='initial-scale=1,userscalable=no'>
Retina用のスタイルを定義する
@media only screen and (-webkit-min-device-pixel-ratio:2) { }
リファレンスの.htmlを[UIImage imageNamed:]みたく検索する
PhoneGapから拝借した。
- (NSString*)resourceNamed:(NSString*)resourcePath { NSBundle* mainBundle = [NSBundle mainBundle]; NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcePath componentsSeparatedByString:@"/"]]; NSString* filename = [directoryParts lastObject]; [directoryParts removeLastObject]; NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"]; NSString* directoryStr = @"www"; if ([directoryPartsJoined length] > 0) directoryStr = [NSString stringWithFormat:@"%@/%@", directoryStr, [directoryParts componentsJoinedByString:@"/"]]; return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr]; }
UIWebViewのスクロール速度をUIScrollViewと同等にする
機能制限ではなく意図的に遅延させているらしい。
UIWebView *webview; [webview.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal];
バウンス時に出現する影レイヤを削除する
UIWebViewを領域外へフリックした際に出現するshadowレイヤを隠蔽します。
背景をネイティブに担当、background: transparentなUIWebViewなどに有効。
for (UIView *webview in [[[self subviews] objectAtIndex:0] subviews]) { if ([webview isKindOfClass:[UIImageView class]]) { [webview setHidden:YES]; } }
ついでに背景を透過する。
[webview setOpaque:NO]; [webview setBackgroundColor:[UIColor clearColor]];
クラス化した
- (id)initWithCoder:(NSCoder *)aDecoder { if ( (self=[super initWithCoder:aDecoder]) ) { [self setOpaque:NO]; [self setBackgroundColor:[UIColor clearColor]]; [self.scrollView setDecelerationRate:UIScrollViewDecelerationRateNormal]; for (UIView *webview in [[[self subviews] objectAtIndex:0] subviews]) { if ([webview isKindOfClass:[UIImageView class]]) { [webview setHidden:YES]; } } } return self; }
input要素へのスタイルを適切に作用させる
input { -webkit-appearance: none; }
Ubuntu12.04でSquid3をPAM認証した
とにかくweb上の文書が少ないし古い。
web上で入手できる文章は限られてるのでそれは参照してもらうとして。
たぶん効いたのはコレ。
$ chmod u+s /usr/lib/squid3/pam_auth $ apt-get install libpam-unix2 $ cat /etc/pam.d/squid auth required /lib/security/pam_unix2.so account required /lib/security/pam_unix2.so
DebianのPAMは完全に鬼門、前もlibpam-unix2で何かを解決した記憶がある。
pam_authのmanには/etc/pam.d/<service name>
って書いてあるけどsquid3
じゃなくてsquid
で大丈夫です。
あとはsquid.confの抜粋、行数も残しとく。
343 auth_param basic program /usr/lib/squid3/pam_auth 344 auth_param basic children 5 345 auth_param basic realm Squid proxy-caching web server 346 auth_param basic credentialsttl 5 hours 701 acl pamauth proxy_auth REQUIRED 849 http_access allow pamauth
参考
- 基本 Proxyサーバー構築
- PAM Ubuntu 8.10: Squid3 with pam_auth revisited
- pam_auth die.net