Wednesday, August 31. 2005Where's blackholes.us?
I was relying on a couple lists at blackholes.us to block a lot of spam. But the server is down without any news as to why. When I can't use the blackholes.us blacklists, my spam triples.
I found a replacement list to use at okean.com, but they don't have a DNSBL, so I have to figure out how to best integrate their list with klunky sendmail. Anyone have a tutorial? Update 2005-09-30: I recently found countries.nerd.dk and I'm trying out their DNSBL. Yesterday it blocked a couple hundred spams from the countries I specified. Sunday, August 21. 2005GPS Data on Google Maps
Today I happened upon this website which lets you upload GPS trackline/waypoint data, and it plots the data on a Google Map, which you can zoom in/out and scroll around. Very cool. I need to start playing around with the Maps API; it would be fun to incorporate this kind of stuff right into this website.
Tuesday, July 26. 2005Removing Serendipity's NL2BR Plugin
I've been getting tired of fighting Serendipity's NL2BR Plugin, which automatically inserts line breaks in blog entries. It got difficult to format things like source code.
This blog entry contains a useful piece of SQL to update your previous entries. Then it's just a matter of disabling the NL2BR Plugin.
After going through those steps, my blog appears to look the same, and now I don't have to worry about the NL2BR problems anymore.
Integrating other sites with PHPBB
I have been working on integrating a PHPBB forum with an established site for a client. Their site has a pre-existing user base and sign-in method, and I didn't want to disturb that.
This knowledge base article at phpbb.com details the basics of bringing PHPBB sessions into your other code. It includes common.php, which, if you read the source code, includes everything and the kitchen sink for PHPBB: general functions, template code, authenticaion/permissions code, etc. I decided to try to trim it down, as the only "feature" I needed from PHPBB on the main site was to keep a PHPBB session alive while the user used the main part of the website. This looks like more code than suggested in the PHPBB KB article, but it's really less code overall, and it seems to work.
define('IN_PHPBB', true);
$phpbb_root_path = '/somepath/'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'config.'.$phpEx); $ip_sep = explode('.',$_SERVER['REMOTE_ADDR']); $user_ip=sprintf('%02x%02x%02x%02x', $ip_sep[0], $ip_sep[1], $ip_sep[2], $ip_sep[3]); include($phpbb_root_path . 'includes/constants.'.$phpEx); include($phpbb_root_path . 'includes/sessions.'.$phpEx); include($phpbb_root_path . 'includes/db.'.$phpEx); $strSQL = "SELECT config_name, config_value FROM " . CONFIG_TABLE . " WHERE config_name IN ('cookie_name', 'cookie_path', 'cookie_domain', 'cookie_secure', 'session_length');"; if( !($result = $db->sql_query($strSQL)) ) { die('Could not query config information'); } while ( $row = $db->sql_fetchrow($result) ) { $board_config[$row['config_name']] = $row['config_value']; } $userdata = array(); $userdata = session_pagestart($user_ip, PAGE_INDEX); This method is working OK for me so far. I've got several other steps to really get things integrated. One problem is that the existing site's code uses a global variable to access the database known as $db, and guess what, so does PHPBB, but they're not compatible. I'm also toying with the idea of stripping out PHPBB's existing session code and replacing it with my own which will connect the main site and the forum. I need to see how well PHPBB's session code is written and if it's mostly separated from the rest of the PHPBB code. But you might give this code a shot if you want to work with PHPBB's sessions. Update 2006-04-12: I had to update this code to work with PHPBB 2.0.20. I also changed the PHPBB message_die() function to PHP's die() function since I'm not including it from the PHPBB functions. Wednesday, June 15. 2005php_exif.dll problems
Today I updated the PHP install on my Windows development box. Initially I kept getting weird errors about php_mbstring.dll and php_exif.dll not being found. I checked the extension path carefully. Then, I saw in the PHP 4.3.11 install file:
php_exif.dll EXIF functions [requires] php_mbstring.dll. And, php_exif.dll must be loaded after php_mbstring.dll in php.ini.If that's the case, it makes sense to me to list the line for php_exif.dll after the line for php_mbstring.dll (currently php_exif.dll appears first), or at least place that install comment into the php.ini file! Thursday, May 26. 2005Wireless, like it or not!
I updated my old Linksys router to a D-Link DI-824VUP router, which sports 802.11G and VPN. I mainly got it for the VPN feature, so I can use it on some projects. I like wireless, but only use it rarely. I was really surprised to find that there's no way to turn the wireless off on this model. My Linksys router allowed for this. I contacted D-Link's tech support about it, and here's an excerpt of the reply:
You can log into the router configuration, go to the Advanced tab and the performance section. From there you can select the Disable SSID broadcast (which will prevent the SSID from being broadcast). You can also put the Antenna transmit Power to the lowest setting. On the Home tab, Wireless section you can enable encryption.I give them credit for replying quickly but I'm not thrilled with the answer. Maybe they'll add a wireless on/off switch to future firmware, but I won't hold my breath. Update 2005-11-08: I just installed a new firmware, 1.05, and the first setting on the Wireless page says "Wireless Radio: On/Off." It happily disables the Wifi when I don't want it on. Cool! Monday, May 23. 2005Who is deixxervaisul?
On a board where I run phpBB, a recent member registered with the name "deixxervaisul". The profile says the member is in the United Kingdom. He left his occupation as "King of the Web" and the email address deixxervaisul@flashcubicle.com. The member didn't try to leave a website and never made a post. I left it alone.
Today, while looking at another phpBB board that I occasionally admin, I noticed a new user with the same odd name. The profile info is the same. The subject matter of the two board is completely different, so I have a hard time believing these are both real users. A Google search on "deixxervaisul" pulls up 113,000 hits. I didn't go through them all, but the first 100 hits or so point to that username on more forums, and not just phpBB either. The poster must be using some automated tool, which means he probably circumvented my basic bot prevention method. I'm not sure what the motivation was to create these accounts, but I'm going to delete them from my boards. Maybe the poster is trying to get search engines to index the domain of that email address? I'd encourage phpBB admins to make their memberlist and profiles unavailable to search engines, as I described in an earlier post. Monday, May 2. 2005Domain Transfer
Just a brief entry to say that my domain transfer from Network Solutions to GoDaddy was quick and painless. It just wasn't worth it to continue to pay $35 a year when someone else provides the same service for $9 a year. The only downside was that GoDaddy's checkout process is full of offers for "accessories" that you don't need. But I passed on all of those and got a pretty good deal.
Sunday, April 17. 2005Bug Mapping
(the insect kind, not the computer kind)
I've always been interested in maps and I've had at least a couple on my walls since I was a kid. That interest has carried over to the computer world, as you can see by the many GPS track maps I publish with my trip reports. I've been a regular participant on the BugGuide.Net website for the past year or so, and I always thought it would be cool to plot a map of the locations where people have photographed their bugs. I offered to give it a try, and Troy Bartlett, the site owner, graciously provided me with the location data to play with. The first hurdle was the free form location data. A photographer could put any location they wanted in that field, and the contents varied significantly. Some would give full state names, others would use abbreviations. Add in several misspellings, some non-U.S./Canada locations and it was hard to work with. (Troy has since modified the website to require users to select from a pre-defined state/province list). I ended up writing a PHP function to try to take a location name and pull the state or province out of it. I basically assigned each state/province an array of possible matches. So West Virginia, for example, was comprised of WV, W. Va., W. Virginia and West Virginia. This worked fairly well. Then it was a matter of arranging the location comparisons so that you get the right state, i.e. you have to check for West Virginia before Virginia because they share names. Through testing I found you also have to put Delaware and Louisiana toward the end of the checks because "de" and "la" appear in some Spanish-based place names. For similar reasons, you need to check Indiana and Ontario toward the end. I found later that it's also a good idea to put Colorado down there since "Co." is an abbreviation for "county." (Click here to see the code). Once I had the locations simplified, I needed a way to plot them on a map. I tossed around various ideas but settled on a good open-source mapping package called MapServer, which I had played around with over the years but never created any applications. I had some publicly available map data "shapefiles" to use, and all I had to do was feed my list of states and provinces to the map template. MapServer did the rest, generating North American maps with the relevant areas colored in. MapServer has lots of features for browsing maps interactively on websites, but for the time I just wanted to create static maps. After lots of testing, I decided it was ready to use. I packaged it up and sent it to Troy, who quickly integrated it into BugGuide as the "Data" page. He adjusted the color scheme and added a neat breakdown of locations by month. While the maps generated aren't comprehensive range-maps, they do show what’s been captured by the website's users, and perhaps with time will approach the true ranges of many species. It's a fun way to use maps on the Internet. Here are a couple examples:
And you can browse the maps anywhere between the phylum and the species...check it out! Saturday, April 2. 2005PHP Cybercash PECL Extension
One of my clients still uses the ancient Cybercash payment system, now owned by Verisign. Last I checked, Verisign charges you to switch over to their newer payment system. Since they keep Cybercash running, so there's not much incentive to upgrade.
A Cybercash interface was built into PHP 4.2.x but it was removed in PHP 4.3.x. It wasn't completely abandoned as it was moved to the PECL repository. Unfortunately, there is next to no documentation telling you how to install it. From digging around their mailing lists, I came across this helpful bug report. Not only does it have the instructions for how to install the extension, it tells you how to correct a bug which they still haven't fixed in the downloadable Cybercash package. For my future reference, to install a PECL extension, you copy the extension into a subfolder of php-4.3.x/ext. Then run autoconf at the command line. At that point, you continue with configure, making sure to request that the extension be included. And finally, make and make install.
« previous page
(Page 4 of 7, totaling 69 entries)
» next page
|
CategoriesQuicksearchSyndicate This Blog |