Search This Blog

Wednesday, June 19, 2013

Checking your outgoing mail server (Is Port 25 blocked?)

Checking your outgoing mail server (Is Port 25 blocked?):

'via Blog this

In a comment Prompt:
telnet example.com 25

or

telnet example.com 587


If unblocked...
220 cl34.gs01.gridserver.com ESMTP Exim 4.63 Tue, 24 Jun 2008 13:45:04 -0700
If blocked...
Trying 64.13.192.208... telnet: connect to address 64.13.192.208: Connection refused telnet: Unable to connect to remote host

Saturday, June 8, 2013

Two questions about the modern Internet?

Why does every browser now hate the Home button?

  - I know why Google hates the home button by why does everyone else follow suit. Too bad, Chrome on many levels is a the best browser out there but Google's business models will eventually render Chrome useless.

   - Mozilla thinks they are smarter than everyone or they are smoking alot of something during UI design sessions.

    - Apple who cares... the moment a major browser release broken basic http authentication I was done.  Apple almost had to produce the iPhone and iPad because no one in their right minds would say I want to develop a web app for Safari.

 - Microsoft - IE9/10 does not suck. But still IE has its challenges, try create ASP.NET/MVC app that shows embedded PDFs also use html dialogs watch the job of staying in focus.  Opposite behavior of everyone else.  

Why can't I find a file sharing site allows me to share a file with URL and then allow the file to be downloaded with a simple WebClient?

  - Skydrive - No.  I tried to use SkyDrive 5 years ago. No Published API at the time, constant UI changes, and file linking schemes.

  - DropBox - You think so...  until some actually uses the link.  DropBox, you're done you just don't know it yet.

  - All of the various sites hosted for nefarious but legal file sharing....
 I just can't do it...  

A thief is always a liar first...Can't trust a user agreement or mission statement for  sites used primarily dumping ground for porn and photos of ex-wives and girl friends.
     Yes includes you Tumblr and Flickr...

Maybe for my next rant, I'll discuss how blogger is now the walking dead....

Wednesday, March 27, 2013

Find open ports in Windows


From http://www.techrepublic.com


Microsoft Windows XP
Microsoft Windows also offers anetstatcommand that can be executed from the command line to get a list of open ports. The standard MS Windows version ofnetstatis slightly more limited than its Unix-like system counterparts, but still suffices to get a listing of listening services:
  netstat -a | find "LISTENING"
The output of this command should look something like this:
TCP    hostname:epmap           hostname:0               LISTENING
TCP    hostname:microsoft-ds    hostname:0               LISTENING
TCP    hostname:10110           hostname:0               LISTENING
TCP    hostname:netbios-ssn     hostname:0               LISTENING
. . . with “hostname” replaced by the system’s hostname, of course.

Saturday, March 16, 2013

Path.Combine() - this is just stupid....

In my DRC project, I found a bug specifically caused by incorrect file path.

My approach was the Base folder path in my app.config / Settings and then use relative paths for all the resources  I need to store in a database.  Seems like a solid plan.   Actually, been using this approach for 10+ years now... what went wrong?

Recently, I've been using Resharper tool to tighten up my code.  During my review of the code, I found where I had some manually concatenated paths using string.Format().  With an eye to porting my application to iOS or Android using Mono, I thought building paths from simple strings simply won't do.  Better to use System.IO.Path.Combine() right?

Wrong!  After converting this code to use Path.Combine() errors occurred.  Impossible I thought, the paths are correct.  I found this issue on StackOverflow:


Why Does Path.Combine not properly concatenate filenames that start with Path.DirectorySeparatorChar

In my testing I found this:

Path path + subfolder + file name

System.IO.Path.Combine(@"C:\DRC_Data","USA","48cnty.dbf")
"C:\\DRC_Data\\USA\\48cnty.dbf"   - PASS


System.IO.Path.Combine(@"C:\DRC_Data\","USA","48cnty.dbf")
"C:\\DRC_Data\\USA\\48cnty.dbf" + PASS


System.IO.Path.Combine(@"C:\DRC_Data",@"USA",@"\48cnty.dbf")
"\\48cnty.dbf" - FAIL



System.IO.Path.Combine(@"C:\DRC_Data\",@"\USA","48cnty.dbf")
"\\USA\\48cnty.dbf" - FAIL


System.IO.Path.Combine(@"C:\DRC_Data\",@"USA",@"\48cnty.dbf")
"\\48cnty.dbf" = FAIL


System.IO.Path.Combine(@"C:\DRC_Data\",@"\USA\",@"48cnty.dbf")
"\\USA\\48cnty.dbf" - FAIL

Now, I'm not going to declare Path.Combine() useless for building paths with relative elements but there needs to a an option set for Path.Combine() does not assume every element that starts with a backslash as a start of a root path.

Path.Combine() works as per spec but it's not what I would have expected either.
Bottom line, it is a helper function that should be more helpful!