maniswebdesign/blog

Just another blog.

Updating PHP (and Apache) on PowerPC Macs

Maybe you know the problem, you want to test your new website locally before uploading it to somewhere where it's publicly accessible.

On PowerPC Macs the latest PHP you can get on Leopard is 5.2.x and on Tiger it's even 4.x...
You want the latest and (probably) greatest? Here you go:

Disclaimer:
Installing Apache and PHP from MacPorts should be done in less than half an hour on an Intel Mac as most of the packages are precompiled already.
On a PowerPC Mac though there are no precompiled packages, and your Mac has to compile them all locally which will take quite some time.
If you want to build 64-bit binaries on a G5, this will lead to errors. Be aware that not all of them are easy to fix.
If you can't get them fixed it's a good idea to ask for help in MacPorts' IRC channel. The guys there are very friendly and they've helped me quite a few times so far.

First you need MacPorts:

  1. If you haven't already, install Xcode (you can find it on your OSX Install Disc)
  2. If you haven't already, install MacPorts

After you have MacPorts installed, open a new Terminal window and run the following commands:

First, let's update the MacPorts port tree so we have access to the latest packages.

sudo port selfupdate

Install PHP (this command installs the latest version of PHP 5.6)

sudo port install php56

...get yourself a cup of coffee...

Set up a basic php.ini
(if you want to use this installation for production, replace "development" with "production")

sudo cp /opt/local/etc/php56/php.ini-development /opt/local/etc/php56/php.ini

Check what version you have installed. If this fails your installation is broken. (optional)

php56 --version

Now let's install Apache

sudo port install apache2

...get yourself another cup of coffee...
Do not run sudo port load apache2 after it finished!

sudo port install php56-apache2handler

...maybe you want one more cup of coffee?
After the installation, enter the following commands like the script tell you to:

cd /opt/local/apache2/modules  
sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php56.so

OK. A base-installation of Apache and PHP is now installed, but how do you run them?
Wouldn't it be nice if you could start and stop them by clicking the checkbox inside your System Preferences?
Of course it would, so let's do that!
The procedure is dependant on which operating system you're using.

On Leopard (or higher)

Make sure Web Sharing is turned off in System Preferences!

For n3rds (or interested people):

If you toggle the checkbox, this enables or disables a LaunchDaemon which takes care of keeping Apache running.
How does it do that you wonder? It runs /usr/sbin/httpd -D FOREGROUND and keeps it running until the LaunchDaemon is killed (when you shut down e.g.)

So let's edit that LaunchDaemon (to take care of our Apache installation):

nano /System/Library/LaunchDaemons/org.apache.httpd.plist

Replace the first entry of the ProgramArguments array (which should be: usr/sbin/httpd) with /opt/local/apache2/bin/apachectl

It should then look like this:

<array>  
    <string>/opt/local/apache2/bin/apachectl</string>  
    <string>-D</string>  
    <string>FOREGROUND</string>  
</array>

Press Ctrl+O to save and Ctrl+X to leave nano.
You can now turn on Web Sharing again (and it should work).

On Tiger (or lower)

Make sure you have Personal Web Sharing turned off in System Preferences!

For n3rds (or interested people):

If you toggle the checkbox, it only sets the -WEBSERVER- entry in /etc/hostconfig and launches the "/System/Library/StartupItems/Apache/Apache" script with start or stop parameters.
You can also run it yourself if you want:
sudo sh /System/Library/StartupItems/Apache/Apache [start|stop]

First let's adjust the path to apachectl:

sudo mv /usr/sbin/apachectl /usr/sbin/apachectl-13  
sudo ln -s /opt/local/apache2/bin/apachectl /usr/sbin/apachectl

And then adjust httpd.conf

sudo nano /opt/local/apache2/conf/httpd.conf

Append the following line (I've put it after ServerRoot)

PidFile "/private/var/run/httpd.pid"

Press Ctrl+O to save and Ctrl+X to leave nano.
You can now turn on Personal Web Sharing again in System Preferences (and it should work).

 Testing

You can now enable Web Sharing test your new installation.
If PHP is not working, please check that

For every change you do to the httpd.conf or any other Apache conf, you have to restart Apache to apply them. You can do this by simply unchecking and then checking again the checkbox in System Preferences.


written by: Takashi Yoshi
Tags: PowerPC, HowTo

Von Orange und der Privatsphäre

Nun da wir wissen, dass uns alle möglichen Geheimdienste auf Schritt und Tritt im Internet überwachen, stellt sich natürlich die Frage, inwiefern dies auch private Unternehmen tun.

Kürzlich habe ich ein Abo bei Orange CH abgeschlossen, dort dabei ist unlimitiert kostenloser Datenverkehr zu Spotify, der Rest ist auf 1GiB beschränkt. Klingt gut, denn schliesslich hält mein 1GiB Datenkontingent so länger.

Aber woher weiss Orange denn überhaupt, welche Datenpakete bei der Nutzung von Spotify verschickt werden und welche nicht, fragte ich mich.
Da gibt es mehrere Möglichkeiten, wie diese Pakete gefiltert werden könnten.
Anstatt darüber zu philosophieren, welche Methode denn wohl am meisten Sinn machen würde, habe ich kurzerhand auf die Facebook-Pinnwand von Orange gepostet.
Und entgegen all meinen Erwartungen habe ich sogar eine Antwort erhalten. Eine äusserst interessante sogar!

Facebook Antwort von Orange
Ausschnitt der Facebook-Pinnwand von Orange CH

Lasst uns diese Antwort mal etwas detailierter betrachten:

Meine Frage lautete, wie Orange denn feststellen könne, welche Pakete für Spotify sind und welche nicht. Ob sie IP-Tables hätten, mit denen abgeglichen werde oder ob sie Deep Packet Inspection betreiben würden.

Dass die Produktverantwortlichen nicht detailiert auf technische Fragen antworten möchten, ist ja ganz normal. Sei es aus technischer Inkompetenz, Angst eine Sicherheitslücke zu verraten oder schlicht aus Faulheit.
Die Begründung, wieso er nicht antworten wolle, ist jedoch äusserst interessant. Er fürchtet sich vor möglichen Missverständnissen.
Weiter habe er dem Social-Media Mitarbeiter erklärt, dass ich mir das als einen Mix aus den beiden Möglichkeiten (aus meiner Fragestellung) vorstellen könne.

Betrachten wir die technische Übertraung von IP Paketen.

Die Aufgabe von Orange in diesem Fall ist es, die Pakete, die ich zu ihnen sende, an ihren bestimmten Empfänger weiterzuleiten.
Das selbe auch in die andere Richtung, sprich mit Paketen von irgendwo, die an mich adressiert sind.

Die Übertragung eines IP-Pakets kann man sich im Grunde wie das Versenden eines Briefs per Post vorstellen. Ein IP-Paket besteht aus einem Header (vergleichbar mit einem Briefumschlag) und dem Body (der Nachricht im Umschlag).
Und genau wie mit einem Brief, bringe ich den Brief erst mal zur Post (hier: die Übertragung des Pakets zum Rechenzentrum von Orange), von wo aus er über mehrere Zwischenhalte seinen Zielort erreicht.

Um nun die Pakete zu bestimmen, die für Spotify bestimmt sind, könnte Orange eine Datenbank anlegen, in der alle IP-Adressen von Spotify-Servern gespeichert sind.
Orange könnte nun bei jedem Paket den Empfänger anschauen und mit der Datenbank abgleichen.
So wüssten sie, welche Pakete für Spotify sind und welche nicht.

Eine andere Möglichkeit wäre DPI (Deep Packet Inspection).
DPI bedeutet, dass Orange jedes Paket öffnet und den Body untersucht (zur Übertragung des Pakets reicht jedoch der Header aus).
Im Beispiel mit dem Brief bedeutet das, dass die Poststelle jeden Brief öffnet, sich die Nachricht durchliest und den Brief dann wieder frisch verschliesst und weiterleitet.
Man könnte diese Technik anwenden, um anhand des Inhalts festzustellen, ob es sich um ein Paket für Spotify handelt oder nicht.
Man kann damit aber auch das Surfverhalten jedes Nutzers genau untersuchen, um dann ein vollständiges Profil über das Surfverhalten des Nutzers zu generieren.
Auf Grund dieser Informationen kann dem Nutzer z.B. auf ihn zugeschnittene Werbung angezeigt werden.
Solche Informationen lassen sich aber auch gut verkaufen (so verdient Google z.B. seine Brötchen).
Aber man kann damit auch Verbindungen zu unerwünschten Dienste blockieren (z.B. VoIP, BitTorrent) oder Pakete für eigene Dienste bevorzugen, so dass diese schneller übertragen werden als solche für Dienste eines Konkurrenten, was dem Prinzip der Netzneutralität widerspricht.
Dies nur, um ein paar mögliche Verwendungszwecke zu nennen.
Allgemein lässt sich jedoch sagen, dass DPI sehr selten zum Vorteil des Kunden verwendet wird.

Halten wir also fest, dass der Mix, den Orange meint, gar keinen Sinn ergibt.
Wenn eh schon in jedes Paket reingeschaut wird, macht dies das Abgleichen der IP-Adressen überflüssig.
Auch befürchten sie Missverständnisse. Normalerweise entstehen Missverständnisse durch schwammige und undeutliche Aussagen.
Um Missverständnisse zu vermeiden, könnte man z.B. präzisere Aussagen machen, aber eine präzise Antwort wäre hier wohl mit einem Geständnis gleichzusetzen.
Geständnis dehalb, weil wenn Orange kein Problem damit hätte, zu sagen, dass sie DPI anwenden, hätten sie es auch gleich sagen können. Die Antwort von Orange hat so einen gewissen "Ja wir machen DPI und jetzt halten Sie endlich die Klappe!"-Touch.

Was bedeutet das nun für uns Nutzer?

So direkt bedeutet das nichts für uns. Das mobile Internet funktioniert so gut wie vorher auch.
Die Frage ist nur, was bedeutet das für die Daten, die wir darüber übertragen.

Aber auch hier kann man soweit nichts sagen, wenn wir wissen nur, dass Orange von allen Daten weiss, die wir übertragen. Was damit gemacht wird, ist unbekannt.
Aber Snowden hat uns gezeigt, dass man hier immer mit dem Schlimmsten rechnen muss!

Was machen wir dagegen?

Am besten zu einem Provider wechseln, der auf die Privatsphäre seiner Kunden achtet.
Und wer nicht wechseln kann, der kann diese Nachricht verbreiten und darauf hoffen, dass es genug Leute für einen Shitstorm gibt. Mit genug Druck, können wir Orange überzeugen, diese Tätigkeit aufzugeben, aber leider nur so!


written by: Takashi Yoshi

Review: Nokia Lumia 520 (and Windows Phone 8)

I got myself another phone just two weeks ago. A Nokia Lumia 520.
Because it's been almost two years since the last post on Windows Phone I've thought it's time to see what has changed in the meantime and whether Windows Phone gets a better mark than last time.

First a few words on the phone itself.
Nokia is known for making good quality and especially very stable phones. I haven't dropped mine so far but I can say that the phone feels very worthy of the price.
While holding it in the palm of your hand you wouldn't be able to tell that it costs less than CHF 100! There are phones by a big Korean company (I don't want to mention the name) which cost a lot more and feel cheaper.
It's not only the enclosure which is very well made it's also the rest of the phone.
The phone features very good specs. It's powered by a Snapdragon S4 processor, has 512MB of RAM, 8GB of built-in storage (which is expandable with a microSD card), a 5MP rear-side camera (which doesn't have a flash though), a high-sensitivity touchscreen (which means you can use the screen with some pens or while wearing gloves), and a lot more.
So far the phone is a steal, there are a few cons though. The capacitive buttons aren't back-lit, the phone doesn't have NFC, a camera flash, or a front-facing camera.

But these are minor details compared to what the phone has.
If you decide to get a Lumia 520 you also get the latest and greatest operating system (Lumia Amber, which is based on Windows Phone 8 GDR2) and an almost lag-less experience!
Very very nice!

Now let's see whether Microsoft has improved its Windows Phone system.

Two years ago I criticized the notification system.
Unfortunately it's still the same. It was and still is pretty much useless.

On the other side I liked the music player and I still do.
It also is pretty much the same (though it plays FM radio now). A few design improvements. Still very good, except for the imho very annoying Xbox ads everywhere. Google does the same with their Play Services on the other side, so it was to expect that they'll be offering some "value-adding" service.

The picture gallery was pretty well-made already two years ago and it has also advanced a bit.
You don't get your Facebook feed on the first page anymore which is a good thing if you ask me, but instead you have access to your pictures (which was probably what you wanted) with just one tap.
Nokia has also developed a very very good camera app called "Nokia Pro Cam". Officially it's not available for the 520 but you can still get it installed if you really want to.

A thing I really hated two years ago was the browser. It wasn't able to display a single webpage properly, but fortunately this has changed.
IE still is not my preferred browser, but I have to say that IE 10 Mobile is definitely useable. It gets almost everything right.
So a huge step in the right direction here. Great work Microsoft.

Buying advice?
Definitely, if you're looking for a reasonably priced device and you don't need an endless collection of apps.
The main thing that's stopping Windows Phone enjoying huge success is the app collection. While you can get most apps you need, you just can't get them all.
If you're ready to relinquish some apps, you get a very good device for what you pay.
"Bang for the buck" is definitely there.


written by: Takashi Yoshi
Tags: opinion, Review, Windows Phone

Billophones - How awesome are they really?

If you're like me you like cheap low-end smartphones for less than 100.- CHF. Let's call them billophones.

It's self-explanatory that they can't keep up with flagship devices like the HTC One or the Sony Xperia Z1 on the spec sheet.
Flagships have quad-core processors, 2 GB RAM, 16+ GB storage, 8-42 MP cameras, LTE, NFC, 5" screens with 400+ ppi and whatever.

And it's clear that you can't expect all that stuff you get in 600+ CHF devices in one 60.- CHF device.

But do billophones have qualities flagship devices don't have I asked myself.
I've come up with five things billophones do better than their expensive counterparts:

  1. SIM card
    Expensive devices use micro or even nano SIMs to "save space".
    Billophones mostly offer a normal mini SIM slot. So you can use your elderly SIM cards.
    Smaller providers often only provide mini SIMs. You can put them into a billophone while you would have to cut them into pieces to work in your flagship device (and you maybe destroy the card by cutting it).

  2. "Bang for the buck"-ratio
    While you can't expect all the performance you get from a flagship device from a billophone you get an incredible amount of technology for next to nothing.
    Of course you buy most of these phones on a pay-as-you-go plan which is why they are so cheap, but you can unlock most of them for less than 10.- CHF.

    So overall they're well worth what you pay for them.

  3. Battery
    Most billophones come with a battery around 1500mAh. This is not much compared to 2300mAh or even more you get from today's flagships but if you realize that billophones don't have power-hungry DC-HSPA+ or LTE radios, a smaller screen, a slower processor, less memory, etc. which all consumes power, you can still get a day or more of juice out of these batteries. Which is more than you get out of some much more expensive models.
    Another plus is that if your battery goes empty, you could just open the back, put another battery in and get another full charge.
    Of course you could get a battery-pack for your flagship and recharge your battery on-the-go, but you have to charge your battery-pack to charge your battery with it, which means that you have to wait and it's not very handy to have a cable at your phone all the time. It's also very stupid to charge a battery to charge another battery with it. Which means that you lose (a lot of?) power.

  4. Storage
    Most flagship phones come with a certain amount of built-in storage and that's it. Since Android 4.0 most of them have a huge data partition which means that you have to transfer your data using MTP.
    But with billophones you get maybe 2-4 GB built-in storage and you can extend its storage with microSD cards. And the best part of it is that most of them still have a separate data and sdcard partition. Which results in you having two SD cards but you can mount both of them using the standard USB mass storage mode, which is just AWESOME.

  5. Durability
    Because most billophones are made out of plastic they should be a lot stronger than devices like the Sony Xperia Z which is made almost completely out of glass.
    Smaller displays (and thus handsets) reduce the chance of getting your glass broken, so overall you have a pretty durable phone.
    And if it breaks you just get a new one because they're so cheap.

So there you go! 5 reasons why billophones are better than their counterparts for maybe 10x the price.

Billophones I can recommend are e.g.:

There are many more available. Just check your local phone store.
Of course it depends on your local carriers whether they have something to offer, but if they do, I'd get one ;-)


written by: Takashi Yoshi
Tags: Windows Phone, Android, opinion

How To: Getting Google Music Manager to work on PowerPC, again!

As we all know, Google hates PowerPC and none of their desktop apps nor most of their plug-ins are still available for PowerPC Macs even though they often support Leopard.

But there are some exceptions where the Product Quality Manager was a bit drunk and made some Universal Binaries available to the public.

The "Google Music Manager" was one of these until Google decided that they should release a new version and break the full PowerPC compatibility leaving you with a build that ran on PowerPC. However, you cannot use the Preference Pane, which actually is the most important part of the whole application.

Just stay with the old version you thought? Nah, Google somehow changed their login procedure (or whatever they've messed with) which leaves you with a neat "error code 5".

But fortunately the Product Quality Manager came to work drunken again and left the build half working which lets us fix the build with a few (more or less) easy steps and upload songs to Google Play Music from our beloved PowerPC's :)

So here we go:

  1. You need two disk images (one with the old version of the Music Manager (1.0.27) and one with the new version (1.0.65)). I've provided them to you and you can download them from here:
    musicmanager_1.0.27.206.dmg
    musicmanager_1.0.65.1341.dmg
  2. After you have them both downloaded you mount "musicmanager_1.0.65.1341.dmg" (the new version)
  3. Drag "Music Manager.app" to your Applications folder.
  4. Unmount "musicmanager_1.0.65.1341.dmg".
  5. To fix the new build we need the old preference pane which we get from (means you have to mount the image) "musicmanager_1.0.27.206.dmg" (the old version)
  6. "Show Package Contents" of "Music Manager.app" (from the image you've just mounted) and open Contents/Resources.
  7. "Show Package Contents" of "Music Manager.app" (from your Applications folder) and open Contents/Resources (now it's important that you don’t confuse both windows as they look pretty similar!)
  8. Copy "MusicManager.prefPane" from the Music Manager you opened from your Applications folder to a temporary location.
  9. Replace "MusicManager.prefPane" (in the new version) by the one you find in the old version.
  10. "Show Package Contents" of the Preference Pane you have just replaced and open Contents/Resources
  11. "Show Package Contents" of the Preference Pane from your temporary location and open Contents/Recources.
  12. Replace the "Music Manager.app" from the "real" Preference Pane with the one from your temporary location.
  13. Done.

Now you can launch Music Manager and have a full working (as far as I could test it) copy of Google's Music Manager!


written by: Takashi Yoshi
Tags: HowTo, Google Play Music
Tutorials, reviews, experiments, and, of course, my opinion on things…
Tags:
Subscribe our feed:
RSS2.0, RSS1.0, Atom
blog powered by EF Blog