Glassfish_logo.svgI manage a small application that is hosted on a single Linux virtual machine and have noticed some occasional performance and stability issues.

The server runs CentOS, MySQL and a GlassFish server. I chose GlassFish several years ago because at the time it was the only EJB3 container around, as well as being very well integrated with the NetBeans IDE.

Like most JavaEE containers, it also makes clustering and scaling easier. Continue reading

logoStashPNGI was having a problem where Stash (which was installed as a service) wasn’t starting up properly and giving me a page that made it look like there was a problem with the database.

I have a local MySQL on the same machine as the Stash server, and both that service and the Stash server are set to automatically start up. Continue reading

English: A timezone indicator showing UTC+6 Ру...

I support a web application that is hosted on a virtual private server. The application architecture is JavaEE running under GlassFish on CentOS.

Like most ISP’s, my hosting provider builds vanilla Linux boxes that can be configured with various flavors of the OS.

Out of the box these images have their timezone set to UTC, and since my end users are in California, and I’m not doing anything on the client to handle timezone conversion, the times that come up in the application are off by 7 or 8 hours (depending on whether it’s Daylight Savings time or not. Continue reading

Recently after an upgrade of my Plesk panel, my web site was down.

In fact ALL of the domains I host on that particular cloud server were not working. A quick call to 1and1’s server guys and it appeared that there was some step in the upgrade process that failed.

They had it fixed in a moment, and then went the extra step to send me the command to fix this myself in the future:

/usr/local/psa/admin/bin/httpdmng –reconfigure-all

That simple command reset all the server config files and got all of the domains working again.

A huge thanks to the 1and1 Server Support guys and Khristian Byrd specifically !!!

Enhanced by Zemanta

Screen Shot 2013-06-08 at 10.35.06 AMIf you read my previous post (WordPress Recovery), you know I’ve been writing some code to recover my old posts. It occurred to me I could take a small segment of what I’ve been doing with that code to demonstrate my approach to TDD.

Since I’m a hacker from way back, and also because I was in semi-panic mode about losing the content, I didn’t approach this task with testing in mind. Now that doesn’t always result in bad code: I’ve been doing this long enough that I can usually think through a fairly good model and code something that isn’t one long method full of inline code.

In this case however, once I had started coding, I realized again that this was an opportunity to practice coding the “right” way. I had already begun with a Maven project, and generated unit tests as I went through the process of starting to build the code, so I had at least some good functioning unit tests.

Continue reading

Homer Simpson
Homer Simpson (Photo credit: Wikipedia)

I just shot my blog in the foot, or more accurately, I didn’t follow IT 101 and back things up before making a change.

I had moved my site to be completely WordPress based a while ago, and as a result I had a bit of a convoluted setup on my server.

When I first set up my WordPress blog it was as a sub-domain of accuweaver.com, and was housed at http://wordpress.accuweaver.com/ (also aliased to http://blog.accuweaver.com/). The http://www.accuweaver.com/ site just static pages that hadn’t changed for years.

So when I finally got my blog set up to host the few static pages I had, I just changed the directory on my server to have a symbolic link to the directory where wordpress.accuweaver.com had it’s content:

  1. Removed the directory httpdocs from /var/www/vhosts/accuweaver.com
  2. Added a link in that folder to /var/www/vhosts/accuweaver.com/subdomains/wordpress/httpdocs.

This actually worked really well, since the content was only in one place, and all I had to do was change the host name in WordPress. Continue reading

I decided I’d walk through creating a new app to replace one I’ve used for years on my iPhone that no longer appears to be maintained. The app in question is called GasBag which as near as I can tell stopped being updated in 2009 (see: http://blog.jam-code.com/).

 

I could just write a quick and dirty web app to store my mileage, but I figured I’d approach this as an exercise in building an iOS application with a design first approach.

 

At a high level, what I want is an app that easily captures my mileage, and allows me to save that information somewhere that won’t get destroyed. There are a number of features that GasBag had that I liked (for instance being able to send an email with my mileage information), and a number that it doesn’t have that would be nice (like allowing me to use it for multiple cars, or to do some data capture from a gas station receipt).

 

Continue reading

After moving from a hosted Exchange service to GMail, you need to set up your email client on the iPhone so that it will receive the push notices.

To do this, you need to add a new Exchange service on the device. There’s a nice step by step of this at http://support.google.com/a/users/bin/answer.py?hl=en&answer=138740

Alternatively, you can use the standard GMail settings, on the iPhone, but my favorite approach is to actually use the GMail app from Google in the App Store. The reason I like that app over the standard iOS mail app is that it is much more of a true mobile client that takes advantage of the platform.

First get the App from https://itunes.apple.com/us/app/gmail-email-from-google/id422689480?mt=8

GMail in the App Store

 

You can do this either from your iPhone/iPad directly, or using the iTunes store on your Mac/PC.

Once you have the app installed, you need to set up your GMail accounts. Either tap “open” from the App Store page about GMail, or find the GMail icon and launch it.

On launch the app will prompt you to log into your account. For a Google Apps account, this will be the email your administrator assigned you like rob@mydomain.com, and the password that you’ve set up previously by going to http://gmail.com.GMail login

Launching the App the first time takes you to the login page, where you can type in your email address and password. Note that this is the same whether you are logging in to a GMail account or a Google Apps account, to Google they are just different users as far as mail goes.


Inbox
Once you log in, you will be shown the inbox for that account, and be able to read your email pretty easily. To navigate the folders (like sent, draft, etc), you tap on the little icon in the upper left corner that looks like a box with stacked bars.

This will cause the folders and settings pane to slide out from the left and reveal your email structure so that you can choose. Clicking on a particular folder will display that list in the same fashion as you saw with the inbox.

Folders

Additionally from this screen, you can add other email accounts by tapping on the profile area at the top of the pane, which slides the list of accounts down and changes the direction of the panel indicator at the top of the pane.

If you’ve already done this, you will see the list of accounts, and each one will be badged with the number of unread messages. Adding a new account is as simple as tapping the large plus icon and logging in. Tapping on a profile picture will switch you to that account once you are logged in.

AccountsThe little gear icon in the upper right of this corner brings up settings for you email where you can set a few things (such as vacation responder, signature, etc).

Loading new account

Once you log into the new account, you will again see the loading page, this time with the image from the new account’s name and profile image

The next time that you go to the account selection page, you’ll see a list of accounts with the icon for each badged with the number of unread messages showing so that you can easily see what needs your attention at the moment.

Google apps on the iPhone are a mixed bag, with some being native, and others not, so it’s also a good idea to set up the Apple “Mail, Contacts, Calendars” for synchronization of those things (which can use the Exchange push in the same way as an actual Exchange server).

Multiple accountsThe best way to do this is to follow the instructions at http://support.google.com/a/users/bin/answer.py?hl=en&answer=138740

First go to your settings (normally you can find this by clicking the home button on and looking for the gear icon that says “Settings”.

Adding an account to your iPhone

If you’ve previously added accounts, the “Add Account …” will appear below the existing account settings list (in my case I actually have to scroll in order to get to this button.

Tap on the add account button and you’ll be presented with the choice of types of account that you want to use. You can use GMail here, but I prefer to use Exchange simply because it pushes the information to the phone asynchronously

Exchange account iPhone

Once you tap on the Exchange button, you’ll get a new page that prompts you for the authentication information. This uses Microsoft’s autodiscover method to figure out how the account should be configured.

Account login

Type in the user name and password for your account here, and give it a description. Typically I use the name of the company that has the domain that I’m adding (for example PMI-SFBAC for my pmi-sfbac.org address).

Then click the “Next” button which should bring up the Domain screen. The only thing you need to make sure of is that the server ends up being m.google.com, and that you still have the right username and password. To continue,  tap “Next”.

Domain Settings

The final step is to choose what you want to be pushed to your phone. Generally the important ones are the contacts and calendars, since those are business related.

Choose what to push

It really doesn’t hurt to have Mail turned on as well, since that keeps your inbox in the iOS Mail app up to date, but if you’re worried about your data plan, just set up the contacts and calendars, since that is the part that the GMail app won’t really be as helpful with.