Recent Notes
Displaying keyword search results 1 - 10
Created by freyo on August 31, 2011 15:49:54
Last update: August 31, 2011 15:49:54
Got this error while trying to build Android app:
[apkbuilder] Creating AppInfo-debug-unaligned.ap...
Solution:
Delete the Android debug keystore:
$ rm ~/.android/debug.keystore
Build again:
$ ant debug
The new key is valid for 30 years (keystore password is 'android'):
$ keytool -list -v -keystore ~/.android/debug.keys...
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 jinx on May 16, 2011 20:21:38
Last update: May 16, 2011 20:21:38
PHP compares two arrays element for element for equality. Two arrays are considered equal when they have the same number of elements, and for each element key and value both match.
Test code:
<?php
$cmp = array(
array(array(1), array(1...
Outputs:
array(1) {
[0]=>
int(1)
}
array(2)...
Created by freyo on April 06, 2011 14:58:43
Last update: May 05, 2011 14:52:49
To view certificate in CERT.RSA :
C:\tmp>openssl pkcs7 -inform DER -in CERT.RSA -noo...
To convert certificate to PEM:
openssl pkcs7 -inform DER -in CERT.RSA -out CERT.p...
Java keytool also works:
$ keytool -printcert -file CERT.RSA
Owner: EMA...
Created by freyo on April 20, 2011 12:26:08
Last update: April 20, 2011 12:26:08
When you create a new key with Java keytool , it wraps the public key in a self signed certificate. You can generate a certificate signing request with the keytool -certreq command. After a certificate authority (CA) signs the certificate request, you can import the certificate received (a .crt file) back into the key store. Instead of using a CA, you can sign the certificate request with another key (with openssl, for example). If the certificate is not signed by a CA, you'll receive an error:
$ keytool -import -alias android-root -file androi... To fix the problem, import the certificate of the signer: $ keytool -import -trustcacerts -file openssl.crt ... Import the certificate again (alias is the alias of the private key whose certificate was...
Created by James on October 06, 2010 20:54:39
Last update: October 06, 2010 20:55:00
When a JavaScript call is taking too much time, Firefox pops up this message: Of course the solution is to speed up your script. But suppose it really needs to exceed the preset timeout, you can delay the popup by following these steps: Enter about:config in the address bar Ignore the warning and proceed Enter dom.max_chrom in the filter input Change the value of dom.max_chrome_script_run_time to a bigger value (default is 20). For IE, there's a similar dialog with this message: "A script on this page is causing Internet Explorer to run slowly". But rather than counting elapsed time, IE counts the number of statements executed , which is controlled by the registry key HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Styles . You need to create a DWORD value named...
Created by Dr. Xi on September 10, 2010 22:53:42
Last update: September 10, 2010 22:54:06
The sort operation for a Python list sorts a list in place . It takes three optional arguments to control the comparisons:
s.sort([cmp[, key[, reverse]]]) cmp specifies a custom comparison function of two arguments (list items) which should return a negative, zero or positive number depending on whether the first argument is considered smaller than, equal to, or larger than the second argument: cmp=lambda x,y: cmp(x.lower(), y.lower()) . The default value is None . key specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower . The default value is None . reverse is a boolean value. If set to True , then the list elements are sorted as if each comparison were reversed. Python 2.7 (r27:82525, Jul 4 2010, 09:01:59) [MSC...
Created by voodoo on July 11, 2009 15:14:55
Last update: July 29, 2010 22:45:48
cURL is a command line tool for transferring files with URL syntax. The main purpose and use for cURL is to automate unattended file transfers or sequences of operations.
It's really easy to see HTTP headers with curl:
C:\>curl --head http://www.google.com
HTTP/1.0 ...
or, headers and page together (dump headers to stdout):
$ curl --dump-header - http://www.google.com HTTP/...
Download openssl from openssl.org:
curl http://www.openssl.org/source/openssl-0.9.6m....
C:\>curl --help
Usage: curl [options...] <url>
...
Created by Fang on April 04, 2010 04:12:14
Last update: July 21, 2010 14:52:58
The tags <c:if> The <c:if> tag may be used with or without body content:
<!-- Without body content, used to export vari... In my opinion, the version without body content is pretty much useless (the <c:set> tag is a lot more meaningful for this purpose). If body content exists, it is inserted into the page if the testCondition is true . Optional attributes var and scope may be specified. If var is specified, a variable whose name is the value of var is exported to the associated scope ( pageScope if no scope is specified). The type of the exported variable is Boolean and its value is the value of the testCondition . <c:choose>, <c:when>, <c:otherwise> These tags imitate the Java control structure if...else...
Created by Dr. Xi on December 04, 2009 04:33:05
Last update: December 04, 2009 04:33:05
Variable Meaning $_ The default or implicit variable. @_ Within a subroutine the array @_ contains the parameters passed to that subroutine. $a, $b Special package variables when using sort() $<digit> Contains the subpattern from the corresponding set of capturing parentheses from the last pattern match, not counting patterns matched in nested blocks that have been exited already. $. Current line number for the last filehandle accessed. $/ The input record separator, newline by default. $| If set to nonzero, forces a flush right away and after every write or print on the currently selected output channel. Default is 0 (regardless of whether the channel is really buffered by the system or not; $| tells you only whether you've asked Perl explicitly to flush after...