wesley tanaka


SELinux file_contexts: Multiple different specifications for . . .


Was getting this error when installing/upgrading rpm software packages using yum, restarting mysql and various other tasks:

/etc/selinux/targeted/contexts/files/file_contexts: Multiple different specifications for /var/lib/awstats(/.*)? (system_u:object_r:httpd_sys_script_rw_t:s0 and system_u:object_r:awstats_var_lib_t:s0).
/etc/selinux/targeted/contexts/files/file_contexts: Multiple different specifications for /usr/share/awstats/wwwroot/cgi-bin(/.*)? (system_u:object_r:httpd_sys_script_exec_t:s0 and system_u:object_r:httpd_awstats_script_exec_t:s0).

Finding Drupal content that uses the PHP filter


One new change in Drupal 6.0 is the PHP input format is now a part of an optional module instead of being enabled by default. After upgrading from Drupal 5, you can only disable the new PHP input format module if none of your content uses it. If you would like to determine which nodes, comments, blocks and content might be using the PHP filter so that you can migrate them and turn off the PHP module, keep on reading.

Drupal 5

How to find out which nodes, comments, and blocks use the PHP input format (assumes your database table prefix is drupal_)

But I get exercise from braking


I'd love one of these knee brace regenerative braking electricity generators, so I hope it becomes commercialized and commonplace. But if it does, my prediction is the appearance of a new medical problem: knee brace hamstring atrophy syndrome.

Drop all tables in a MySQL Database


echo DROP TABLE `echo 'SHOW TABLES;' | mysql -u USER -p DATABASE | tail -n +2 | sed -e 's/$/,/'` | sed -e 's/,$/;/'

will output the necessary DROP TABLE command. If you have a my.cnf file (in the current directory) you can run the DROP at the same time with:

echo DROP TABLE `echo 'SHOW TABLES;' | mysql --defaults-file=my.cnf | tail -n +2 | sed -e 's/$/,/'` | sed -e 's/,$/;/' | mysql --defaults-file=my.cnf

Fedora 8 sopcast rpm


My gsopcast binary from ftp.fedora.cn/pub/fedora-cn/linux/7/i386/gsopcast-0.2.10-1.fc7.fcn.y1.i386.rpm was crashing in Fedora 8.

There's a qsopcast rpm that works with Fedora 8 at http://apt.magiclinux.org/magic/2.1/unstable/RPMS.os/, as well as some other useful rpms like an rpm for the BlueDJ games client.

Join multiple adjacent lines into one line in UNIX, Linux


I'm looking for the opposite or the converse of GNU fold — a command line program that would join word-wrapped text into a single line per paragraph. In other words, something that would take input containing adjacent lines of text like this:

now is
the time for
all good men

to come to the
aid of their

where adjacent paragraphs were separated with blank lines, and produce output with one line per paragraph, like this:

Nokia N82


I owned a Mainland Chinese Nokia N82 for two days, which I purchased for 4180 yuan ($575.84) from a Zhongyu Telecom embedded inside the Kunming Jin Ma Fang (金马坊) Park & Shop.

Authentication in China


Many documents in China need to have a company seal affixed to them (盖章) to make them official. From what I can tell, this involves a normal rubber stamp with the name of the company, and a normal red rubber stamp ink pad that you can buy anywhere.

Drupal Search Single Result Redirect


A snippet of code that will automatically redirect searches that would display only one search result so that they do not show the search results page but instead immediately and automatically redirect to the first result.

To use it, add it to your active theme's template.php file and replace themename with the name of your theme.

China Telecom Auto-blocker


About a month ago, the China Telecom here started blocking my DSL account from downloading web pages. One of their network techs told me they stopped allowing the

Syndicate content
by Wesley Tanaka