Recent Notes
Displaying keyword search results 1 - 10
Created by voodoo on December 08, 2011 14:32:06
Last update: December 08, 2011 14:32:06
Use the read command to pause a shell script and give the user a chance to stop it:
#!/bin/sh
echo "Press CTRL-C to stop this scrip...
Created by freyo on April 20, 2011 12:50:09
Last update: April 20, 2011 12:50:09
To sign an Android APK from command line:
Sign the APK with jarsigner (using default keystore, android-root is the alias of the signing key):
$ jarsigner -signedjar HelloWorld-new.apk HelloWor...
Verify signature (optional)
$ jarsigner -verify -verbose -certs HelloWorld-new...
Align the APK (must use -v 4 option):
$ ~/android-sdk-linux_86/tools/zipalign -v 4 Hello...
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 freyo on February 23, 2011 13:38:23
Last update: February 23, 2011 13:38:23
The Java keytool utility does not support importing a private key directly from a file. But it does support merging a keystore with the -importkeystore command. So, for a private key generated with OpenSSL in PEM format, you first convert the PEM key into PKCS12 format , then merge the one-key PKCS12 store with the Java KeyStore:
C:\>keytool -importkeystore -srckeystore openssl_c...
Created by woolf on October 22, 2010 02:53:32
Last update: October 22, 2010 03:18:12
The easiest way to shutdown Windows XP with a shortcut is to create a shortcut icon on the desktop (or the Start menu, or the Quick Launch menu) and assign a shortcut key combination.
Useful command line commands:
Shutdown : shutdown -s -t 0
Restart : shutdown -r -t 0
Log off : shutdown -l -t 0
Hibernate : rundll32.exe PowrProf.dll, SetSuspendState Hibernate
Command line options for shutdown :
C:\> shutdown /?
Usage: shutdown [-i | -l | -s ...
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 voodoo on July 12, 2010 18:44:06
Last update: July 12, 2010 18:44:06
Use the \d command to show information about a table:
postgres=# \d patchtype
Table ...
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...
Created by Dr. Xi on August 16, 2007 20:54:04
Last update: August 16, 2007 20:54:04
PuTTY is a free telnet/ssh client. Even though its release number is still less than 1.0, it's actually pretty stable (I've used 0.6 and prior versions on Windows).
For Windows binaries, you download each utility individually:
PuTTY (the Telnet and SSH client itself)
PSCP (an SCP client, i.e. command-line secure file copy)
PSFTP (an SFTP client, i.e. general file transfer sessions much like FTP)
PuTTYtel (a Telnet-only client)
Plink (a command-line interface to the PuTTY back ends)
Pageant (an SSH authentication agent for PuTTY, PSCP and Plink)
PuTTYgen (an RSA and DSA key generation utility).
Created by Dr. Xi on June 02, 2007 02:52:24
Last update: June 02, 2007 02:53:12
You can use more or less to display a file on the screen, one screen at a time.
However, less is more versatile and allows both forward and backword movements. You can also use vi commands to switch files ( e, n, p ), search ( /, ? ) and navigate through the file. Press the "H" key to get online help for less .
One interesting command for less is F (forward forever), which makes it behave like tail -f . Since you can break out of the "forward forever" mode and scroll backwords or do searching, this command makes less a better tail -f .