昨年投稿して、あっという間に1年以上が経過。
このままじゃダメだなー、もう少し書かないとなー、と思いつつ久しぶりに更新。
仕事の忙しさにかまけて、契約しているさくらのVPSもownCloudを利用している位で、せいぜい脆弱性がないようにupdateをかけているような状態。
これじゃいかん!と思い、一念発起の気持ちで勉強を決意。
ということで、書籍を2冊ほど購入。
ちょっとPythonをいじって、いろいろやってみようと思う。
GeekWind の何でもメモ
ここのところ放置しっ放しだったので、ちょっと手を入れてみる。
巷で噂(?)のGroongaをインストールしてみようと思う。
例のごとく、それほど面倒ではなさそうな感じ。
# rpm -ivh http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm Retrieving http://packages.groonga.org/centos/groonga-release-1.1.0-1.noarch.rpm Preparing... ########################################### [100%] 1:groonga-release ########################################### [100%] [root@www9262ue tmp]# yum makecache Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile epel/metalink | 5.2 kB 00:00 * epel: ftp.iij.ad.jp base | 3.7 kB 00:00 base/group_gz | 212 kB 00:00 base/filelists_db | 5.9 MB 00:00 base/other_db | 2.7 MB 00:00 epel/group_gz | 237 kB 00:00 epel/filelists_db | 7.1 MB 00:00 epel/other_db | 2.9 MB 00:00 epel/updateinfo | 598 kB 00:00 extras | 3.5 kB 00:00 extras/filelists_db | 10 kB 00:00 extras/prestodelta | 964 B 00:00 extras/other_db | 5.5 kB 00:00 groonga | 951 B 00:00 groonga/filelists | 151 kB 00:00 groonga/primary | 45 kB 00:00 groonga/other | 44 kB 00:00 groonga 300/300 groonga 300/300 groonga 300/300 updates | 3.5 kB 00:00 updates/filelists_db | 1.6 MB 00:00 updates/prestodelta | 304 kB 00:00 updates/other_db | 220 kB 00:00 epel/pkgtags | 327 B 00:00 Metadata Cache Created
# yum install groonga ・・・・・・ ・・・・・・ ==================================================================================================== Package Arch Version Repository Size ==================================================================================================== Installing: groonga x86_64 3.0.2-0.el6 groonga 288 k Installing for dependencies: groonga-libs x86_64 3.0.2-0.el6 groonga 2.2 M groonga-plugin-suggest x86_64 3.0.2-0.el6 groonga 47 k Transaction Summary ==================================================================================================== Install 3 Package(s) ・・・・・・ ・・・・・・ Complete!
yum install -y groonga-tokenizer-mecab groonga-normalizer-mysql ・・・・・・ ・・・・・・ Complete!
最近、仕事でも携帯電話やスマートフォンでURLを入力する機会が増えてきた。
簡単なURLならまだしも、長ったらしいURLだと入力するのも面倒だし、打ち間違えたりするとイラッ!ときてしまう。
このURL入力を簡素化するためQRコードを生成して、それをカメラで読み取ればいいやと思い、プログラムを作成。
今回は開発スピード重視ということで、開発言語はPerlを用いた。
ちなみにPerlの場合、CPANにGD::Barcode::QRcodeという便利なモジュールがあるのだ。
使い方はいたって簡単。
use GD::Barcode::QRcode; binmode(STDOUT); my $qr = new GD::Barcode::QRcode->new( 'http://www.geekwind.net', { Ecc=>'L', Version=>5, ModuleSize=>4 } ); print $qr->plot->png; exit;
ちょっと、そろそろちょっとしたツールでも作ろうと思い、環境整備に走る。
「PHP 5.3.9」に危険度の高い脆弱性、最新版へのアップデートを
一般社団法人JPCERTコーディネーションセンター(JPCERT/CC)は6日、PHPのバージョン5.3.9に危険度の高い脆弱性が存在するとして、注意喚起を行った。
-INTERNET Watch
と、その前に昨日こんな記事が目に止まったので、PHPのバージョンをチェックしてみると、あれれれ?こんなメッセージが出てしまった。
# php -v PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: apc: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match in Unknown on line 0 PHP Warning: PHP Startup: memcache: Unable to initialize module Module compiled with module API=20060613 PHP compiled with module API=20090626 These options need to match in Unknown on line 0 PHP 5.3.10 (cli) (built: Feb 3 2012 08:20:28) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies #
# pecl uninstall apc Unable to remove "extension=apc.so" from php.ini uninstall ok: channel://pecl.php.net/APC-3.1.6 # sudo -u root pecl install apc downloading APC-3.1.9.tgz ... Starting to download APC-3.1.9.tgz (155,540 bytes) .................................done: 155,540 bytes 54 source files, building < 中略 > Build process completed successfully Installing '/usr/lib64/php/modules/apc.so' Installing '/usr/include/php/ext/apc/apc_serializer.h' install ok: channel://pecl.php.net/APC-3.1.9 configuration option "php_ini" is not set to php.ini location You should add "extension=apc.so" to php.ini # # pecl uninstall memcache Unable to remove "extension=memcache.so" from php.ini uninstall ok: channel://pecl.php.net/memcache-2.2.6 # sudo -u root pecl install memcache downloading memcache-2.2.6.tgz ... Starting to download memcache-2.2.6.tgz (35,957 bytes) ..........done: 35,957 bytes 11 source files, building < 中略 > Build process completed successfully Installing '/usr/lib64/php/modules/memcache.so' install ok: channel://pecl.php.net/memcache-2.2.6 configuration option "php_ini" is not set to php.ini location You should add "extension=memcache.so" to php.ini # # php -v PHP 5.3.10 (cli) (built: Feb 3 2012 08:20:28) Copyright (c) 1997-2012 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies #
昨日から触り始めた楽天WEB SERVICEの商品検索用のPerlモジュールができた。
ということで、キーワードを渡せば、アフィリエイトコード付きで商品検索結果を取得することができるようになった。
モジュールそのものは、わりと汎用的に使えるようにしてあるので、オブジェクトを生成する際に、引数を指定すれば私以外の人でもアフィリエイトコード付きの商品検索結果を得ることが可能となる。
とはいえ、そのままだと私のデベロッパーIDを使うことになってしまうため、デベロッパーIDも指定してできるようにはなっている。
明日はAmazonのAPIを利用して、汎用モジュールを作成しようかと思ったが、実はNet::AmazonのようなモジュールがCPANには登録されているので、Amazonに関しては作る必要がない。
なので、明日はValueCommerceのAPI、もしもドロップシッピングのAPI(PDF)、Yahoo!ショッピングのAPIを使った検索モジュールを作成しようと思う。