Notes by Dr. Xi
Displaying keyword search results 1 - 10
Created by Dr. Xi on August 15, 2012 12:05:39
Last update: August 15, 2012 12:05:39
Use OpenSSL's s_client command to fetch a page manually:
$ openssl s_client -connect localhost:443 -state -...
Sample session for Google:
$ openssl s_client -connect www.google.com:443 -st...
Resource: SSL/TLS Strong Encryption: FAQ
Created by Dr. Xi on June 06, 2009 18:31:44
Last update: June 25, 2012 12:37:35
You can use the system call from the os module to execute an external program:
>>> import os
>>> os.system(the_command_line_st...
However, the path to the executable contains a space character, the system call treats the strings after the first space as arguments, causing an error.
Python doc recommends the use of the subprocess module:
The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function.
For example, using wget to get the google home page:
>>> from subprocess import Popen, PIPE
>>> (out...
or
>>> import subprocess
>>> subprocess.call(['cur...
Created by Dr. Xi on May 25, 2012 15:47:34
Last update: May 25, 2012 15:49:33
Steps to configure SSL for Apache HTTPD server on Windows:
In Apache2.2/conf/httpd.conf , load mod_ssl and include httpd-ssl.conf :
LoadModule ssl_module modules/mod_ssl.so
...
In Apache2.2/conf/extra/httpd-ssl.conf , make sure the paths for the cert files point to the cert and key you want to use:
# Server Certificate:
# Point SSLCertificat...
Start up Apache. If it fails, use the command line to see what the error is. There won't be any log in error.log if there are errors in the conf files:
C:\Program Files (x86)\Apache Software Foundation\...
I corrected the previous error by using the alternative line for SSLSessionCache :
# Inter-Process Session Cache:
# Configure ...
Created by Dr. Xi on March 14, 2012 14:23:14
Last update: March 14, 2012 14:23:14
If forgotPasswordForm.error is a String and not null, you cannot test the error condition with:
<!-- This does not work! -->
<c:if test="${forg...
You have to use "not empty":
<c:if test="${not empty forgotPasswordForm.error}"...
Created by Dr. Xi on February 06, 2012 09:20:20
Last update: February 06, 2012 09:20:20
This is the error message:
Error 6 initializing SQL*Plus
SP2-0667: Message...
It might be that the ORACLE_HOME environment variable is not properly set or a missing sp1<lang>.msb (for example sp1us.msb ) file. But for my Ubuntu system, there was no such thing as sp1<lang>.msb , and it wasn't caused by a missing ORACLE_HOME . The error was resolved after I restored the shared library file libsqlplusic.so .
Created by Dr. Xi on September 19, 2011 11:56:42
Last update: September 19, 2011 11:57:26
It is well known that with the -D switch you can turn an ssh session into a socks proxy:
ssh -D localhost:8080 remote_user@remote_host
Now configure your browser to use " localhost:8080 " as a socks proxy and your web traffic is routed through remote_host via an ssh tunnel.
But sometimes you encounter an error message like this:
Disconnecting: Bad packet length - 1416586337
This is because sometimes, the ssh session outputs some "welcome" message into the tunnel, polluting the protocol stream between the client and the remote host.
A safer way to establish an ssh socks proxy would be:
ssh -N -D localhost:8080 remote_user@remote_host
Created by Dr. Xi on February 17, 2011 12:34:58
Last update: August 10, 2011 09:04:32
String comparison operators: Operator Meaning -n str the length of str is nonzero. -z str the length of str is zero (0). str1 = str2 str1 and str2 are the same (note one equal sign, not two!). str1 != str2 str1 and str2 are not the same. str str is not a null string Examples:
# empty string is not null if [ '' ]; then ... Numerical comparisons ( integer expressions only! ): Operator Meaning int1 -eq int2 int1 and int2 are numerically equal int1 -ne int2 int1 and int2 are numerically NOT equal int1 -gt int2 int1 is greater than int2 int1 -ge int2 int1 is greater than or equal to int2 int1 -lt int2 int1 is less than int2 int1 -le...
Created by Dr. Xi on July 11, 2011 12:24:10
Last update: July 11, 2011 12:25:44
This code snippet
import java.util.*;
public class UncheckedCast ...
fails with a compilation error and a warning:
$ javac -Xlint:unchecked UncheckedCast.java
Unc...
Because List<String> is not a reifiable type, the Java Runtime does not have enough information to verify the type or do the type casting. This is fixed by changing List<String> to List<?> (or to the raw type List ):
public static void main(String[] args) {
Ob...
Created by Dr. Xi on June 27, 2011 13:12:36
Last update: June 27, 2011 13:12:36
Parameterized types are considered different at compile time but not at runtime. This program fails compilation because List<Foo> is not the same as List<Bar> :
import java.util.ArrayList;
import java.util.Li...
Error:
$ javac SameErasure.java
SameErasure.java:8: do...
This also fails because List<Foo> and List<Bar> are considered the same:
import java.util.ArrayList;
import java.util.Li...
Error:
$ javac SameErasure.java
SameErasure.java:11: n...
Created by Dr. Xi on April 26, 2011 20:12:01
Last update: April 28, 2011 15:28:12
An XML schema is a definition of XML files, in XML. It plays the same role as old-time DTDs. Overall, an XML schema file looks like this:
<schema attributeFormDefault = (qualified | u... The attribute meanings: targetNamespace : The name space targeted by the current schema definition. It can be any URI. id and version : For user convenience, the W3C spec defines no semantics for them. xml:lang : Natural language identifier defined by RFC 3306 . attributeFormDefault and elementFormDefault : Set default values for the form attribute for attribute and element declarations. blockDefault and finalDefault : Set default values for the block and final attributes for attribute and element declarations. The W3C defined some built-in datatypes . Examples of primitive datatypes are: string ,...