January 8th, 2010
I received a new monitor for xmas and wanted to set up dual display (twinview) for Ubuntu 9.10. I already had the proprietary Nvidia drivers install, and it was very easy to get the dual monitors up and running. However, I always got this error when trying to save the configuration: Can’t parse /etc/X11/xorg.conf. And upon restarting, only one screen would show and I would have to set it up again.
Even when I launched Nvidia with sudo (sudo nvidia-settings), I still got this error on the command line:
VALIDATION ERROR: Data incomplete in file /etc/X11/xorg.conf.
Undefined Device “(null)” referenced by Screen “Default Screen”.
I moved /etc/X11/xorg.conf to a new filename, ran sudo nvidia-settings and was able to save as new xorg.conf file and now I have both monitors on start up. Also looks like you can simply edit the existing xorg.conf file and you will be able to save your settings.
Posted in Uncategorized, Ubuntu | No Comments »
December 18th, 2009
It seems like every time I upgrade Kubuntu, my sound doesn’t work anymore. I guess “doesn’t work” isn’t the right term. It seems that the output is muted. If I type pavucontrol into the command line and then go to output devices on the volume control window that pops up, the Internal Audio Analog Stereo is muted. I don’t know why the pulse audio volume control is defaulting to that setting every time I upgrade, but I fiddled around with my sound settings a couple of years ago when I was having issues and that’s likely the culprit. I think I need to do a fresh install one of these days….
Posted in Uncategorized, Ubuntu | No Comments »
December 13th, 2009
The Zend_Auth Db adapter will fail if you have more than one record returned, which makes sense. However, when I have coded something like this in the past, I would check how many records were returned with a matching username and password. Zend_Auth looks at how many records are returned for the username field regardless of whether the password matches, so you need to have a unique username field. I was trying to use a person’s last name and password to authenticate, but obviously people had the same last name, so it was failling.
Posted in Zend Framework | No Comments »
December 2nd, 2009
It’s been awhile since I had to set up a new site with Zend Framework, and I took the chance to play around with Zend_Tool_Project. Following the QuickStart guide, I had a site up and running in no time. But it did take me a little while to figure out how to get my modules and custom library working with the site.
Modules
To get modules enabled, you first need to create a module with Zend_Tool_Project, or you can manually create a modules directory and add the module folder there. If I wanted to add a module called
cms, I would create application/modules/cms or use the command line
zf create module cms.
Then, In application.ini, you need to add the following two lines:
resources.modules[] =
resources.frontController.moduleDirectory = APPLICATION_PATH “/modules”
Finally, in order to load models and views, you need to add a Bootstrap.php file in the root of the modules - i.e. application/modules/cms/Bootstrap.php. In the module Bootstrap.php, place the following:
<?php
class Cms_Bootstrap extends Zend_Application_Module_Bootstrap
{
}
?>
You should be all set with modules now. Models you create within the module will use the naming convention of Cms_Model_Foo and controllers will be Cms_IndexController (when using Zend_Tool_Project and issuing zf create controller index index-action-included=1 cms, it names the controller class IndexController instead of Cms_IndexController?)
Autoloading Custom Library
The last thing I needed was to autoload my personal library which uses the naming convention Bolton_. My custom library resides in the same folder as the Zend library and is within my include path set in php.ini. In application.ini, you need to add the following line:
autoloaderNamespaces[] = \"Bolton_\"
Posted in Zend Framework | No Comments »
November 3rd, 2009
I had a site that uses Technorati’s API via Zend Framework- i.e. Zend_Service_Technorati. I noticed I am getting TCP connection errors via an exception (Message: Unable to Connect to tcp://api.technorati.com:80. Error #111: Connection refused), and upon going to Technorati’s site to look at the API, I found out the new API is under works and the old API is available until October 25th, 2009. It is November 3rd, the old API apparently doesn’t work and the new API isn’t released. Really? Am I missing something here? TCP connection failing tells me they are rejecting completely rejecting the TCP connection, which leads me to believe they have shut off the API. Searching on Twitter confirms this, although having an existing key doesn’t seem to matter…
Posted in Zend Framework | 2 Comments »