Skip to content

"a service you can count on"? - free as in freedom unique number repository (web service and client) available

Every needed a service that takes care of ensures each number is unique?
The unique number repository is such a service. Since it is "free as in freedom", you can own your data (why? because it is your data of course).
What is it? A simple REST based server and an example command line client.
It is using an authentication token to prevent the service is used by unauthorized persons. Feel free to create a pull request for a more sophisticated authentication method.

Translate to de es fr it pt ja

Convert VCF File into a CSV File

I needed to convert a VCF file into a CSV file by fetching the important and readable informations.
Thanks to the bazzline component it was a quick win/no brainer. You can find the result here. It is written under GPL-3 License.

How to use it?

  • open a terminal / command line
  • git clone https://github.com/stevleibelt/incubator
  • cd incubator/general/vcftocsv_converter
  • ./converter
Translate to de es fr it pt ja

version 1.1.1 php component cli readline

I am happy to announce the release of 1.1.1 of bazzlines cli readline component for php.
Important changes are:
Since Version 1.1.1

  • fixed bug in nested arrays and dealing with closures
Since Version 1.1.0
  • removed unused DebugManager
  • moved from project namespace "Autocomplete" to "Readline"
Since Version 1.0.0
  • initial release

Whats so super cool about this component? Creating a php command line script with autocomplete was never that easy!

Translate to de es fr it pt ja

New versions of the zend framework 2 console helper family available now

I happy to announce the release of 1.1.0 of bazzlines zend framework 2 console helper (debian backport) module for php as well as the release of 1.1.0 of bazzlines zend framework 2 console helpermodule for php.
Important changes are:

  • added AbstractConsoleControllerFactory
Translate to de es fr it pt ja

version 1.0.0 of php component cli argument released

I am happy to annoucen the release of 1.0.0 of bazzlines cli argument component for php.
Benefits

  • easy up handling of following kinds of arguments
    • flags (command -f|--force)
    • lists (command --foobar=foo | command -f=foo)
    • values values (command )

Example
A simple call to the shipped "run.php" with the following arguments:

php run.php --foo bar --foobar=foo --foobar="bar" -f="foo" -f=bar -b foobar foo -flag
Generates the following output:

arguments provided:
    --foo
    bar
    --foobar=foo
    --foobar=bar
    -f=foo
    -f=bar
    -b
    foobar
    foo
    -flag
flags provided:
    foo
    b
    f
    l
    a
    g
lists provided:
    foobar
        foo
        bar
    f
        foo
        bar
values provided:
    bar
    foobar
    foo

Translate to de es fr it pt ja

version 1.0.2 of zend framework 2 console helper (debian 6 backport) released

I happy to announce the release of 1.0.2 of bazzlines zend framework 2 console helper (debian backport) module for php. Important changes are:

  • removed dependency to apigen
  • updated dependencies
Translate to de es fr it pt ja

version 1.3.3 of zend framework 2 locator generator released

I happy to announce the release of 1.3.3 of bazzlines zend framework 2 locator generator module for php. Important changes are:

  • updated dependencies
  • removed apigen dependency
  • fixed dependency issue
  • added factory for controller creation
  • updated to locator generator 1.4.0
  • added documentation @todo - add link
  • added migration
  • added link to debian 6 / zend framework 2.2 backport
  • prefixed console commands with "net_bazzline" to not pollute the available command environment
Translate to de es fr it pt ja

version 1.0.3 of zend framework 2 console helper released

I happy to announce the release of 1.0.3 of bazzlines zend framework 2 console helper module for php. Important changes are:

  • removed apigen dependency
  • added use statement into example
  • added link to demo environment
  • added link to debian 6 / zend framework 2.2 backport
  • added minimum version of zend framework 2 to 2.3.* since AbstractConsoleController is mandatory
  • updated dependencies
Translate to de es fr it pt ja

version 1.2.2 of zend framework 2 locator generator (debian 6 backport) released

I happy to announce the release of 1.2.2 of bazzlines zend framework 2 locator generator module for php. Important changes are:

  • added factory for controller creation
  • added migration
  • update dependencies
  • removed dependency from apigen
Translate to de es fr it pt ja

version 1.0.0 of zend framework 2 console helper (debian 6 backport) released

I am happy to announce the release of 1.0.0 of bazzlines zend framework 2 console helper module for php.
It is a backport of the existing locator generator module.

Translate to de es fr it pt ja

version 1.0.0 of zend framework 2 locator generator (debian 6 backport) released

I am happy to announce the release of 1.0.0 of bazzlines zend framework 2 locator generator module for php.
It is a backport of the existing locator generator module.

Translate to de es fr it pt ja

version 1.1.0 of zend framework 2 locator generator released

I happy to announce the release of 1.1.0 of bazzlines zend framework 2 locator generator module for php. Important changes are:

  • prefixed console commands with "net_bazzline" to not pollute the available command environment
Translate to de es fr it pt ja

version 1.0.1 of zend framework 2 locator generator released

I happy to announce the release of 1.0.1 of bazzlines zend framework 2 locator generator module for php. Important changes are:

  • fixed links in readme
  • fixed namespace issue in test
  • added usage of zf console helper
  • updated dependencies
  • updated usage
Translate to de es fr it pt ja

version 1.0.1 of zend framework 2 console helper released

I happy to announce the release of 1.0.1 of bazzlines zend framework 2 console helper module for php. Important changes are:

  • added example code output
  • added apigen
  • moved to usage of "Zend\Mvc\Controller\AbstractConsoleController"
Translate to de es fr it pt ja

version 1.0.0 of zend framework 2 console helper released

I happy to announce the release of 1.0.0 of bazzlines zend framework 2 console helper module for php.
This module should easy up implementing console commands supporting POSIX Signal Handling.
Furthermore, there are some simple but useful methods implemented:

  • getConsole()
  • getParameter($name)
  • getRequest()
  • hasBooleanParameter($shortName = '', $longName = '')
  • hasParameter($name)
  • throwExceptionIfNotCalledInsideAnCliEnvironment()

How can I use it?


namespace MyModule\Controller\Console;

use Exception;

class IndexController extends AbstractConsoleController { public function indexAction() { try { $this->throwExceptionIfNotCalledInsideAnCliEnvironment();

        $this->attachSignalHandler($this);

        //some example items
        //  simple think about a lot of items that indicates longer
        //  processing runtime
        $items = array('one', 'two', 'three', 'four');

        //use implemented method to react on signal handling
        $this->processItems(
            $items,             //big list of items
            $this,              //current object
            'processItem',      //method that should be called for each item
            $arguments = array( //additional arguments for method 'processItem' (if needed)
                'foo',
                'bar'
            )
        );
    } catch (Exception $exception) {
        $this->handleException($exception);
    }
}

/**
 * must be protected since it will be called from the parent
 *
 * @param string $item
 * @param string $stringOne
 * @param string $stringTwo
 */
protected function processItem($item, $stringOne, $stringTwo)
{
    $console = $this->getConsole();
    $console->writeLine(
        'this is item "' . $item .
        '" with string one "' . $stringOne . '"' .
        '" and string two "' . $stringTwo . '"'
    );
}

/**
 * @return boolean
 */
private function beVerbose()
{
    return $this->hasBooleanParameter('v', 'verbose');
}

}

How can I install it?

with packagist


composer require netbazzline/zfconsolehelper:dev-master

manuel


mkdir -p vendor/netbazzline/zfconsolehelper
cd vendor/netbazzline/zfconsolehelper
git clone https://github.com/zfconsole_helper
Translate to de es fr it pt ja

POSIX signal handling in a php zend framework 2 console controller action call

I played around with php console applications for a while now. The projects are getting bigger and sometimes, the load on the system or the runtime itself increases a lot.
At night, it made "click" and I asked myself "Are you nuts or why aren't you simple using POSIX signals for your php console applications (like normal people are doing it)?". Thanks to the book Signaling PHP, I could "kickstart" into the topic and created a simple example script.

While solving this problem and migrating some own scripts, I wanted to implement the signal handling in a bigger zend framework 2 project.
Quickly done, I copy/pasted/adapted my example code and thought "this is it". To bad, I need to take one pitfall. I could not debug it right know, but zf2 needs to have the "signal handler method" public. The following code is the final outcome of this adaptation session.


class MyController extends AbstractCliActionController
{
    //AbstractCliActionController extends zend AbstractActionController
    //...usefull controller code
    /**
     * @param AbstractCliActionController $object
     * @param string $method
     */
    protected function attachSignalHandler(AbstractCliActionController $object, $method = 'defaultSignalHandler')
    {
        declare(ticks = 10);

    pcntl_signal(SIGHUP,    array($object, $method));
    pcntl_signal(SIGINT,    array($object, $method));
    pcntl_signal(SIGUSR1,   array($object, $method));
    pcntl_signal(SIGUSR2,   array($object, $method));
    pcntl_signal(SIGQUIT,   array($object, $method));
    pcntl_signal(SIGILL,    array($object, $method));
    pcntl_signal(SIGABRT,   array($object, $method));
    pcntl_signal(SIGFPE,    array($object, $method));
    pcntl_signal(SIGSEGV,   array($object, $method));
    pcntl_signal(SIGPIPE,   array($object, $method));
    pcntl_signal(SIGALRM,   array($object, $method));
    pcntl_signal(SIGCONT,   array($object, $method));
    pcntl_signal(SIGTSTP,   array($object, $method));
    pcntl_signal(SIGTTIN,   array($object, $method));
    pcntl_signal(SIGTTOU,   array($object, $method));
}

/**
 * @param $signal
 */
public function defaultSignalHandler($signal)
{
    echo 'caught signal "' . $signal . '"' . PHP_EOL;
}

}


You can easily extend the method "defaultSignalHandler" to whatever you need (push something to a log, flip a flag to stop execution etc) and thats it. Injoy your work :-).

Thanks to the nice irc freenode channel #zftalk, I can provide a second implementation to prove my example to be right.

Translate to de es fr it pt ja

tool to generate suggestions on potential problems in your php code

PHP-Tricorder is a CLI utility that scans structure files created using phpDocumentor and offers suggestions on potential problems with your code along with testing strategy information.

Executing /path/to/php tricorder.php will give you some usage information.

Please read the file LICENSE included with this code for licensing details.


source

Found it, gave it a try and want to share it.

Translate to de es fr it pt ja

tool php classmap generator packagist

After a month, i've finished a tool to create a classmap from a php project. The current stable version is v1.4 and can be found on github.com as well as on packagist.org. Why? Well, obviously because i can (and wanted to learn a few things like tokens, or symfony console) ;-). But for real, when you have to deal with legacy projects or code but want to remove the strange and slow existing autoloader (with all its exception), the easiest way to do this is by using a classmap. I also tried to find a classmap generator that can deal with psr-0 and not psr-0 files, all i could find are generators that support psr-0 files. A classmap itself is just a php array. The key is the full qualified classname and the value is the relative path to the file. Creating a classmap on your own is suitable when you have to manage a number of files below 20. But when it comes to more you can not effort the time to maintain that file. So for a lot of files that are not covert by composer, the classmap generator should be well suitable. It is planned to implement a "phar" classmap generation for the upcoming version. When you want to create phar files, this could be a timesaver as well. The classmap generator is build by using symfony\console and yes, it is a joy to work with that component! Shame on me, the current version is not covered by unittests. After i implemented the current features from the todo list, this will be my major task.

The classmap generator can handle all kind of php files like: - Interface - Abstract Class - Class The generator can handle files with or without namespace. Even files with multiple definitions (interface, abstract class and class in one file) is no problem.

Furthermore, you can create multiple configuration files and update this classmaps when needed. Like well known from the composer, the classmap generator is able to create a autoloader file for you. The created autoloader will use the created classmap file and supports psr-0 autoloading.

source/link to the wiki

What is left to write? Of course i'm proud about this. What you see right now is the work of one month and after i finished the core design, i rebuild a lot by replacing my cli application class with the symfony\console component.

I hope you can use the tool. If you need help or found a bug, contact me on github.com

Translate to de es fr it pt ja

howto - remove CrLF from file

tr -d '\r' < myFileWithCrLF > m<FileWithoutCrLF

'tr' is a cli tool to translate or delete characters. Option '-d' is used to delete the evil carrage return '\r'. For more information take a look into the man page.

Translate to de es fr it pt ja

Web - Create bootable usb stick with multiple linux iso files

Ok, as everybody i am running out of time but i want to play around some linux distributions. For playing around you either need some virtual pc's or a real one and some blank cd's/dvd's.

Inasmuch as i want to install it on a subnotebook, i decided to use a real pc. The only question is, should it be a debian (or a child of debian) or arch linux? I couldn't decide so i need to install/start and try them out. But for trying you need blank cd's/dvd's or a usb stick. I guess my household hasn't seen a blank cd or dvd for quite a while, means the selection met the usb stick.

The general process was to us a tool like unetbootin, by using "dd" of find howtos like the one at nixCraft. By the way, this howto is pretty cool since even linux starters are learning a bit the power of linux tools :-). But all methods are ending up with the effect "on os per usb stick". When you want to try out multiple OS, this i definitely not a satisfying method ;-).

Thats why i searched in the www and found a lot of solutions. Because of the numbers, i decided to write an entry :-).

First i found something at the german arch linux board. Even the link at the end is even better. By the way if you have some loopback problems, try to take a look at link. Also the howto from pendrivelinux.com is worth to have a look.

But i must admit, i want to have it nice and gui driven like the windows tool sardu i mention here. After i while, i was near by to do it the arch way but the god of laziness had mercy on my soul and presented me the link to multisystem. It is very easy to use, fast and works like a charm :-D.

By the way, since my plan was to have fun with the subnotebook, the choice felt on arch. Just for fun you know (and the community it is worth.

By searching for a funny distro to try, i stumbled over the good old slax i never booted - maybe in the future :-D.

Translate to de es fr it pt ja

tool - create php classes from a soap wsdl

Since i am working with a lot of soap services right now i searched for a tool that generates the soap classes for me. Thankts to propel and its "schema.xml" i am getting really lazy for doing such a task by hand ;-). Fortunately, the internet is still a place where everything can be found, so the search engine of my choice scores and found the wsdl2phpgenerator provided by walle.

Simple WSDL to PHP classes converter. Takes a wsdl file and outputs class files ready to use.

Uses the MIT licence (http://www.opensource.org/licenses/mit-license.php)

Usage executable: ./wsdl2php -i input.wsdl -o /tmp/my/directory/wsdl

Just add -v to use the verbose mode and -n my\namespace to add a preferred namespace.

Translate to de es fr it pt ja

tool - zend framework zf cli aka zend tool

Just a quick entry for the zend framework comand line tool (available for *nix and windows). I tought it would be a good idea to use it and create the general files or directory layout. But it is not perfect at all. Creating modules and layouts is quick nice. But a

zf create controller myModuleName
does not what i have expected. An controller was created below the general controller directory and not inside the module "myModuleName". Lets see if i like the tool at all. I will stick on it for this project and fill up the links in the following section when i find some usefull one. I can give one hint so far, the zend tool can only create, not delete anything. If you want to delete something, you have to do it manualy (remember the zfproject.xml file).

available parameters for application.ini official zend tool manual using the cli tool create a layout zend tool in phpstorm zend framework as cli application tutorial from akrabat Proposed Q&A site for PHP developers using Zend Framework 1 and Zend Framework 2

Translate to de es fr it pt ja

howto - mount filesystem via ssh using sshfs

First of all, you have to install "sshfs". After that you just have to type.

sshfs [email protected]$host:/path/to/dir /path/to/mount

If fuse throws an error of permission, you have to add your user to the group fuse by typing:

usermod -a -G fuse $user

After you re-logged-in you can see by typing "groups" in your shell that everything is done fin. Do not want to logoff? Try

su $user
in your shell. This is a new login and so your new group is available now.

Just another hint, if you want to access symbolic links, try:

-o followsymlinks
and/or
-o transformsymlinks

The man page will help you to understand what you are doing.

Now put everything as an alias in your bashrc (or something similar) and you are done :-).

alias mountMyShare="sshfs [email protected]:/path/to/dir /path/to/mount -o follow_symlinks"; alias umountMyShare="fusermount -u /path/to/mount";

Happy mounting and unmounting.

Translate to de es fr it pt ja