programclip
programclip
プログラムの学び方
943 posts
Don't wanna be here? Send us removal request.
programclip · 10 years ago
Link
2 notes · View notes
programclip · 10 years ago
Link
gitの使い方
1 note · View note
programclip · 10 years ago
Quote
中国新聞のRSSを生成するスクリプト あんたぁ、中国新聞読みたいんじゃろう。じゃけどRSSがないけえ、生成するんよ。 記事を取得してRSSの中身に出すようにしました。
中国新聞のRSSを生成するスクリプト あんたぁ、中国新聞読みたいんじゃろう。じゃけどRSSがないけえ、生成するんよ。 記事を取得してRSSの中身に出すようにしました。
1 note · View note
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Link
update-alternatives --set editor /usr/bin/vim.basic
0 notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Photo
Tumblr media
VimのカラースキームをMolokaiに変更する - ponkiti's blog
0 notes
programclip · 10 years ago
Text
nginxとredisのrpmを作ってみた(fedora16 x86_64用)
プロジェクトで最新の安定版のnginxとredisを使いたかったのでrpmを作ってみました。 今回作ったrpmはgithubに公開しています。
10xlab / rpms
準備
作業は全てrootユーザーで行いました。 今回fedora16 x86_64用のrpmを作ってます。
1 rpmの作成にはrpmbuildを使うのでrpmbuildをインストール
# yum install rpm-build
nginxのrpm作成
1 前準備
# mkdir src # cd src/ # mkdir nginx # cd nginx/
2 src.rpmの取得と展開 今回は、Index of /Linux/fedora/epel/6/SRPMSからsrc.rpmを落として使いました。
○ ダウンロード # wget http://ftp.riken.jp/Linux/fedora/epel/6/SRPMS/nginx-1.0.15-1.el6.src.rpm ・ ・ ○ インストール(warnはでるがスルー) # rpm -ivh nginx-1.0.15-1.el6.src.rpm 1:nginx warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root warning: user mockbuild does not exist - using root ・ ・
fedora16だとインストール先は下記のようになります /root/rpmbuild/SOURCES : ソースコードの置き場所 /root/rpmbuild/SPECS : rpm作成ファイル (specファイル) /root/rpmbuild/RPMS : rpm出力先ディレクトリ
3 最新のnginxのソースを取得、配置する ソースはnginx: downloadから取得しています。
# cd /root/rpmbuild/SOURCES/ # wget http://nginx.org/download/nginx-1.2.0.tar.gz ・ ・
4 specファイルの編集 一応バックアップはとっておく
# cp nginx.spec nginx.spec.1.0.15 # vim nginx.spec 【修正箇所】 ○バージョンの変更 Version: 1.0.15 ↓ Version: 1.2.0 ○パッチを当てないようにする # removes -Werror in upstream build scripts. -Werror conflicts with # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors. Patch0: nginx-auto-cc-gcc.patch ↓ # removes -Werror in upstream build scripts. -Werror conflicts with # -D_FORTIFY_SOURCE=2 causing warnings to turn into errors. # Patch0: nginx-auto-cc-gcc.patch %patch0 -p0 ↓ #%patch0 -p0 パッチ(nginx-auto-cc-gcc.patch)の内容を見ると、コンパイル時におけるfedora特有の現象に対してパッチをてています。このパッチを当てなくても、エラーが出ずにrpmを作れたので今回はパッチは当てませんでした。 パッチの内容↓ +# This combined with Fedora's FORTIFY_SOURCE=2 option causes it nginx +# to not compile. +#CFLAGS="$CFLAGS -Werror"
5 rpm作成
# rpmbuild -bb nginx.spec error: Failed build dependencies: GeoIP-devel is needed by nginx-1.2.0-1.fc16.x86_64 gd-devel is needed by nginx-1.2.0-1.fc16.x86_64 libxslt-devel is needed by nginx-1.2.0-1.fc16.x86_64 openssl-devel is needed by nginx-1.2.0-1.fc16.x86_64 pcre-devel is needed by nginx-1.2.0-1.fc16.x86_64 zlib-devel is needed by nginx-1.2.0-1.fc16.x86_64 ぐっ依存関係が・・ # yum install GeoIP-devel gd-devel libxslt-devel openssl-devel pcre-devel zlib-devel # rpmbuild -bb nginx.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.FTmDbe + umask 022 + cd /root/rpmbuild/BUILD + cd /root/rpmbuild/BUILD ・ ・ ・ + cd nginx-1.2.0 + /bin/rm -rf /root/rpmbuild/BUILDROOT/nginx-1.2.0-1.fc16.x86_64 + exit 0 # ls ../RPMS/x86_64/ nginx-1.2.0-1.fc16.x86_64.rpm 完了!
6 テスト
○ インストール # rpm -ivh nginx-1.2.0-1.fc16.x86_64.rpm Preparing... ########################################### [100%] 1:nginx ########################################### [100%] ○ 起動 # nginx # ps aux | grep nginx root 9942 0.0 0.0 98504 1908 ? Ss 11:07 0:00 nginx: master process nginx nginx 9943 0.0 0.1 98860 2596 ? S 11:07 0:00 nginx: worker process root 9949 0.0 0.0 109248 880 pts/0 S+ 11:07 0:00 grep --color=auto nginx http://{IPADDR}にアクセスして、ページも確認しました。 # nginx -s stop ○ アンインストール # rpm -e nginx
redisのrpm作成
1 前準備
# cd /root/src/ # mkdir redis # cd redis/
2 src.rpmの取得と展開 redisも、Index of /Linux/fedora/epel/6/SRPMSからsrc.rpmを落として使いました。
○ ダウンロード # wget http://ftp.riken.jp/Linux/fedora/epel/6/SRPMS/redis-2.4.10-1.el6.src.rpm ・ ・ ○ インストール(warnはでるがスルー) # rpm -ivh redis-2.4.10-1.el6.src.rpm 1:nginx warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root warning: user mockbuild does not exist - using root warning: group mockbuild does not exist - using root warning: user mockbuild does not exist - using root ・ ・
3 最新のredisのソースを取得、配置する ソースはDownloadから取得しています。
# cd /root/rpmbuild/SOURCES/ # wget http://redis.googlecode.com/files/redis-2.4.13.tar.gz ・ ・
4 specファイルの編集 一応バックアップはとっておく
# cp redis.spec redis.spec.2.4.10 # vim redis.spec 【修正箇所】 ○バージョンの変更 Version: 2.4.10 ↓ Version: 2.4.13 同梱されてたパッチは、redis.confのデフォルトの設定を変更するものだったので、そのパッチはそのまま当てることにしました。
5 rpm作成
# rpmbuild -bb redis.spec Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.ZpN07N + umask 022 + cd /root/rpmbuild/BUILD + cd /root/rpmbuild/BUILD ・ ・ + umask 022 + cd /root/rpmbuild/BUILD + cd redis-2.4.13 + rm -fr /root/rpmbuild/BUILDROOT/redis-2.4.13-1.fc16.x86_64 + exit 0 # ls ../RPMS/x86_64/ redis-2.4.13-1.fc16.x86_64.rpm 完了!
6 テスト
○ インストール # rpm -ivh redis-2.4.13-1.fc16.x86_64.rpm Preparing... ########################################### [100%] 1:redis ########################################### [100%] ○ 起動 # redis-server /etc/redis.conf [root@xsy001 ~]# redis-cli redis 127.0.0.1:6379> SET test 1 OK redis 127.0.0.1:6379> GET test "1" ○ アンインストール # rpm -e redis
動作確認もできたので、まあ大丈夫かと思います。 今回作ったrpmはgithubに公開しています。
10xlab / rpms
なにか不具合があれば、ご連絡ください。
7 notes · View notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Quote
# 30日以内に更新された/etc以下のファイル群を # ディレクトリ構造を保ったまま/backup_dirにコピー find /etc -mtime -30 | xargs -iX cp -P X /backup_dir
findで検索したファイル群のディレクトリ構造を保ったままコピーする | taichino.com
0 notes
programclip · 10 years ago
Link
0 notes
programclip · 10 years ago
Quote
codicは、プログラマー・システムエンジニアのためのネーミングツールです。新しいcodicでは、ネーミングを生成できるようになりました。
プログラマーのためのネーミング辞書 | codic
0 notes
programclip · 10 years ago
Link
0 notes