Ubuntu apt-get install failure fix

This post is to add to a search anyone trying to figure out how to fix "apt-get install" failing. This was Ubuntu 9.10, attempting to install php-pear:
apt-get install php-pear

The error was:
E: Internal Error, Could not perform immediate configuration (2) on mountall

What I did was:
cd /var/cache/apt/archives/
dpkg -i --force-depends *

Then after a bunch of output:
apt-get -f install

That did the trick! Hope this helps if you stumble upon this issue.

new release of Perl libmemcached drivers

I'm pleased to announce the release of Cache::Memcached::libmemcached 0.02011 and Memcached::libmemcached 0.4201. Cache::Memcached::libmemcached uses Memcached::libmemcached, which is a Perl wrapper for libmemcached, which is now in sync with the latest libmemcached, 0.42. This means support of binary protocol as well as other current libmemcached features. I've uploaded both to CPAN, so once the mirrors update they will be available via CPAN.

Changes in this release:

Changes in 0.4201 (svn r163) 15th July 2010

  Sync with libmemcached 0.42
  Squashed various compile warnings
  Many updates to libmemcached API calls due to API changes
  Merged existing svn tree (which was out of sync) with Daisuke Maki's official tree

As of late...

What I'm up to lately (giving love to some projects):

* Fixing bugs in DBD::mysql, just released 4.015, 4.016, and next 4.017. I had a patch sent yesterday from a user/developer that I want to get out there
* Memcached::libmemcached - 0.4201 version - now using latest libmemcached 0.42. This is the only Perl client that supports binary protocol!

patg@patg-desktop:~/code_dev/perl-libmemcached$ PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/12-set-get-binary.t
All tests successful.
Files=1, Tests=5,  0 wallclock secs ( 0.04 cusr +  0.01 csys =  0.05 CPU)


* FederatedX (in Maria) - fixing MySQL bug 32426, https://bugs.launchpad.net/maria/+bug/571200 . This involves a little work as it is fixed in Federated (not FederatedX) and FederatedX has a whole new design using an IO class to abstract database driver details as well as numerous other changes. But it will happen.

* Delving into C++ Boost libraries. These look quite useful!

DBD::mysql 4.015 Released

I'm glad to let everyone out in Perl Land know that DBD::mysql 4.015 is released. Per the changelog:

* BUG #56664 fixed t/40blobs.t skip_all logic (W. Phillip Moore)
* BUG #57253 Fixed iteration past end of string (crash). (Chris Butler)
* Added a new parameter for old behavior- mysql_bind_comment_placeholders which
  will make it possible to have placeholders bound within comments for those who really
  want that behavior.
* Fixed bind_type_guessing - always on now. Numbers will not be automatically quoted as they are now.

You can get the latest release at:


 file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.015.tar.gz
 size: 132029 bytes
  md5: 4d80bb5000b97bbfbe156140b9560c20

Also, the latest source:


Thanks for using DBD::mysql and reporting bugs!

--Patrick 'CaptTofu' Galbraith

Cleaning up OS X /core directory - path to disk liberation!

Today, I discovered where all my disk space is going. I use a Macintosh and pretty much live in either my home directory or /usr/local or /opt/local. I kept running out of space and having to move things around, 'make clean', get an external hard drive, etc. I happened to stumble upon a directory /cores:

patrick-galbraiths-macbook-pro:/ patg$ du -s cores/
79295824    cores/


Filesystem    1024-blocks      Used Available Capacity  Mounted on
/dev/disk0s2    118153176 112094368   5802808    96%    /
devfs                 107       107         0   100%    /dev
fdesc                   1         1         0   100%    /dev
map -hosts              0         0         0   100%    /net
map auto_home           0         0         0   100%    /home

patrick-galbraiths-macbook-pro:cores patg$ sudo rm -f cores/*

patrick-galbraiths-macbook-pro:/ patg$ df -k
Filesystem    1024-blocks     Used Available Capacity  Mounted on
/dev/disk0s2    118153176 71190080  46707096    61%    /
devfs                 107      107         0   100%    /dev
fdesc                   1        1         0   100%    /dev
map -hosts              0        0         0   100%    /net
map auto_home           0        0         0   100%    /home

Wow! I freed up 40GB! 

This is like Christmas!

And yes, I know, I should see why the heck I have so many core dumps going on, but for now, I'll rejoice in having some disk space!

I'm sure many of you who stumble upon this may already know this, but for those of you who don't, I hope the tip helps!

DBD::mysql 4.014 Released

It's been an extremely busy year thus far with all the great work we're doing at NorthScale as well as the release of CaptTofu 2.0 (My son Kiran!). With the new UI on rt.cpan.org, in my spare time, I went through and closed some bugs, hence a new release of DBD::mysql, 4.014. In this release:

* BUG 30033 Fixed handling of comments to allow comments that contain characters
  that might otherwise cause placeholder detection to not work properly
* BUG 53844, Fix for memory leak in stats. (Gregory Burmistrov)
* BUG 49719, Fix for handling of NULLs in prepared statements (Gert Pache)
* BUG 55627, Fix for testing failure due to strict mode (Yves)
* BUG 51784, Fix for mysqladmin on Windows in Makefile (Zeeshan Muhammad)
* BUG 41630, Typo in Makefile

There are other bugs in rt.cpan.org, hence a pending release in the next week or two. I like an empty bug list!
Thank you to Gregory Burmistrov, Gert Pache, Yves, Zeeshan Muhammad for your patches!

You can find the code at:


The file:

  file: $CPAN/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.014.tar.gz
  size: 131270 bytes
   md5: 74f118a4984e6a49f8ece28e68caf543

Also, I have moved the source repository from Subversion to Git (Github)

git clone git://github.com/CaptTofu/DBD-mysql.git

Why Github? I've really grown to like Git once my brain wrapped around it. No slight to any other system. I have DBD::drizzle hosted at Launchpad. At least now, I have to only concentrate on remembering how to use two revision control systems!

Expert PHP and MySQL published!

Expert PHP and MySQLI'm very pleased to announce the publication of my book Expert PHP and MySQL, published by Wrox. This book was written by myself, Andrew Curioso and Ronald Bradford. The short of it is, upon finishing my previous book, Developing Web Applications with Apache, MySQL, memcached, and Perl, Wiley asked me if I knew of anyone who would like to write a MySQL/PHP book. I had worked with Andrew at Lycos and found him to be a brilliant PHP developer, having been the primary developer of Lycos's Webon product-- which has some excellent usage of PHP, Javascript and MySQL. When I friend of mine Bob Wilkins, who started MyVBO, was looking for a developer I suggested Andrew (he now works at MyVBO), and for this book I also suggested Andrew. Andrew had also written a short book for O'Reilly on AJAX, so Wiley was glad to have had him as a suggestion. They came back and asked if I would lend a hand to which despite being exhausted from writing my first book, decided to contribute and work on some chapters that covered material that thought would be a great benefit to the community-- namely Gearman, Sphinx, the Memcached Functions for MySQL as well as Memcached itself. Finally, we needed someone else with MySQL expertise to add to the mix to cover more advanced MySQL information to which Ronald Bradford, who I know, like, and respect as an expert in the field, signed on also.

For me, I have been more of a Perl guy, however, I like PHP just as well and even prefer how it's web deployment model is much easier (you don't need to modify your httpd config files) was interested in a challenge of writing a book on a different language. Also, some fruits of this being that my project from my Perl book, Narada, now has a PHP port.

I'm proud of this book. It was harder in some ways to write a book with other people than do it all myself, despite far fewer pages. However, the end product took advantage of all our strengths.

Topics covered in this book are (but not limited to!):

* PHP and MySQL techniques every programmer should know
* Advanced PHP concepts such as using iterators, making classes behave like functions, using true lambda functions and closures
* MySQL storage engines
* Using the information schema
* Improving performance through caching - using memcached to add a caching layer to your application
* Writing UDFs
* Writing PHP extensions
* Using the Memcached Functions for MySQL (UDFs)
* Full text search - installing, configuring, and using Sphinx in a PHP application
* Multi-tasking in PHP using Gearman. Narada is used as an example application demonstrating how to put many of the concepts of the book into an application
* Using Apache rewrite rules
* HTTP-based authentication

All-in-all, this is a great book that I hope will benefit PHP/MySQL or any other web developers who need a source of expert information!

I want to thank Andrew, Ronald, Wiley (Bob Elliot, Maureen Spears), Trond Norbye and Eric Day (who tech-edited the book!), and all others who I could write a book in itself who have helped (see my credits in the book!). Also, I want to thank the team at NorthScale, my employer, for being able to work with a team experts who I could refer to while working on this book.

You can buy this book from any major publisher, and from Wiley at http://www.wiley.com/WileyCDA/WileyTitle/productCd-0470563125.html

bazaar is really annoying me

Ok, I have to get this off my chest. As much as I feel clueless with Git at times, Bazaar is really a PITA! Launchpad upgrades something, then my bazaar repositories are broken. This is not acceptable as a revision control tool. Then I ask people and they say "you have to upgrade bazaar". Ok, so I'm trying to do that:

patg@hanuman:~/code_devel$ bzr clone lp:bzr
Enter passphrase for key '/home/patg/.ssh/id_dsa': |
bzr: ERROR: exceptions.KeyError: 'Bazaar repository format 2a (needs bzr 1.16 or later)\n'

Traceback (most recent call last):
File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 729, in exception_to_return_code
return the_callable(*args, **kwargs)
File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 924, in run_bzr
ret = run(*run_argv)
File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 560, in run_argv_aliases
return self.run(**all_cmd_args)
File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1143, in run
File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 1142, in sprout
cloning_format = self.cloning_metadir(stacked)
File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 176, in cloning_metadir
File "/usr/lib/python2.5/site-packages/bzrlib/registry.py", line 260, in get
r = Registry.get(self, format_string)
File "/usr/lib/python2.5/site-packages/bzrlib/registry.py", line 173, in get
return self._dict[self._get_key_or_default(key)].get_obj()
KeyError: 'Bazaar repository format 2a (needs bzr 1.16 or later)\n'

bzr 1.15 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'clone', 'lp:bzr']
encoding: 'ANSI_X3.4-1968', fsenc: 'ANSI_X3.4-1968', lang: None
bzrtools /usr/lib/python2.5/site-packages/bzrlib/plugins/bzrtools [1.15]
fastimport /home/patg/.bazaar/plugins/fastimport [0.8dev]
launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [1.15]
netrc_credential_store /usr/lib/python2.5/site-packages/bzrlib/plugins/netrc_credential_store [1.15]
*** Bazaar has encountered an internal error.
Please report a bug at https://bugs.launchpad.net/bzr/+filebug
including this traceback, and a description of what you
were doing when the error occurred.

Yeah, ok. That works great.

How about this: How about they write a revision control tool that doesn't break repositories because they upgrade the @#$#%ed website?

Also, on my Mac, I can't upgrade Bazaar because the latest version is only for Snow Leopard. So, launchpad is upgraded, and people are scrambling to "fix" their Bazaar setup so they can develop their code.

I've just wasted hours trying to get this all to work. Revision control tools are meant to make people productive, not eat of their time "fixing" things.

libmemcached on Windows working!

I am so thrilled! I have libmemcached running on Windows! I've had to hack a bit with the Makefile (which is generated) and disabled some things like the 'example' directory as well as some code that's using sys/mman.h, which mingw32 does not have.

This image show the compile is successful:


I was able to run memslap (strange results, but it seems to be setting values)

Administrator@IP-0AF859ED /c/code-dev/bak/libmemcached-win32-bzr
$ ./clients/memslap.exe --servers="localhost:22122" --concurrency=1 --binary

Then to verify:

$ ./clients/memdump.exe --servers="localhost:22122"|wc -l
memdump: memcache error A TIMEOUT OCCURRED

Not sure what the timeout is about, but hey--- it's running on Windows! I'll continue investigating how to get this running better.

Stay tuned.