tech stuff.

Archive for the ‘Uncategorized’ Category

Debugging regex from the CLI

leave a comment »

Just stumbled across this obvious solution from the why didn’t I realize this earlier? department. GNU grep makes an great regex debugger!

Read the rest of this entry »

Written by Lee Verberne

2017-02-21 at 12:43

Posted in Uncategorized

Quicktip: Use your own VNC client for Softlayer CloudLayer console

with 3 comments

Contrary to what Softlayer sales would have me believe, Softlayer’s CloudLayer service does, in fact, provide console access. It’s provided via a java VNC applet accessible from https://manage.softlayer.com.

I use Linux on the desktop, though, so anything involving the words “java” and “applet” seems destined for failure. Fortunately, Softlayer is stand-up enough to provide the VNC connection information on the same page, so I thought I might fire up PPtP and give it a shot.

Strangely, I was unable to get Vinagre or gtkvncviewer to work. They would connect and send keystrokes successfully, but the display would remain blank. Bummer. The jtightvncviewer provided by Ubuntu’s tightvnc-java package works, though, and I don’t care enough to figure out why Vinagre didn’t work.

Good Luck, and if you figure out why Vinagre doesn’t work please let me know.

Written by Lee Verberne

2012-02-12 at 13:29

Posted in Uncategorized

Tagged with

Installing Apache modules on Mac OS X Leopard

with 2 comments

Installing mod_python on my mac laptop was surprisingly difficult.  My first attempt of simply compiling it with {LD,C}FLAGS="-arch ppc -arch ppc64 -arch i386 -arch x86_64" failed in a bit of a strange way.  It appeared to create a universal binary for the DSO, but apache failed to load it with the following error message:

httpd: Syntax error on line 118 of /Volumes/Workplace/pflex/2.1.x/Build/build/ValidationWeb/apache/etc/httpd.conf: Syntax error on line 22 of /Volumes/Workplace/pflex/2.1.x/Build/build/ValidationWeb/apache/etc/platform/i386.Mac OS X/httpd.conf: Can't locate API module structure `python_module' in file /usr/libexec/apache2/mod_python.so: dlsym(0x100201000, python_module): symbol not found

As it turns out, the build process was respecting the LDFLAGS & CFLAGS for processes called directly by make, but it was not passing them on to apxs.  Adding the following to src/Makefile (after the initial INCLUDE declaration) worked to put apxs on the right track:

INCLUDES+= -Wc,-arch -Wc,ppc -Wc,-arch -Wc,ppc64 -Wc,-arch -Wc,i386 -Wc,-arch -Wc,x86_64
INCLUDES+= -Wl,-arch -Wl,ppc -Wl,-arch -Wl,ppc64 -Wl,-arch -Wl,i386 -Wl,-arch -Wl,x86_64

So, the procedure to install mod_python is:

  1. Download source here
  2. ./configure
  3. Add above two lines to src/Makefile
  4. make
  5. sudo make install or sudo make install_dso

Written by Lee Verberne

2008-11-19 at 17:48

mtr versus pot (plain ole traceroute)

leave a comment »

It drives me nutso when someone reinvents the wheel and then the reinvention becomes more popular than the actual wheel.  Usually it happens with some kind of great slogan explaining why this wheel is better.  “New WHEEL!  Now with more ROUND!” or “Much like previous so-called WHEELs, but NEW WHEEL is avaiable in 5 pastel colors!”

With that in mind,  I finally broke down and took a look at Matt’s Traceroute, mtr.  (Ok, ok.  Now it’s “My Traceroute”, but that’s even dumber than “Matt’s Traceroute”.)

According to MTR’s website, “mtr combines the functionality of the ‘traceroute’ and ‘ping’ programs in a single network diagnostic tool”.  They go on to explain that mtr sends out ICMP echo requests with modified TTLs in order to discover the routers along a route and determine statistics for each router.  Fantastic.  So it’s traceroute -I.

In general, I’m not a fan of traceroutes that use ICMP instead of UDP.  I’ve found ICMP too often receives special-case low-priority processing that provides misleading results.  It used to be that ICMP was filtered more rigorously than UDP, but (strangely) this seems to be diminishing.  Also programs generating ICMP have to be run as the superuser or left setuid, and who wants that?

The UI to MTR is pretty compelling, though.  I thought I was going to hate the ncurses interface, but it turns out that I only want to hate it.  You know.. like I want to hate top but end up using it anyway.  The point of MTR seems to be to run a traceroute over and over.  That’s pretty neat, though it’s something I hardly ever need.  MTR also does a better job of displaying multiple routers per hop as well.

Other than the interface, I don’t see much value-add.  There’s a lot less in the way of configurable options.  The other side of that coin is that I’d really have to stretch to fabricate reasons not to use it as well.  For general purpose use, the only really annoying thing is that you have to run it as root.

I’ll probably continue to avoid it for the same reason I avoid ruby-on-rails.  Until I need it, of course.

Written by Lee Verberne

2008-09-02 at 17:25

Posted in Uncategorized