Inofficial FreeBSD port for Zend Optimizer Plus

Posted by: gdelmatto  :  Category: FreeBSD, PHP

While just in the process of doing web-server freshup on FreeBSD, I was caught by the good news that Zend Technologies have released their Zend opcode caching engine as open source.

Now it’s called Zend Optimizer Plus and hosted over there at github.

As far as I have seen, it did not yet popup as a buildable port on FreeBSD’s ports tree, but that can only take little time for today.
So I quickly made up my own port which you can download here.

To build it, simply download and extract the file to /usr/ports/devel:

cd /usr/ports/devel
fetch -o- http://phaq.phunsites.net/files/2013/02/ZendOptimizerPlus.tgz | tar -xzpvf -

Then “make install” as usual:

cd /usr/ports/devel/ZendOptimizerPlus
make install

Afterwards, running “php -i” (or phpinfo from a web-accessible script file) should denote it runs “with Zend Optimizer+ 7.0.0-dev”.

Done 🙂

Nagios/Icinga Plugin to check for DokuWiki Updates (v2,2015-09-05)

Posted by: gdelmatto  :  Category: HowTo's, Perl, Programming, Scripting

Nagios/Icinga can also serve to send you friendly reminders, like for example that you need to perform software updates.

Here’s my little contribution, a simple plugin to monitor a given DokuWiki site and check against the release server for any upgrades.

Just fetch the  check_dokuwiki-0.1 check_dokuwiki-0.2 tarball and extract the check_dokuwiki script to your Nagios/Icinga plugin directory.

The latest plugin update (0.2, 2015-09-06) catches up with latest updates on Dokuwikis web page, and now incorporates upstream checks using the same mechanism that Dokuwiki uses internally. Also it adds some (although not yet well tested) support for http authentication.

Please check out the cli help for more details on specific arguments:

check_dokuwiki v (nagios-plugins 1.4.15)
The nagios plugins come with ABSOLUTELY NO WARRANTY. You may redistribute
copies of the plugins under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
Copyright (c) 2012 Gianpaolo Del Matto

Usage:
  check_dokuwiki -H 
  check_dokuwiki [-h | --help]
  check_dokuwiki [-V | --version]

more arguments
  -a | --use-auth              enable http authentication mode
  -r name | --realm=name       use given realm with http auth
  -u user | --username=user    use given username for http auth
  -p pass | --password=pass    use given password for http auth
  -s | --use-ssl               enable SSL mode (uses TCP:443 as default, see --tcp-port
  -p num | --tcp-port num      use non-standard port
                               if not given, defaults to TCP:80 (or TCP:443 if --use-ssl is used)

   	give any valid DokuWiki hostname to fetch the 'VERSION' file from.
                         Note: HTTP AUTH is currently not supported.

Send email to nagios-users@lists.sourceforge.net if you have questions
regarding use of this software. To submit patches or suggest improvements,
send email to nagiosplug-devel@lists.sourceforge.net.
Please include version information with all correspondence (when possible,
use output from the --version option of the plugin itself).

Register the plugin with a command definition like this:

# 'check_dokuwiki' command definition
define command{
        command_name	check_dokuwiki
        command_line	/usr/local/libexec/nagios/check_dokuwiki -H $HOSTNAME
	}

Then simply add a service to one or more of your DokuWiki hosts (or hostgroups, whatever you prefer).

define service{
        use                     generic-service
        host_name               your_wiki_host_objects_list_here
        service_description     dokuwiki_version
        check_command           check_dokuwiki
        max_check_attempts      5
        check_interval          5
        retry_interval          3
        check_period            24x7
        notification_interval   0
        notification_period     24x7
        notification_options    w,c,r
        }

Restart Nagios/Icinga and you’re done.

Happy monitoring 🙂

Perl/SOAP::Lite: Rewrite response XML for ASP.NET compatibility

Posted by: gdelmatto  :  Category: Hacks, Perl, Programming

So you finally hacked up your nifty SOAP::Lite web service only to find that it works fine with SOAP::Lite or PHP clients, but ASP.NET terribily fails?
Yes, I should mention, that you must of course write up a WSDL first, especially for .NET, I’ll cover that topic in a follow-up.

This post however refers to a hack that I have done to SOAP::Lite to allow for dynamic response rewriting for different SOAP client implementations.
Read more…

Validate your self-created SNMP MIB

Posted by: gdelmatto  :  Category: Bits and Bytes, Memos

So, if you ever need to create your own SNMP MIB and are not relying on any given tools (i.e. you’re so crazy to write it on your own in a text editor), you may still want to validate it afterwards.

Here’s a nice web-based validator, that does the trick for you:

http://www.simpleweb.org/ietf/mibs/validate/

Notify me if IP is propagated in DNS

Posted by: gdelmatto  :  Category: Memos

So here’s my short snipped of a bash shell loop I hacked up.
It’s only purpose is to check in DNS repeatedly if a certain IP address is propagated for a given fully qualified domain name.

If the script sees the IP address, it would “ring the bell” and exit, otherwise it sleeps for a while and repeats the check.

This way I could leave it running in the console and – whenever the IP appeared in DNS – I’d get an audible alert.
No big trick after all 😉

Here’s the code:

$ while [ : ] ; do echo scanning ... ; dig @DNSSERVER FQDN | grep IPADDR && { echo -e "\a"; break; } || sleep 5;   done

And here’s what it looks like in action:

scanning ...
scanning ...
scanning ...
scanning ...
scanning ...
scanning ...
my-cool-fqdn.some.domain.tld. 3600 IN	A	192.0.2.1
[you would hear a "bing" tone at this point as well]

Swisscom FTTH: 6RD mit Cisco 892F nutzen

Posted by: admin  :  Category: Cisco, HowTo's, Networking

Wie bereits aufgezeigt, kann man statt dem Centro Grande oder Centro Piccolo auch problemlos einen Cisco 892F an einem Swisscom Vivo FTTH-Anschluss betreiben.

Hat man diese Hürde erstmal geschafft, möchte man den Cisco vielleicht am Swisscom-eigenen IPv6 6RD Gateway anbinden um in den Genuss von IPv6 zu kommen.

! Wichtige Information !

Die IP-Adresse des Swisscom 6RD Relays ändert per 9. April 2013:

193.5.29.1

Read more…

Fix iTunes refraining from syncing the iPhone

Posted by: gdelmatto  :  Category: Bits and Bytes, Hardware, HowTo's, OS X

Out of a sudden iTunes struck me with this error: The iPhone “…” could not be synced because the sync session failed to start

I did web research, but did not really find a proper solution to this.
Well, there were a few which either did some funny things on Windows (I run a Mac ….), or recommended to restore the iPhone from a previous backup, removing just one app, installing just one new app through the iTunes store, and, well, some other curious and strange things.

After all, I thought to give the restore thing a try, however that changed nothing. Same message came up. So I disabled WLAN sync as to not interfere with the iPhone being hooked up by the cable already — again to no avail.

So I decided to look into the iTunes internals. There I found a primising folder within the Application Library folder called SyncServices. It was not that big, around 6 megs. But inside there where clear traces of synchronisation stuff.

My solution to the above error was then to quit iTunes, remove the SyncServices folders completely. And voila, iTunes would just start syncing my iPhone as if nothing bad had ever happened.

A backup volume switcher for Apple’s TimeMachine

Posted by: gdelmatto  :  Category: Operating Systems, OS X, Programming, Shells

So here’s another piece of code I hacked up tonight.
Since I’m roaming around with my MacBook every now and then, the need arised, that I would need to switch my TimeMachine destination volumes based on location.

So while in the office, I’d like to backup to my external USB drive there.
Being at my home office, i’d like to backup to my NAS, while on the road, I’d love to habe my external mobile drive to kick in (and yes, I know about the “mobile backup feature” of OS X Lion, but that’s not the point …)
Read more…

Swisscom Vivo FTTH Anschluss mit Cisco Router betreiben

Posted by: admin  :  Category: Cisco, Networking

Wer das Glück hat in einem mit Glasfaser erschlossenen Quartier zu wohnen, kann statt DSL mit Lichtgeschwindigkeit surfen – FTTH (Fibre to the Home) macht’s möglich. Bei Swisscom Vivo FFTH-Anschlüssen für Privatkunden wird man mit dem Centro Piccolo oder dem Centro Grande ausgestattet, was für die meisten Kunden auch mehr als ausreichend sein dürfe.

Möchte man allerdings seinen FTTH-Anschluss richtig ausreizen, bietet sich der Einsatz eines Cisco 892F Routers an. Zugegebenermassen nicht gerade ein billiges Gerät (ab rund 1000 Franken Listenpreis), dafür kriegt man aber auch alles, was ein Cisco typischerweise so zu bieten hat.
Read more…

Cheat sheet for Check Point Firewall

Posted by: gdelmatto  :  Category: Check Point

For everyone who’s interested in Check Point Firewall, find some valuable cheat sheets over at Jens Roesen’s Website.

Great thing indeed, and yet very helpful if you need just a quick lookup instead of going through the full official documentation.
Here’s the direct links:

Check Point CLI Cheat Sheet
Check Point’s “fw monitor” Cheat Sheet

Thanks to Jens for assembling these.