Monthly Archives: April 2012

Schema update (Symfony2 + Doctrine)

php app/console doctrine:schema:update --force [--env="[ENV]"]

Generate Entities (Symfony2 + Doctrine)

php app/console doctrine:generate:entities [BUNDLE]/Entity/[ENTITY]

list assume-changed files on git

git ls-files -v | grep "^[[:lower:]]"

routine to backup / restore mysql database

mysqldump -u root --password=[PASSWORD] [DATABASE] --compact -R --skip-lock-tables --default-character-set=utf8 | gzip -c > /path/to/your/$(date +%Y-%m-%d_%H-%M-%S)backup.gz
gunzip -c /path/to/your/backup.gz | mysql -u [USER] --password=[PASSWORD] [-h HOST] [DATABASE] --default-character-set=utf8

FIX Symfony2 vendor management GIT clone error

rror: RPC failed; result=18, HTTP code = 200MiB | 20 KiB/sfatal: The remote end hung up unexpectedlyfatal: early EOFfatal: index-pack failedwarning: http unexpectedly said: ’0000′

edit ‘deps’ file

change http to https

i.e.:

[symfony]
git=http: ….

[symfony]
git=https: ….

adduser ubuntu

useradd -s /bin/bash -m -d /home/[USER] [USER]

Grant Acess to user for any host (MySQL)

GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY 'topsecret';

bash PS1

PS1='\[\033[0;37m\][\t]\[\033[0;32m\][\u]\[\033[31m\][\h]`git branch 2>/dev/null | grep \* | head -1 | sed "s/\* //g" | awk "{ print \"[ \"\\\$1 \" ]\" }"` \[\033[1;33m\]\w\a\[\033[0m\]\n\$ '

Install Ruby Gem

wget  http://production.cf.rubygems.org/rubygems/rubygems-1.8.21.tgz
tar xzvf rubygems-1.8.21.tgz
cd rubygems-1.8.21/
ruby setup.rb
gem update --system

Install mysql2 gem for Ruby

apt-get install libmysql-ruby libmysqlclient-dev
gem install mysql2
Page 1 of 212