Recent Notes
Displaying keyword search results 1 - 11
Created by Dr. Xi on February 07, 2012 15:40:11
Last update: February 07, 2012 15:40:11
An alias defined in .profile does not work when you open a bash window from the desktop. Simply put, alias should be put in .bashrc ; PATH should be put in .profile . These are the facts: .profile is executed by the login shell, i.e., when you login. .bashrc is executed whenever a bash shell is opened - login or non-login. When you open a new bash window from the desktop, a non-login shell is created, it will execute .bashrc , not .profile . When you ssh to a remote system interactively, a login shell is created. When you ssh to a remote system and run a command directly, a non-login shell is created. PATH modifications should be put in .profile since it is usually...
Created by Dr. Xi on February 06, 2012 08:42:21
Last update: February 06, 2012 08:42:21
Here are some ways to add shared libraries to the Linux loader search path:
Copy the library to one of the standard paths (for example, /usr/lib ), then run ldconfig
Add the path to /etc/ld.so.conf , then run ldconfig (for details, man ldconfig ).
Use the environment variable LD_LIBRARY_PATH .
Created by freyo on August 25, 2011 09:07:40
Last update: August 25, 2011 20:45:43
This is a list of built-in Android permission values: Permission Description Since API Level android.permission.ACCESS_CHECKIN_PROPERTIES Allows read/write access to the "properties" table in the checkin database, to change values that get uploaded. 1 android.permission.ACCESS_COARSE_LOCATION Allows an application to access coarse (e.g., Cell-ID, WiFi) location 1 android.permission.ACCESS_FINE_LOCATION Allows an application to access fine (e.g., GPS) location 1 android.permission.ACCESS_LOCATION_EXTRA_COMMANDS Allows an application to access extra location provider commands 1 android.permission.ACCESS_MOCK_LOCATION Allows an application to create mock location providers for testing 1 android.permission.ACCESS_NETWORK_STATE Allows applications to access information about networks 1 android.permission.ACCESS_SURFACE_FLINGER Allows an application to use SurfaceFlinger's low level features 1 android.permission.ACCESS_WIFI_STATE Allows applications to access information about Wi-Fi networks 1 android.permission.ACCOUNT_MANAGER Allows applications to call into AccountAuthenticators. Only the system can get this permission. 5 android.permission.AUTHENTICATE_ACCOUNTS...
Created by voodoo on February 25, 2011 14:00:41
Last update: February 25, 2011 14:03:46
Suddenly my Windows XP failed to boot with this error message on a blank screen:
missing or corrupt <windows root>\system32\hal.dll I took out the hard drive, put it in a USB enclosure and attached it to another PC. Then I ran CHKDSK and it fixed some file system errors. But I did find that hal.dll was intact, so hal.dll was not missing or corrupt . It turned out that the file that was really missing was C:\boot.ini . It is a hidden file, so you have to use attrib boot.ini to see it. The file is missing if attrib boot.ini returns nothing (run in the root folder C:\). In my case I reconstructed the boot.ini file: [boot loader] timeout=30 default=multi(0)dis... and changed the attributes back...
Created by Dr. Xi on February 17, 2011 14:06:22
Last update: February 17, 2011 14:06:22
This is the crontab to run a cron job every 15 minutes:
*/15 * * * * /path/to/executable >/redirect/output...
or,
0,15,30,45 * * * * /path/to/executable >/redirect/...
In general, the format is:
minute hour day_of_month month day_of_week command
Valid values are:
Field Value
minute 0-59
hour 0-23
day of month 1-31
month 1-12
day of week 0-6 (Sunday = 0)
Reference: crontab(5) - Linux man page
Created by Fang on August 16, 2010 22:00:05
Last update: August 16, 2010 22:12:25
The tags <sql:update> Executes SQL INSERT , UPDATE , DELETE statements, or SQL DDL statements. Syntax:
<sql:update sql="sqlUpdate" [dataSource="d... or, put the SQL within the element body: <sql:update [dataSource="dataSource"] [v... Attributes: Name Dynamic? Type Description sql true String SQL update statement. dataSource true javax.sql.DataSource or String Data source associated with the database to update. A String value represents a relative path to a JNDI resource or the parameters for the JDBC DriverManager class. var false String Name of the exported scoped variable for the result of the database update. The type of the scoped variable is java.lang.Integer . scope false String Scope of var. Defaults to "page". <sql:transaction> Establishes a transaction context for <sql:query> and <sql:update> subtags. Syntax: <sql:transaction [dataSource="dataSource"] ... where...
Created by Fang on August 16, 2010 21:44:41
Last update: August 16, 2010 22:01:46
The tags <sql:query> Queries a database. Syntax:
<sql:query sql="sqlQuery" var="varName" [scope... or, put the query within the element body: <sql:query var="varName" [scope="{page|req... Attributes: Name Dynamic? Type Description sql true String SQL query statement. dataSource true javax.sql.DataSource or String Data source associated with the database to query. A String value represents a relative path to a JNDI resource or the JDBC parameters for the DriverManager class. maxRows true int The maximum number of rows to be included in the query result. If not specified, or set to -1, no limit on the maximum number of rows is enforced. startRow true int The returned Result object includes the rows starting at the specified index. The first row of the original query result set is at index...
Created by Fang on August 16, 2010 20:42:56
Last update: August 16, 2010 20:47:24
Of course you'll need a datasource to run your SQL statements. It can be set in web.xml , or with the <sql:setDataSource> tag. In web.xml , the declaration is something like this:
<context-param> <param-name>javax.servl... where the parameter value is a relative JNDI path, or parameters for a JDBC connection. In the above example, the real JNDI name for the data source would be: java:comp/env/jdbc/myDataSource . You are out of luck if the JNDI path for the data source does not fall under the java:comp/env/ namespace. In the case of JDBC connection parameters, the expected format is: url[, [driver] [, [user] [,password]]] For example: jdbc:mysql://localhost/,org.gjt.mm.mysql.Driver , where no user name or password is used. <sql:setDataSource> Exports a data source either as a scoped variable or...
Created by Dr. Xi on September 29, 2008 23:21:38
Last update: January 16, 2010 23:36:05
Create a startup script for inetd
Copy /etc/init.d/skeleton to /etc/init.d/inetd . Change the top section of the script to read:
PATH=/usr/sbin:/usr/bin:/sbin:/bin
DESC="In...
Now inetd can be stopped/started/restarted like this:
sudo /etc/init.d/inetd stop
sudo /etc/init....
Add links to rc*.d
$ sudo update-rc.d inetd defaults
Adding sy...
If you no longer need to start inetd at boot up:
$ sudo update-rc.d -f inetd remove
update-r...
This would remove the links from the start up sequence but leave /etc/init.d/inetd in place.
Contents of /etc/init.d/skeleton :
#! /bin/sh
### BEGIN INIT INFO
# Provide...
Created by woolf on March 14, 2009 22:31:59
Last update: March 15, 2009 01:34:23
Python version is 2.6 windows native build (not cywgin build).
Download setup tools from http://pypi.python.org/pypi/setuptools . The download links are at the bottom of the page.
Create symbolic link python26 and run setuptools-0.6c9-py2.6.egg as shell program.
C:\local>bash
bash-3.2$ cd /cygdrive/c/download...
Add C:\python26\Scripts to PATH.
Created by Dr. Xi on September 21, 2008 21:04:24
Last update: September 21, 2008 22:27:36
IE uses Notepad as the default editor when you select "View Source" from a web page. You can change it to your favorite editor by adding a couple of keys to the registry: Start regedit Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\ Add key View Source Editor Under View Source Editor , add key Editor Name Change the default string value to the full path of your favorite editor. The following is the registry entry for vim (full tip for vim is available from the vim wiki ):
Windows Registry Editor Version 5.00 [HKEY_... It is probably easier (less error prone) to edit this in a file and import it back into the registry. The contents of gvim.vbs are: '--- gVim.vbs ------------------------------------... It is OK to use gvim.exe...