June 29, 2011

Windows CE c# .net compact framework webException "the response did not contain an end of entity mark"

This problem usually occurs on the Compact Framework of .Net.

Just setting the HTTP ProtocolVersion of the WebRequest to version 1.0 fixed my problem:

request.ProtocolVersion = System.Net.HttpVersion.Version10;



I found this solution at this blog

Windows CE c# .Net An error message cannot be displayed because an optional resource assembly containing it cannot be found.

Copy this cab file to your CE device, double-click to install it on your CE device,and now you should have the detailed debug messages now.

If anyone is still having this issue the cab file you are looking for, for CF2 is actually in
"C:\Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE\Diagnostics"
I am running WM5 with messaing and security pack and the cab required was System_SR_ENU.CAB and not the System_SR_ENU_wm.CAB version

There is also a stack overflow question with the same answer

June 27, 2011

popular free http proxy software

1. Privoxy, block ads
2. polipo, fast light-weight proxy
3. squid, heavy-duty enterprise proxy
4. tinyproxy

All are Free and Open Source software

I use tinyproxy most of the time, and it works great.

June 20, 2011

How to use curl to upload a file

curl -F "myfile=@testfile.exe" http://123.45.5.6/test/upload.php

June 17, 2011

A fairly new comparison of openswan and strongswan

Openswan vs strongSwan


From the beginning of my VPN project, I knew about strongSwan... but I stuck to Openswan because that’s what is covered in the Openswan book I bought and read.

After perusing the strongSwan website for a few minutes, one thing became apparent: the strongSwan project has superior documentation. The comparison isn’t even close; most of the Openswan documentation hasn’t been updated in years; it often refers to Openswan 3.0 - a branch on which development has stopped for at least 3 years, if its git repository is accurate.

Additionally, when I looked at features, a few trends emerged:
  • Openswan moved in the direction of the networking industry
    • And as a result, supports aggressive mode (which the Openswan devs ask you not to use).
    • Openswan supports the legacy KLIPS IPsec kernel stack.
  • strongSwan is interested in authentication and security:
    • No surprise, given its originator provided the x.509 patch.
      • strongSwan has better support for authentication mechanisms in general
      • Supports EAP methods, including EAP-RADIUS
      • PKCS#11 smart cards
  • strongSwan only supports KLIPS on 2.4 linux kernels; if you’re running 2.6, they use the in-kernel NETKEY IPsec stack.
  • strongSwan also supports the new IKEv2 standard (and interoperates well with other IKEv2 implementations.
    • IKEv2 allows for automatic IP address assignment, DNS assignment, and routing.
    • IKEv2 is in its infancy in Openswan.
  • strongSwan aupports Mobility and Multihomed IKEv2 (also known as MOBIKE)
  • strongSwan supports additional ciphers, such as TwoFish, and elliptic curve crypto.
  • strongSwan is modular (vs. Openswan’s monolithic nature)
  • strongSwan also has IP address pools/assignment with IKEv1, which is not offered by Openswan.

With the data available to me, strongSwan looks like the clear winner. About the only thing I’ve heard about that Openswan does that strongSwan doesn’t are:
  • KLIPS/MAST on 2.6 kernels
    • This allows (with a patched & recompiled kernel) some NAT mapping that doesn’t work well with the NETKEY stack. Cases where NAT clients have the same “internal” IP address as the server, or each other have problems with NETKEY currently.
  • IKEv1 Aggressive mode: Which is something that even the Openswan developers suggest you avoid if at all possible.

June 10, 2011

Cross compile wget on Linux for Windows

GNU wget does not release binary on Windows, and it is not very straight-forward to compile for Windows, but it works great on Windows. I just compiled wget 1.12 for Windows. Please DOWNLOAD IT HERE

I did this on Debian 5.0, and I have the following mingw package installed (not https supported, shouldn't be hard to add if you want to compile the openssl):

dpkg -l | grep -i mingw
ii  mingw32                   4.2.1.dfsg-1                       Minimalist GNU win32 (cross) compiler
ii  mingw32-binutils          2.18.50-20080109-1                 Minimalist GNU win32 (cross) binutils
ii  mingw32-runtime           3.13-1                             Minimalist GNU win32 (cross) runtime

This is how to compile wget for Windows on a Linux host using the MingW32 for Linux tool chain

1. download the gnu wget source at http://www.gnu.org/software/wget/
2. tar zxvf wget-1.12.tgz;  cd wget-1.12; 
3. ./configure CC=i586-mingw32msvc-gcc AR=i586-mingw32msvc-ar RANLIB=i586-mingw32msvc-ranlib --disable-ipv6 --host=mingw32
4. change "src/config.h" to add 
           #define WINDOWS 1
           #define INHIBIT_WRAP 1
   and comment out these two lines:
           //#define HAVE_SYMLINK 1
           //#define HAVE_USLEEP 1
4.1 comment out "src/host.c" line 67
           //extern int h_errno;
5. vi src/Makefile, add "mswindows.o" to the end of the "am_wget_OBJECTS" assignment
6. search for "LIBS =", and append "-l ws2_32 -s"
7. Make

The wget.exe file is located in src/wget.exe

Enjoy!

June 8, 2011

vsftpd config file

anonymous_enable=YES
listen_port=34567
anon_root=/tmp/ftproot
run_as_launching_user=YES
pasv_promiscuous=YES
write_enable=YES
local_umask=022
anon_upload_enable=YES
dirmessage_enable=YES
xferlog_enable=NO
connect_from_port_20=YES
listen=YES

June 7, 2011

persistent ssh tunnel

MyEnTunnel

Work really well. It retries to connect after the ssh session is disconnected.

June 2, 2011

Windows CE static IP registry setting

; Enable static IP address for VMINI1
[HKEY_LOCAL_MACHINE\Comm\VMINI1\Parms\Tcpip]
"EnableDHCP"=dword:0 ; Disable the DHCP/ enable static IP
"IPAddress"="192.168.1.3"
"SubnetMask"="255.255.255.0"
Note : VMINI1 is the correct key path to point to the registry settings used by this driver.
VMINI is the adapter name

source: http://nicolasbesson.blogspot.com/2007/11/static-ip-address-for-kitl-vmini.html