The best way to parse out the port number from a URL (e.g. http://example.com:8080) is to use regular expressions. The PHP function parse_url() will not return port numbers that are specified in the URL. However, I’ve found parse_url() to be useful for retrieving the host name from a long string.
→ Read More...By default, SELinux will block the ability for Apache/webapps to write to files in Fedora. This is a security feature to limit what folders Apache can write to. You can notice this issue if you get errors in your Apache logs such as:
PHP Warning: move_uploaded_file(): Unable to move ‘/tmp/…’ to ‘…….’
Command to set permissions:
chcon -R -t httpd_sys_rw_content_t [Name of Folder]
You can check the SELinux permissions via the following command:
ls -halZ
If you have an AJAX application that uses a PHP back-end app on a different server as your web front-end server (e.g. load balancing, cdn’s, etc), your PHP script will need to send header variables with the allowed content server name(s).
Web browsers are now following a standard for HTTP Access control to prevent client-side Cross Site scripting attacks.
I tested this with Firefox and it simply blocks the request without any error messages. Google Chrome browser will error out with the following message if the access control origin is not set correctly on your PHP script. (woot!)
“XMLHttpRequest cannot load [PHP URL].. Origin [JAVASCRIPT URL] is not allowed by Access-Control-Allow-Origin.”
For example, if the Javascript is hosted on example.com and your PHP app is on example.org.
Below is the PHP script for fixing this error. [see full message for the solution]
→ Read More...The best price for TurboTax 2010 Deluxe (with E-File and State) is currently at Amazon.com for $41.99. Costco, Best Buy, Staples are selling TurboTax Deluxe with E-File and State for around $50
Price is subject to change.
→ Read More...I’ve been working on a quick list of pros and cons for each backup
solution. Pricing, backup time, network traffic, hardware, and software are key differences between Avamar and Quantum.
Avamar Best for redoing the entire backup solution or starting from scratch. Client backup software is included, de-dupe on the client side, integration with VMWARE, faster backups, reduced network traffic, higher hardware cost, higher software cost if backing up large amounts of data (several TB) and has a scalability option.
Quantum: Best for adding to existing backup infrastructure, client software is not included, de-dupe is on server end, backup time is limited by speed of network/servers, flexibility, and lower hardware cost.
→ Read More...
MacWorld 2011 is currently at Moscone Center from January 27, 2011 through January 29, 2011. This year they consolidated everything into the Moscone West Hall, which makes is very convenient for attending the conference and the exhibit hall.
Users Conference
If you are a new Mac user or love learning new technologies, the Users Conference at MacWorld is an excellent venue. There are a number of tracks including: Mac OS Skills, Creative Skills, Photography, iPhone Tips and Tricks, iPad usage, Small Business, and Education. The presenters so far have been very good and knowledgeable with the topics they present. One of the highlights for me was attending the Kyle Lambert presentation on the process he uses to create artwork on the Mac, iPhone, and iPad. It was amazing how the iPad can be used to create such detailed artwork vs. software on a computer. Apps such as Brushes are paving the way to make the iPad a canvas for digital artists. (Reason #1)
→ Read More...
If you encounter the following error in Debian Lenny while installing Sun-Java-6:
This package is an installer package, it does not actually contain the
JDK documentation. You will need to go download one of the
archives:
jdk-6u12-docs.zip jdk-6u12-docs-ja.zip
The quickest way to fix this is to go to the Sun/Oracle Website and download the latest version of the jdk documentation. Place the file in the /tmp folder.
http://java.sun.com/javase/downloads/
If you ever have the need to find the answer to the following:
One of the quickest ways to find out MySQL reporting stats is using PHPMyAdmin. The software is usually installed on a number of servers by default, so its just a matter of locating where in the program to find this info.
This is an example of what the stats look …
→ Read More...Drupal 7 has been released. There are a number of improvements to the system with this release including a new administrative interface, built-in custom content structure (it was a previously a plug-in), improved performance, and an automated testing framework built-in.
For more information, visit the Drupal website: http://drupal.org/drupal-7.0
There are also Drupal release parties on January 7, 2011. http://www.drupal7releaseparty.org/
→ Read More...There is currently a bug in PHP 5.2/5.3 for certain numbers to take up all system resources in a 32-bit system using the x87 instruction set (Most Intel/AMD boxes use this instruction set). Systems running 64-bit operating systems are not affected by this bug.
You can test whether your system is running 64-bit by typing the following command in a shell window:
uname -m
If you see i386, you are running a 32-bit server. Listings with x86_64, or amd64 denote a 64-bit machine.
→ Read More...