mac portsから楽にインストールできる
※手元のmac portsが古かったのでアップデート
$ sudo port selfupdatffmpegとコーデックのインストール(xvid, mp3, H264を一緒にいれる)
$ sudo port install ffmpeg +gpl +lame +x264 +xvid基本的には技術メモです。
mac portsから楽にインストールできる
※手元のmac portsが古かったのでアップデート
$ sudo port selfupdatffmpegとコーデックのインストール(xvid, mp3, H264を一緒にいれる)
$ sudo port install ffmpeg +gpl +lame +x264 +xvid$ rpm -ivh http://repo.webtatic.com/yum/centos/5/latest.rpm $ yum -y install --enablerepo=webtatic git
$ useradd kasahi $ passwd kasahi $ usermod -G wheel kasahi $ id kasahi uid=500(kasahi) gid=500(kasahi) groups=500(kasahi),10(wheel)
$ mkdir /var/git $ chmod 775 /var/git $ chown root:wheel /var/git $ cd /var/git $ mkdir demo.git $ chmod 775 demo.git $ chown root:wheel demo.git $ cd demo.git・gitをshare用にinit
$ git init --bare --shared Initialized empty shared Git repository in /var/git/demo.git/これで(空の)共用demo.gitリポジトリができた。
$ sudo port install git-core・git用のユーザ名とメールアドレスを設定
$ git config --global user.name "Your Name" $ git config --global user.email you@example.com
$ cd ~/tmp $ git clone ***.***.***.***:/var/git/demo.git demo-clone
$ cd demo-clone $ touch README.txt $ git commit -am "initial checkin" [master (root-commit) c045b23] initial checkin 1 files changed, 1 insertions(+), 0 deletions(-) create mode 100644 README.txt
$ git push ***.***.***.****:/var/git/demo.git master Counting objects: 3, done. Writing objects: 100% (3/3), 261 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To 182.48.45.221:/var/git/demo.git * [new branch] master -> master
$ git log $ git status※gitのコマンドは別途勉強。
$ sudo yum -y install httpd・apacheを起動
$ sudo service httpd start
$ yum -y install --enablerepo=webtatic gitweb・gitweb用の設定ファイルを修正
Alias /git /var/www/git
<Directory /var/www/git>
Options +ExecCGI
AddHandler cgi-script cgi
DirectoryIndex gitweb.cgi
AuthType Basic
AuthName "Please enter your ID and password"
AuthUserFile /var/www/git/.htpasswd
require valid-user
</Directory>
$ vi /var/www/git/.htpasswd修正後、 apache を再起動。
$ sudo service httpd restart
72 # absolute fs-path which will be prepended to the project path 73 #our $projectroot = "/pub/scm"; 74 #our $projectroot = "/var/lib/git"; 75 our $projectroot = "/var/git"; # <---- /var/git を追加
$ id apache uid=48(apache) gid=48(apache) 所属グループ=48(apache)ないので追加
$ sudo usermod -G wheel apache
$ sudo port -d selfupdate $ sudo port -d sync・ apacheを入れる
$ sudo port install apache2・ MySQLを入れる
$ sudo port install mysql5 mysql5-server・ phpを入れる。オプションでpearとか有効にしておく
$ sudo port -d install php5 +apache2 +curl +mysql5 +pear +mbstring・apache moduleのphp5を有効に。
$ sudo /opt/local/apache2/bin/apxs -a -e -n "php5" /opt/local/apache2/modules/libphp5.so [activating module `php5' in /opt/local/apache2/conf/httpd.conf]
$ sudo -u mysql mysql_install_db5・サーバの起動
$ sudo /opt/local/share/mysql5/mysql/mysql.server restart・Mysqlのパスワードを設定(以下はrootアカウントを設定する場合)
$ /opt/local/lib/mysql5/bin/mysqladmin -u root password '*********'・Mysqlにログインしてみる
$ /opt/local/lib/mysql5/bin/mysql -u root -p
$ sudo vim /opt/local/apache2/conf/httpd.confhttpd.conf
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
<IfModule mime_module>
AddType application/x-httpd-php .php .html .htm
</IfModule mime_module>
# これをやらないと.htaccessが有効にならない
<Directory "/opt/local/apache2/htdocs">
AllowOverride All
</Directory>
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
$ sudo cp /opt/local/apache2/conf/extra/httpd-vhosts.conf /opt/local/apache2/conf/extra/httpd-vhosts.conf_bak $ sudo vim /opt/local/apache2/conf/extra/httpd-vhosts.confhttpd-vhosts.conf(※hogehoge.comを適当に読み替え)
#
# Virtual Hosts
#
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "/opt/local/apache2/htdocs/phpmyadmin"
ServerName phpmyadmin
ErrorLog "/opt/local/apache2/logs/error_log"
CustomLog "/opt/local/apache2/logs/error_log" common
<Directory "/opt/local/apache2/htdocs/phpmyadmin">
Order deny,allow
Allow from All
</Directory>
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "/opt/local/apache2/htdocs/hogehoge.com"
ServerName hogehoge.com
ServerAlias www.hogehoge.com
ErrorLog "/opt/local/apache2/logs/hogehoge.com/error_log"
CustomLog "/opt/local/apache2/logs/hogehoge.com/access_log" common
<Directory "/opt/local/apache2/htdocs/hogehoge.com">
Order deny,allow
Allow from All
</Directory>
</VirtualHost>
・ログ用ディレクトリを作る$ sudo mkdir /opt/local/apache2/logs/hogehoge.com $ sudo chmod 777 /opt/local/apache2/logs/hogehoge.com・apache再起動など
$ sudo /opt/local/apache2/bin/apachectl start $ sudo /opt/local/apache2/bin/apachectl stop $ sudo /opt/local/apache2/bin/apachectl restart
$ sudo vim /opt/local/etc/mysql5/my.cnfmy.cnf
[mysqld] max_allowed_packet=256M
$ sudo /opt/local/share/mysql5/mysql/mysql.server restart(※必要ならばDB流しこみ)
$ sudo /opt/local/lib/mysql5/bin/mysql -uroot -p****** dbname < ~/hogehoge.sql
$ sudo pear install Cache_Liteなど。
$ sudo port install php5-mbstring $ sudo port install php5-curl $ sudo port install php5-mysql $ sudo port install php5-iconv ($ sudo port install php5-imagick)
$ sudo vim /etc/hosts/etc/hosts
127.0.0.1 localhost 127.0.0.1 phpmyadmin 127.0.0.1 hogehoge.com
$ chmod 777 /opt/local/apache2/htdocs/phpmyadminを落としてくる(今回は phpMyAdmin-3.4.3.1-all-languages )
$ mv ~/Downloads/phpMyAdmin-3.4.3.1-all-languages /opt/local/apache2/htdocs/. $ cd /opt/local/apache2/htdocs/ $ ln -s phpMyAdmin-3.4.3.1-all-languages phpmyadmin
$ sudo cp /opt/local/etc/php5/php.ini-development /opt/local/etc/php5/php.ini $ sudo vim /opt/local/etc/php5/php.iniphp.ini
pdo_mysql.default_socket =/opt/local/var/run/mysql5/mysqld.sock mysql.default_socket =/opt/local/var/run/mysql5/mysqld.sock mysqli.default_socket =/opt/local/var/run/mysql5/mysqld.sock short_open_tag = On
$ sudo pear install Mail_MimeDecode
downloading Mail_mimeDecode-1.5.5.tgz ... Starting to download Mail_mimeDecode-1.5.5.tgz (11,554 bytes) .....done: 11,554 bytes downloading Mail_Mime-1.8.2.tgz ... Starting to download Mail_Mime-1.8.2.tgz (30,914 bytes) ...done: 30,914 bytes install ok: channel://pear.php.net/Mail_Mime-1.8.2 install ok: channel://pear.php.net/Mail_mimeDecode-1.5.5
編集 --> 環境設定 --> ActionScript --> ActionScript3.0設定 --> クラスパスを追加($(AppConfig)/ActionScript 3.0/Classes になってた)・実際の場所
C:\Program Files\Adobe\Adobe Flash CS3\ja\Configuration\ActionScript 3.0\Classes
C:\Program Files\Adobe\Adobe Flash CS3\ja\Configuration\Componentsの中にswcファイルを置く。
Fatal error: Call to undefined function iconv_get_encoding()
$ sudo port install php5-iconv
$ ./youtube-dl.py http://www.youtube.com/watch?v=********* -lとyoutubeのビデオURLを渡すだけ。-lオプションを付けてるのは、つけないとデフォルトのflvファイル名が英数字の羅列になっちゃうので。-lを付ければ名前もちゃんとつけてくれます(日本語OK)。
$ ./youtube-dl.py -h
Usage: youtube-dl.py [options] url...
Options:
-h, --help print this help text and exit
-v, --version print program version and exit
-U, --update update this program to latest stable version
-i, --ignore-errors continue on download errors
-r LIMIT, --rate-limit=LIMIT
download rate limit (e.g. 50k or 44.6m)
-R RETRIES, --retries=RETRIES
number of retries (default is 10)
--playlist-start=NUMBER
playlist video to start at (default is 1)
--playlist-end=NUMBER
playlist video to end at (default is last)
--dump-user-agent display the current browser identification
Authentication Options:
-u USERNAME, --username=USERNAME
account username
-p PASSWORD, --password=PASSWORD
account password
-n, --netrc use .netrc authentication data
Video Format Options:
-f FORMAT, --format=FORMAT
video format code
--all-formats download all available video formats
--max-quality=FORMAT
highest quality format to download
Verbosity / Simulation Options:
-q, --quiet activates quiet mode
-s, --simulate do not download video
-g, --get-url simulate, quiet but print URL
-e, --get-title simulate, quiet but print title
--get-thumbnail simulate, quiet but print thumbnail URL
--get-description simulate, quiet but print video description
--get-filename simulate, quiet but print output filename
--no-progress do not print progress bar
--console-title display progress in console titlebar
Filesystem Options:
-t, --title use title in file name
-l, --literal use literal title in file name
-A, --auto-number number downloaded files starting from 00000
-o TEMPLATE, --output=TEMPLATE
output filename template
-a FILE, --batch-file=FILE
file containing URLs to download ('-' for stdin)
-w, --no-overwrites
do not overwrite files
-c, --continue resume partially downloaded files
--cookies=FILE file to dump cookie jar to
--no-part do not use .part files
--no-mtime do not use the Last-modified header to set the file
modification time
<?php
// 正方形に切り取る
$im = new Imagick();
$im->readImage('/home/kasahi/tmp/org.jpg');
$im->cropThumbnailImage(80, 80);
$im->writeImage('/home/kasahi/tmp/resize.jpg');
$im->destroy();
?>
<?php
// 余りの背景を白でうめて正方形にする場合
$im = new Imagick();
$im->readImage('/home/kasahi/tmp/org.jpg');
$sideNum = 300; // 一辺を300ピクセルにする
$im->setImageBackgroundColor(new ImagickPixel('white'));
if ($im->getImageWidth() > $im->getImageHeight()) {
$im->scaleImage($sideNum, 0);
$height = ($sideNum - $im->getImageHeight()) / 2;
$im->spliceImage(0, $height, 0, 0);
$im->spliceImage(0, $sideNum - $im->getImageHeight(), 0, $im->getImageHeight());
} else {
$im->scaleImage(0, $sideNum);
$width = ($sideNum - $im->getImageWidth()) / 2;
$im->spliceImage($width, 0, 0, 0);
$im->spliceImage($sideNum - $im->getImageWidth(), 0, $im->getImageWidth(), 0);
}
$im->writeImage('/home/kasahi/tmp/resize.jpg');
$im->destroy();
?>
$ php imagik_test.php zsh: segmentation fault php imagik_test.phpとかsegmentation faultを起こすようになってしまった。
$ ./configure --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp $ make $ sudo make installこのオプションでコンパイルしてたので先人に習ってそのままやって見る。
$ convert -v Version: ImageMagick 6.2.8 08/28/09 Q16 file:/usr/share/ImageMagick-6.2.8/doc/index.html Copyright: Copyright (C) 1999-2006 ImageMagick Studio LLCで6.2.8だった。
$ sudo yum remove ImageMagick
$ wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
$ tar zxvf ImageMagick.tar.gz $ cd ImageMagick-6.6.7-7 $ ./configure --disable-static --with-modules --without-perl --without-magick-plus-plus --with-quantum-depth=8 --disable-openmp $ make $ sudo make install※configureのオプションに関しては↑を付けておいたほうがよさげ。
$ convert -v Version: ImageMagick 6.6.7-7 2011-02-15 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLCOK。
$ sudo pecl uninstall imagick
$ sudo pecl install imagick
$ sudo /etc/init.d/httpd restart
$ sudo pecl install imagick ------------ .....................done: 93,920 bytes 13 source files, building running: phpize sh: phpize: command not foundERROR: `phpize' failed ------------と言われる。phpizeがないみたい。
$ yum -y install php-develを入れる。
$ sudo pecl install imagick ------------ .....................done: 93,920 bytes checking whether to enable the imagick GraphicsMagick backend... no checking ImageMagick MagickWand API configuration program... configure: error: not found. Please provide a path to MagickWand-config or Wand-config pr ogram. ERROR: `/var/tmp/imagick/configure --with-imagick' failed ------------
$ sudo yum -y install ImageMagick-devel ------------ .......... Installed: ImageMagick-devel.x86_64 0:6.2.8.0-4.1 Dependency Installed: ghostscript-devel.x86_64 0:8.15.2-9.12.el5_5 lcms-devel.x86_64 0:1.18-0.1.beta1.el5_3.2 libICE-devel.x86_64 0:1.0.1-2.1 libSM-devel.x86_64 0:1.0.1-3.1 libXext-devel.x86_64 0:1.0.1-2.1 libXt-devel.x86_64 0:1.0.2-3.2.el5 Dependency Updated: ghostscript.x86_64 0:8.15.2-9.12.el5_5 Complete! ------------
$ sudo pecl install imagick ------------ ........ Build process completed successfully Installing '/usr/lib64/php/modules/imagick.so' Installing '/usr/include/php/ext/imagick/php_imagick_defs.h' Installing '/usr/include/php/ext/imagick/php_imagick_shared.h' Installing '/usr/include/php/ext/imagick/php_imagick.h' install ok: channel://pecl.php.net/imagick-3.0.1configuration option "php_ini" is not set to php.ini location You should add "extension=imagick.so" to php.ini ------------
$ sudo vim /etc/php.d/imagick.iniimagick.ini
extension=imagick.so
$ sudo yum install pcre-devel $ sudo pecl listall apc ※もしかしたら事前にこのあたりも入れておいたほうがいいかも ( $ yum install -y php-devel ) ( $ yum install -y httpd-devel )
$ sudo vim /etc/php.d/apc.ini extension=apc.so
$ sudo /etc/init.d/httpd restart