Skip to content →

Tag: Leopard

Snow leopard + wordpress + latex problem

Ever since I’ve upgraded to Snow Leopard I’ve been having problems with the webserver.

At first there were the ‘obvious’ problems : mysql-connection lost and php-error message. These were swiftly dealt with using the excellent Snow Leopard, Apache, PHP, MySQL and WordPress! advice from ‘tady’.

Right now, access to this blog is extremely slow (and often impossible), certainly via the admin-page. The problem appears to be that most of my CPU is used by lots of pdfetex-processes owned by www. Hence the conjecture that it is a problem with either LaTeXRender or WP LaTeX.

Anyone experiencing a similar problem, or knowing a trick to resolve it? Takk.

Leave a Comment

iTouch as network sniffer

In the iTouch warwalking post I was considering trying to gain access to closed networks for innocent purposes such as checking mail, rather than stealing secret passwords from people allowing you free access to their wireless network, but still, I should have thought of the following possibility

Here’s a walk-through :

  • type the following command into your iTouch (assuming you’ve installed the BSD subsystem) :

tcpdump -v -s 65535 -w log.txt

  • once you’ve collected enough packets, cancel the command (ctrl c), AFPd the file from the iTouch to your Mac and open it with Wireshark (this is the most convenient way to install binaries under Leopard as well as an updated version of X11. For other platforms, or source code, see here)

  • do whatever black magic you feel you have to perform using Wireshark (the new name for Ethereal) or other password crackers


overloaded iTouch

A jailbroken iTouch can do many wonderful tricks : by sarting up an AFDd server one can use it in Disk mode, exactly as an iPodClassic, one can use it as a WebServer by installing Apache and PHP and run a Wiki, one can install OpenSSH and secure shell to the rest of the world, one can even turn the iTouch into a music streamer via the FireFly server, one can …

And all of this on a gadget with only 116Mb RAM and one processor running at 412MHz… is asking for overload problems both on memory and battery. A couple of days ago I wanted to start up the iTouch and was greeted by a bright flickering screen and thought I’d finally bricked it…

Fortunately, there’s a simple lesson to be learned : with every new feature you install, learn how to switch if off and monitor your iTouch using the (under Utilities) which allows to view basic system info (screenshot below) as well as all active processes.

Here a few tricks to turn on/off the major consumers :

  1. To turn off the Apache-sever, ssh into the iTouch and give a apachectl stop command (you can always restart it with apachectl start.

  2. To control OpenSSH, install the (under Utilities) which allows to toggle Wifi, Edge, SSH and Bluetooth on or off (screenshot below).

  3. To control APFd, use its control pannel to toggle the Broadcast active feature only when you need your iTouch in Disk mode (it will then appear under Shared in your Finder window, at least under Leopard. For more on this see Mount and use your iPod touch as a Thumb Drive.

  4. To control FireFly, use the (under Multimedia) and scroll down (after staring for about 15 seconds to a white screen) to, tap it and start or stop the server.

Another major consumer is the (under Productivity). Maybe I should restrict my subscriptions to the hottest blogs only


first things first : jailbreak

You may have surmised it from reading this post : Santa brought me an iPod Touch! (( or rather : Santa brought PD2 an iTouch and knowing his jealous nature ordered one for him as well… )) Ive used an iPodClassic to transfer huge files between home (MacBook) and office (iMac) as well as for backup purposes. I wanted to find out what new tricks this trio could play now that iPod can go online. Major disillusion : one cannot even enable DiskUse via iTunes at the moment. (( rumours are that Apple will enable DiskUse in firmware 1.1.3, coming up next februari… )) What’s wrong with Apple? They make this marvelous piece of technology and then do a Golem-act preventing anyone else from using their precious thing. I understand their business plan, but soon it will make more sense to buy Apple shares than to buy their computers…

Enters the 13-year old AriX writing iJailbreak to free the iTouch. So, before you put any music or video on your pod (( and frankly there’s not much else Apple allows you to put on it )), dare to void the guarantee and risk your new gadget being bricked (( but, if I can pull if off you certainly can.. )) by Jailbreaking it! There are plenty of good guides around, both for Windows and Mac, but most of them can be slightly improved. I’ve followed Let’s Jailbreak the iPod touch 1.1.2 with OS X but shortened his downgrade to 1.1.1 procedure which is the first (and hardest) step in the whole procedure. The moment PD2 will see I can use Maps and Weather she’ll want me to jailbreak her iTouch too, so mainly for myself I list here the procedure before I forget it.

Jailbreak 1.1.2 with Leopard on Intel, use at your own risk.

Get a decent browser such as Firefox or Flock (to prevent the download to selfexpand, so when given the choice to open it with iTunes or save it to Disk, save!) and download Firmware1.1.1 and place it somewhere (why not create a Folder called Jailbreak).

Connect your iTouch and fire up iTunes and select your iTouch in the left column. Hold down the option key and click in the summary pane the Check for Update button. This will open a Finder window allowing you to navigate to the downloaded file and open it. The iTouch will downgrade itself to 1.1.1. Just wait until it reappears in iTunes and disconnect it.

With Safari on the iTouch go to and scroll to the bottom and click on the InstallAppSnap button. Let it do its magic and afterwards there is a new Installer-icon on your ‘springboard’ (the opening iTouch page). Open it and refrain from installing all the goodies now, just scroll down to Tweaks (1.1.1) open and select “OktoPrep” and install it (button top right-hand corner).

Connect iTouch to mac, start iTunes and select your iTouch. Click on the update button and now iTunes will bring you back to Firmware 1.1.2. After finishing wait until your iPod reappears in the left column. (Do not panic if you fail to see the Installer-icon on springboard, it will reappear later on). Then, close iTunes (your iPod stays connected via USB to the Mac). Use any browser on your mac to download Jailbreak 1.1.2 and place it somewhere.

Find the Java-applet jailbreak.jar in the folder and double click it. Again, magical things are happening ending with the iTouch booting up several times and you performed the Jailbreak.

Let’s open up the iTouch to the world

So, what was the point of all this? We still have no DiskUse enabled nor can we speak to the iTouch directly. But all of this is going to change rapidly. Let’s make it available to our DeskTop.

With “install package xxx” I will mean : fire up Installer from your springboard, donate as quickly as you can to the guys making this available, then click on the “install” icon lower-left. This will open up lists of packages, scroll down to package xxx, click on it to read more about it, and then hit the “install” button top-right. That’s it. (If you ever want to unistall a package, do the same process now starting from the “uninstall” icon lower-right).

Install first BSD Subsystem (under System packages) and the AFPd (under Network). This will turn your iTouch into an AFP-server. By clicking on its icon in the Springboard you can turn the server on and off (remember to turn it off when not needed!) and turn on Broadcast if you want the iTouch to show up on your Desktop (in the Leopard-Finder under ‘Shared’). You can now connect to the iTouch by clicking on its icon in the Finder and hitting connect. The default user/password combination for a Jailbroken iTouch are
root/alpine. Change this as soon as you figure out how to do it. ‘Alpine’ must be the most popular password right now… The AFPd-page also contains the Wi-Fi IP Address of the iTouch and you will need it soon, so write it down.

For we are going to connect via ssh and sftp to and from iTouch/Mac. Install the OpenSSH package (under System) and the Term-vt100 package (also under System). From the Mac to iTouch you can connect via something like

ssh root@

(change the number to the IP-Address of the iTouch) and login with the alpine password. You’re in! Conversely, open up the Term-vt100 icon in the springboard which give you a genuine *nix-Terminal. You can connect via ssh to your mac provided you know its IP and your login. That’s all.

Btw. you can also use your favourite file-transport program (mine is Transmit to connect to and from your iTouch via SFTP. Right, now that the iTouch is under control we might as well give it a voice of his/her own.

Install Apache (under System) and PHP (under Development) and follow the instructions from the iTouch Fans Forum (you will need to register, but if you’re not an iTouch-fan there’s little point in you reading this post anyway) and you will have turned your iTouch into a PHP-enabled webserver! On the left is a screenshot of the proof via the php-info testpage.

Finally, we can turn the world upside down completely. Before all of this we had no way to get control of the iTouch, now we can use the iTouch to take control of all our Macs serving VNC (Leopard comes with it, enable the password in System Preferences/Sharing/Screen Sharing/Computer Settings and you’re under iTouch control). To pull this off, just install the VNsea package (under Network). It really works well!

Oh, you’re only here to install the iPhone Apps…

Well, that’s easy enough. Just follow the instructions of the Install and use iPhone Apps in iPod touch from the excellent blog by Rupert Gee. The most difficult part is to get hold of the iPhone Apps if you don’t own an iPhone… Well, I’m happy to provide you with this secret information

Leave a Comment

NeB on Leopard and iPhone

If you have an iPhone or iPod Touch and point your Safari browser to this blog you can now view it in optimised format, thanks to the iWPhone WordPress Plugin and Theme. I’ve only changed the CSS slightly to have the same greeny look-and-feel of the current redoable theme.

Upgrading a WordPress-blog running under Tiger (Mac OS 10.4) to Leopard produces a few anxiety moments. All of the standard tools (Apache, PHP and MySQL) seem no longer to work as before. For those of you who do not want to waste too much time over it, I’ll walk through the process.

After upgrading to Leopard you want to check whether your blog is still alive, so you fire up Safari and will be greeted by the message that Safari cannot find your server. Sure enough you forgot to start the WebServer in SystemPreferences/Sharing/Web Sharing. Having fixed this you will see the default Apache-screen because Leopard put these default-files in your webserver-root directory (/Library/WebServer/Documents). In case you installed your blog under a user account you will get a message that you enter forbidden territory, see below for the solution to that problem. Having removed all those index.html files (making sure NOT to delete the index.php of your blog) a more serious problem presents itself : you see the text-version of index.php meaning that PHP isnt working. You check the /etc/httpd/httpd.conf file and it still contains all the changes you made to it to get PHP running under Tiger, so what is going on?

Googling for something like ‘enabling PHP under Leopard’ you’ll discover that the configuration file used by the webserver is in a different location. It now resides at /private/etc/apache2/httpd.conf. You will have to remove the hash sign (#) at the beginning of line 114 so that it reads

LoadModule php5_module libexec/apache2/

Next, you have to create a php.ini file and change one line. The first thing is settled by the following Terminal-commands

cd /private/etc
sudo cp php.ini.default php.ini

and in the php.ini you have to modify line 305 so that it becomes (removing the latter part of the line)

error_reporting = E_ALL

Restarting the webserver enables PHP. If you need more details check out the article Enabling PHP and Apache in Leopard. However, you are not quite done yet. Your blog will now show the WordPress-page that something is wrong with your mysql-database. However, mysql seems to be running fine as you can check from the Terminal so PHP cannot find it.

To remedy this, you have to add the locations (after the = sign) in the follwing two lines of the php.ini file

mysql.default_socket = /private/tmp/mysql.sock
mysqli.default_socket = /private/tmp/mysql.sock

Restarting the webserver should resolve the problem. But then your blog can still choke on old PHP-code in one of the plugins you use. In my case I was using an ancient version of the PHP-Markdown plugin but after replacing it with the newest version NeB looked just like I left it with Tiger…

A final point : webpages stored in personal Sites-folders cannot be served by Apache2 and will produce a message that you have not enough privileges to view the page. To resolve this, type the following command from the Terminal

sudo cp /private/etc/httpd/users/*.conf /private/etc/Apache2/users


mathML versus LaTeXRender

No math
today. If you’re interested in the latest on noncommutative geometry,
head over to the NCG-blog where Alain Connes has a post on
Still, Alain’s post is a good illustration of what Ill be rambling about
TeX and how to use it in a blog.

If you’re running a math-blog,
sooner or later you want to say something more than new-age speak like
‘points talking to each other’ and get to the essence of it. In short,
you want to talk math and it’s a regrettable fact that math doesnt go
well with ASCII. In everyday life we found a way around this : we all
use TeX to write papers and even email-wise (among mathematicians) we
write plain TeX-commands as this language is more common to us than
English. But, plain TeX and the blogosphere don’t mix well. If you’re
expecting only professional mathematicians to read what you write, you
might as well arXiv your thoughts. Im convinced the majority of people
coming here (for whatever reason) dont speak plain-TeX. Fortunately,
there is technology to display TeX-symbols on a blog. Personally, I was
an early adapter to
LaTeXRender and even today a
fair share of page-views relates to the few
posts I did on
how to get latexrender working on a mac. Some time ago I
switched to mathML and now I’m
regretting I ever did…

Mind you, I’m convinced that mathML is the
‘proper’ way to get TeX to the internet but there are at the moment some
serious drawbacks. For starters, it is highly user-unfriendly. You
simply cannot expect people to switch browsers (as well as installing
extra fonts) just because they come to your site (or you have to be a
pretty arrogant git). Speaking for myself, Im still having (against my
better judgment) Safari as my default browser, so when I come to a site
like the n-category cafe I just
skim the plain-text in between and if (and only if) the topic interests
me tremendously I’ll allow myself to switch to Flock or Firefox to read
the post in detail. I’m convinced most of you have a similar
surfing-attitude. MathML also has serious consequences on the
server-side. If you want to serve mathML you have to emit headers which
expect everything to follow to be purified XHTML. If I ever forget a
closing tag in a post, this is enough to break down NeverEndingBooks to
all Firefox-users. I’ve been writing HTML since the times when the best
browser around was something called NCSA Mosaic so Ive a
pretty lax attitude to end-tags (especially in IMG-tags) and Im just
getting too old to change these bad habbits now… It seems I’m not the
only one. Many developers of WordPress-plugins write bad XHTML-code, so
the last couple of weeks I’ve been spending more time fixing up code
than writing posts. If you want to run a mathML-wordpress site you might
find the following hints helpfull. If you get a ‘yellow screen of
death’ when viewing your site with Firefox, chances are that one of your
plugin-authors missed a closing tag in the HTML-rendering of his/her
plugin. As a rule of thumb : go for the IMG-tags first! I’m sorry to
say, but Latexrender-Steve
is among the XHTML-offenders. (On a marginal note, LaTeXrender also has
its drawbacks : to mathematicians this may seem incredible but what
Latexrender does to get one expression displayed is to TeX an entire
file, get the image from the ps-file turn it into a gif and display it,
so one gets a GIF-folder of enrmous proportions. Hence, use Latexrender
only if you have your own server and dont have to care about memory
constraints. Another disadvantedge was that the GIFs were displayed with
a vertical offset, but this has been solved recently (use the ‘offset
beta’ files in the distribution)). Wrt. to that offset-beta version, use
this latex.php file instead (I
changed the IMG-line). Some plugins may not serve the correct headers
to display mathML. So, if you want to allow readers to have a
printer-friendly version of your mathML-post, get the WP-print plugin BUT
change to this wp-print.php file in order to
send the proper headers. Sometimes there are just forgotten lines/tags
in the code, such as in the [future calendar plugin](
plugin.html). So, please use this version
of the future.calendar.php file. And so on, and so on. The joys of
trying to maintain a mathML-based blog… So, no surprise I’m seriously
considering to ditch mathML and change to normal headers soon. One of
the things I like about LaTeXRender is that it can be extended, meaning
that you can get your own definitions and packages loaded whereas with
mathML you’re bound to write iTeX, which Ill never manage. But, again,
mathML will be the correct technology once all major browsers are mathML
capable and the font-problem is resolved. Does anyone know whether
Safari 3 (in Leopard, that is Mac OS 10.5 to the rest of you) will be

Leave a Comment