January 2009

Choose a random winner or randomize a list with terminal and PHP [solved]

I wrote this for my class, which needed to have a randomized order of presentations:

php -r '$order = array("person1","person2","person3","person4","person5","person6","person7","person8","person9","person10");shuffle($order);foreach($order as $number=>$name){echo $number+1 . " $name\n";}'

To run it, open up terminal (in OS X) and paste it in.

I’ve also had to choose a random winner for gift certificates before:
php -r '$order = array("person1","person2","person3","person4","person5","person6","person7","person8","person9","person10");shuffle($order);echo "$order[0]\n";'

‘No access’ greyed out for user Everyone in Leopard File Sharing [unsolved]

This is a follow up to my previous post about locking the system out of itself by trying to set “Everyone”‘s priveledges to “no access” via get info and locking Leopard out of its own system.
I recently discovered that my file sharing is not behaving like it is supposed to. “Everyone” having “read only” access indeed SHARES ALL OF MY FILES with read only access and no password required. If you try and set “Everyone” to “no access” via get info like I previously described, when you reboot Leopard fails to launch and the Leopard install disk cannot repair the permissions. (See my previous post for my fix).
But when I try and change the read only access for Everyone, “no access” is greyed out:
Leopard does not let you choose no access for Everyone
This is a huge bug apple!! Leopard has downgraded the ability to share files with a password.

iTunes for windows can’t see shared mac library [solved]

For several months I have been trying to stream my iTunes library from my iMac to my wireless laptop in the living room on the same network. I’ve streamed iTunes with various software to other devices (other PCs, Windows Mobile phone, iPhone) using SlimServer, Simplify Media and Mojo, but for some reason it would not stream over the network.
I tried updating iTunes on both machines but had no luck. I tried using Simplify Media to share instead but that didn’t work either. I double checked the preferences on both machines. I disabled the firewall and AVG antivirus. Still no luck.
Finally, I solved it: I opened up Apple Software Update and installed the Bonjour update for Windows. So it was Apple’s fault but I couldn’t find any documentation anywhere. Oh well, it’s fixed now. Hurray!