DELAEMON BLOG

Live as if you were to die tomorrow. Learn as if you were to live forever.

Apache2.4 build from source@OS X

Apache 2.4がOS Xですんなりビルドできなかった。 発生したエラーと解決方法をメモ。 wget http://apache.mirrors.pair.com/httpd/httpd-2.4.17.tar.gz tar xvzf httpd-2.4.17.tar.gz cd httpd-2.4.17 ./configure #ここでエラー XCode -> Open Develop Tool…

Translate Shell + sayコマンドで喉が痛くても外国人と話せるよ@OS X

10分の立ち話で消費されるカロリーは体重60kgの場合19kcal 消費カロリー早見表|活動量計カロリズム|株式会社タニタ10分のタイピングで消費されるカロリーは男性の場合9kcal 『執筆,デスクワーク,タイピング』の消費カロリー|運動・生活活動の消費カロリ…

音声と色付きfizzbuzz.sh@OSX

Go 1.5 gxui install & sample

cd Downloads/glew-1.12.0/ make sudo make install go get github.com/google/gxui go get github.com/golang/freetype/truetype go get github.com/go-gl-legacy/gl go get -u github.com/go-gl/glfw/v3.1/glfw go get -u github.com/goxjs/glfw go get -u…

はじめてのCOBOL

同僚がCOBOLERと結婚されたので書いてみました。その同僚は今週金曜が最終出社日です。

Docket Meetup Tokyo #5 に行ってきた

dockerjp.connpass.comkubernetesの話、デモが印象的だった。memcachedの作者に会えて嬉しかった。

CoreOS fleetで分散デプロイ・フェイルオーバー

CoreOS + Vargrant でクラスタ構成を作る - DELAEMON BLOG 前回からの続き ローカルPCにfleetをセットアップ % go version go version go1.4.2 darwin/amd64 % git clone git@github.com:coreos/fleet.git % cd fleet % ./build クラスタを確認 % bin/fleetc…

CoreOS + Vargrant でクラスタ構成を作る

CoreOSのクラスタ構成ことはじめとしてローカルPC上にCoreOS + Vargrantでテスト環境を作った。 環境 OSX 10.10.4 VirtualBox 4.3.30 Vagrant 1.7.4 coreos-vargrant でクラスタ構築 % git clone https://github.com/coreos/coreos-vagrant.git % cd coreos-…

Dockerコンテナ上のファイルをIntelliJから編集

共有ボリューム用コンテナ作って、samba用コンテナで共有、ローカルPCと開発サーバ用コンテナから参照、編集、実行する 対象バージョン Mac OS X 10.10.3 IntelliJ 14.1.3 VirtualBox 4.3.28 Docker 1.6.2 boot2docker 1.6.2 手順 共有ボリューム用コンテナ…

Docker using boot2docker on OS X

Docker: Image -> New Container | Now Container -> New Image boot2docker: Dockerコンテナ稼働に特化した軽量Linuxディストリビューション開発環境は手元のOS XにDockerで、本番と同じ環境をすぐ作ったり、いらなくなったらすぐ捨てて新しく綺麗な状態に…

AtomからIntelliJに移行してGolang

いったんVim辞めたら、すぐ移行できた cocos2d-xはXCodeやUnityはMonoDevelopなど触ったのも障壁を下げたかもAtomは起動が少し遅いのとプラグインをもりもり入れた以外は特に問題ない でもIntelliJは言語のプラグインのみと少しの設定変更で段違いに快適だっ…

NeoVim Install On Ubuntu14.04

Linuxbrewが必要でrubyやpython-setuptoolsまで入れたら、 結局不要で、Ubuntuはパッケージ用意されてたInstalling · neovim/neovim Wiki · GitHub Homebrew/linuxbrew · GitHub sudo apt-get install curl ruby python-setuptools ruby -e "$(curl -fsSL ht…

PHPで色付きdump

書きなぐり

golang wiki

http://golang.org/dl/go1.3.darwin-amd64-osx10.8.pkg でインストールした % go version go version go1.3 darwin/amd64 http://golang.jp/codelab-wiki やってみたけど、現在は存在しない関数、構造体使っていたので動くようにしたコードが以下 package ma…

hhvm install on OSX 10.8 (UNSUPPORTED)

OSXは正式にはサポートされてない http://docs.hhvm.com/manual/en/install.macosx.php jit対応してないから速さは体感できないけど、機能試したり開発はできる。 ローカルで開発したくてOSXにしたけど、UbuntuとかDebianでやる方がよさげ。ここ見てインスト…

MySQL UDF UDF_ARGS, UDF_INIT

mysql_com.h 487 typedef struct st_udf_args 488 { 489 unsigned int arg_count;>-->---/* Number of arguments */ 490 enum Item_result *arg_type;>-->---/* Pointer to item_results */ 491 char **args;>->--->--->---/* Pointer to argument */ 492 un…

MySQL UserDefinedFunction

http://dev.mysql.com/doc/refman/4.1/ja/adding-udf.html単純関数のUDFでhello world的なものを作ってみる。orz.c #include <string.h> #include <mysql/mysql.h> my_bool orz_init(UDF_INIT *initid, UDF_ARGS *args, char *message) { return 0; } void orz_deinit(UDF_INIT *initi</mysql/mysql.h></string.h>…

Apache Module logging

前回のままだとエラーメッセージを画面に出力してるので、ログファイルに書き出すように変更。読み込み #include "http_log.h エラー int code = apr_dbd_select(dbd->driver, r->pool, dbd->handle, &res, stmt, 0); if (code != 0) { ap_log_rerror(APLOG_…

Apache Module mod_dbd (ubuntu 12.4 apache install)

Apache Moduleからmod_dbdを使ってDBにアクセス、レコードの中身を表示してみる。 mod_dbdはapr(Apache Portable Runtime)を使ってデータベースを操作するもの。 http://httpd.apache.org/docs/2.4/mod/mod_dbd.html http://apr.apache.org/ubuntuにはmodule…

Apache Module IPを表示

ひな形つくってモジュールとディレクトリの紐付け済みでmod_xx.cを以下に編集 // ~ 省略 #include "http_core.h" /* The sample content handler */ static int ip_handler(request_rec *r) { const char *remotehost = NULL; if (strcmp(r->handler, "ip"))…

Apache Module ClearSilver

前作ったhello worldモジュールでClearSilverを使って表示してみるhttp://delaemon.hatenablog.jp/entry/2013/04/24/010326Makefile コマンドをapxs → apxs2へ。ClearSilverのインストールされたパスを指定。読み込むライブラリを指定。 # the used tools AP…

Apache Module Debug

作ったモジュールにClearSilverを使って表示を追加したら コンパイルは通るがアクセスするとerror.log吐いてる [notice] child pid 32713 exit signal Segmentation fault (11)デバック情報が少ないのでどこで落ちているのか調べるためcoreを吐くcore file s…

Ubuntu language-pack-ja-base

Apache Moduleを書き直してコンパイル使用としたら以下のエラー $ sudo apxs2 -i -a -c mod_hello_world.c perl: warning: Setting locale failed. perl: warning: Please check that your locale settings: LANGUAGE = "en_US:", LC_ALL = "ja_JP.UTF-8", L…

C++ テンプレートエンジン clearsilver インストール

Apache Moduleをclearsilverというテンプレートエンジンを使って作る。 まずはインストール。pythonのも入れておく $ sudo apt-get install clearsilver-dev python-clearsilver 環境はUbuntu $ uname -a Linux <host_name> 3.2.0-36-generic #57-Ubuntu SMP Tue Jan 8 </host_name>…

Apache Module のモジュールの引数 STANDARD20_MODULE_STUFF

/** Use this in all standard modules */ #define STANDARD20_MODULE_STUFF MODULE_MAGIC_NUMBER_MAJOR, \ MODULE_MAGIC_NUMBER_MINOR, \ -1, \ __FILE__, \ NULL, \ NULL, \ MODULE_MAGIC_COOKIE, \ NULL /* rewrite args spot */

Apache Module apxsコマンドで生成されたソースコード

mod_hello_world.c /* ** mod_hello_world.c -- Apache sample hello_world module ** [Autogenerated via ``apxs -n hello_world -g''] ** ** To play with this sample module first compile it into a ** DSO file and install it into Apache's modules …

Apache Module の構造体 (ver.2.4.4)

httpd-2.4.4/include/http_config.h /** * Module structures. Just about everything is dispatched through * these, directly or indirectly (through the command and handler * tables). */ typedef struct module_struct module; struct module_struct…

Apache Module で Hello World

C言語本読むの飽きるから動くものを書いてみる。 apacheをインストールするとapxsっていうコマンドも一緒にインストールされる。 apxsコマンドでapacheモジュールのひな形が作れたりコンパイルできたりする。apacheインストール sudo apt-get install apache…

Graphviz で リツイートをグラフ化

入門ソーシャルデータ 語彙的多様性

コード #! /usr/bin/env python # -*- coding: utf-8 -*- import twitter import json twitter_search = twitter.Twitter(domain="search.twitter.com") search_results = [] for page in range(1,6): search_results.append(twitter_search.search(q="LesPa…