Recent Notes

Displaying keyword search results 1 - 11
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 May 25, 2012 15:47:34    Last update: May 25, 2012 15:49:33
Steps to configure SSL for Apache HTTPD server on Windows: In Apache2.2/conf/httpd.conf , load mod_ssl and include httpd-ssl.conf : LoadModule ssl_module modules/mod_ssl.so ... In Apache2.2/conf/extra/httpd-ssl.conf , make sure the paths for the cert files point to the cert and key you want to use: # Server Certificate: # Point SSLCertificat... Start up Apache. If it fails, use the command line to see what the error is. There won't be any log in error.log if there are errors in the conf files: C:\Program Files (x86)\Apache Software Foundation\... I corrected the previous error by using the alternative line for SSLSessionCache : # Inter-Process Session Cache: # Configure ...
Created by James on January 10, 2011 15:20:10    Last update: February 03, 2012 10:10:14
Dojo ShrinkSafe: http://shrinksafe.dojotoolkit.org/ : command line utility written in Java, based on Rhino - JavaScript engine written in Java. Douglas Crockford's JSMIN: http://crockford.com/javascript/jsmin : command line utility written in C, can download MS-DOS exe. Dean Edwards' Packer: http://dean.edwards.name/packer/ : online tool, or .NET, Perl, PHP application. YUI Compressor: http://developer.yahoo.com/yui/compressor/ : command line utility written in Java. Google Closure Compiler : command line Java application, web application, or RESTful API. One problem is, the compressor utility may not be 100% reliable. So make sure to test the compressed script.
Created by magnum on September 21, 2011 16:01:16    Last update: September 21, 2011 16:02:33
More like assign a second ip address to the same nic, instead of a virtual nic. Multiple IP addresses can be assigned to the same NIC, but all IP addresses must be on the same subnet - otherwise some IP addresses will not be accessible. From command line, assign IP address 192.168.0.2 to alias eth0:0 : sudo ifconfig eth0:0 192.168.0.2 netmask 255.255.2... But IP addresses added this way are not persistent. They are lost whent he OS is restarted. To make the additions persistent: For Fedora: $ su - # cd /etc/sysconfig/network-scripts/ ... The contents of ifcfg-eth0:0 should look like this: DEVICE=eth0:0 IPADDR=192.168.0.2 NETMASK=255... Restart network: # service network restart For Ubuntu: $ sudo vi /etc/network/interfaces Append this to the file: auto eth0:0 iface eth0:0 inet static name Et......
Created by freyo on September 09, 2011 11:43:36    Last update: September 09, 2011 11:45:45
When you run automated Android tests with Eclipse or from the command line, you get text output, which isn't good for reporting purposes. If you run a large set of test cases with automated build, the text report isn't very helpful. Fortunately, Android CTS generates test reports in XML with accompanying XSL to make it look nice in a browser. To run your own tests with Android CTS: Download Android CTS Make a new directory MyRepository under android-cts , alongside the existing repository directory. Copy host_config.xml from repository to MyRepository Create directory plans under MyRepository , add a test plan ( MyTests.xml ): <?xml version="1.0" encoding="UTF-8"?> <TestPla... Create directory testcases under MyRepository . Copy TestDeviceSetup.apk from repository/testcases to MyRepository/testcases Under MyRepository/testcases , create a test...
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 woolf on February 10, 2011 12:51:14    Last update: February 10, 2011 13:06:11
Windows command line shell does not come with a sleep command. One trick is to emulate sleep using the ping command: C:\>ping /? Usage: ping [-t] [-a] [-n count... To sleep for about 5 seconds: @rem make sure to ping a non-existing IP, otherwis... If you have the Windows Resource Kit installed, it does provide a sleep command: C:\>sleep Usage: sleep time-to-sleep-in-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 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.
Created by Dr. Xi on June 03, 2008 03:42:48    Last update: September 07, 2008 18:34:10
When I ran the vssadmin command to view the storage used by "System Restore and Shadow Copies" , vista complained that I didn't have the right permissions, even though I was logged in as administrator! Microsoft Windows [Version 6.0.6000] Copyright ... To make it work you have to start the command prompt with "elevated administrator" privileges: 1. Click the "start" button and enter "cmd" into the "Start Search" box. 2. Right click the "cmd" icon in the "Programs" list and select "Run as Administrator". Alternatively, it you already set up a shortcut for the command prompt. just right click the shortcut and select "Run as Administrator".