wesley tanaka

Tech

Unintuitive Python Behavior

()

Curious about the Google App Engine, I started playing with it, which meant writing code in Python.

Unicode support in Python seems to be a tangle of confusing function names, source code file encodings, backslash escapes, the letter "u" before strings, and probably other things. Together, this smells to me like the language originally didn't support Unicode, but wanted to keep backward compatibility with pre-unicode-support scripts.

MySQL Database Table Schema for domestic geonames

()

A MySQL schema for the domestic part of the geonames database. If you find any errors, please leave a comment below.

ndiswrapper in Fedora 8

()

Based on the name, the dkms-ndiswrapper-1.48-1.fc8.rf claims to support Fedora 8. It is the latest version from the yum repository. Unfortunately, it no longer seems to compile (much less install) correctly.

Moment of Mourning Online

()

A dip in Google search traffic during the three minute moment of silence on May 19 mourning the victims of the Sichuan Earthquake.

Convert Videos for playback on Nokia N82 in Fedora 8

()

I found this command line online for converting videos to H263 .3gp files in Linux:

ffmpeg -i inputfile.avi -s qcif -vcodec h263 -acodec mp3 -ar 8000 -ab 32 -y outputfile.3gp

It seems to be a bit out of date, as it gives:

WARNING: The bitrate parameter is set too low. It takes bits/s as argument, not kbits/s
Unknown encoder 'mp3'

Those two problems are easily fixed:

Pass PHP variables to Javascript in Drupal 6

()

To access PHP values and variables from Javascript using Drupal, you can send them to your javascript code using Drupal's drupal_add_js as follows:

drupal_add_js(array('mymodule' => array(
'username' => 'Mike',
'uid' => 123,
'likes' => array('ice cream', 'peanuts', 'coffee'),
)), 'setting');

page not found (404) for all pages in Drupal 6

()

If Drupal 6 runs into a fatal problem while calling hook_menu(), your site may get into a state where all page views (the front page, the administration page, the modules page, everything) will give a 404/"Page not found"/"The requested page could not be found" error.

You can revive your site by fixing the error that caused the menu rebuild failure and then loading /update.php and completing the upgrade process (even if there are no updates available for any of the modules on your site).

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.

Syndicate content
by Wesley Tanaka