Alex (SirShurf) Frenkel's Blog

A web log of a PHP professional

Archive for the ‘IDE’ Category

How to fix Zend Server on Ubuntu 12.04 Precise

with 10 comments

After a long battle a solution is here!

Many thanks to Alex Sherman @AlxShr  from BelleRon

Disclaimer: Use at your own risk! Worked on clean 12.04 install.

First of all we used a script taken from:

#modded by japzone

if [[ -z "$1" ]]; then
  echo "Syntax: $0 debfile"
  exit 1

TMPDIR=`mktemp -d /tmp/deb.XXXXXXXXXX` || exit 1
OUTPUT=`basename "$DEBFILE" .deb`.modfied.deb

if [[ -e "$OUTPUT" ]]; then
  echo "$OUTPUT exists."
  rm -r "$TMPDIR"
  exit 1

dpkg-deb -x "$DEBFILE" "$TMPDIR"
dpkg-deb --control "$DEBFILE" "$TMPDIR"/DEBIAN

if [[ ! -e "$TMPDIR"/DEBIAN/control ]]; then
  echo DEBIAN/control not found.

  rm -r "$TMPDIR"
  exit 1


MOD=`stat -c "%y" "$CONTROL"`
gedit "$CONTROL"
read -p "Press any key once you've finished editing and saved"

if [[ "$MOD" == `stat -c "%y" "$CONTROL"` ]]; then
  echo Not modfied.
  echo Building new deb...
  dpkg -b "$TMPDIR" "$OUTPUT"

rm -r "$TMPDIR"

The script above saved as and given execute permissions by

chmod u+x

Packages downloaded by:

apt-get download libpq4  php-5.3-imap-zend-server

Then edited dependencies by:

./ libpq4_8.1.17-0etch1_amd64.deb
./ php-5.3-imap-zend-server_5.3.9+b260_amd64.deb

In the “Depends” line of each of them changed libkrb53 to libkrb5-3

After that installed each of the modified packages:

dpkg -i libpq4_8.1.17-0etch1_amd64.modfied.deb
dpkg -i php-5.3-imap-zend-server_5.3.9+b260_amd64.modfied.deb

And then, finally, installed the zend server by:

apt-get install zend-server-ce-php-5.3

WOW! It Works!!!

This is continued from: Zend Server broken on Ubuntu 12.04

Written by Alex (Shurf) Frenkel

May 1, 2012 at 2:42 pm

Ubuntu 11.10 (Oneiric Ocelot) and MySQL Workbench gpl, fix plus deb repository

with 3 comments

Since the install of Ubuntu 11.10 (Oneiric Ocelot) my MySQL Workbench was mostly unusable. I could not open it normally and Query Browser was not accessible. Finally a few days ago a patch was summited to the MySQL forum, but it was for a self compile version only.

Today I found a debian repository that maintains MySQL Workbench gpl and the fix is already implemented there. In order to update it use next commands:

sudo add-apt-repository ppa:olivier-berten/misc
sudo apt-get update
sudo apt-get install mysql-workbench-gpl

Now we have a debian repository for MySQL Workbench and a version that will work on Ubuntu 11.10 (Oneiric Ocelot)

Written by Alex (Shurf) Frenkel

November 7, 2011 at 9:46 am

Using External SVN with Zend Studio (Eclipse)

leave a comment »

Well, it looks like I found finally how to work with SVN Externals in Zend Studio.

You cannot!

In order to work with SVN and Zend Studio you have to go to command line and work with SVN only. Figurs…

Written by Alex (Shurf) Frenkel

October 23, 2011 at 7:44 pm

Posted in IDE, SVN

Tagged with , ,

A new generic module for Zend framework – Menu Module

leave a comment »

I have created a new generic self containing module that works with Zend framework MVC application.

The module is a Menu Module, it manages menu for MVC application and using a bootstrap and substitutes it over the menu added in the config.

Here is the link to it:

Currently it depends on my jQGrid Library and on Belleron-Frenkel library (an extension on Zend Framework standard modules)

Any help/idea is welcomed 🙂

Written by Alex (Shurf) Frenkel

October 22, 2011 at 12:10 pm

Posted in IDE, jQGrid, Uncategorized, Zend Framework

Tagged with , , ,

memcached-top or a way to see how much your memcachd is full….

leave a comment »

Over the past days I have found that my Amazon Micro account was getting to a load level of 120%, with an uptime of 30+. After some search I found that the problem was in search crawlers (GoogleBot, GoogleImage and BAIDA at the same time) over Magento installation I have there.

So, after some web searches, I derided to install some caching. Minified all CSS/JS and added GZIP compression to Apache but it was not enough, so I added a memcached which was.

But now I had a question of how can I know how many is used of my memcached instance? Maybe I need another one? I have not found any information on the memcached forum but what I did found was a little application called “memcached-top” that is hosted on google code.

This small script creates a display like TOP to the memcachd instances you have (in my case it’s only 1 instance…. but still)

The installation/usage of the application is really simple:

$ curl > ~/bin/memcache-top $ chmod +x ~/bin/memcache-top $ memcache-top --sleep 1 The result looks like that:  memcached-top screen shot 

Written by Alex (Shurf) Frenkel

October 21, 2011 at 5:22 pm

Posted in IDE, memcached

How to use Zend-Framework-PDF-Table-Helper

with 10 comments

Here is the example of how to user ZendFramework PDF-Table-Helper.

You can get the code from GitHub here:

One of the prerequisites is that you mast have the zf_autoloader on and configured since I am relaying on it to auto load files.

first you have to in instantiate the class:

$pdf = new SirShurf_Pdf_TableSet ();

You can instantiate it with a Zend_PDF object and without it, in which case it will be created for you, but if you are instantating with Zend_PDF you have to tell the system on what page you are working (Default is page 0).

Now what you need it to initialise a Table you are going to work with:
$objTableRow = $table->addRow ();

Each table can have his own number of columns and settings.
Each table can have a different number of rows a row can be added using this method:

And as with HTML a row has a number of cells (or columns):
$objTableRow->addCol ( $strCourseId, array (
'bold' => false, 'colspan' => 1, 'align' => 'center'
) );
$objTableRow->addCol ( Labadmin_Models_Static::convertHebrew ( $this->view->translate ( 'LBL_GRADE_FORM_COURSE_ID' ) ), array (
'bold' => false, 'colspan' => 1, 'align' => 'center', 'font' => 'arial.ttf', 'fontBold' => 'arialbd.ttf'
) );

The Cell can have each own definitions as the example here shows, and you can iterate over the data to create it.

And finally you can call render(); in order to render the changes to PDF, or build(‘fileName’) to save the finale PDF to a file.

$pdf->build ( $strGradeFileLocation . $intTimeStamp . ".grade.pdf" );

Written by Alex (Shurf) Frenkel

July 26, 2011 at 3:15 pm

SVN (Subversion) and UTF files…

leave a comment »

Recently I had a strange problem.

One of my SVN hooks was failing and I had to login to the server to run the hook manually. At first I have thought that it’s a simple permission error but when I was running the same hook using the same user it was working.

After some googleing I have found that the SVN hook runs not in the user environment but without it, and in order to simulate it I need to run my hook in the same way.

The command to do it is: “env – ./post-commit”.

In this case I have seen the error and understood it. Since the SVN hook is not runs under the environment, the UTF-8 characters in file names are not visible in SVN Update.

If you have this problem all you need to do is to add next lines to your hook:

export LANG=en_US.UTF-8
export LANGUAGE=en_US:en
export LC_CTYPE="en_US.UTF-8"
export LC_NUMERIC="en_US.UTF-8"
export LC_TIME="en_US.UTF-8"
export LC_COLLATE="en_US.UTF-8"
export LC_MONETARY="en_US.UTF-8"
export LC_MESSAGES="en_US.UTF-8"
export LC_PAPER="en_US.UTF-8"
export LC_NAME="en_US.UTF-8"
export LC_ADDRESS="en_US.UTF-8"
export LC_TELEPHONE="en_US.UTF-8"
export LC_ALL=

That will set your environment for the SVN hook request to work with UTF characters!

Written by Alex (Shurf) Frenkel

May 19, 2011 at 5:26 pm

Posted in IDE, SVN

Tagged with , , ,