Recent Notes
Displaying notes 81 - 90
Created by magnum on August 15, 2012 11:34:53
Last update: August 15, 2012 11:34:53
I was scared the first time I saw a bunch of random URL requests from Chrome on my proxy server. Was the copy of Chrome on my machine hacked? It turned out that there was a "deep" reason for the behavior. From Nico Weber : If you type in a single-word search query, chrome needs to send a DNS request to check if this might be a single-word host name: For example, "test" might be a search for "test" or a navigation to "http://test". If the query ends up being a host, chrome shows an infobar that asks "did you mean to go to 'test' instead". For perf reasons, the dns query needs to be asynchronous. Now some ISPs started showing ads for non-existent domain...
Created by voodoo on August 15, 2012 11:23:44
Last update: August 15, 2012 11:23:44
By default Linux pipe output is buffered. For example, you can't see the most recent stdout on screen with tee :
$ ./mycommand | tee /tmp/mycommand.log
Here are two ways to make the pipe unbuffered.
Method 1: use the unbuffer command from expect
$ sudo apt-get install expect-dev
$ unbuffer ./...
Method 2: use stdbuf
# Make output line buffered:
$ stdbuf -oL ./myc...
Created by voodoo on August 15, 2012 09:07:41
Last update: August 15, 2012 09:07:41
$ var='variable to be truncated'
$ echo ${var#v...
Created by Dr. Xi on August 15, 2012 08:55:15
Last update: August 15, 2012 08:55:15
From Java JSSE documentation :
The generic Java dynamic debug tracing support is accessed with the system property java.security.debug , while the JSSE-specific dynamic debug tracing support is accessed with the system property javax.net.debug .
The javax.net.debug property value must specify either all or ssl , optionally followed by debug specifiers.
Examples :
To get a list of debugging options:
java -Djavax.net.debug=help MyApp
To view all debugging messages:
java -Djavax.net.debug=all MyApp
To view the hexadecimal dumps of each handshake message (the colons are optional):
java -Djavax.net.debug=ssl:handshake:data MyApp
To view the hexadecimal dumps of each handshake message, and to print trust manager tracing (the commas are optional):
java -Djavax.net.debug=SSL,handshake,data,trustman...
A detailed debugging example: Debugging SSL/TLS Connections
Created by Dr. Xi on August 13, 2012 14:54:44
Last update: August 13, 2012 14:54:44
According to wikipedia , only two characters are invalid in a file name:
In Unix-like file systems the null character, as that is the end-of-string indicator and the path separator / are prohibited.
Created by zhidao on August 09, 2012 14:44:08
Last update: August 09, 2012 14:44:08
Create a directory src/jaxws alongside src/main and create a bindings file bindingx.xml with the <serializable> customization:
<jaxb:bindings
xmlns:jaxb="http://java.sun....
Reference : JAX-WS wsimport Maven plugin documentation
Created by balu on August 09, 2012 09:36:26
Last update: August 09, 2012 09:36:26
Create the instance:
C:\vfabric-tc-server-standard-2.6.1.RELEASE>tcrunt...
Create Windows service:
C:\vfabric-tc-server-standard-2.6.1.RELEASE>tcrunt...
Start the server:
C:\vfabric-tc-server-standard-2.6.1.RELEASE>tcrunt...
Created by voodoo on August 07, 2012 12:02:33
Last update: August 07, 2012 12:02:33
This code snippet:
#include <time.h>
#include <stdio.h>
int...
generates warning at line 6:
tt.c: In function ‘main’:
tt.c:6:15: warning: i...
The problem was that the prototype for strptime was not included from time.h . Define _GNU_SOURCE or _XOPEN_SOURCE to get rid of the warning:
$ gcc -D_XOPEN_SOURCE -o tt tt.c
Created by voodoo on August 03, 2012 08:42:38
Last update: August 03, 2012 09:31:25
The C function getsockopt lets you get the error codes with the option SO_ERROR . The possible error numbers are defined in the global errno.h . The relevant values are:
#define ETIMEDOUT 110 /* Connection timed out */
...
But here's the whole list on my Linux system ( /usr/include/asm-generic/errno.h ):
#ifndef _ASM_GENERIC_ERRNO_H
#define _ASM_GENER...
Created by James on August 01, 2012 14:26:53
Last update: August 01, 2012 14:26:53
The jQuery size() function returns the number of elements in the jQuery object.
According to jQuery doc:
The .size() method is functionally equivalent to the .length property; however, the .length property is preferred because it does not have the overhead of a function call.