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…

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…

Working around WordPress’ wpdb limitations with MySQL User Variables

Posted by: gdelmatto  :  Category: PHP, Programming

Think about retrieving a data set from MySQL, where you need to add distinct, auto-incremented ID to each row retrieved. Sounds easy?

Well, the ID has to be generated on-the-fly and out of nowhere. Still easy?

One might think about using MySQL user variables to accomplish this, sure. But what if your framework does not allow injecting chained queries because of SQL injection countermeasures?
Read more…

Run command in background from PHP

Posted by: gdelmatto  :  Category: PHP, Programming

While working on my newest project, a PHP- and AJAX-based network management application, I came along the need to run multiple commands on the server and track their return states (basically if they were run successful or not).

While sticking together my framework, I found that forking a process into background from PHP requires some additional steps if you don’t want to break AJAX functionality.
Read more…

Convert a Perl Hash of Hashes into XML with XML::Dumper

Posted by: gdelmatto  :  Category: Perl, Programming

For a project of mine, I wanted to convert a Perl data structure, a so called Hash of Hashes, into an XML.

The simple solution to this is to use the XML::Dumper module.
Read more…

VpnInit AppleScript: Override and Restore Default VPN-Routes on OS X

Posted by: gdelmatto  :  Category: Networking, Operating Systems, OS X, Programming, Scripting, Utilities

Years ago I wrote a small script to restore local default route after connecting the RAS VPN on Windows.

Now, I made up a similar script to do the same on OS X.
Read more…

Automating MakeMKV with AppleScript

Posted by: admin  :  Category: Operating Systems, OS X, Programming, Scripting

It’s only days since I wrote about a custom script action upon inserting a DVD in OS X, allowing me have either run the DVD Player or MakeMKV to rip the DVDs.

Now I was digging around if I could do some automation on the GUI part, which indeed turned out to work … at least to a certain degree.
Read more…

Interface-Statistiken in Cacti für Pirelli Router erstellen

Posted by: gdelmatto  :  Category: HowTo's, Networking, Programming

In diesem Beitrag geht es darum, Cacti Interface-Statistiken auf einem Pirelli Router über den Umweg via SSH zu erzeugen. Dies wird auf bestimmten, kastrierten Pirelli-Geräten, wie sie von bestimmten Providern ihren Kunden zur Verfügung gestellt werden, auch dringend benötigt, da die Geräte den nötigen SNMP-Support schmerzlich vermissen lassen. Das fehlende SNMP Support lässt sich auf diesen Geräten auch mit Hilfe eines Hacks, der bereits seit mehreren Jahren in einschlägigen Foren kursiert, nicht nachrüsten.

Read more…

Make OS X run custom actions upon DVD insert

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

I’m currently ripping my complete DVD collection off to MKV (Matroska) format, so I can stream them across my home network.

So I sought a way to have my OS X give me the choice to either start DVD Player or MakeMKV upon inserting a DVD.
Read more…

Shutting Speakers on OS X when Screen Saver runs

Posted by: gdelmatto  :  Category: OS X, Scripting

Why for God’s sake would anyone even think about shutting speakers while the screen saver runs?
Don’t these thingies provide an internal mute switch to stay quiet?

Well, yes, most of the time, they do. Though in my case, I run that nice and decent System47 LCARS-style screen saver. And while it provides indeed a mute switch, it yet refuses to honor that flag and will always revert to non-muted operations. This drives me crazy, at least during the night time.

So here’s my solution to shut it quiet — really handy when I’m not along and forgot to turn volume down …
Read more…