Recent Notes
Displaying keyword search results 1 - 10
Created by Dr. Xi on June 22, 2011 13:23:19
Last update: April 30, 2012 11:40:06
This is a utility to convert a byte array to hex string, and to convert a hex string back to the original.
To convert a String to hex, you must call String.getBytes() first. The utility does not pretend to know your string encoding.
public class StringHexUtil {
public static ...
This also works:
String binaryToHex(byte[] data) {
StringBui...
Created by Dr. Xi on March 08, 2012 12:13:57
Last update: March 08, 2012 12:13:57
This example creates an instance of XMLGregorianCalendar and converts it to java.util.Date :
import java.util.Date;
import javax.xml.datatyp...
Created by Dr. Xi on May 02, 2011 15:59:37
Last update: February 25, 2012 09:16:37
This code snippet gets the default keystore used by the Java keytool and displays the list of aliases along with the key type (certificate or private key).
import java.io.File;
import java.io.FileInputSt...
The default keystore used by the above code is: $HOME/.keystore .
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 Fang on February 15, 2012 21:26:46
Last update: February 15, 2012 21:26:46
Add configuration variables for the surefire plugin to use system properties in Maven test:
<build>
<plugins>
<plugin>
<group...
Created by Fang on February 10, 2012 14:41:03
Last update: February 10, 2012 14:44:01
I wanted to add a jar file to a Maven project but I don't want to create an artifact and install it to the repository. This is a third party jar that will be used only for this project and not shared with other projects, so it's convenient just to drop it in the project folder and package it with the target.
Maven provides the system dependency scope to do just that:
<dependency>
<groupId>com.thirdparty</group...
Created by Fang on February 08, 2012 21:21:01
Last update: February 08, 2012 21:21:17
Just a reminder that I got this error when I set the Java system property javax.net.ssl.trustStore to a non-existing file (typo). The full error message when running Maven was:
[ERROR] java.lang.RuntimeException: Unexpected e...
Created by Dr. Xi on February 07, 2012 15:40:11
Last update: February 07, 2012 15:40:11
An alias defined in .profile does not work when you open a bash window from the desktop. Simply put, alias should be put in .bashrc ; PATH should be put in .profile . These are the facts: .profile is executed by the login shell, i.e., when you login. .bashrc is executed whenever a bash shell is opened - login or non-login. When you open a new bash window from the desktop, a non-login shell is created, it will execute .bashrc , not .profile . When you ssh to a remote system interactively, a login shell is created. When you ssh to a remote system and run a command directly, a non-login shell is created. PATH modifications should be put in .profile since it is usually...
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 James on January 11, 2011 22:08:26
Last update: February 03, 2012 11:23:25
By default Firefox puts a dotted line box around the link or button label when you click them. Sometimes it's annoying and makes your sexy buttons look ugly. You can get rid of the dotted lines for links with outline:none in CSS, but that doesn't work for buttons.
<!doctype html>
<html>
<head>
<style t...
For buttons you need " button::-moz-focus-inner { border: 0; } ":
<!doctype html>
<html>
<head>
<style t...
I've also seen this:
/* get rid of those system borders being generated...
For more information :
Remove Button Focus Outline Using CSS