Recent Notes

Displaying notes 151 - 160
Created by meiu on October 14, 2011 14:21:39    Last update: October 14, 2011 14:22:24
This works for Eclipse Indigo. From the Help menu, select Install New Software... Select --All Available Sites-- for the Work with dropdown Enter maven in filter text Check m2e and install:
Created by Fang on October 14, 2011 13:22:38    Last update: October 14, 2011 13:25:13
You get "permission denied" if you are using JBoss repository http://repository.jboss.org/maven2 . This repository has been deprecated . The new repository is: https://repository.jboss.org/nexus/content/groups/public Maven 3.0.3 archetype weld-jsf-servlet-minimal generated pom.xml still uses the old JBoss repository, causing the build to fail.
Created by balu on October 14, 2011 10:21:08    Last update: October 14, 2011 10:21:08
Got this error while trying to start vFabric tc server : C:\Apps\vfabric-tc-server-standard-2.6.1.RELEASE>t... It's a UAC error. Need to start the command prompt with Administrator privileges: right click the shortcut and select Run as administrator . Or enable administrator rights for the shortcut: Bring up the cmd shortcut properties Select the Shortcut tab, click the Advanced button. Check Run as administrator .
Created by magnum on October 10, 2011 15:21:31    Last update: October 10, 2011 15:21:52
tcpdump is capable of capturing traffic between two hosts other than the host on which you are running tcpdump. Sometimes, you only see traffic to and from the capturing host and broadcasts from a third host. This could be that your hosts are connected by a switch , as explained by the TCPDUMP FAQ .
Created by magnum on October 09, 2011 19:53:26    Last update: October 09, 2011 19:53:50
#include <stdio.h> #include <stdlib.h> #incl... UNIXguide.net explains this option well: This socket option tells the kernel that even if this port is busy (in the TIME_WAIT state), go ahead and reuse it anyway. If it is busy, but with another state, you will still get an address already in use error. It is useful if your server has been shut down, and then restarted right away while sockets are still active on its port. You should be aware that if any unexpected data comes in, it may confuse your server, but while this is possible, it is not likely. It has been pointed out that "A socket is a 5 tuple (proto, local addr, local port, remote addr, remote port). SO_REUSEADDR just says that you...
Created by magnum on October 08, 2011 20:37:04    Last update: October 08, 2011 20:37:35
Three APIs for event based non-blocking I/O: select() select() is limited to FD_SETSIZE handles. This limit is compiled in to the standard library and user programs. poll() There is no hardcoded limit to the number of file descriptors poll() can handle, but it does get slow about a few thousand. epoll() The epoll event mechanism is much more scalable than the traditional poll when there are thousands of file descriptors in the interest set. The work done by poll depends on the size of the interest set whereas with epoll (like Solaris /dev/poll ) the registration of interest is separated from the retrieval of the events. Reference: The C10K problem
Created by magnum on October 06, 2011 14:35:20    Last update: October 06, 2011 14:35:20
The longjmp function jumps to the line where setjmp was last called. In return, setjmp returns the value passed in as the second parameter to longjmp . #include <stdio.h> #include <stdlib.h> #incl... Result: $ ./longjmp val is 0 val is 1 --> val is ...
Created by magnum on October 06, 2011 12:32:21    Last update: October 06, 2011 12:32:21
What's the value of INADDR_ANY ? You can look it up in header files, but it's equally easy to get it with a little code: #include <stdio.h> #include <arpa/inet.h> ... Output: $ ./inaddrvalue INADDR_ANY value: 0.0.0.0
Created by magnum on September 27, 2011 11:57:49    Last update: October 05, 2011 12:20:00
This procedure sets up an IPSec vpn server on Linux with Preshared Key (PSK) using Openswan . Install Openswan: # yum install openswan Edit /etc/ipsec.conf . This is about the minimum needed to run IPSec server. Instead of running L2TP on port 1701, I'm running TCP on port 8080 so that I can test the setup with nc later. # /etc/ipsec.conf - Openswan IPsec configurati... Edit /etc/ipsec.secrets . # # Preshared key for clients connecting from a... Start IPSec: # /etc/init.d/ipsec start Check status: # ipsec auto --status Monitor IPSec log: # less /var/log/secure If IPSec is running KLIPS, you should see a new nic ( ipsec0 ). There's no ipsec0 if IPSec is running NETKEY. # ifconfig eth0 Link encap:Ethernet HWadd...
Created by magnum on September 27, 2011 13:57:23    Last update: October 03, 2011 13:02:34
After an IPSec connection is established, all traffic between the network interfaces named in /etc/ipsec.conf are tunneled through IPSec. And only the protocols and ports listed in /etc/ipsec.conf are allowed. For example, if you were able to ssh to the server, after IPSec connection ssh is no longer working if port 22 is not listed. Assume that you set up IPSec tunnel between the hosts 192.168.0.1 and 192.168.0.101 , these tests will show that the IPSec connection is successfully working. Before bringing up IPSec connection If IPSec connection is already established, bring it down: # ipsec auto --down TCP8080-PSK-CLIENT Monitor server port 8080 with tcpdump ( 192.168.0.1 ): # tcpdump -i eth0 port 8080 -X On server side ( 192.168.0.1 ), listen on port 8080:...