Thursday, January 10, 2013

.NET TcpClient: "An established connection was aborted by the software in your host machine"

My client app was getting the exception suddenly.  After a lot of hair pulling it seems that a minor change in the hostname given to the TcpClient was the culprit.  The client was connecting to a server on the local machine and got the error when using the fully qualified name (eg. machine.domain.local) of the local machine as the hostname for TcpClient.  The problem goes away when I change the hostname parameter to '127.0.0.1'.  It seems like TcpClient sockets has collision issues when connecting to localhost by the network name.

Monday, January 7, 2013

jQuery sortable Interaction

Had a simple ASP.NET MVC 4 app and decided to play with jQuery.  Tabs worked fine but 'sortable' lists and table-rows didn't drag or drop.  Turns out that I was including 2 versions of jquery-ui-xxxx.js scripts in my BundleConfig.RegisterBundles call.  took out the reference to jquery-ui-1.8.20.js and sortable worked.

Thursday, April 12, 2012

Nokia N900: Connection Problems

A couple of days ago I noticed that my N900 could no longer update the weather (OMWeather) when connected to my home wifi network.  The network connection was fine but it seemed like I had no internet connection (email, browser, ftp, etc); however, the other devices on the same wifi network had no such problem.  The strange thing was that my Skype account was logged in successfully on the N900, all my other VOIP/IM accounts reported 'Network Error.'  I switched to my 3G network and experienced the same thing: only Skype worked.  When I got to work and connected to the office's wifi, everything was fine.

The key symptom was that 'ping-ing' anything would fail on the 3G or home-wifi networks but succeeded on the office wifi-network.  A DNS problem.  The /etc/resolv.conf had been automatically changed by vpnc to point to the office's dns.  I don't know why this problem suddenly happened now, but I've commented out the entries in /etc/resolv.conf to fix the problem (for now?).

Friday, July 10, 2009

Linksys PAP2 Overheating Problem

Bought it off ebay (new, unlocked NA version) from China and all was well for about 3 weeks. Then Line-1 stopped working: no dial tone, just some popping sound when I lift the receiver. Line-2 was still OK. However, a few days later Line-2 also dies. When unplugging the device I noticed that it was very hot; so I left it unplugged until it cooled down. The cool device came back to life and all worked for about 20 minutes until it got very hot again. Did this a few times and now the Lines can access the internal AVR menu of the device but the SIP connections don't work anymore--even though the web-config shows that the SIP connections are online.

Thursday, July 2, 2009

Ubuntu: NetworkManager, VPN, Mediatomb Conflicts

Oh, the stupidity of wanting *too* much: I want mediatomb to startup at boot so that the media service will be available without any users logging-in. However, using NetworkManager to manage connections doesn't configure the ethernet adapter before mediatomb starts so mediatomb dies at startup. This is easily resolved by setting the ethernet device to autostart in /etc/networks/interfaces, but this causes NetworkManager to not show any network connections and thus you can't start any VPN connections you may have setup in NetworkManager.

OK, so let's just scrap NetworkManager and use a different interface to connect to VPN. Kvpnc seems like a good candidate so I tried that. Unfortunately the latest release of Kvpnc (0.9.0) for Jaunty does not have support for MS-CHAP v2. Probably have to wait for Karmic to get Kvpnc 0.9.1 which should support MS-CHAP v2. Shit.

Sunday, June 28, 2009

Mediatomb uPNP Streaming to Samsung 7 series LCD TV

Installed mediatomb on ubuntu Jaunty to make my pictures, music and video available to my Samsung 7 series (2008 model) LCD TV.

First problem:
The TV recognized the mediatomb uPNP server and listed all the available folders and files; however, trying to play anything resulted in a "unrecognized file format" error. I found this fix googling: you have to add a couple of elements to the custom-http-headers section in mediatomb's config.xml. Audio and pictures works after this fix.
<custom-http-headers>
...
<add header="transferMode.dlna.org: Streaming">
<add header="contentFeatures.dlna.org: DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=017000 00000000000000000000000000">
</custom-http-headers>
Reference link

Second problem:
When I got mediatomb to automatically scan my disk for media files and make them available, most AVI files were tagged with the mime-type of 'video/x-msvideo.' The TV doens't like this mime-type, so I added this element:
<map from="avi" to="video/mpeg">
in the import/mappings/extension-mimetype section. After rescanning the disk, AVI files now have a mime-type of 'video/mpeg' which the TV likes and most divx-encoded files play perfectly.

Third problem:
Some video resulted in 'unsupported video/audio codec' errors. I had already enabled mediatomb's transcoding feature and set mkv files to be transcoded using MPlayer's mencoder (google 'mediatomb samsung config.xml'). So I figured why not just transcode files that don't play nice on the TV directly. I configed files that are tagged with the mime-type of video/x-msvideo to be transcoded by mencoder as well. Then when I run across a file that won't play nice on the TV directly, I use mediatomb to set it's mime-type to video/x-msvideo. BTW, I did try transcoding using VLC but it didn't work for me; kept getting the 'unsported format' error even though VLC was doing something.

Forth problem:
Transcoding works very well except that when playing large, 720p or 1080p video, my computer couldn't transcode fast enough and you get pauses (every second or two) in the playback. But if I pause the playback, the buffer gets a chance to fill up and I get smoother video on resume. The longer the pause the more the buffer fills up and more more smooth video I get.

Wednesday, June 24, 2009

Ubuntu VPN into Microsoft Server

When creating the PPTP profile make sure to turn off all authentication methods except for MSCHAPv2. Also enable MPPE.