[OpenSSL] 自己署名証明書(オレオレ証明書)の作成方法
- 2013 3/6
自己署名証明書(オレオレ証明書)の作成方法をメモ。
openssl genrsa -out server.key 2048 openssl req -new -key server.key > server.csr openssl x509 -in server.csr -days 3650 -req -signkey server.key > server.crt |
詳しくはここを読む。
自己署名証明書(オレオレ証明書)の作成方法をメモ。
openssl genrsa -out server.key 2048 openssl req -new -key server.key > server.csr openssl x509 -in server.csr -days 3650 -req -signkey server.key > server.crt |
詳しくはここを読む。
Ubuntu や CentOS などの Linux サーバーで構築したマシンのバックアップすべきディレクトリを調べたのでご紹介します。
Apache + PHP4 + PostgreSQL で下記のようなエラーが出た場合の解決方法をメモ。
libphp4.so で使う libpq.so.2.1 が無いというエラーです。
# /etc/init.d/httpd configtest Syntax error on line 941 of /etc/httpd/conf/httpd.conf: Cannot load /etc/httpd/modules/libphp4.so into server: libpq.so.2.1: cannot open shared object file: No such file or directory |
libphp4.so のダイナミックリンクの関係を表示して確認すると、libpq.so.2.1 => not found となっていることが確認できます。
# ldd /etc/httpd/modules/libphp4.so libpam.so.0 => /lib/libpam.so.0 (0x40177000) libdl.so.2 => /lib/libdl.so.2 (0x40180000) libpq.so.2.1 => not found libcrypt.so.1 => /lib/libcrypt.so.1 (0x40184000) libresolv.so.2 => /lib/libresolv.so.2 (0x401b2000) libm.so.6 => /lib/libm.so.6 (0x401c4000) libnsl.so.1 => /lib/libnsl.so.1 (0x401e6000) libc.so.6 => /lib/libc.so.6 (0x401fd000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000) |
# find / -name libpq.so.2.1 /usr/local/src/postgresql-7.0.3/src/interfaces/libpq/libpq.so.2.1 /usr/local/pgsql/lib/libpq.so.2.1 |
postgres 以下にある libpq.so.2.1 を /lib 以下にシンボリックリンクを貼ります。
# ln -s /usr/local/pgsql/lib/libpq.so.2.1 /lib/libpq.so.2.1 |
ちゃんと libpq.so.2.1 が読み込めていることを確認できました。
# ldd /etc/httpd/modules/libphp4.so libpam.so.0 => /lib/libpam.so.0 (0x40177000) libdl.so.2 => /lib/libdl.so.2 (0x40180000) libpq.so.2.1 => /lib/libpq.so.2.1 (0x40184000) libcrypt.so.1 => /lib/libcrypt.so.1 (0x40196000) libresolv.so.2 => /lib/libresolv.so.2 (0x401c4000) libm.so.6 => /lib/libm.so.6 (0x401d6000) libnsl.so.1 => /lib/libnsl.so.1 (0x401f8000) libc.so.6 => /lib/libc.so.6 (0x4020f000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000) |
# vi /etc/httpd/conf/httpd.conf #LoadModule php4_module lib/apache/libphp4.so LoadModule php4_module /usr/lib/apache/libphp4.so |
[参考]:2日目突入ちぅ – やちまうの戯言
PHP4 をソースコードから再インストールする際に、make でエラーが出たので解決方法をメモ。
一度、make install してから、./configure のオプションを変更して、再インストールしたい。
# ./configure # make # make install |
# ./configure # make ... stub.lo: file not recognized: File truncated collect2: ld returned 1 exit status make[1]: *** [libphp4.la] エラー 1 make[1]: 出ます ディレクトリ `/usr/local/src/php-4.0.6' make: *** [all-recursive] エラー 1 |
上記のようなエラーが出た場合、make clean すればOK
# make clean # make # make install |
Ruby on Rails + Haml で、text mail 内で改行するには、バックスラッシュを使います。
Dear = @user.name, \ Your username is = @user.username \ \ \ \ Your status is = @user.status |
Google Web Fonts は iPhone/Android アプリでもLICENSE的に使ってOKみたいです。
Google WebFonts – free fonts, mostly open source but some licenses for use in commercial projects
http://docs.appcelerator.com/titanium/latest/#!/guide/Custom_Fonts
Can I download the fonts on Google Web Fonts to my own computer?
Yes. To download the fonts, simply add fonts to your collection and click the “Download your Collection” link. You can download the fonts to use them for your mockups, in your documents or to host them on your own server.
Do I need to download the font in order to use the font on my website or blog?
No. The font is available for download in case you need the font in a local program like Adobe Photoshop. To use the font on your website or blog, you can simply copy the HTML snippet available from the “Use” tab for your collection.
https://developers.google.com/webfonts/faq?hl=ja
Typekit font を iOS/Android アプリで使って良いか Adobe に質問してみました。
結論としては、ウェブサイトのみ利用可能で、iOS や Android アプリではNGとのことでした。
■ 質問内容
Hi
Can I use Typekit font in iOS or Android app?
If I can, please tell me how to use.Thanks!
■ 返答内容
Hi Tadashi,
At this time, Typekit fonts are only licensed for use in websites. We’re looking into font licensing for native iOS and Android apps but I can’t say when this might be available.
I’m sorry I couldn’t be of more help. Let me know if you have any further questions.
Cheers,
Benjamin
Ruby で配列から正規表現の作成は Regexp.union を使ってできます。
# 画像ファイルの拡張子の形式が正しいかチェック # @param [String] ファイルの拡張子 # @return [Boolean] 正常: true, 異常: false def valid_image_file_extension?(file_extension) regex = Regexp.union(extension_white_list) (file_extension =~ regex) ? true : false end # 許可する拡張子のリスト def extension_white_list %w(jpg jpeg gif png) end |
CarrierWaveでローカルファイルを登録する方法をメモ。
@user = User.new @user.image.store! File.open(path_to_file) |
Ruby on Rails の Action Mailer でのメール送信処理をする方法をメモ。
主にこのへんを読む。
・Action Mailer Basics — Ruby on Rails Guides
・Rails 3 の Action Mailerまとめ – おもしろWEBサービス開発日記
・ActionMailer Railsアプリからメールを送信 – 酒と泪とRubyとRailsと
config/environments/production.rb に下記のような感じで設定する。
MyApp::Application.configure do # Mailer config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { address: "smtp.gmail.com", port: 587, domain: 'example.com', user_name: "gmail_user", password: "gmail_pass", authentication: 'plain', enable_starttls_auto: true, } end |
[参考]