Recent Notes

Displaying keyword search results 1 - 10
Created by magnum on November 10, 2012 18:42:19    Last update: November 10, 2012 18:42:19
IFS : The Internal Field Separator that is used for word splitting after expansion and to split lines into words with the read builtin command. The default value is "<space><tab><newline>". $ echo "$IFS" | cat -vte ^I$ $
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 voodoo on August 15, 2012 11:23:44    Last update: August 15, 2012 11:23:44
By default Linux pipe output is buffered. For example, you can't see the most recent stdout on screen with tee : $ ./mycommand | tee /tmp/mycommand.log Here are two ways to make the pipe unbuffered. Method 1: use the unbuffer command from expect $ sudo apt-get install expect-dev $ unbuffer ./... Method 2: use stdbuf # Make output line buffered: $ stdbuf -oL ./myc...
Created by Dr. Xi on February 06, 2012 12:14:11    Last update: February 07, 2012 15:39:35
Oracle sqlplus command line tools does not support command line editing out-of-the-box. But on Linux there's a handy utility that enables command line editing with any command line tool: rlwrap - readline wrapper. Install rlwrap: $ sudo apt-get install rlwrap Create a keywords file .sql.dict (optional, but convenient): false null true access add as asc begin by chec... It would be nice to add the tables names also. Create an alias for sqlplus (put it in .bashrc ): alias sqlplus='rlwrap -f $HOME/.sql.dict sqlplus'
Created by woolf on December 29, 2011 11:18:11    Last update: December 29, 2011 11:18:11
Use the expand command to extract files from a .cab file: expand [-r] source [destination] [-d source.cab ... Option Description [-r] Renames expanded files. [destination] Specifies where files are to be expanded. If source is multiple files and -r is not specified, destination must be a directory. destination can consist of a drive letter and colon, a directory name, a file name, or a combination of any of these. [-d source.cab] Displays a list of files in the source location. Does not expand or extract the files. [-f:files] Specifies the files in a cabinet (.cab) file that you intend to expand. You can use wildcards (* and ?). source.cab Specifies the files to expand. source can consist of a drive letter and colon, a directory...
Created by Fang on December 06, 2011 19:52:15    Last update: December 06, 2011 19:52:15
Resource files under the src/main/resources directory are copied verbatim to the target/classes directory during build. But resources can be filtered by turning on filtering in pom.xml : <build> <resources> <resource> ... When filtering is turned on, constructs like ${...} are replaced with actual values if they are defined. For example, create a file test.properties : project.stage=${project.stage} The build command " mvn package " simply copies test.properties to target/classes/ . But if you build with: mvn -Dproject.stage=dev package the contents of target/classes/test.properties becomes: project.stage=dev Sometimes you want different resource definitions for different environments, e.g., dev vs. prod. You can achieve that by defining profiles in pom.xml : <profiles> <profile> <id>dev</id> ... In the above, dev is the default profile, prod is defined but not active unless...
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 August 01, 2011 16:06:40    Last update: August 03, 2011 08:32:01
To list all installed packages: # pm list packages To list all disabled packages: # pm list packages -d pm help: # pm usage: pm [list|path|install|uninstall] ...
Created by alfa on June 02, 2011 13:04:18    Last update: June 02, 2011 13:04:18
Some javap usage examples. Start from HelloWorld.java : @Deprecated public class HelloWorld { pu... javap -c HelloWorld outputs: Compiled from "HelloWorld.java" public class He... javap -v HelloWorld outputs ( -v for verbose mode): Compiled from "HelloWorld.java" public class He... The output consists of: " Compiled from... " header Class attributes. For the HelloWorld example, there are two: SourceFile and Deprecated . Minor and major class file version Constant pool Disassembled code LineNumberTable for debugging purposes. javap by default only prints package/protected/public members. To display all members including private, use the -p switch. javap -v -p HelloWorld
Created by woolf on May 15, 2011 14:35:58    Last update: May 15, 2011 14:36:47
Assign IP adrress and network mask: sudo ifconfig eth0 192.168.183.5 netmask 255.255.2... Add default gateway: sudo route add default gw 192.168.183.2 Add name server: " sudo vi /etc/resolv.conf " and add: nameserver 192.168.183.2
Previous  1 2 3 4 Next