Recent Notes

Displaying keyword search results 1 - 4
Created by freyo on May 16, 2011 12:13:34    Last update: May 16, 2011 12:17:17
By Android documentation , odex files are "Optimized DEX" files, which can be created in at least three different ways: The VM does it "just in time". The output goes into a special dalvik-cache directory. This works on the desktop and engineering-only device builds where the permissions on the dalvik-cache directory are not restricted. On production devices, this is not allowed. The system installer does it when an application is first added. It has the privileges required to write to dalvik-cache . The build system does it ahead of time. The relevant jar / apk files are present, but the classes.dex is stripped out. The optimized DEX is stored next to the original zip archive, not in dalvik-cache , and is part of the system...
Created by Dr. Xi on March 28, 2011 11:11:33    Last update: March 28, 2011 11:13:21
grep is a versatile command with many variations (grep, egrep, fgrep, then various implementations). It uses a regula expression (regex) pattern to filter input. But then there are basic and extended flavors of regex - leading to even more confusion. And, beware that there are lots of bad examples of regex in the wild... There are two critical questions to ask when you use grep: which grep implementation are you using? what is the flavor of the regex? Here are some examples for gnu grep v2.7: # Find all numbers (no decimal point), basic regex... Use the -o flag to show only the matching part instead of the whole matching line: grep -o -E '\b[0-9]{2}\b' The good thing about the gnu grep is that it...
Created by Dr. Xi on February 17, 2011 16:09:49    Last update: February 17, 2011 16:09:49
This is a common problem with shell scripts running from cron. Everything works perfectly fine from the command prompt, but fails when running from cron. In the worst cases, the job fails silently, even giving a return code of 0! Usually, these are caused by differences between the execution environments: the interactive shell (command line) has more environment variables defined/exported (through .kshrc , .bashrc etc.) than the shell started by cron. A simple way to resolve the differences is to run set in the command prompt and compare the output with the output of set from cron (add a single line to the shell script). You can also make the shell script more verbose by adding the -x switch: #!/bin/sh -x
Created by Dr. Xi on June 11, 2010 19:04:18    Last update: June 11, 2010 19:06:35
The caret ^ is DOS command line escape character. Example 1: echo < and > as is, not interpreting them as input/output redirect. @rem sign an XML file. Requires Java class utils.x... Example 2: treat & literally, not as the special character to combine two commands. @rem search "dos command line" in Google. curl ... Add switch -A "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1" to make curl look like Firefox.