Error 

Wordpress 2.8 Database Upgrade Loop

1 Comment, 193 views
Posted June 14, 2009 at 10:06am in General with tags ,

Last night I upgraded both of my blogs to Wordpress 2.8 and ran into a couple problems. The redirection plugin caused some problems with wp-db.php so I had to disable that to get the site back up if you upgrade redirection prior to upgrading you won’t have that problem.

The other problem I ran into was that I would be presented with a page saying “Database Upgrade Required”, after upgrading it would bring me back to the same page. The problem ended up being the wp-content/object-cache.php file, moving that out fixed the problem. However because the page was still cached in memcache moving the file back raised the same issues. The faster fix is to restart memcache all together to clear the cache.

Retrieve Gmail/GApps Message Count

163 views
Posted June 14, 2009 at 01:06am in Python with tags , , ,

Long ago I switched from using any sort of mail client to using the webmail interface of Gmail/Google Apps. This switch was really fueled by my increased usage of the interface after being hired by Google. I won’t go on and on about using the web interface, but sometimes it is nice to know how many actual emails are in your account. Google mail only shows you the number of threaded emails, not each individual response. If I look in “All Mail” for my manis@digital39.com account I see “1 – 100 of 21758″, which represents the number of email threads, the actual number of responses is 56578. FYI, this requires that you enable IMAP support for the account.

$ imap_count.py manis@digital39.com
Password for manis@digital39.com: *****
56578 messages in account manis@digital39.com

Expand the code below and copy it to a file on your system. It takes one argument, and that argument is a comma separated list of email addresses.

#!/usr/bin/python2.4
#
# Copyright (c) 2009, Peter Manis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# Neither the name of the Peter Manis nor the names of its contributors may
# be used to endorse or promote products derived from this software without
# specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import getpass
import imaplib
import sys

results = []

def RetrieveMsgCount(username, password):
  """Retrieves message count by accessing Gmail or Google Apps IMAP account.

  Args:
    username: str, Username of the account we are accessing.
    password: str, Password of the account we are accessing.

  Returns:
    count: str, Number of messages in IMAP account

  Raises:
    imaplib.IMAP4.error: Failed to login to the IMAP account.
  """
  try:
    imap = imaplib.IMAP4_SSL('imap.gmail.com', 993)
    imap.login(username, password)
    status, [count] = imap.select ("[Gmail]/All Mail")
    imap.close()
    imap.logout()
  except imaplib.IMAP4.error:
    return 'Unable to check'
  else:
    return count

def main():
  if len(sys.argv) > 1:
    accounts = sys.argv[1]
    for account in accounts.split(','):
      password = getpass.getpass("Password for %s: " % account)
      results.append('%s messages in account %s' % (
          RetrieveMsgCount(account, password), account))
    for account in results:
      print account
  else:
    print "Please provide a comma separated list of accounts to check."

if __name__ == '__main__':
  main()

Why techies get annoyed

142 views
Posted May 11, 2009 at 11:05pm in Random

Many times I hear people say how they hate when their friend gets mad at them for asking questions. I have been on both sides of this, I often get annoyed after receiving a number of questions, and I have complained about the way people have acted with me in the past. Looking back I see what I did that annoyed people and I try very hard to avoid those situations.

Continue reading

Home Office

175 views
Posted April 12, 2009 at 10:04pm in Consulting

I forgot to post this last month, and I have since acquired a couple more pieces of equipment the most impressive one being an HP DL360G5 4G RPS Performance Server. Dual QC 5345 Xeon, 16gb FB ECC RAM, 6×146gb 10K SAS SFF hard drives, in a 1U. Here is the post I saved last month. Don’t miss the recent photos at the bottom of the post.

In 2007 a friend and I both started moving out equipment to rack mount setups. We each had our own reasons, but the common reasons were saving space, organization, and it is kinda nice to say you have a rack in your house. When I was looking for a rack/cabinet I found someone a couple hours away that had a lightly used 45U fully enclosed cabinet for sale. The cabinet came with sides, doors, caster base, two shelves, four-fan unit for the top, and a $350 price tag. A few days after picking up the cabinet I spoke with him again and we made a deal that resulted in me having an entire car full (trunk full and front and back seats full to the ceiling) of equipment. I recreated an album containing the older pictures of the cabinet, and how things were organized, which can be viewed in the Rack Project album.

Continue reading

My impression of the ipod touch

171 views
Posted April 12, 2009 at 05:04am in Hardware with tags , ,

The other day I purchased an iPod touch with the hopes of having a mp3 player that did what I wanted and a platform to develop applications on. Prior to using the touch I had never used a touch screen Apple product moee than a couple minutes so I left the store wondering how many days I had to return it. That night I spent over three hours playing with the device and the apps in the store, it was very hard for me to put the device down. I love my G1, since I work for Google the integration the device gives me is very important to me and would keep me from using something else. So that being said I love how smooth the iPhone and iPod Touch are, how easy the onscreen keyboard is to use, and the amazing apps that are available. I think the G1 will get to the same point, things will obviously be different and one will have features the other one doesn’t have, but the big difference right now is device maturity. There have been things about the iPhone that people have disliked that are now being fixed and things missing from Android are being added. I enjoy having the G1 as my primary device, but I think having the touch available to do certain things is important. I have been using my touch for most of my Twittering and I am currently writing this blog post from the awesome Wordpress app in the store. The keyboard took some time getting used to but now I can type pretty fast on the device and most things I miss are caught by the auto correct. One oft big worries before buying the device was size, and how it would feel in my pocket at work. It is so thing that I don’t even notice is when I am work so I can move freely without it being this giant block in my pocket. I also don’t have it moving around in my pocket freely like smaller players might. Overall I am very happy with the purchase they won’t get me to move to an iPhone, but I support the use of the touch to complent the Android based products.