Recent Notes
Displaying keyword search results 1 - 10
Created by Fang on February 21, 2012 20:54:23
Last update: February 21, 2012 20:57:57
Tomcat gzip compression filter can be turned on with " compression=on " in server.xml :
<Connector port="8080" protocol="HTTP/1.1"
...
The default compressed MIME types are: text/html,text/xml,text/plain .
It would be nice to add other types:
<Connector
port="8080"
protocol="HTT...
Created by voodoo on September 30, 2011 08:22:39
Last update: February 18, 2012 16:17:36
This iptables rule redirects all port 80 traffic from subnet 192.168.0.0/24 to 192.168.0.1 running HTTP proxy (say squid):
/usr/sbin/iptables -t nat -A PREROUTING -s 192.168... Make any packets destined to port 3256 on firewall be NAT'ed to internal system server on port 80: iptables -t nat -I PREROUTING -s ! 192.168.2.0/24 ... To make internal web server work for clients from the internet, LAN and the firewall itself: Make all packets from the Internet going to port 80 on the firewall ( $INET_IP ) to be redirected (or DNAT'ed) to the internal HTTP server ( $HTTP_IP ): iptables -t nat -A PREROUTING --dst $INET_IP -p tc... SNAT the packets entering the firewall that are destined for $HTTP_IP (internal HTTP server) port 80 so that they...
Created by woolf on February 17, 2012 13:08:52
Last update: February 17, 2012 13:08:52
The steps:
Click File , then Info
Click M anage Rules & Alerts
Click New Rule in Rules and Alerts
To block a sender, select "Move messages from someone to a folder"
Created by woolf on February 17, 2012 13:01:41
Last update: February 17, 2012 13:01:41
The steps:
Click File then Info
Click Automatic Replies .
Created by voodoo on February 16, 2012 13:35:38
Last update: February 16, 2012 13:35:57
The C shell allows you to define aliases with arguments: \!^ passes the first argument, \!* passes all arguments. Examples from http://unixhelp.ed.ac.uk :
alias print 'lpr \!^ -Pps5'
alias print 'lp...
In ksh or bash you cannot define alias with arguments. Use function instead.
Created by Dr. Xi on February 13, 2012 20:48:56
Last update: February 13, 2012 20:48:56
When you insert an attribute in JSP:
<%@ taglib uri="http://tiles.apache.org/tags-tiles...
you must define the attribute in tiles definitions:
<definition name="/home" template="/WEB-INF/templa...
Otherwise you'll get runtime exception.
The ignore attribute, which defaults to false , will suppress the runtime exception when the attribute is not defined in tiles definition:
<%@ taglib uri="http://tiles.apache.org/tags-tiles...
Created by voodoo on February 13, 2012 20:09:53
Last update: February 13, 2012 20:10:25
This diagram, from The TCP/IP Guide , describes the TCP termination sequence well:
In particular:
The server (the side responding to a CLOSE request, or FIN) enters CLOSE-WAIT to wait for the application using the connection to be told the other end is closing.
The client (the side requesting CLOSE, or initiating the FIN), enters TIME-WAIT to ensure the ACK it sent was received. The waiting period is two times the maximum segment life (2xMSL)
Created by James on June 22, 2010 18:56:40
Last update: February 13, 2012 10:25:47
Version 1.6.4:
<!-- jQuery -->
<script type="text/javascript" ...
Version 1.7.1:
<script type="text/javascript" src="https://ajax.g...
Google URL: http://code.google.com/apis/ajaxlibs/documentation/#jquery
Created by voodoo on February 11, 2012 15:02:56
Last update: February 11, 2012 15:04:13
Screenshot:
Details:
W:Failed to fetch copy:/var/lib/apt/lists/partial/...
Solution:
Become root:
$ sudo bash
Goto the apt folder:
# cd /var/lib/apt
Remove (or move) lists:
# rm -r lists
Create new lists folders:
# mkdir -p lists/partial
Retrieve new lists of packages:
# apt-get update
Created by Fang on February 10, 2012 16:17:13
Last update: February 10, 2012 16:17:13
The annotation @org.hibernate.annotations.Type overrides the default hibernate mapping type used for a column. This can usually be omitted since Hibernate normaly infers the correct type to use.
But @Type is required in ambiguous scenarios such as a java.util.Date attribute, which can map to SQL DATE , TIME or TIMESTAMP . You use the @Type("timestamp") annotation to tell Hibernate that a timestamp converter should be used, which identifies an instance of org.hibernate.type.TimestampType .
@Type can also be used to identify custom type converters, which can be defined with @TypeDef at the class level:
@TypeDefs(
{
@TypeDef(
na...
or with an xml file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mappi...