Sunday, September 2, 2012

SpringSource STS Install under Linux gives NullPointer / Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.



Run these 2 commands if you get an error like the one shown below:
[user@domain ~]$ chmod 644 .Xauthority 

[user@domain ~]$ export XAUTHORITY=~/.Xauthority 

[user@domain Downloads]$ sudo sh spring-tool-suite-3.0.0.RELEASE-e4.2-linux-gtk-installer.sh
[user@domain Downloads]$ chmod 600 ~/.Xauthority 


Error during install:
[user@domain Downloads]$ ls
spring-tool-suite-3.0.0.RELEASE-e4.2-linux-gtk-installer.sh
[user@domain Downloads]$ sudo sh spring-tool-suite-3.0.0.RELEASE-e4.2-linux-gtk-installer.sh
[sudo] password for user: 

*******************************************************************************
*                               Welcome to the                                *
*                    SpringSource Tool Suite 3.0.0.RELEASE                    *
*                                  Installer                                  *
*******************************************************************************

 preparing the installer... done
 starting UI installer. please follow instructions on screen...X11 connection rejected because of wrong authentication.
java.lang.NullPointerException
at javax.swing.MultiUIDefaults.getUIError(MultiUIDefaults.java:133)
at javax.swing.UIDefaults.getUI(UIDefaults.java:759)
at javax.swing.UIManager.getUI(UIManager.java:1000)
at javax.swing.JOptionPane.updateUI(JOptionPane.java:1878)
at javax.swing.JOptionPane.<init>(JOptionPane.java:1841)
at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:859)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:668)
at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:639)
at com.izforge.izpack.installer.GUIInstaller.showFatalError(GUIInstaller.java:138)
at com.izforge.izpack.installer.GUIInstaller.<init>(GUIInstaller.java:129)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.izforge.izpack.installer.Installer.main(Installer.java:118)
Exception in thread "main" java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable.
at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:62)
at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:178)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:142)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:186)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
at sun.swing.SwingUtilities2.isLocalDisplay(SwingUtilities2.java:1393)
at javax.swing.plaf.metal.MetalLookAndFeel.initComponentDefaults(MetalLookAndFeel.java:1563)
at javax.swing.plaf.basic.BasicLookAndFeel.getDefaults(BasicLookAndFeel.java:147)
at javax.swing.plaf.metal.MetalLookAndFeel.getDefaults(MetalLookAndFeel.java:1599)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:530)
at javax.swing.UIManager.setLookAndFeel(UIManager.java:570)
at javax.swing.UIManager.initializeDefaultLAF(UIManager.java:1320)
at javax.swing.UIManager.initialize(UIManager.java:1407)
at javax.swing.UIManager.maybeInitialize(UIManager.java:1395)
at javax.swing.UIManager.getInstalledLookAndFeels(UIManager.java:410)
at javax.swing.UIManager.installLookAndFeel(UIManager.java:453)
at com.incors.plaf.kunststoff.KunststoffLookAndFeel.<init>(KunststoffLookAndFeel.java:58)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.izforge.izpack.installer.GUIInstaller.loadLookAndFeel(GUIInstaller.java:532)
at com.izforge.izpack.installer.GUIInstaller.init(GUIInstaller.java:158)
at com.izforge.izpack.installer.GUIInstaller.<init>(GUIInstaller.java:120)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.izforge.izpack.installer.Installer.main(Installer.java:118)
 done
 cleaning up... done

*******************************************************************************
*                         For more information vist:                          *
*                  http://www.springsource.com/products/sts                   *
*******************************************************************************

Friday, July 20, 2012

Banana/Blueberry Bread Recipe

Makes  9" square pan:

Preparation Time: 30 minutes
Baking Time: 30 minutes

3/4 cup softened unsalted butter
1/2 cup sugar
2 eggs
2 cups flour (I use King Arthur light whole wheat)
1 tsp baking powder
5 banana's mashed
1 cup blueberries mashed

  1. In a large mixing bowl add butter and sugar, mix. Add eggs, make sure you mix well.  If the butter was melted in a microwave, make sure the butter temp isn't too hot or else the eggs will cook which is bad.
  2. Add  banana's and blueberries, mash.  I use a potato masher in the bowl with the butter and sugar.
  3. Add flour and baking powder (others recommend that this be done separately, but I'm lazy and try and mix it all in one bowl).  If the baking power is unevenly mixed, you'll get poorer results.
  4.  Coat the pan with (spray) shortening
  5. Bake at 350 (my oven isn't perfect so I use 360) for 40 minutes (or until a dipped toothpick comes out clean) 
Came up with this recipe yesterday 7/19 on the fly and came out great. Got a thumbs up from the kid crowd as well.

Tuesday, July 10, 2012

Cold Spring Travel Distances and Times to Manhattan. 


Red Light in Cold Spring to 87 (Nyack) is 27.3 miles and takes 32 minutes with no traffic.


Red Light in Cold Spring to George Washington Bridge is 44.2 miles and takes 48 minutes with no traffic.  To the tip of Manhattan it's 46.4 miles and 53 minutes.


Red Light in Cold Spring to Manhattan to 18th St and 9W is 56.2 Miles and takes 1 hr 10 minutes without any traffic. With light traffic on the 9W, it takes 1 hr 33 minutes.



Data is as follows:
ExitTimeMilesTraffic
Cold Spring Light (start)7:310N
Palisades 137:57
98:0327.360
N8:0831.560
48:123664
28:1438.964
18:1944.264
GWB8:2446.464
Cross Bronx 138:2649.3N
W95th8:3052N
798:3152.7N
428:3454.7N
308:3655.2N
188:3855.9N
9th Ave8:4056.2N
18th & 8th (end)8:4156.4N
16th & 8th (start)18:0458.2N
Boat Basin18:1861.4N
96th18:2562.3N
125th18:3263.540
135th18:3765.2slow
GWB18:4667.7ok
9E19:0686.4ok
1519:1696.6fast
Garrison Lib19:30110.1fast
Cold Spring Light (end)19:37114.1fast

Wednesday, March 14, 2012

Free Web Site Monitoring Utility Using Google Docs



I found a very cool web site monitoring utility today and set it up on my account.  I take no credit for this other than to help explain it a little better.  Here is the author's site:

http://joeriks.com/2011/05/17/coding-my-own-automated-web-page-tests-with-google-apps-script-and-a-spreadsheet/

Updated 7/20/2012: Added another column so a single error doesn't trigger an email now the URL must fail twice in a row before an email is sent out.

The instructions were good, but not perfect so here are some improvements to help you along.

Create a new Google Spreadsheet as follows:


Then, Add columns A, B, and C.  Notice that you can check the response-code, and look if text exists in the  response or if text doesn't exist as shown by these examples:


Choose the script editor (later you can view your scripts with the script manager):

Paste in the code

Rename the script

Give it a name and then hit the save button

Now you can test that it runs.  Click the Run/checkUrls function as shown:

Now you have to authorize that the script is allowed to email and update the spreadsheet.  Hit authorize:

If another confirmation comes up, just close it.   Click the Run/checkUrls function again:


Now you can close the script tab (or window) and go back to the spreadsheet window and you should see the spreadsheet (notice that I hovered over column E to show the contents of what was captured):


Now click Resources/All your triggers... and then add new trigger on the window that follows.

Add a trigger as shown (time-driven).  This will allow the script to run continually and update the spreadsheet when it's not open in a browser (very cool!).  Save it and...
That's it!  You now have a functional spreadsheet which will monitor all of your websites and email you if there is an issue.

Here's the code I used for this sample which comes 99% from  http://joeriks.com/2011/05/17/coding-my-own-automated-web-page-tests-with-google-apps-script-and-a-spreadsheet/ .   I implemented this as is with a change to remove the "ERROR" checking which was causing unnecessary error to be emailed AND a change to email more information about the error (including the response code i.e. 200 or 404 and the actual response text (which is useful to find out what went wrong).

Enjoy.

Code follows:

function isCellEmpty(cellData) {
  return typeof(cellData) == "string" && cellData == "";
}
 
function checkUrls() {
 
  // The code below iterates over rows in a sheet and uses the value in
  // column A as an url, requests it and puts the response code in column B
  // and the request string as the comment
 
  var doc = SpreadsheetApp.getActiveSpreadsheet();
  var cell = doc.getRange('a1');
  var mailMessage = "";
 
   
  // leftmost resultcolumn
   
  var resultColumn = 3;
 
  cell.offset(0,resultColumn).setValue(new Date());
  cell.offset(0,resultColumn+1).setValue("Content type");
  //20120704 mhf
  cell.offset(0,resultColumn+2).setValue("Success Prior Run?");
  cell.offset(0,resultColumn+3).setValue("Success?");
  cell.offset(0,resultColumn+4).setValue("Seconds");
  cell.offset(0,resultColumn+5).setValue("Comment");
   
  for (var i = 1; i < 20; ++i)
  {
    var cellData = cell.offset(i,0).getValue();
    if (!isCellEmpty(cellData))
    {
 
      var command = cell.offset(i,1).getValue();
      var optionData = cell.offset(i,2).getValue();
      if (optionData=="") optionData="{}";
      var options = Utilities.jsonParse(optionData);
       
      var hasError = false;
      var startTime = new Date();     
       
      if (command=="" | command=="GET")
      {
 
        var responseCode = 404;
        var requestContentText = "";
        var results = "";       
        var headers;
        var requestType ="";
        var contentType = "";
         
        var expectedResponseCode = 200;
        if (options["response-code"]!=undefined)
          expectedResponseCode = options["response-code"];
 
        try
        {
          var response = UrlFetchApp.fetch(cellData);
          responseCode = response.getResponseCode();
          requestContentText = response.getContentText();
          headers = response.getHeaders();        
          if (headers!=undefined)
            contentType=headers["Content-Type"].toLowerCase();
        }
        catch (e)
        {
          requestContentText = e.message;
        }
                 
        cell.offset(i,resultColumn).setValue(responseCode);
        if (responseCode!=expectedResponseCode)
        {
          hasError = true;     
          results += "Expected response code: " + expectedResponseCode;
        }
         
        if (contentType.indexOf("html")!=-1)
          cell.offset(i,resultColumn).setComment(requestContentText);
        else
          cell.offset(i,resultColumn).setComment("");
         
        cell.offset(i,resultColumn+1).setValue(contentType);
         
        // print results in column
        var colOffset = resultColumn+5;
         
        //// not contain the word ERROR
        //var containsError = (requestContentText.toLowerCase().indexOf("error") != -1);
        ////cell.offset(i,colOffset).setValue("Error: " + containsError);
        //if (containsError)
        //{
        //  results += "Error found. ";
        //  hasError = true;                     
        //}
         
        if (options["should-contain"]!=undefined)
        {
          // not contain the word ERROR
          var shouldContain = options["should-contain"].toLowerCase();
          var doesContain = (requestContentText.toLowerCase().indexOf(shouldContain) != -1);
          if (!doesContain)
          {
            results += "Not found: " + options["should-contain"] + ". ";
            hasError = true;                     
          }
           
        }
 
        if (options["should-not-contain"]!=undefined)
        {
          var shouldNotContain = options["should-not-contain"].toLowerCase();
          var doesContain = (requestContentText.toLowerCase().indexOf(shouldNotContain) != -1);
          if (doesContain)
          {
            results += "Found: " + options["should-not-contain"] + ". ";
            hasError = true;                     
          }
           
        }
        cell.offset(i,colOffset).setValue(results);
         
      }
       
      // timer       
      var endTime = new Date();     
      var timeDiff = endTime-startTime;

      // set the prior success column 20120704 mhf
      cell.offset(i,resultColumn+2).setValue(cell.offset(i,resultColumn+3).getValue());
      cell.offset(i,resultColumn+2).setBackgroundColor(cell.offset(i,resultColumn+3).getBackgroundColor());
      // success? (no errors)
      cell.offset(i,resultColumn+3).setValue(!hasError);
      // Only show an error if it happens 2 times in a row
      var priorStatus = cell.offset(i,resultColumn+2).getValue();
      var currStatus = cell.offset(i,resultColumn+3).getValue();
             
      if (hasError && currStatus == false && priorStatus == false)
      {
        cell.offset(i,resultColumn+3).setBackgroundColor("red");
        mailMessage += "ERROR on " + cellData + "\n" +
          results +
          " actual response code: " + responseCode + "\n" +
          "request content: " + requestContentText + "\n";
      }
      else
        cell.offset(i,resultColumn+3).setBackgroundColor("green");
       
      // time spent (in seconds)     
      cell.offset(i,resultColumn+4).setValue(timeDiff/1000);
       
 
    }
    else
    {
      break;
    }
  }
  if (mailMessage!="")
  {
    MailApp.sendEmail("spam@mitchellfeinstein.com", "ERROR on your web ", mailMessage);
  }
   
}
 
function getTime()
{
  var startTime = new Date();
  Browser.msgBox(startTime);
  var endTime = new Date();
  var timeDiff = endTime-startTime;
  Browser.msgBox(timeDiff);
}




Friday, February 24, 2012

Working from Home - Reasons

I'm compiling a list of reasons working from home (now called telework).  This can be used when a manager asks why working from home is a good idea.    Primarily this is technology based, but it could be used by almost anybody who can do their job from home.  Additions / deletions comments would be appreciated.

Teleworking Benefits for the firm:
  1. Increased Productivity through fewer interruptions and less commuting time,
  2. Improve Continuity of Operations to help ensure that essential functions continue during emergency situations
  3. Increases employee morale,
  4. Conserves energy,
  5. Helps preserve our environment,
  6. Reduces walk up distractions,
  7. Reduces traffic congestion,
  8. Enhances recruitment and retention of employees.
  9. Savings on office space (others can share remote workers desks),
  10. Improved Employee Retention,
  11. Start time and end time is usually longer when working from home as there is no 3 hour commute,
  12. Delays in transit do not affect the start time.

Teleworking Benefits for the Team:
  1. Increased Productivity through fewer interruptions and less commuting time,
  2. Increases employee morale,
  3. Improved Employee Retention,
  4. Start time and end time is usually longer when working from home as there is no 3 hour commute,
  5. Delays in transit do not affect the start time and end time.  Sometimes issues come up during the commute when there is no computer access.  Working from home alleviates this issue,
  6. Over time, the team will probably become more distributed with more member in other countries so having the team work remotely helps prepare the team for this eventuality,
  7. Improve Continuity of Operations to help ensure that essential functions continue during emergency situations

Teleworking Benefits for Me:
  1. I have a home office which has better equipment and is more ergonomically setup than  my office.
  2. Commuting time.  Delays in transit do not affect start time.
  3. Improved balance of work/family life,
  4. Increases employee morale.

Monday, October 10, 2011

Optimum Online Docsis 3.0 Ariss Modem

A few months back, I started having internet speed problems at night.  Primarily after 6PM and before 12AM.  The phone techs all seemed to think getting 2Mbps was way too slow and would send a tech out to investigate.  The first few times, they changed cable (running a new line to the house, changing some cable in the house, etc.) but alas it did not fix the nightly problem.


Finally, after months of complaining to Optimum online and having techs come to the house to discover "nothing" wrong, I read that sometimes these new 3.0 modems work much better so I got optimum to provide a new cable modem.
Arris TM802 Manual
and so far this new modem has been providing speeds like I've never seen before.  I've seen 20Mbps regularly and have been very impressed. The only downside is the Upload speeds are definitely lower.  With my old Motorola Surfboard modem, I was getting 2Mb/s up consistently and 2Mb/s - 10Mb/s down.  Given my speed issues, I'll happy with this setup.






It also appears to have a battery slot in the bottom (for which Cablevision did not provide a battery).


If anyone knows a backdoor into the modem's diagnostics, I'd like to post that here.


So, if you've been having speed issues like this, I think the first thing I'd try is to get one of these new modems!  


Leave feedback if this has worked for you to let others know.





Friday, September 2, 2011

Setting up a Monoprice 8070 router as a gateway (repeater).

I needed to extend my network to the outside of my house so was looking for an inexpensive way to do this when I came across the Monoprice 8070 router.  


It had all the features of a modern router for $30 bucks so I decided to try it.


Built in to the router is a mode where you can set it up as your primary access point and have it connect to another wireless network (hence creating another network in your house) but I could not get this mode to work even after working with Monoprice's technical support.  I had already filled out the RMA form but had not hit send yet.  The voice in my head was saying: "You should have bought the brand-name router and this never would have happened."  BUT just at that point and 4 hours working with the monoprice technical support folks, they suggested what I really needed was to use the Gateway functionality of the router which turns the router into a repeater.  This extends the network (which is really what I was trying to do anyway).  So I gave it a shot, and it works great!  I wish I had known all of this before I started and could have saved myself 8 hours of frustration.  Here are the details:




To get the Monoprice 8070 router to work as a repeater follow these directions.
This assumes you have another wireless router in place that the monoprice router will get it’s internet connection from.
Step 1:
Disconnect your existing connection from your computer (this might mean disconnecting an ethernet cable, or disconnecting from the wireless lan)
Step 2:
Plug in the Monoprice router with a cable into port #1 and your computer
Step 3:
Use Firefox (or equivalent) and go to http://192.168.0.1
Step 4:
Use the Wizard it recommends
Wizard Step 1: Select Bridge
Wizard Step 2: Put in the appropriate time zone.
Wizard Step 3:  Note:  Make sure your old network is setup on 192.168.0.1 (which is the same as the default value here).  
Wizard Step 4:  The old router should be running with DHCP enabled so you can leave the default here.
Wizard Step 5:  Change the band to match your old router’s setting.  Change the mode to Client (this is the important part) AND the SSID to match your old network’s SSID.  The rest are defaults:
Wizard Step 6: Change the encryption to match what was on the old network.  Mine is WPA2(AES) with a long pass phrase.


One thing to note, is that using a repeater in this way reduces the maximum throughput of the network by half (the repeater has to waste bandwith reading from the network and rebroadcasting that traffic).  As these routers max throughput is close to 300Mbps this shouldn't be much of an issue with a "normal" 10Mbps connection.


Let me know if this works for you.


WRITERS FINAL NOTE:  
The main reason I got the router was to attempt to extend the network's reach in my house.  


I eventually gave up on this router and went back to my D-655 D-Link router.  I had 3 issues (1) the router seemed to be rebooting randomly, but mostly when i was using the admin pages, and (2) it didn't seem fast enough and (3) I got tired of spending time trying to make this router work. I probably got a bum unit and I'm sure Monoprice would have rectified the situation as they were really trying to make this router a success in the marketplace.  


The Monoprice router did have better range than the D-Link router so I decided to try and take swap the Monoprice and D-Link Antennae to see if the range of the D-Link would be extended and, to my surprise, it worked!  I had the same range at the Monoprice router.  So in the end, I got what I wanted just not in the way I wanted it.    YMMV.