Recent Notes

Displaying keyword search results 1 - 9
Created by magnum on September 27, 2011 12:55:51    Last update: September 27, 2011 12:55:51
These steps set up a Linux host as IPSec client, using Openswan . Install Openswan: # yum install openswan Edit /etc/ipsec.conf . Instead of L2TP on port 1701, I'm setting up TCP on port 8080 so that I can test the connection with nc . # /etc/ipsec.conf - Openswan IPsec configuration f... Edit /etc/ipsec.secrets . # include /etc/ipsec.d/*.secrets 192.168.0.101 ... Start IPSec: # /etc/init.d/ipsec start Connect to IPSec server: # ipsec auto --up TCP8080-PSK-CLIENT 104 "TCP80...
Created by Dr. Xi on August 11, 2007 15:56:47    Last update: July 19, 2011 08:15:55
Here's a list of common TCP ports. You can find a more complete list here: http://www.gasmi.net/docs/tcp.html . Port Number Service Description 21 FTP File Transfer Protocol 22 SSH Secure Shell 23 Telnet Telnet remote login 25 SMTP Simple Mail Transfer Protocol 70 gopher Gopher 79 finger Finger 80 HTTP Hyper Text Transfer Protocol (WWW) 88 Kerberos Kerberos authentication 94 tivoli Tivoli Object Dispatcher 110 pop3 Post Office Protocol Version 3 123 ntp Network Time Protocol 137 netbios NetBIOS Name Service 138 netbios NetBIOS Datagram 139 netbios NetBIOS Session 143 imap Internet Message Access Protocol 161 snmp Simple Network Management Protocol 162 snmptrap SNMP trap 194 irc Internet Relay Chat Protocol 389 ldap Lightweight Directory Access Protocol 443 https Secure HTTP 445 SMB MS Server Message...
Created by freyo on May 20, 2011 09:25:20    Last update: May 23, 2011 12:11:42
The javax.xml.crypto and javax.xml.crypto.dsig packages are not available in Android (as of version 2.3). Therefore, standard Java API does not work. But you can use the Apache Santuario library to do that. Here are the steps: Download the xml security source distribution (curently version 1.4.4). Build with ant. Create your own library jar (only the apache classes, no javax): jar -cf xmlsec-1.4.4.jar -C build/classes org Copy xmlsec-1.4.4.jar to the libs directory of your Android project. Here's the Java code: import java.io.*; import javax.xml.parsers.*; ...
Created by Dr. Xi on November 08, 2010 20:44:12    Last update: November 08, 2010 20:44:12
Key points: Java String.matches() matches the entire string, not a partial string. Use java.util.regex.Matcher.find() to match a partial String. For case insensitive match, use Pattern.compile with case insensitive flags: // Case insensitive for ASCII Pattern p = P... Use (?i) or (?iu) (for unicode) to inline case-insensitive flag: boolean b = "StringToMatchAgainst".matches("(?... Test code: import java.util.regex.*; public class Test...
Created by woolf on September 17, 2010 19:31:06    Last update: September 17, 2010 19:31:06
From http://hardware.slashdot.org/story/10/09/17/0247246/HDCP-Master-Key-Is-Legitimate-Blu-ray-Is-Cracked : MakeMKV rips most Blu-Rays very easily. If you want to re-encode with compression like x264, Handbrake will do it easily (though it takes about 6 hours at "20" quality on my i7 HTPC). The audio is a little tricky, but with MKVmerge you can just take the stream that MakeMKV gave you and mux it into the video stream Handbrake spat out. Subtitles are tougher because of the way they're done on Blu-Ray, but I find that opensubtitles.org usually has a perfectly-timed SRT file for my rips, most often from a guy called Shoocat. With newer codecs, the text is super-smooth and often looks better than the subtitles on the blu-ray. The only really hellacious problem I've had with moving my Blu-Ray...
Created by Dr. Xi on July 19, 2010 21:58:34    Last update: July 23, 2010 21:37:23
Parsing XML in Java is really simple: import java.io.*; import javax.xml.parsers.Docu... The parser implementation details are hidden behind the JAXP API. In case you want to know which parser implementation is used, this is what the JavaDoc for DocumentBuilderFactory.newInstance says: Use the javax.xml.parsers.DocumentBuilderFactory system property. Use the properties file " lib/jaxp.properties " in the JRE directory. This configuration file is in standard java.util.Properties format and contains the fully qualified name of the implementation class with the key being the system property defined above. The jaxp.properties file is read only once by the JAXP implementation and it's values are then cached for future use. If the file does not exist when the first attempt is made to read from it, no further attempts are made to...
Created by Dr. Xi on June 20, 2010 14:35:17    Last update: June 20, 2010 14:35:17
This XML signature validator comes from the Apache XML Security project. It validates the signature according to the core validation processing rules . It does not verify that the key used to generate the signature is a trusted key. You can override the KeySelector class to make sure that the signing key is from a trusted store. import javax.xml.crypto.*; import javax.xml.cry...
Created by Dr. Xi on June 19, 2010 04:34:01    Last update: June 19, 2010 04:39:13
Java SE 6 contains built-in utilities to generate XML signatures. This is an example that generates XML signatures using a Java keystore. It has options to generate signature for the whole document, for an element with a specific ID, or for elements matched by an XPATH expression. The XML document used to test is taken from Getting Started with XML Security : <?xml version="1.0"?> <PatientRecord> ... This is the Java code: import java.io.FileInputStream; import java.io.... However, it looks like the XPATH transform is not working. The digest generated with XPATH filter is exactly the same as that without it (i.e., the whole document)! Another reference: Programming With the Java XML Digital Signature API
Created by Dr. Xi on February 04, 2009 16:16:03    Last update: February 06, 2010 21:53:40
Action Shortcut Bring up context menu Shift+F10 Move active window Alt+Space, M Minimize active window Alt+Space, N Move cursor to web browser address bar and select the text Alt+D Minimizes all open windows and displays the desktop Windows Logo+D Restore minimized windows Repeat Windows Logo+D Open windows explorer Windows Logo+E Navigate through tabs in browser Ctrl+TAB Close tab in browser Ctrl+W Page Back Alt + LeftArrow Page Forward Alt + RightArrow Reload Page F5 Reload Page Override Cache Ctrl+F5 Find computer CTRL+Windows Logo+F Open Run dialog box Windows Logo+R Display Start menu CTRL+ESC (same as the Windows Logo key) Move the focus on the taskbar so you can TAB to the Quick Launch tool bar, the Taskbar etc. CTRL+ESC,ESC Quick Launch shortcuts in Windows Vista...