Linux
[Linxu]CentOS6.3にProFTPDを設定する
■インストールする
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
#yum install proftpd ======================================================================================= Package Arch Version Repository Size ======================================================================================= Installing: proftpd x86_64 1.3.4a-1.el6.rf rpmforge 2.0 M Installing for dependencies: perl-Mail-Sendmail noarch 0.79-12.el6 epel 28 k perl-Time-HiRes x86_64 4:1.9721-130.el6_4 updates 47 k Transaction Summary ======================================================================================= Install 3 Package(s) Total download size: 2.1 M Installed size: 6.8 M Is this ok [y/N]: y Downloading Packages: (1/3): perl-Mail-Sendmail-0.79-12.el6.noarch.rpm | 28 kB 00:00 (2/3): perl-Time-HiRes-1.9721-130.el6_4.x86_64.rpm | 47 kB 00:00 (3/3): proftpd-1.3.4a-1.el6.rf.x86_64.rpm | 2.0 MB 00:03 ---------------------------------------------------------------------------------------- Total 668 kB/s | 2.1 MB 00:03 warning: rpmts_HdrFromFdno: Header V3 RSA/SHA256 Signature, key ID 0608b895: NOKEY Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 Importing GPG key 0x0608B895: Userid : EPEL (6) <epel@fedoraproject.org> Package: epel-release-6-8.noarch (@epel/6.4) From : /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6 Is this ok [y/N]: y Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : 4:perl-Time-HiRes-1.9721-130.el6_4.x86_64 1/3 Installing : perl-Mail-Sendmail-0.79-12.el6.noarch 2/3 Installing : proftpd-1.3.4a-1.el6.rf.x86_64 3/3 Verifying : proftpd-1.3.4a-1.el6.rf.x86_64 1/3 Verifying : perl-Mail-Sendmail-0.79-12.el6.noarch 2/3 Verifying : 4:perl-Time-HiRes-1.9721-130.el6_4.x86_64 3/3 Installed: proftpd.x86_64 0:1.3.4a-1.el6.rf Dependency Installed: perl-Mail-Sendmail.noarch 0:0.79-12.el6 perl-Time-HiRes.x86_64 4:1.9721-130.el6_4 Complete! |
■設定ファイル(/etc/proftpd.conf)の編集 ・起動方法 #ServerType standalone ServerTy […]
[Linux]CentOS6.3にMysqlを導入する
・インストール # yum install mysql-server
1 2 3 4 5 6 7 8 9 |
Dependencies Resolved ======================================================= Package Arch Version Repository Size ======================================================= Installing: mysql-server x86_64 5.1.67-1.el6_3 updates 8.6 M Installing for dependencies: mysql x86_64 5.1.67-1.el6_3 updates 886 k perl-DBD-MySQL x86_64 4.013-3.el6 base 134 k |
# cd /etc # cp my.cnf my.cnf.org # vi my.c […]
[facebook]友達情報の取得
facebookアプリで、外部アプリでFQLを使って友達の誕生日を取得する例です。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
package Main; use 5.0008; use strict; use base qw(CGI::Application); use Facebook::Graph; use Encode; sub cgiapp_init { my $self = shift; $fb = Facebook::Graph->new( app_id => 'xxxxxxx', secret => 'yyyyyyy', postback => 'http://hoge.jp/demo.cgi?rm=callback', ); } sub doConnect{ my($self, $err) = @_; my $uri = $fb->authorize->extend_permissions(qw/friends_birthday/)->uri_as_string; return $self->redirect( $uri ); } 誕生日の未入力(非表示もか?)のデータを除去しています。 sub doList{ my($self, $err) = @_; my $q = $self->query(); my $fql = "SELECT uid, name,birthday_date FROM user WHERE birthday_date!='' AND uid IN (SELECT uid2 FROM friend WHERE uid1=me()) ORDER BY birthday_date"; my $frinfo = $fb->fql( $fql ); my $ff = $frinfo->{data}; foreach my $friend ( @$ff ){ $fbuf .= "["; $fbuf .= "uid:$friend->{uid}/"; $fbuf .= "name:" . Encode::encode("utf8", $friend->{name}) . "/"; $fbuf .= "birthday:$friend->{birthday_date}"; $fbuf .= "]<br />"; } } |