• Travel Notes from the Land of Penguins

    A simple computer with a green screen on a workbench, connected by a cable to two server racks in a cool gray room

    Note (2026): The basic bash and Vim tips are still recognizable today. But the Zend Framework context is historical: new Zend Framework releases moved to the Laminas Project, and modern PHP projects usually manage dependencies with Composer.

    Convenient Shortcuts

    There is a useful thing in *nix systems called command shortcuts, or aliases. Almost everyone has probably thought about this while typing another long path to some command. And everything is actually as simple as can be.

    So, to create an alias, you need to enter this command:

    bash
    alias zf='sh /home/ast/vhosts/ZendFramework/bin/zf.sh'

    The best option is to put the necessary aliases into your settings:

    bash
    gedit ~/.bashrc

    Done. Now you can compare the original version of the command with the new one that uses aliases:

    bash
    sh /home/ast/vhosts/ZendFramework/bin/zf.sh create project Sample
    zf create project Sample

    The benefit is obvious.

    Console Editing

    Using SSH is a very convenient way to manage servers remotely: it requires minimal channel bandwidth and has all the power of the *nix console. But while commands are not hard to remember, sometimes you also need to edit some config. Connecting a graphical interface for that is like hunting a fly with a rocket launcher. Fortunately, there is Vim.

    Using it is very simple, like an ordinary editor:

    bash
    vim /etc/php5/apache2/php.ini

    Here are the basics, enough to edit configuration files.

    / lets you enter text for the simplest search. To find the next occurrence of the search string, call the command without a parameter.

    i switches the program into editing mode. You can return to viewing mode at any time by pressing ESC.

    :w saves the file if you have permission to write it. Adding ! can override Vim’s read-only setting, but does not grant filesystem permissions.

    :quit exits the program when there are no unsaved changes.

    See the Vim reference for saving and quitting for details.