Archive | February, 2011

Color vim on CygWin

I’ve had to do some admin work on a Windows 2008 R2 server and found it handy to have a POSIX environment installed on Windows so I have ssh, grep, rsync, git, bash, vim and other functionality available all working within the same shell.

While vim was functional, the terminal was one that vim didn’t recognize as color, and hence the editor was only black and white and a few shades of gray. A little Googling returned this page: http://infrablue.tripod.com/cygwin.html with instructions on using rxvt as the terminal and configuring bash to run within it. A few tweaks, and I’m running vim and editing in color!

[UPDATE] @mintty_cygwin on twitter was kind enough to point out that rxvt development is pretty much stopped, but that the project http://code.google.com/p/mintty/ offered yet another TTY to run on Windows. This one has some pretty cool options, and is easy to install. I’m up and running with it now!

WordPress updated to version 3.1

A new version of WordPress is available, and I’ve updated the blog to version 3.1 and downgraded it again. It seems like some of my custom hacks didn’t make the transition as smooth as I’d like. A good lesson there: always make backups; they’re handy for quick rollbacks. Check out some of the new features, listed here.

It appears that the Header Image Rotator (http://wordpress.org/extend/plugins/twenty-ten-header-rotator/) is the problem. I’ve disabled it, got the update working, re-enabled it and it broke again. Sure enough. I’ve let the author know about the problem and the error messages in my logs. Let’s hope for a painless fix. In the meantime, I’ll post a favorite old picture of mine, taken on a cold snowy night.

Updated Planet Fox

The Venus aggregator is a Python program which will read in a list of RSS feeds and generate an HTML stream-of-news page that displays the posts, most recent first. Planet Fox (http://www.tedroche.com/planetfox/) uses the list of blogging FoxPro folks posted to the FoxPro Wiki as its source. Add yourself to the Wiki and your posts will appear in the aggregator. Thanks to one of Planet Fox’s regular readers for pointing out that Jim Nelson’s great PEMEditor blog was not on the list; it turned out the Wiki post incorrectly listed the location of the RSS feed. I’ve updated that manually, and you can see Jim’s posts.

Notes from NH Ruby/Rails, 21-Feb-2011

Eight attendees made it to the February meeting of the New Hampshire Ruby Rails group at the New Hampshire Innovation Commercialization Center. A round of introductions included the usual suspects and several new people with interesting backgrounds and interests.

Brian Turnbull talked about Ruby debugging. He had a sample he created on Github Ruby comes with it’s own debugging library, but you can add a good one with a gem: ruby-debug.
Commands:
list – lists the code currently load
next – steps through the code listed, but skips over subroutines.
step – steps into the code
where – dumps the stack
finish – finishes the current subroutine call
display – dumps a value
(commonly use display value.inspect to make a cleaner display)
pp – pretty print, evaluates any Ruby code you want
edit – launches the EDITOR variable in our shell
catch – catch exceptions
cont – continue
break – set a breakpoint

,,, and so forth. Use the help, it is your friend.

The second example is far more complex, with a Sinatra app using OmniAuth and an LDAP provider. Following the supplied documentation, the app crashes on startup. (That’s what you get for reading the docs!) Debug and another tool – rbtrace to the rescue! Excellent demo of the problem and how the tools can debug them.

Fail2Ban more skript kiddies poking 404 files

I review my web server logs pretty regularly, and there’s a pattern of 404’s I’ve seen recently that I haven’t been blocking up until now: searching each directory for ‘contact.php’ or ‘setup.php’ — the latter often searching for every variety of phpMyAdmin. I don’t have PMA on my machine, but I’d sure make sure I read all the instructions and removed setup.php if I had! (And you should, too!) I found this link that adds a simple test and rules using Fail2Ban to temporarily banning sites that hit too many 404’s too fast. I’ll have to see if this bonks too many search engines.

http://www.barbarycodes.com/2010/10/06/automated-banning-of-script-kiddies-with-fail2ban/

“That shouldn’t break anything…”

I changed one of the settings on the web server. I had it set to redirect from the older location of this blog http://www.tedroche.com/blog/ to the new subdomain of http://blog.tedroche.com but the redirect was set to a temporary (302) redirect rather than a permanent (301) one, causing extra traffic to the web server and slower response to the clients. I’ve changed this to a permanent redirect. There shouldn’t be any negative effects, he said, with his fingers crossed…

Seacoast WordPress Developers Group announce March meeting

Organizer Amanda Giles announced a second meeting of the Seacoast WordPress Developers Group:

When: Wednesday, March 2, 2011 7:00 PM
Where: NH-Innovation Commercialization Center, 75 Rochester Avenue, Portsmouth, NH 03801
Why: Let’s get together for another meetup. More details coming soon. Please send me your suggestions or ideas for things you would like to share or see shared.

CMS Learning Curves, artist unknown

CMS Learning Curves

Powered by WordPress. Designed by Woo Themes

This work by Ted Roche is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States.