Moving back to Windows?

It’s been over 6 years since I exclusively used Windows and have been using Apple. But recently I’ve had the urge to build a PC – mainly for games and video transcoding. So I started doing so research on hardware. As I am doing research, I’m starting to realize how much Apple has limited me from doing certain things and lacked support for some I/O devices.

I find myself running Windows virtually for doing simple tasks that I can’t seem to do with Apple either free or efficiently. For instance, if I need to edit metadata on a video file without having it render again is only possible with iTunes. But if I use iTunes, it has to be added to the library and not all file formats are supported. In Windows, I can accomplish this by using a free app called MP3Tag. I’ve looked and have not found an app for OS X – free anyway.

My second example. USB 3.0 and eSata has been available for years now (well eSata has been around for years) – no support at all by any Apple hardware. Yes, there is FW400 and FW800 but it isn’t as practical or affordable. I have many external devices that have both USB 2.0 and eSata. The eSata is begging to be used but I can’t. Even my HD camcorder uses USB and iMovie can recognize it – no FW support on the camcorder.

My third example. I have a bluray burner and have a lot of movies. Not all have portable media versions that come with it and even if they did, I would download through iTunes and have it be stuck (DRM) to 5 accounts. I’d like to throw this file onto my DLNA server and have it stream throughout the house. I don’t want to leave my iMac on all day just so that iTunes can share things – that’s why I have a Terastation with DLNA. Now I can rip blueray videos. I use MakeMKV to rip it then use Handbrake to create an MP4 file which would take around 9 hours to do. I’m hoping to cut this down by a lot on a Windows machine because Windows supports blueray format.

My fourth example. Time Machine is great. But without the expensive Time Capsule, I can’t do back ups over the network. I have found hacks but they are not 100%. Again, I have a Terastation and want to use it to its full potential.

My fifth example. My iMac that I bought in 2008 has been maxed out of its upgrade. The ram is at 4GB and the hard drive is 1TB 7200RPM (I think this model should recognize up to 1.5TB). I’m unable to upgrade the video card because iMacs are built like laptops. So whenever a new game comes along (Starcraft 2), I’m stuck with hardware from 2008. I’m able to get as high as medium setting and still experience some lag. World of Warcraft, I’m able to get 22-40 FPS in high populated areas. For my uses, I can’t upgrade the hardware anymore and would like to. If I had bought a Mac Pro, I probably could but for the price… no thanks!

So the plan is to build a PC that will let me have a better experience in games as well as transcode/edit videos more efficiently than my current iMac. I will be using an Intel i7-2600K processor and an H-series motherboard. The P-series is a little more expensive and I don’t plan on overclocking anytime soon – even though the 2600K allows me to. Now why spend the extra bucks on K? I just want to have the capability of overclocking once I do decide. And when I do, I just get a new motherboard. By then the Z-series motherboards will be available will have the Quick Sync capability and overclocking capability. I will be running 8GB DDR3 1333 ram for starters but the motherboard will be ready for 16GB when I am. For now, I’ll be running 500GB Sata 3Gbps, but in the future I’ll have it set up with 4 250GB on Sata 6Gbps with RAID10. That should give me a powerful and enjoyful experience compared to what I have now with my iMac.

I enjoy using Apple and OS X and will continue to use it. But as a desktop and for my current needs, I feel I’m better off on a PC running Windows 7 64bit. My MBP 13″ will be my second desktop/laptop because I still don’t feel comfortable nor do I trust doing certain things on a Windows machine.

Once I get more comfortable and have a nice workflow set up on my new PC, I will be selling my iMac. But that won’t be for weeks. Hopefully, what I have read and expect is true. If not, my new PC will just be a gaming computer and I will continue to do everything else on my Mac.

My new Linksys E2000 Router

I was using an Apple Extreme Base Station for a few years now. It’s the model right before they added the gigabit ethernet support but it does have wireless N. There were several things I hated about this router. The one thing I just can’t stand is it has to reboot every time you make any changes. I’ve owned other routers from Linksys, Netgear, and Belkin prior to this router and they never rebooted nor took a long time to apply changes. I use Mac address filtering so whenever a new device is introduced to the network, I have to make this change. In order to do so, anyone who is connected will be disconnected because it has to reboot.

After doing some research I found the Linksys E2000. It does everything I need it to do. Comparing it to my old Apple router, it has more ethernet ports (4) and supports gigabit speed. It’s fast when you make changes and the Cisco Connect software is compatible with OS X. Another great feature is it has a guest mode where it has a separate connection for guest devices. Guest devices can access the internet but will not have access to your LAN. Great feature, but for now I have it disabled. I still have to check how far that signal reaches. I don’t want anyone camped outside leeching off my internet.

The installation is simple. Only problem I had was with the software trying to connect to the router after I had changed the default settings. Turns out the version of the software was old. Linksys has a support chat system and they were able to direct me to the latest version of the software. After I installed the newer version, I was up and running.

I picked up a factory refurbished version. I figured it’s half the cost and should work as well as a new one. There are certain brands I don’t concern about quality even though it is refurbished, and Linksys is one of them. I’ve always had great experiences with their products. It’s a big savings compared to the $180 I originally paid for the Apple router (never again). A brand new E2000 will run $80 and up.

The only thing I lose from the Apple router is the USB port. Actually I won’t miss it at all. I hardly used it. What you can do with it is attached a USB printer to share or a hard drive. I have 2 wireless printers on the network and a Terrastation NAS box… problem solved!

So far it has been doing its job. The signal seems a bit stronger too and does not interfere with other wireless devices. Here are some pics.

Creating a CakePHP environment using MAMP and OS X

This will show you how to create a CakePHP environment in MAMP on OS X. Here list of softwares used and their version.

  • OS X Leopard or Snow Leopard
  • MAMP version 1.91 (using PHP5.2.x)
  • CakePHP 1.2.8

You shouldn’t have to use MAMP 1.9.1. I have it working on version 1.8.x. You will need to change Apache’s port from 8888 to 80. Make sure there aren’t any other web servers running on the same port. Leave MySQL running on port 8889. We will be creating a /Applications/MAMP/conf/apache/sites file that will store your virtual sites. It isn’t necessary but it’s easier to manage new sites on a separate file. You will need to edit the /Applications/MAMP/conf/apache/httpd.conf file by adding the following lines of code.

# virtual hosts file
Include /Applications/MAMP/conf/apache/sites

This will tell Apache to check the new sites file for additional configurations. So now, whenever you need to add or create a new site, you will edit the sites file and add the following code.

<VirtualHost *:80>
DocumentRoot /Users/username/Sites/projectname
ServerName projectname.local
</VirtualHost>

The value of DocumentRoot can be different. I just chose to put it in that folder. Now you will need to edit your /etc/hosts file by adding the following code.

127.0.0.1          projectname.local

Restart your MAMP server. Now unzip the CakePHP files into the projectname folder. You should now be able to view your new CakePHP site by directing your browser to http://projectname.local. This page will tell you that you need to change the default Security.Salt value. All you need to do is change at least one character and you will meet the requirement. You can also use Terminal to generate your own.

echo -n ‘foobar’ | openssl sha1

This will give you a 40 character string. You can use a mixture of upper and lower case on the letters. Copy and paste this value from Terminal to give a new Security.Salt value.

The next warning is your database. Rename the database file and edit it. Provide your database server information. Because MySQL in MAMP is using port 8889, you will have to edit the array and add the following.

‘port’ => ’8889′

There are notes in this file to help you further with additional array elements.

To use Terminal with the cake command, you will have to edit you ~/.bash_login file and create aliases. Here is the code to add to your .bash_login file.

# php
alias php5=”/Applications/MAMP/bin/php5.2/bin/php”

# cake for this project
alias cake=”php5 /Users/username/Sites/projectname/cake/console/cake.php”

To apply

. ~/.bash_login

You should be able to run

cake help

If you get a permission denied error, give it executable access with this.

chmod +x /Applications/MAMP/bin/php5.2/bin/php

That’s it. You can now start baking in a development environment. I know I have skipped a few steps but I’m assuming you know the basic commands and configurations. If not, please feel free to comment and ask questions. I’m still new with the MVC framework and CakePHP so go easy on questions regarding those. I am learning, slowly… haha!

Still looking for fast web development techniques

I’ve been developing web sites for almost 10 years now. I’m still in search of a way to develop faster. I find myself doing things over and over again.

I use PHP as the programming language to develop the web apps with MySQL database. I started to look for different frameworks – but most use MVC and I don’t have time to learn it.

Some have suggested to do validation using MySQL. This helps a bit so I don’t have to write more PHP code to validate whether or not the record exists, foreign key constraints, etc. Plus it really is good practice to have these in place in the database layer.

Next I looked in to template engines to help with the layout of the site. It does help quite a bit but I’m still left with a lot of PHP code. I use Dreamweaver to write code and I used to use its automated code writing but I found it too messy and inefficient. Now I only use it because the FTP client is built in, has a file checkout system and in CS5 it can read included files so I have easy access to them. The error check is nice too. It catches many syntax errors right away. It can read used variables and be a part of the autocomplete feature.

I tried using existing systems like CMS or blogs (Joomla and WordPress). I figured I can create add-ons on top of an existing system. Joomla uses the MVC framework. WordPress on the other hand is easier to figure out how to build on top of it. Plus their documentation is really easy to follow. One of the limitations I found is the lack of access levels. Another is the pre-existing environment may not fit with a project since it’s so customized – better to be built from the ground up.

I’ve been peeking into the .NET framework off and on. I don’t primarily use Windows at all. I’m mostly on a Mac or using some sort of Linux flavor. I do have Windows7 running virtually on my MBP and iMac so I can play with it. I have played with Visual Studio and it felt easy to use plus it seemed to make developing quick. The drawbacks I’ve found are Windows hosting is more expensive than Linux hosting, IDEs are expensive and run mostly on Windows OS, and I don’t like creating online applications that can potentially only work with Internet Explorer (does not support web standards and only available on Windows OS).

Rails looks promising with the DRY (don’t repeat yourself) approach. I’ve tried to look into it and even bought some books and watched some screencasts. It’s a great language but I can’t seem to understand how to authenticate/authorize different users. They have many different plugins that I can use but each one uses their own way of doing it.

I guess I’ll keep looking. Either I’ll find time to learn MVC framework, get better at Rails, or someone will develop a new platform to speed up web development.

Deleting ._ files in Windows

At work we use iMacs for workstations but Windows for servers. There are some nuisance when sending files from OS X to Windows. Filename lengths, network connections, hidden files – just to name a few.

In OS X, there are hidden files that start with ._ which become visible when viewed in Windows. It’s usually not a problem. It becomes a problem when you are working with Joomla. If you download and unzip Joomla, then transfer the files to a Windows machine, you will get a ._ for each file and folder. This bad because in the Joomla system, there is an XML file for each components, modules, plugins, themes, etc that describes it. There is also a list of files in that XML file. You will probably get errors in the Joomla admin interface because of those ._ files.

Here’s the command to get rid of them in Windows. Open up your command prompt and enter the following command…

del /A:H /S /Q [location] ._*

The del command means delete. The A switch selects files based on an attribute. The H means hidden attribute. The S switch is used to search subdirectories within the [location]. The Q switch is quite mode and is optional. [location] is obvious so replace this with the path of where you want to do the deleting. Finally, the ._* means files that start with ._ and the * is a wildcard.

Make sure you check to make sure there are no files that begin with ._ that you need.