Browsing the blog archives for July, 2009.

MongoDB – Find Documents Missing Fields

Examples

icon

In MongoDB it is possible that some documents will not contain fields other documents have. The following code shows how to find these documents using the mongo shell.

db.collectionName.find("function() { return this.fieldName == null }")
db.collectionName.find("function() { return this.fieldName == null }").count()

The second example shows how to only get the count.

In this example. you would replace “collectionName” with the name of the collection you are interested in querying. Additionally, you would change “fieldName” to the name of the field that interests you.

No Comments

Push a Branch to Git

Tools

git-logo

I found this example of how to push a branch to Git in the GitHub documentation.

git push <remote_repository_name> <branch_name>

E.g.

git push origin master

Execute this from the base of your local repository. This pushes your local commits to the TOT.

No Comments

Chkconfig Notes

Config

linux

Chkconfig is a simple utility available on Linux that allows you to register services to start/stop on bootup and shutdown. The following are the basic commands you need to know to get things going:

chkconfig --list (lists all the commands that are registered)
chkconfig --add httpd (add httpd to the chkconfig list)
chkconfig  --level 35 httpd on (enables the httpd daemon to start on runlevels 3 and 5)
chkconfig --level 35 mysqld on (enables the mysqld daemon to start on runlevels 3 and 5)
chkconfig --level 35 memcached on (enables the memcached daemon to start on runlevels 3 and 5)
chkconfig --level 2345 sendmail on (enabled the sendmail daemon to start on runlevels 2, 3, 4 and 5)
No Comments

Internet Explorer 6 On OS X

Misc

ies4osx_256

Recently, the need arose to run IE 6 on OS X. Microsoft released IE for OS X but discontinued support in version 5.x. Fortunately, this problem has been solved by running a IE 6 on top of a Wine port on OS X. The simple steps below describe how to get this running:

It is as simple as that!

Note: Darwine requires the X11 libraries that come with OS X (not installed by default but ships with the OS X install disks).

No Comments