August 14, 2009

Mac web access troubles

Normally the web folders on OS X are pre set with the right access rights. However when you migrate between versions, or installs, you may encounter a different situation, as I did. Which is why I got an annoying You don’t have permission to access / on this server. That is easily solved I hear you think, just by chmod-ding your Sites folder to 755 (rwxr-xr-x). Nothing more beyond the truth in my case.

After a decent amount of research on the web – and I like to think of myself as a good searcher – I found the issue is in the OS ACL entries, which you do not see (or only partly) in the GUI nor with the normal unix commands. However if you type ls -le you may see one or more extra lines underneath the folders normal listing, for example with something like 0: group:_guest deny list. The solution for this? Remove the ACL with chmod -N foldername.

August 04, 2009

Install MySQL on Mac OSX

The article takes you through all of it step by step, if you want to skip reading and just get to all commands you need then go there now.

Download the package First of course you need to get the installation package on www.mysql.com. Click the download link, choose MySQL Community Server and the Mac OS X (package format). For all recent Macs you need the x86_64 version.

Install all the package contents Once you have downloaded the package install MySQL and also the StartupItem and MySQL.PrefPane. The startup item makes sure the database is started every time you startup your Mac and the prefpane allows you to control this.

Mysql package

Check whether MYSQL is really running When you have installed all open the MySQL preference in your System Preferences to make sure the database is really running.

MySQL prefpane

Setup the command line tools Now one of the things the installation is missing it to set the paths for the command line tools. To fix this open a terminal window (in your Applications > Utilities folder) and type: echo ‘export PATH=/usr/local/mysql/bin:$PATH’ >> ~/.profile

Set a password on your database server Best practice would be to add a new user and disable the standard database root user. Depending on the scenario you could have many different databases with different users assigned to them. For now we will just add a password to the default root database user. In a terminal window type: mysqladmin -u root password NEWPASSWORD

If you want to change the password after you have set the initial password you need to use: mysqladmin -u root -p’OLDPASSWORD’ password NEWPASSWORD

Set up the manual pages The command line manual pages are a great and directly available resource if you need help using the command line tools. Unfortunately they are not automatically set up properly by the installation. Lucky for us it is fairly simple to do. Just open a terminal window again and type: echo ‘export MANPATH=/usr/local/mysql/man:$MANPATH’ >> ~/.profile to set the path and then: sudo /usr/libexec/makewhatis to rebuild the manual pages index.

If all went well you should be able to get the manual pages by typing: man mysql

Set MySQL for use with PHP Only needed if you want to run or develop php based applications (websites) that make use of the MySQL database. The default setup puts the mysql.sock file in the wrong location so that needs to be corrected. Again, open a terminal windows and type: sudo mkdir /var/mysql sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

The commands for all this magic

Open a terminal window and fire off all these commands, obviously after replacing the passwords. echo ‘export PATH=/usr/local/mysql/bin:$PATH’ >> ~/.profile echo ‘export MANPATH=/usr/local/mysql/man:$MANPATH’ >> ~/.profile sudo /usr/libexec/makewhatis sudo mkdir /var/mysql sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock mysqladmin -u root password NEWPASSWORD mysqladmin -u root -p’OLDPASSWORD’ password NEWPASSWORD

Troubleshooting

If you have an issue with the mysqladmin command there are two things you can do to troubleshoot. All commands without quotes!

Check if the software is installed correctly (usually is). Open a terminal window and type cd /usr/local/mysql/bin and then type ./mysqladmin status. If it returns some status information it’s installation is fine and the issue in in the path.

Check your .profile to see if the path is correct. From the same terminal window, typecat ~/.profile. It should have a line with export PATH=/usr/local/mysql/bin:$PATH. If not, go back to: Setup the command line tools

I hope reading this is as useful for you as writing and finding it all out (again) was for me.

July 24, 2009

Favorite Mac Web Development Tools

I use Wordpress as publishing platform. It is easy to use and making plugins and themes is simple. Development is pretty progressive and it can even be used as CMS for medium to small websites.

As Wordpress is built in php you need a good text editor to make plugins and themes, preferably one with syntax support for html and php. Textmate does the job pretty well and allows you to open a folder with files and you can easily open a folder to work in multiple files in tabs.

To administer the database, including making back-up copies, opening different databases on different database servers Navicat is an excellent choice. It even allows you to open databases on servers with only a php connection and you can do virtually all you need to be able to. And it not only is capable of working with MySQL but it does PostgreSQL and Oracle databases too.

For CSS you need a good CSS editor. I can endorse CSSEdit to anyone. It provides visual and source editing and even a combination of both.

Lately I have started to use Coda, which provides an integrated suite for editing php and CSS as well and an ftp site manager and more. The killer feature for me is integrated ftp which allows you to synchronize your online and local site. As with all synchronization tools, operating it needs some caution. Especially when syncing folders as you can choose to overwrite the original folder (thus deleting all original content) or merging it with the original content.

The tools that come for free with OSX are is the digital color meter, which allows you to sample a color from anything on your screen –set to 8-bit HEX value- to the color code for in your CSS at once. Another excellent tool is the screenshot capability –COMMAND-SHIFT-4- with backspace for a window shot.

I don’t do much with images. I am just not creative enough and don’t have the patience to work on that. If I would Photoshop would definitely be my favorite. I used a lot of alternatives, both paid and free, but nothing seems to be able to beat it, even though it has a relatively steep learning curve. Job targeted online tutorials can help you overcome that.

What tools do you use for web development?

June 23, 2009

Programs to Use Your Mac in the Office

I just finished a re-install of my Macbook, which I use mainly for my work. This prompted me to review what software I need on it. Here are my favorites.

Microsoft Office, although there are a few alternatives that are just as good or better I prefer using the office suite to prevent compatibility issues. Also as far as I am concerned nothing beats excel atm. The home and student edition, which is more than enough if you don’t need exchange server support, costs € 130.

Merlin is the leading professional project management software for Mac OS X and is fully compatible with Microsoft Project. It costs €145. If you are really into big time project management check out the add-ons, like the project server and web and iPhone sharing.

Omnigraffle to create a diagram, process chart, quick page-layout, website mockup or graphic design. The standard version costs €99 and the pro-version, which is fully compatible with MS Visio, costs €199.

Skype, to make free calls and chat over the Internet to other people on Skype for as long as you like, to wherever you like. It is free to download.

Along these programs that I actually use there are some that you will never really see after installation and setting them but they make your life much easier.

Flip4Mac WMV Components allow you to import, export and play Windows Media video and audio files on your Mac. It is free to download.

DivX® 7 for Mac is a free download that provides everything you need to enjoy high-quality digital videos on your computer, including high definition H.264 (.mkv) videos with AAC audio and videos created using all previous versions of DivX technology. It is free to download.

Precipitate lets you search for and launch the information you have stored in the cloud from within Spotlight or Google Desktop for Mac. It is free to download.

StartupSound preference pane is software to control or mute the volume of the startup sound of your Mac computer without changing the output volume setting. It is free to download.

January 25, 2009

Run Windows on a Mac

VMware Fusion ($79)
Supports 32 and 64 bit operating systems, multiple CPU’s and lots of memory. Provides data and application sharing, 3D video acceleration, support for multiple displays, USB and printing. Strong OSX integration with a real Mac interface, Quick Look, Cover Flow and Boot Camp support. Includes tools for migration of Parallels and Virtual PC for Mac and migration of existing Windows machines. Over 900 appliances for download from the VMware Application Market Place. Bundled with 12-month subscription for McAfee VirusScan® Plus, providing antivirus, antispyware and Windows firewall.

Parallels Desktop 4.0 ($79.99)
Let’s you use your Windows programs and Mac apps side-by-side, shared folders and access to shared CD/DVD drives and removable devices. Auto Start VMs on Mac boot. Support for 3D graphic acceleration, disk management and power saving features. Bundled with 12 month free Kasperski Internet Security and a version of Acronis True Image Home.

VirtualBox (free for personal use)
Freely available as Open Source Software under the terms of the GNU General Public License (GPL). Presently, VirtualBox runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems including but not limited to Windows (NT 4.0, 2000, XP, Server 2003, Vista), DOS/Windows 3.x, Linux (2.4 and 2.6), Solaris and OpenSolaris, and OpenBSD.

An interesting distinctive feature is that a virtual machine can act as an RDP server, allowing you to “run” the virtual machine remotely on some thin client. With its unique USB over RDP feature the virtual machine can access USB devices that are connected on the RDP client. Note that these are enterprise features that are only present in the closed-source edition.

December 14, 2008

Five things Apple should fix on the iPhone

Call reception is buggy. No week goes past without at least once being disconnected during a call. As this happens with different people and I never experienced it before it must be the iPhone.

Battery life is too short. It does not even last a day when I call a lot. I used to be able to do two to three days until I had to recharge. Now I risk running out of juice even before the day is over.

You cannot use it as a modem. Most other cell phones can easily be used as a modem. Even though that is not something you would do constantly it is very convenient when you are on the road and no wifi is nearby. Sure there are ways around, but you should be able to do so legally and without upgrade issues.

The touch screen is dangerous. With the ‘normal’ keyboard I used to be able to select contacts and dial them without having to look on the phone. Now I have to look at the screen. Not something you should do while driving.

Photo quality is poor. Unless you have perfect circumstances with lots of light, the subject is nearby and not moving too much, image quality is poor at best. We need more pixels.

Lacking management tools. I’d love to rollout the iPhone as handheld device for calendar and e-mail. But apart from the call quality and battery life there’s something else stopping me. There are not decent tools to manage the device. When you hand it out for business, you need to be able to lock it down, push the settings and disable and wipe it, all over the air, with an easy to use tool.

So that makes six instead of five issues? Not really, I do not expect Apple to ‘fix’ the touch screen, but I could not resist listing it as it does bug me from time to time.

Interesting is most issues are on the phone-side of the device. I also use it for, sms, reading e-mail, checking my calendar listening to music, which all works excellent. Maybe I should get a phone on the side…