Recent Notes
Displaying keyword search results 1 - 10
Created by magnum on September 11, 2012 11:59:43
Last update: September 11, 2012 11:59:43
Exerpt from bash documentation. HISTORY EXPANSION The bash shell supports a history expansion feature that is similar to the history expansion in csh. This feature is enabled by default for interactive shells, and can be disabled using the +H option to the set builtin command. Non-interactive shells do not perform history expansion by default. History expansions introduce words from the history list into the input stream, making it easy to repeat commands, insert the arguments to a previous command into the current input line, or fix errors in previous commands quickly. History expansion is performed immediately after a complete line is read, before the shell breaks it into words. It takes place in two parts. The first is to determine which line from the history...
Created by Fang on February 21, 2012 20:33:58
Last update: February 21, 2012 20:33:58
You can customize Tomcat error page with error code:
<error-page>
<error-code>404</error-code>
...
or Java exception type:
<error-page>
<exception-type>java.lang.Throwab...
Either error-code or exception-type is required, but not both. There's no way to aggregate error codes, such as:
<!-- This does not work! -->
<error-page>
...
Customizing error pages is about the only way to suppress the default stack trace in Tomcat in case of an unhandled exception.
Created by mee2 on November 20, 2011 21:23:02
Last update: November 20, 2011 21:23:02
By default, alfresco.log is located in the current working directory (where you started Tomcat from). But you can override the default location with a custom lo4g.properties file:
Create file $TOMCAT_HOME/shared/classes/alfresco/extension/custom-log4j.properties with contents:
log4j.rootLogger=error, File
log4j.appender...
The Alfresco log will be relocated to /home/alfresco/logs (but somehow s small portion remains in the CWD).
This works only when the shared.loader property in conf/catalina.properties includes ${catalina.home}/shared/classes .
Created by freyo on August 04, 2011 12:27:27
Last update: August 04, 2011 12:30:42
I got this error while building an APK:
[apply]
[apply] UNEXPECTED TOP-LEVEL ERROR...
Apparently the dx tool was running out of memory. The dx script (shell or bat) provides options to pass in Java options, but it's a lot easier just to bump up the default in dx :
# By default, give dx a max heap size of 1 gig. Th...
Here, I changed the default 1024M to 1624M and resolved the problem.
Created by freyo on July 27, 2010 21:18:24
Last update: June 29, 2011 13:49:36
Use android list targets to find valid targets:
C:\android-sdk-windows\tools>android list targets
...
Created by magnum on May 06, 2011 12:26:14
Last update: May 06, 2011 12:26:14
The bash environment variable PROMPT_COMMAND contains a regular bash command that is executed just before the command prompt is displayed.
For example:
$ export PROMPT_COMMAND=a
bash: a: command not ...
The command a is not valid so you get the error message every time you hit enter.
Echo something before $PS1 :
$ export PROMPT_COMMAND='echo -n Hi!'
Hi!$
...
PROMPT_COMMAND is regularly used to change the xterm window title. You may find this in /etc/bashrc :
case $TERM in
xterm*)
if [ -...
Created by Dr. Xi on April 26, 2011 20:12:01
Last update: April 28, 2011 15:28:12
An XML schema is a definition of XML files, in XML. It plays the same role as old-time DTDs. Overall, an XML schema file looks like this:
<schema attributeFormDefault = (qualified | u... The attribute meanings: targetNamespace : The name space targeted by the current schema definition. It can be any URI. id and version : For user convenience, the W3C spec defines no semantics for them. xml:lang : Natural language identifier defined by RFC 3306 . attributeFormDefault and elementFormDefault : Set default values for the form attribute for attribute and element declarations. blockDefault and finalDefault : Set default values for the block and final attributes for attribute and element declarations. The W3C defined some built-in datatypes . Examples of primitive datatypes are: string ,...
Created by voodoo on March 04, 2011 12:11:33
Last update: April 13, 2011 13:55:13
By default SELinux blocks execstack permission. According to Ulrich Drepper :
"As the name suggests, this error is raised if a program tries to make its stack (or parts thereof) executable with an mprotect call. This should never, ever be necessary. Stack memory is not executable on most OSes these days and this won't change. Executable stack memory is one of the biggest security problems. An execstack error might in fact be most likely raised by malicious code."
You can check if a library/application requires execstack by using the execstack utility:
execstack -q PATHTOPROGRAM
You can try to clean the flag and see if the application still runs:
execstack -c PATHTOPROGRAM
To allow execstack for cc1 :
# grep cc1 /var/log/audit/audit.log | audit2allow ...
Created by jinx on April 10, 2011 21:15:46
Last update: April 10, 2011 21:23:04
When developing in PHP, it's frustrating to have errors in the code but no error message displays. According to the PHP manual, the display_errors setting controls whether errors are displayed. You can either change it in php.ini :
; This directive controls whether or not and where...
or set it in your code:
<?php
ini_set('display_errors', 'On');
fsdlf...
But when you have syntax errors in your code, the ini_set function may not even get a chance to execute. So the only reliable way is to set it in php.ini :
<?php
// nothing gets displayed when display_er...
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...