My Move to the OSX (the dark-side)
I recently bought my 6th laptop and this time I thought I’d make this big jump to the other-side (OSX). I wanted to find out what makes a Mac so loved by the “simple-ones”. Well it looks like this whole “simplicity” is what gives the Mac its advantage. It’s the same secret I suppose that puts facebook ahead of the other social networking sites. It captures even the simplest of the simple users there is. It takes away all the non-essentials and keeps you focused on what you need. Putting all its power into delivering your very basic needs. I’ll keep that in mind the next time I create something. Focused Power… I like that.
Running Drupal on XAMPP/OSX
I was able to setup my XAMPP/OSX and got it working. Following the directions on how to install XAMPP on OSX it tells you to put your site on the htdocs folder. But I decided to setup my Drupal site on another directory outside of the XAMPP folder. My experience tells me to simply look for the httpd.conf file and insert a virtual-host that points to my site. So I did and I also included a vhost for my local xampp stuff. The XAMPP site is now working but not my drupal site. Here’s what I did with my conf:
<Directory “/Users/riobautista/Documents/workspace/skoolflyer”>
Options Indexes FollowSymLinks ExecCGI Includes
AllowOverride All
Order allow,deny Allow from all
</Directory><VirtualHost *:80>
ServerAdmin rio.bautista@ragingriverict.com
DocumentRoot “/Applications/XAMPP/xamppfiles/htdocs”
ServerName localhost
</VirtualHost><VirtualHost *:80>
ServerAdmin rio.bautista@ragingriverict.com
DocumentRoot “/Users/riobautista/Documents/workspace/skoolflyer”
ServerName skoolflyer.local
</VirtualHost>
I restarted my Apache after modifying the conf but I’m getting an Error 403 (Permission Denied) when I tried to access the site. I’m thinking maybe I should setup the permissions so I went into the terminal and did a chmod 755 on the skoolflyer folder but still didn’t solve the problem.
I just moved my site to the /Users/riobautista/Sites/ this fixed the problem.
This time, I got a bunch of deprecated function ereg(). Turns out XAMPP 1.7.2a is using PHP 5.30 which no longer support ereg(). Good thing I found this simple patch that fixed the problem. The problem is in line 902 of the includes/file.inc:
902: elseif ($depth >= $min_depth && ereg($mask, $file)) {
just replace the ereg function with mb_ereg so it becomes:
902: elseif ($depth >= $min_depth && mb_ereg($mask, $file)) {
That worked perfectly for me so on to my work.
Hibernate on Mac
I’m now trying to find out how to put the MacBook on hibernate. It’s a very useful feature found on Windows. As I move around very often, this helps me completely turn off my laptop while preserving everything so that when I turn the power back on I’m back exactly at where I left off.
MacBook seems to have something else they call Safe Sleep. It’s supposed to do exactly what hibernate does, but it is not readily accessible to the user. That gives me the feeling that Apple is not recommending this for regular use. I’ll try to read more on this.
I found these 2 terminal commands that lets you enable and disable SafeSleep.
To enable SafeSleep, use the Terminal program and enter the following command:
sudo pmset -a hibernatemode 3
To disable SafeSleep:
sudo pmset -a hibernatemode 1
I tried enabling SafeSleep and will now observe how well this works. For almost a day now, SafeSleep seems to work well. When I put my MacBook to sleep it hibernates just like windows. It does take a bit longer to sleep and wake than the usual sleep mode but I’m fine with that.
My First Crush (Crash)
I downloaded drivers and other software for my Line6 PODxt. Of course I got the latest ones from Line6. Installed Line6 Monkey without a problem. But after finishing the GearBox installation I got this message about the Line6Audio.kext:
Read more about this error here: http://line6.com/community/docs/DOC-1583
Well Line6 says this is a known issue and should not be a problem. Anyway, after completing the installation I was asked to restart but when I did I noticed it was taking much longer than usual to boot up. After a while I received this message telling me to shutdown by pressing the power button until the MacBook shuts down and turn it back on again. I did but I kept getting the same message. So got my other laptop and looked around for what I can possibly do. I tried the single-user and verbose approach (which you do be pressing command+s or command+v during start up). I was given the bsd terminal where I started exploring ways to uninstall the Line6 driver using the terminal. It’s not very Apple-like, so I decided to look for an alternative. Apparently the Apple-way is to login in SafeMode and uninstall my drivers from the Finder. It’s too simple really. You simply press the command+shift buttons while booting and you’ll get into SafeMode (pretty much like Windows). From there I was able to locate the Line6 Driver Uninstaller and that fixed my problem.
Simple yet effective way to replicate/mirror a database (any database at that)
Here’s what I did:
- First, I centralized all my data calls into a single object or function which receives an sql statement as the parameter.
- I check if the SQL statement is performing an INSERT, UPDATE or DELETE. To do this I just check if the first word is “SELECT” ( you may have to improve that if you’re using stored Procedures ).
- If the statement modifies data on the database then I put the complete sql statement in an “sql_transfer.sql” file which is a simple text that is accessible through the web. This server now acts as the publisher.
- I also have an option to perform real-time replication if the other server is within the same network. If this option is on, then I immediately execute the same sql statement on the mirror server.
- Normally, I’d have a cron running every so number of minutes that pulls the sql_transfer.sql from my publisher server. If the download was successful then the file is deleted from the server using a script on the publisher server. The downloaded sql_transfer.sql is then executed on statement a time deleting each one that was executed. A flag is raised telling the process not to download while the sql_transfer.sql is not yet empty.
Advantages:
- Works even across domains and ISPs.
- Doesn’t require complex replication tools.
- Easy to recover in case of network problems. can be manually executed.
- Works on practically any database platform.
MySQL .frm recovery
I had problems with my hard driver that caused my MySQL tables to be inaccessible. I was getting “#1033 – Incorrect information in file” error. I checked the files if there where obvious anomalies on the file caused by cross-linked file pointers but the files looked ok.
I had just reinstalled my MySQL due to the corruption and didn’t realize that this database was using InnoDB. I thought it was enough to backup and restore the database directory as that would be enough for MyISAM databases. Later I tried copying the InnoDB files from the data directory of the old installation. It didn’t work at first until I re-started my computer. The database was recovered after that (structure and data).
-
Recent
- My Move to the OSX (the dark-side)
- Skype & Apache conflict
- Simple yet effective way to replicate/mirror a database (any database at that)
- MySQL .frm recovery
- cakePHP calls crashing Apache
- Reformatting the default CakePHP layout (default.ctp)
- Syntax highlighting CakePHP using Eclipse
- Intersecting Entities on CakePHP Models
- Integrating Flickr into my PHP web-app
- Installing CakePHP
- Accessing a POP3 mailbox using PHP
-
Links
-
Archives
- October 2009 (2)
- April 2009 (2)
- February 2008 (1)
- January 2008 (6)
-
Categories
-
RSS
Entries RSS
Comments RSS