Recent Notes

Displaying keyword search results 1 - 12
Created by voodoo on September 25, 2012 19:33:02    Last update: October 31, 2014 12:34:25
This a step-by-step example of how to create the files for GNU automake. Put the C source file in directory src ( cat src/hello.c ): #include <config.h> #include <stdio.h> ... Run autoscan to generate configure.scan . Rename configure.scan : mv configure.scan configure.ac Edit configure.ac . Update this line: AC_INIT([FULL-PACKAGE-NAME], [VERSION] , [BUG-REP... Add this line after AC_INIT : AM_INIT_AUTOMAKE([foreign -Wall -Werror]) Add this line before AC_OUTPUT : AC_CONFIG_FILES([Makefile src/Makefile]) Create file Makefile.am ( cat Makefile.am ): SUBDIRS = src Create file src/Makefile.am ( cat src/Makefile.am ): bin_PROGRAMS = hello hello_SOURCES = hello.c Run these commands: $ aclocal $ autoheader $ automake --add-miss... The file configure is generated after autoconf is run. Build with: $ ./configure $ make Create tarball for distribution with: $ make dist...
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 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 voodoo on April 13, 2011 13:47:34    Last update: April 13, 2011 13:49:20
You get "permission denied" error from Apache HTTPD for a page. And you checked file/directory permissions (the whole directory path, not just the file) and everything in httpd.conf . If everything seemed right, then SELinux may be blocking the access. Open /var/log/httpd/error_log , you may see a line like this: [Wed Apr 13 15:50:35 2011] [notice] SELinux poli... These are the steps to fix: If the directory resides in a user home directory: # setsebool -P httpd_read_user_content 1 Create a policy package from the audit log: # grep httpd /var/log/audit/audit.log | audit2allo... Apply the policy package just created # semodule -i mypol.pp Restart apache httpd: # apachectl restart
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 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 January 04, 2010 05:04:10    Last update: January 07, 2010 15:59:25
This is the error: >>> import urllib2 >>> f = urllib2.urlopen('htt... Reason: SSL is not supported in Python installation. >>> import httplib >>> hasattr(httplib, 'HTTPS'... Solution: recompile Python with SSL on Steps: Download and install OpenSSL , if you don't have it already. Download Python source and rebuild Python (the usual steps of configure, make and make install). Python's configure script should be able to pick up your existing SSL libraries automatically and build a shared library _ssl.so. Some web sites suggest editing the file Modules/setup.dist , uncomment the lines starting with _ssl , and making changes to the SSL path. This would link the SSL library statically to Python. # Socket module helper for socket(2) #_socket s...
Created by Dr. Xi on October 18, 2008 03:16:24    Last update: October 18, 2008 03:17:21
Normally the browser opens a page if it knows how to. For example, text files are usually displayed in the browser window. You can set the Content-Type and Content-Disposition headers in the HTTP response to force the browser to popup the download dialog. Python example: def download_log(req, app = None, file = None): ... Java example: public void service(HttpServletRequest req, Ht...
Created by Dr. Xi on February 06, 2008 21:43:33    Last update: February 06, 2008 23:40:01
These commands are useful for monitoring Linux swap space: cat /proc/meminfo swapon -s cat ... To make a swap file of 512M and use it automatically at boot up 1. make a file of size 512M (swap files can't be sparse) dd if=/dev/zero of=/data/swapfile.1 bs=1024 count=... 2. Add this line to /etc/fstab: /data/swapfile.1 none swap sw 0 0 3. turn it on now swapon -a
Created by Dr. Xi on August 26, 2007 23:22:30    Last update: August 27, 2007 02:00:18
If you want to add security to your wireless network, you almost never want to use WEP . WPA is an improved encryption algorithm that avoids many of the WEP vulnerabilities. However, FC4 (Fedora Core) doesn't support WPA out of the box. I have to install wpa_supplicant in order to access my wireless AP with WPA encryption. Since my Airlink wireless card only shipped with Windows drivers, I also needed ndiswrapper to make it work under Linux. This is my experience setting up wpa_supplicant with ndiswrapper. 1. Download wpa_supplicant 0.5.8 from http://hostap.epitest.fi/wpa_supplicant/ . Extract files to a working directory. 2. Create a .config file that contains: CONFIG_DRIVER_NDISWRAPPER=y CONFIG_CTRL_IFACE=y The first line initially read CONFIG_DRIVER_WEXT=y following the ndiswrapper documentation, but that didn't work for me. 3....