Emails Not Updating – Solved

As my wife and I transitioned to having several Apple devices, all with email capability, I noticed emails were not updating. I was finally able to solve this!

As we each got more computing devices the problem worsened. First we had just a windows machine, each, with many email accounts. Then we got iPhones and read and sent email on our iPhones. Then we got iPads and added more email sending and receiving. And, recently, we switched to Mac Pros. And, during the transition we were using email on both our windows machines and our Mac Pros. All totaled, we probably had about 10 email accounts, each. And, each of us was trying to have email clients have sending (SMTP) accounts on 4 devices each and receiving (IMAP) on 4 devices each. That means there were possibly 2 (people) x 10 email accounts x 4 devices x 2 (send and receive ports) = 160 simultaneous possible connections.

Almost all of these accounts were on a single VPS (Virtual Private Server) I have for all of our domains. That meant this one VPS server was trying to handle over 100 email ports at the same time.

In looking at the WHM panel on my VPS I found several settings for maximum connections for email. Some were maximums for a single IP address. Since we were trying to do all of this email from our home office, that meant all of these were trying to come from the same IP address. Changing the WHM email maximum settings from 30 to 250 solved our problem. Now all the devices are able to update their email at the same time!

Here is a picture of the WHM at “Home »Service Configuration »Mailserver Configuration”

WHM Screen Shot to Configure Email Port Maximums
WHM Screen Shot to Configure Email Port Maximums

Limited Access Internet Connection on Windows and Vagrant

I had a problem with my wireless internet connection on Windows last night. Although I could list, and even connect with, various WiFi portals, there was no connection to the internet. I would get a “Limited Access” message on my selected WiFi connection.

It turns out it was my Vagrant VM that was causing the problem. Sometime before I noticed the problem I remember having some problems with my Vagrant VM. I remember trying to start up Vagrant and being told that a copy was already started. Since the current copy of Vagrant was not responding I remember doing a ‘kill -9′ on the process to get the old one stopped. My guess is that this left my computer in an odd state. (If a reader has other guesses as to what caused your problem, please let me know.)

In any case this is how I got it working again. First go to:

Control Panel > Network and Sharing Center > Change Adapter Settings

Right click on the connection you are having a problem with. In my case it was “Wireless Network Connection”. On this menu select “Properties”.

You should then see something like this:

Wireless Network Connection Properties

Notice there is a line here that says “Virtual Box Bridged Networking Driver”. This is Vagrant watching the connection, is my guess.

When I unchecked the box in front of “Virtual Box Bridged Networking Driver” my internet connection started working again.

Now at this point I started using Google to find out what was going on. I never found a solution or reason. After searching I rechecked the box. And everything started working again.

I should note that I did not have Vagrant running at the time. I was on a clean reboot.

I also found that Vagrant had the same problem on my hard-wired connection (called “Local Area Connection” on my computer). So I needed to un-check and re-check the box on this one, too. You may find that Vagrant has affected a number of your internet connections that you will need to reset.

Cut and Paste Using Cixwin or Cygwin

I have been using Cixwin (which uses Cygwin) to allow me to access xterm to my Vagrant virtual machine. Everything has been working fine. The challenge I was having was to cut and paste from Windows to my xterm. I tried searching Google many times for the answer. This time I figured it out, so I want to share it…

To copy from Windows to xterm window:

(1) Select the text in the Windows window
(2) Use the copy command (e.g., Cntl-C)
(3) click on the xterm window (paste will occur at current cursor location in the xterm window)
(4) Use the Cygwin paste command (Shift-Insert)

To copy from xterm window to Windows:

(1) Select the text in the xterm window [Just selecting the text actually does the copy command, by the way]
(2) Click on the Windows window where you will be pasting your text
(3) Place your cursor where you want your paste to occur
(4) Use the paste command (e.g., Cntl-V)

This saves much typing and copy errors. Hope it helped you, too!

Tools for Creating RegEx Expressions

In my Ruby class on Saturday we learned about two websites that can help you develop your RegEx expressions. Rather than develop and test code again and again these websites allow you to create a RegEx expression and test it against various strings and see the results. Much quicker!

The first website is http://regexpal.com/

The second is http://rubular.com/

Rubular.com will even give you an example RegEx to work with!

Try them out!

Improving your ‘irb’ experience

The interactive ruby (irb) interpreter allows ruby coders to try things out in trial ‘sandbox’. It is great for typing in a few ruby commands and get a result. For example you can just type in:

> 2 + 3
=> 5

and it gives you the result right away!

Each time you enter irb, the slate is clean. So, if you have to enter several ‘require’ commands, for example, they have to be typed in each and every time.

Fortunately, irb has a configuration file to makes things easier for you! Let’s say you are testing a new Class that you are writing. And, every time you enter irb you need to type “require ‘./my_new_class'”. You can add that line to your .irbrc file and the file will be read by irb each time you start up irb!

But the fun doesn’t stop there. You can colorize your irb! Try out the following commands in your irb. Or, better yet, just add them to your .irbrc file:

require 'rubygems'
require 'wirble'
Wirble.init
Wirble.colorize

You can also create some quick use commands by creating an alias. Here we add the following line to our .irbrc file so we can just type ‘q’ to leave irb, rather than having to type ‘exit':

alias q exit

Another cool trick you can do is to customize new methods for irb. Most rubyists already know that in irb you can ask for a list of all the methods that can be used on an object. For example, here we ask for all the methods that can be performed on a text string:

> “some text”.methods

This, of course, list ALL the methods that can be used against a string INCLUDING all the methods string inherited from object. Usually we don’t care about all those extra methods that were inherited. So we can add a method to the object class to give us methods, but not the methods from the object class. Try adding this to your .irbrc file…

class Object
  # Return only the methods not present on basic objects
  def m?
    methods = (self.methods - Object.instance_methods).sort
  end
end

Now, whenever we are in irb, we can just type:

> “some text”.m?

and we will bet back a list of methods that can be used on a string, and they will be sorted.

I hope you enjoy these tricks!

Special thanks go out to the Jeffrey Matthais at Boulder Ruby Group meeting who taught these great tricks!

The Git Working Directory, Staging Area, and Repository

On Saturday (2/8/2014), we learned about Git (http://git-scm.com/).  Git is a distributed version control system (http://en.wikipedia.org/wiki/Revision_control).

Git works with three levels of files in the process of modifying one’s files.  These three are:

  1. The Working Directory
  2. The Staging Area, and
  3. The Respository

The Working Directory

This is where you work with your files as you are updating them.  This is on your local machine.

The Staging Area

As you work on your files (and modify them), you will eventually get to a point that you believe you have a version of the file you will want to save in the repository.  In Git, you use the ‘git add’ command to move a particular file into the Staging Area.

Normally, though, you will have a group of files that interact together.  So, you will not want to put individual files into the repository.  Rather, you will want to move the group of files that mean something together, all at once, to the repository.  An example of this would be a program module that has several objects included in the module.

Anyhow, as you ‘git add’ various files, to the Staging Area, you are getting ready to commit the group of files (or the single file, if you have only one) to the repository.

The Repository

The Repository is where all the files for your system (or whatever collection you have) are kept.  When you have your files at a point where you want to save them all you will do a ‘git commit’.  This will move the group of files (all the ones moved to the Staging Area) into the repository.  You will also give a textual label to this update to the repository so you can know what this version was all about!

There are , of course,  many more aspects of the Git system.  This article is only talking about the three levels of working files in the Git system.

Ruby on Rails

I started an Advanced Ruby on Rails (RoR) class on Monday, February 3rd.  Part of our class was to create a blog so that we could share our technical knowledge.  This is the start of that.

I hope you enjoy our ride on the Rails!

Tom