понедельник, 10 сентября 2012 г.

Git remove submodule

Params:
git version 1.7.9.5

Problem:
Bundles DoctrineFixturesBundle and DoctrineMigrationsBundle has changed repository URLs and namespaces. So I can't update submodules.

Solution:
1) Remove appropriate sections in .git/config file:
pattern: git config -f .git/config --remove-section submodule.$submodulepath
> git config -f .git/config --remove-section submodule.vendor/bundles/Symfony/Bundle/DoctrineFixturesBundle
> git config -f .git/config --remove-section submodule.vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle
It also remove appropriate sections in .gitmodules file, if not, use this command:
pattern: git config -f .gitmodules --remove-section submodule.$submodulepath
2) pattern: git rm --cached $submodulepath
> git rm --cached vendor/bundles/Symfony/Bundle/DoctrineFixturesBundle
> git rm --cached vendor/bundles/Symfony/Bundle/DoctrineMigrationsBundle

3) Commit this changes:
> git commit -m "Remove submodules DoctrineFixturesBundle and DoctrineMigrationsBundle"

Midnight Commander color scheme and code highlight

Params:
Linux A230512 3.2.0-29-generic #46-Ubuntu SMP Fri Jul 27 17:03:23 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
GNU Midnight Commander 4.8.1

Problem:
Need another color scheme and code highlightes in Midnight Commander.

Solution:
Configuration file for mc-4.8.1 located here:
~/.config/mc/ini

1) Enable code highlightes in mc editor.
Change highlight parameter in mc config file to 1:
editor_syntax_highlighting=1
May be you need to copy misc/filehighlight.ini file from mc source to /etc/mc directory.

2) Apply custom color scheme. 
Set appropriate parameter:
[Color]
base_color=lightgray,default:normal=lightgray,default:selected=black,green:marked=yellow,default:markselect=white,green:errors=white,red:menu=lightgray,default:reverse=black,lightgray:dnormal=white,default:dfocus=black,green:dhotnormal=brightgreen,default:dhotfocus=brightgreen,green:viewunderline=brightred,default:menuhot=yellow,default:menusel=white,black:menuhotsel=yellow,black:helpnormal=black,lightgray:helpitalic=red,lightgray:helpbold=blue,lightgray:helplink=black,cyan:helpslink=yellow,default:gauge=white,black:input=black,green:directory=white,default:executable=brightgreen,default:link=brightcyan,default:stalelink=brightred,default:device=brightmagenta,default:core=red,default:special=black,default:editnormal=lightgray,default:editbold=yellow,default:editmarked=black,cyan:errdhotnormal=yellow,red:errdhotfocus=yellow,lightgray

!!! IMPORTANT !!!  - use nano or vi or ... to edit mc ini file, but not internal mc-editor,
otherwise your changes will be lost
!

PS: Thanks to this post author. 

http://plug-and-pray.blogspot.com/2009/09/editing-midnight-commanders-color.html
Her color scheme is beauty.

пятница, 7 сентября 2012 г.

Composer time out error

Params:
php5.3

Problem:
Error while installing dependencies. Command:
> php composer.phar install
returned the error:
[Composer\Downloader\TransportException]
......... file could not be downloaded: failed to open stream: Connection timed out


Solution:
Set higher timeout for composer, run command:
> COMPOSER_PROCESS_TIMEOUT=1000 php composer.phar install
If you get error again try to set higher timeout. For example 3000 against 1000.



четверг, 6 сентября 2012 г.

KnpMenuBundle and Twitter Bootstrap styles

Params:
Symfony2.1 RC2 and appropriate KnpMenuBundle
Twitter Bootstrap 2.1

Problem:
Need to customize Menu by Bootstrap css classes.
For example, I need to add attribute class="nav" to <ul> element of generated menu.

Solution:
Using methods setAttribute(), setChildrenAttributes(), ...
Example:
$menu = $factory->createItem('root');
$menu->setChildrenAttributes(array('class' => 'nav'));
$menu->addChild('Home', array('route' => 'bst_app_homepage'));
...
The output will be:
<ul class="nav">
   <li>...</li>
</ul>

пятница, 31 августа 2012 г.

Symfony2 composer install error

Params:
PHP 5.3.10-1ubuntu3.2
Symfony 2.1 RC2

Problem:
After command
> php composer.phar install
I have error:
Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Installation request for jms/security-extra-bundle == 1.2.9999999.9999999-dev -> satisfiable by jms/security-extra-bundle 1.2.x-dev.
    - Can only install one of: jms/security-extra-bundle dev-master, jms/security-extra-bundle 1.2.x-dev.
    - Installation request for jms/security-extra-bundle == 9999999-dev -> satisfiable by jms/security-extra-bundle dev-master.

Solution:
1) Remove composer.lock file from your project directory
   > rm composer.lock
2) Re-install all packages again, run command:
   > php composer.phar install

It will take some time, but the problem will be solved.

вторник, 29 мая 2012 г.

пятница, 18 мая 2012 г.

Enable Apache mod_status in Gentoo

Params:
OS: Linux solar 3.1.6-gentoo #16 SMP Thu Jan 5 14:49:10 GMT 2012 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ AuthenticAMD GNU/Linux
Apache-2.2

Problem:
I need enable apache module mod_status.


Solution:
Edit apache conf file: "/etc/conf.d/apache2"
Add option "-D STATUS" to the directive "APACHE2_OPTS"
Example string:
APACHE2_OPTS="-D DEFAULT_VHOST -D INFO -D SSL -D SSL_DEFAULT_VHOST -D LANGUAGE -D PHP5 -D STATUS"

Restart apache and follow here "http://localhost/server-status"