Embrace Dreams
Archive for the ‘Technical’ Category
Install PHPUnit on OpenSuse12.1
December 5th, 2011 | admin
First of all,
$pear channel-discover pear.symfony-project.com $pear channel-discover components.ez.no $pear upgrade --force PEAR
Then,
$sudo pear install --alldeps phpunit/PHPUnit
If you can not find phpunit, remember to add phpunit channel to your pear path, like
$sudo zypper install php5-pear-channel-phpunit
It works for me via Symfony 2.
PS: If you meet
Unknown remote channel: pear.symfony-project.com phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2) No valid packages found
please checkout does pear.symfony-project.com stay at your pear channels.
PhpStorm does not work on OpenSuse 12.1 with Sun JDK(solution)
December 5th, 2011 | admin
After Sun JDK 1.7.0_01 configured for OpenSuse 12.1, PhpStorm does not work, I think it invokes /usr/lib/jvm/bin/java, but I can not find the folder, so I use the following solution:
$sudo ln -s /usr/lib/jdk1.7.0_01/ /usr/lib/jvm/java
Now it works.
Setup Sun JDK on OpenSuse
December 5th, 2011 | admin
Download JDK from http://java.sun.com, extra to /usr/lib/, mine is: /usr/lib/jdk1.7.0_01
Then:
$sudo /usr/sbin/update-alternatives --install /usr/bin/java java /usr/lib/jdk1.7.0_01/bin/java 3 $sudo /usr/sbin/update-alternatives --install /usr/bin/javac javac /usr/lib/jdk1.7.0_01/bin/javac 3
The last parameter is 3, it’s priority, not very important, you can find other by
$sudo /usr/sbin/update-alternatives --list java
It’s not important, do not care about it.
Now you have new JDK installed, let’s configure it:
$sudo /usr/sbin/update-alternatives --config java $sudo /usr/sbin/update-alternatives --config javac
See the details, you can choose your new installed Sun JDK from list.
fetch remote branch via git
December 5th, 2011 | admin
We have many remote branches such as origin/dev, origin/master, origin/research and so on. How to fetch remote branch?
$git checkout -b dev origin/dev
dev is local branch name, origin/dev is remote branch name.
Build PHP 5 Development enviroment on OpenSuse 12.1
December 5th, 2011 | admin
First of all, you must have OpenSuse 12.1 installed. Then let’s start.
Install and configure MySQL
$sudo zypper install mysql mysql-client $sudo /sbin/chkconfig --add mysql $sudo /etc/init.d/mysql start $sudo mysql_secure_installation
Optional, let’s create a test database
$mysql -uroot -p $CREATE DATABASE `voicens` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
Install and configure Apache2
$sudo zypper install apache2 $sudo /sbin/chkconfig --add apache2 $sudo /etc/init.d/apache2 start
Install and configure PHP5
$sudo zypper install apache2-mod_php5 $sudo /etc/init.d/apache2 restart $sudo zypper install php5-mysql php5-bcmath php5-bz2 php5-calendar php5-ctype php5-curl php5-dom php5-ftp php5-gd php5-gettext php5-gmp php5-iconv php5-imap php5-ldap php5-mbstring php5-mcrypt php5-odbc php5-openssl php5-pcntl php5-pgsql php5-posix php5-shmop php5-snmp php5-soap php5-sockets php5-sqlite php5-sysvsem php5-tokenizer php5-wddx php5-xmlrpc php5-xsl php5-zlib php5-exif php5-fastcgi php5-pear php5-sysvmsg php5-sysvshm php5-pdo $sudo /etc/init.d/apache2 restart
cheers.
Install build tools for Fedora
November 29th, 2011 | admin
One of my workstation installed Fedora 16 via LiveCD, I need to install gcc, make and something more. The simplest way is :
#yum groupinstall "Development Tools" "Legacy Software Development"
Upgrade to Symfony 2.0.6 for security upgrade
November 24th, 2011 | admin
It’s easy, change your deps to :
[symfony]
git=http://github.com/symfony/symfony.git
version=v2.0.6
[twig]
git=http://github.com/fabpot/Twig.git
version=v1.1.2
[monolog]
git=http://github.com/Seldaek/monolog.git
version=1.0.2
[doctrine-common]
git=http://github.com/doctrine/common.git
version=2.1.2
[doctrine-dbal]
git=http://github.com/doctrine/dbal.git
version=2.1.3
[doctrine]
git=http://github.com/doctrine/doctrine2.git
version=2.1.2
[swiftmailer]
git=http://github.com/swiftmailer/swiftmailer.git
version=v4.1.3
[assetic]
git=http://github.com/kriswallsmith/assetic.git
version=v1.0.2
[twig-extensions]
git=http://github.com/fabpot/Twig-extensions.git
[metadata]
git=http://github.com/schmittjoh/metadata.git
version=1.0.0
[SensioFrameworkExtraBundle]
git=http://github.com/sensio/SensioFrameworkExtraBundle.git
target=/bundles/Sensio/Bundle/FrameworkExtraBundle
[JMSSecurityExtraBundle]
git=http://github.com/schmittjoh/JMSSecurityExtraBundle.git
target=/bundles/JMS/SecurityExtraBundle
version=origin/1.0.x
[SensioDistributionBundle]
git=http://github.com/sensio/SensioDistributionBundle.git
target=/bundles/Sensio/Bundle/DistributionBundle
version=origin/1.0
[SensioGeneratorBundle]
git=http://github.com/sensio/SensioGeneratorBundle.git
target=/bundles/Sensio/Bundle/GeneratorBundle
[AsseticBundle]
git=http://github.com/symfony/AsseticBundle.git
target=/bundles/Symfony/Bundle/AsseticBundle
version=v1.0.1
change your deps.lock to
symfony b55a43813e8fbcf4facd19ce1da0cd7acc67ce9b twig 396435ecd05556adb0a8bd05b14641cb4f8a8aa5 monolog b704c49a3051536f67f2d39f13568f74615b9922 doctrine-common b385ca770888248241bd3086a40d5b3bd082a706 doctrine-dbal e0b69790ab1ffd646fd70a04fdb91e5dfbb3ccf1 doctrine 144d0de0ab61dffc738d7fb590cff8d77919f553 swiftmailer daaff2b8515390fbb10882647311f476b89a67e6 assetic f829ad23d23c87480151a21faad49fefe7c09e5d twig-extensions d5851b96f06442e74590e5540a4209e9e3946243 metadata 8717ad2a5689480765d9ffafe925cd8a2457e582 SensioFrameworkExtraBundle dcd40eb4e2fff2d82fad644bb44fc2a40ccaf381 JMSSecurityExtraBundle b8b7eb294ed83d83ca7260ac018e701f08003538 SensioDistributionBundle 20b66a408084ad8752f98e50f10533f5245310bf SensioGeneratorBundle c6af9719ae9e81fa4e086f40697d35e7090921cc AsseticBundle 41b5913b5086a0909af92adcb4a6005ee0051b16
Is it enouth? No, another two part need to add to your deps:
[JMSAopBundle]
git=https://github.com/schmittjoh/JMSAopBundle.git
target=/bundles/JMS/AopBundle
[CGLibrary]
git=http://github.com/schmittjoh/cg-library.git
target=cg-library
At last, do not forget:
$bin/vendors install $php app/console cache:clear
Setup your own git server using gitolite
January 28th, 2011 | admin
Let’s start.
git clone git://github.com/sitaramc/gitolite gitolite-source
cd gitolite-source
sudo mkdir -p /usr/local/share/gitolite/conf /usr/local/share/gitolite/hooks
sudo src/gl-system-install /usr/local/bin /usr/local/share/gitolite/conf /usr/local/share/gitolite/hooks
Let’s add a repo. Open conf/gitolite.conf in the gitolite-admin dir you cloned to your local machine. You will see two default repos there, just copy one of them like this:
RW+ = test-user
git commit -m “created test-repo, added RW+ to test-server user”
git push origin master
git push origin master