This weekend I got rid of the Digital AlphaServer 4000 5/300 that I've had for a number of years. It ended up going a friend, so hopefully some good use will be made of it. Honestly, getting rid of it is probably for the best: it's a pain to move (huge + weighs a third of a ton), and I haven't used it for a while...in fact, it hasn't been plugged in since moving out to Oregon a couple years ago. Still, I can't help but feel a little bit nostalgic & miss it a little bit... Between this & the other stuff I've given away over the last 4 months, I'm now down to the fewest number of computers I've owned since December 2002. Huh. Seems odd to realize that. Anyway, bye Azure the AlphaServer! Now playing: Lifehouse – Who We Are – 05 Broken
Java EE lesson from this week: At least on WebSphere Application Server v6.1, ordering of elements matters in a .war file's web.xml definition file. <servlet-mapping> definitions must occur after the servlet being mapped has been defined. So this works: <servlet id="JAXWS_MyFirstService">
<description>My first JAX-WS demo service</description>
<display-name>JAX-WS: My First Service</display-name>
<servlet-name>com.ntldr.example.jaxws.MyFirstServiceSoap12PortImpl</servlet-name>
<servlet-class>com.ntldr.example.jaxws.MyFirstServiceSoap12PortImpl</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlate-mapping>
<servlet-name>com.ntldr.example.jaxws.MyFirstServiceSoap12PortImpl</servlet-name>
<url-pattern>/MyFirstService/Soap12</url-pattern>
</servlate-mapping>
(good!)
But this generates bizarre NullPointerException's during attempts to load the .ear file:
<servlate-mapping>
<servlet-name>com.ntldr.example.jaxws.MyFirstServiceSoap12PortImpl</servlet-name>
<url-pattern>/MyFirstService/Soap12</url-pattern>
</servlate-mapping>
...
<servlet id="JAXWS_MyFirstService">
<description>My first JAX-WS demo service</description>
<display-name>JAX-WS: My First Service</display-name>
<servlet-name>com.ntldr.example.jaxws.MyFirstServiceSoap12PortImpl</servlet-name>
<servlet-class>com.ntldr.example.jaxws.MyFirstServiceSoap12PortImpl</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
(bad!)
Yes, I ran into this problem this week at work. And it took me forever to realize that I'd made such a stupid mistake. So, keep in mind: servlet-mapping comes after servlet!
Now playing: Emm Gryner – Stray Bullets – 05 Holiday
No fun computer stuff this weekend...all my motivation to do stuff like that got destroyed by work on Friday, where I spent the whole day banging my head against the wall trying to get servlet-mapping's to work with WAS 6.1 Feature Pack for Web Services...obviously I'm doing something wrong...just no idea what. At least not thinking about it at all this weekend has given me a few ideas of things to look into on Monday... No, this weekend was spent cleaning. Saturday involved acquiring cleaning supplies. Today has involved the actual cleaning. I've had two "DOH!" moments with cleaning, where I just realize that up until that point, I've been doing it all wrong. The first was two years ago when I discovered the vacuum cleaner has a filter, and that filter needs to be Replaced Periodically (this explained the decreasing performance and all the dirt left on the carpet...). Filter not replaced for 3 years: bad performance. Replace filter, and *shock* miraculous improvement! All of a sudden vacuuming actually makes a difference! Today, I realized I've been cleaning the linoleum floor in my kitchen wrong. For the last three years. I've tried a bunch of different floor cleaners, but in the end it seemed that the floor was always still dirty. In the end, it always came down to having to apply enough elbow grease & spending hours on hands-and-knees to scrub the floor down. What good was a mop? It just didn't work. Today I tried a tile cleaner (it hadn't worked against the soap scum & rust stains in the bathroom, so what the heck? might as well make some use of it...). So I sprayed it on the floor and wiped it up. And all the built up dirt & grime just vanished. Egats! What is that magical stuff?? What wondrous chemical concoction could achieve such results??? Here's what the bottle says: - 2.28% chlorine bleach
- 97.72% water
Now playing: Emm Gryner – Stray Bullets – 06 Stray Bullet
Remember that trip I was thinking of taking down to Berkeley? Well, it happened! Got a flight down after work in the middle of the week (Wednesday) on Southwest, with a direct flight into Oakland (much nicer than those flights into Oakland via SFO & DEN...). I was late heading to the airport, and then the Max broke down en route, so I was worried about missing the flight and got chastised by the security checkpoint people for being in such a hurry (I mandate this was merely because of the contrast of my efficiency with the sloth immediately preceding me...). But I made it with plenty of time to spare. And the flight was only a quarter or third full, so I ended up with no one next to me (nice change of pace from most flights where I seem to be singled out by "larger" individuals as a good seatmate...). Anyway, landed a bit early and promptly found out Emil (the friend I was going down to visit & stay with) had only just left. And then he got lost because of GPS issues. So, I ended up hanging around curbside for an hour. There's not much to see at an airport at night. Eventually we met up & headed back to Berkeley. Only to end up on Treasure Island. Oops...silly GPS units...but I did get a good view of San Francisco at night, which was cool (sorry; no pics, we were in the car and couldn't really stop to get out the cameras). The next day was spent walking around the Berkeley campus. I liked how it was hilly and had vegetation. Purdue just seems kind of...flat...in comparison. I think Purdue had better architecture though, and more modern facilities. So maybe all that construction that my tuition paid for was worth it after all... : Tree on campus (near the Life Science's building) : Soda Hall, UC Berkeley campus The next day was supposed to be tourist day in San Francisco. Which started off really well; we got to San Francisco without getting lost again (hehe...). But the weather didn’t really cooperate & it rained. A lot. We still walked around Fisherman's Wharf, which was pretty deserted. On the bright side, parking was really easy! So after grabbing lunch & getting wet, we got back into the car to see the other attraction at the top of my list: the Golden Gate Bridge : : Golden Gate Bridge, San Francisco By the time we got to the view point though, the weather had turned a bit worse. Winds came in and the rain started coming down harder. After grabbing a photo or two, I got the brilliant idea of heading over to the visitor center (50 feet away). Those 50 feet resulted in my rain jacket getting soaked through. The 50 feet back to the car meant that we were both totally soaked. At which point it seemed like a good idea to conclude the site seeing for the day and just head back. For dinner, I met up with a friend from high school (John) that works in the Valley. Which was a lot of fun (even if I don't feel like I helped the conversation much...:( ... meh). The last full day there consisted of a lot of driving. Headed over to South San Francisco to see where my parent's are going to be living now & hit up a couple of Filipino Bake Shops to get goodies for my coworkers. Got to see the big "South San Francisco" sign, stopped at Red Ribbon & Goldilocks, and then headed out to the coast at Pacifica. Drove down route 1 to Half Moon Bay...the coast there is beautiful! : Montara Beach (?) On the way back we swung through Mountain View, Santa Clara, and San Jose. Honestly, that was probably the part of the trip I liked the least. Too many strip malls, suburbs, cars, & people. Which to be honest is kind of what I was expecting from California... Seeing all the tech companies there was sort of interesting, but didn't outweigh the dislike of the environment. On the plus side, I did find out that Skype video conferencing actually works really well over my WWAN connection from AT&T (you still need to come out & see it in person though, Matt!). So, California...liked San Francisco, liked Berkeley, liked the coast, but didn't really like Silicon Valley all that much (nor the East Bay Area much either...). I'll have to go back sometime & hope for better weather so I can actually do the touristy stuff. Maybe in April...got some time off there...might drive down this time though... (full picture album) Now playing: In-Flight Safety – The Coast is Clear – 07 Fear
Here's the workflow I used for analyzing the logs from this website: - Wait until end of day.
- Copy the day's log file to a temp directory.
- Run the log loading utility (this also applies the geolocation lookups, so sometimes the geoip databases need to be refreshed from www.maxmind.com)
- After a bit (3-20 minutes usually; depends highly on the level of traffic), the log entries are all in a SQL Server database.
- The database has a View that filters out bots, crawlers, spammers, and internal traffic
- I view the external user records by querying the view.
That view has a horribly complicated SELECT statement. Which I found out this week had some bugs, so not all results were being correctly returned. And by "horribly" complicated I mean that it has thousands of conditions that are being evaluated. So after wasting a bunch of time trying to chase down where the problems were, I decided to scrap that approach and come up with a better one. What came to mind was developing some sort of "how-likely-is-it-that-this-record-should-be-hidden" score. The more pieces of "evidence" that a particular request came from a bot/crawler/spammer/etc., the higher the score. So now I've got a basic implementation going. It's written in C# 4.0 (hey, have to play with the new stuff sometime!) and operates as a separate external utility that persists the score as another field on each log entry's record. It took that massive SELECT and refactored it down into 45 separate rule sets (classes)...much more manageable! At the moment the scores from each rule are kind of arbitrary, and will probably need to be redone/tweaked in the future. Right now I'm basically taking everything that didn't match a rule (score = 0) and treating that as legitimate external traffic...which seems to be working fairly well, but isn't really as fine grained as I originally envisioned. Also, at some point (soon) I need to add more complex conditions. A couple of bots operate in such a way that if you look at any one individual request to the web server, that request is legitimate. But as soon as you see, say, 4 requests, repetitive patterns start to emerge and it becomes obvious that some sort of crawling is going on. So having an automated way to catch these would be nice...but also more complicated...probably just haven't thought about it enough yet... Coolest parts of doing the new implementation: Linq to SQL, & using Linq + reflection to automatically discover all the rule sets. Just a couple lines of code to do such complex things! And it's so much simpler with that syntax! Now playing: In-Flight Safety – We Are An Empire, My Dear – 05 Torches
Last Monday I applied a redirect rule to the site. And promptly watched (okay, so it took me 4 hours to notice...) as things went crazy & stuff broke. So, to help avoid that in the future, here's what I did & why I think it broke, and what was done to fix it. Okay, so basically, there are 4 different domain names that can get visitors to this site. That's nice and all, but it doesn't help the search engine rankings at all. Also, it just seems kind of...repetitive (let's face it; this is probably the real reason I bothered to mess with things; having 4 different paths isn't as elegant as having just one). So I downloaded the URLRewrite add-on for IIS 7.5, installed it and created a simple rule: 1: <rewrite>
2: <rules>
3: <rule name="Redirect to www.ntldr.com" enabled="true" stopProcessing="true">
4: <match url=".*" />
5: <conditions>
6: <add input="{HTTP_HOST}" pattern="^(www.)ntldr.com$" negate="true" />
7: </conditions>
8: <action type="Redirect" url="http://www.ntldr.com/{R:0}" />
9: </rule>
10: </rules>
11: </rewrite>
The rule looks at every URL used to get to the site, checks to see that the destination server is not www.ntldr.com, and then redirects the request to http://www.ntldr.com/whatever-the-original-request-was. Pretty simple, tested it internally, verified it was working, then applied it to the site and went away for a few hours.
And came back to find that the logs had tens of thousands of entries. Mostly from some computer in Kansas that kept going to / over and over and over and over again. For almost 2 hours. The bots almost universally gave up after just 6 rounds.
Of course I immediately turned off the rewrite rule and frantically began looking at logs & network traces trying to figure out what the heck was going on and how I managed to not catch it in testing. It quickly became apparent that the rule worked internally, but not from outside the Forefront TMG 2010 firewall. Which narrowed down the problem quite a bit, & made me feel less incompetent (yay! the rule worked!), but more stupid (doh! for not testing like an actual user would!).
However, examining the TMG logs didn't really yield anything useful. A request would come in, it would go to the web server, a 301 Permanent Redirect would go back, and then the client would seem to reissue the same request again. Out of desperation, I decided to take a look at the rule and noticed this tab:
At the time, "Apply link translation to this rule" was checked. And one rule is used to make all 4 hosts accessible. Consequently, this is what the Link Translation Mapping looked like:
Public name: ntldr.com
| Original URL |
Translated URL |
Mapping Details |
| http://ntldr.com |
http://ntldr.com |
Rule Defined: ntldr.com |
| http://www.ntldr.com |
http://ntldr.com |
Rule Defined: ntldr.com |
Public name: ntldr.net
| Original URL |
Translated URL |
Mapping Details |
| http://ntldr.net |
http://ntldr.net |
Rule Defined: ntldr.com |
| http://www.ntldr.com |
http://ntldr.net |
Rule Defined: ntldr.com |
Public name: www.ntldr.com
| Original URL |
Translated URL |
Mapping Details |
| http://www.ntldr.com |
http://www.ntldr.com |
Rule Defined: ntldr.com |
Public name: www.ntldr.net
| Original URL |
Translated URL |
Mapping Details |
| http://www.ntldr.net |
http://www.ntldr.net |
Rule Defined: ntldr.com |
| http://www.ntldr.com |
http://www.ntldr.net |
Rule Defined: ntldr.com |
Oops. Fairly major, mind-numbingly stupid oops.
See, this is what was happening:
- User visits http://ntldr.net.
- Request for http://ntldr.net comes into Forefront TMG.
- Forefront TMG processes the ntldr.com rule and forwards the request to www.ntldr.com (at this point, an internal DNS alias for the actual server, tourmaline.global.ntldr.net).
- IIS gets the request and applies rewrite rules.
- Rewrite rules send a reply back saying "no, you really should go to http://www.ntldr.com".
- Reply reaches Forefront TMG. Forefront TMG applies Link Translation mappings.
- Link Translation mappings change that to "no, you really should go to http://ntldr.net".
- User dutifully goes to http://ntldr.net.
- Repeat 1-8 until the user's browser either gives up (nice browsers), or the user gives up (impatient users), or I disconnect them.
So, the solution: disable link translation in Forefront TMG. Note that I not only had to do that on the rule itself, but also in the Web Filters. That might be just because I was impatient and didn't wait for TMG to fully cycle and disable the rule-level mappings. Not sure though, and haven't had a chance to find out yet.
Now playing: The New Pornographers – Challengers – 07 Unguided
Okay, better (although less productive) idea than messing around with URL normalization: why not read that Consider Phlebas book that's just laying around? It's actually the 3rd Iain M. Banks book I've read. Summary: I liked it. It came recommended via a couple of sources, and definitely had parallels to one of the web comics that I read (Schlock Mercenary). Actually, come to think of it, maybe I read that comic because it was recommended by the same people that recommended the book...meh, don't remember now...could be another occurrence of the echo chamber phenomena of the blogosphere. I think it ranks in between the other two books. I still like Use of Weapons the most...maybe in part because it was the first one I read? Maybe I just liked the way it ended, even if it was obvious to more astute readers. But both stories come out ahead of Matter. I can't really fault the writing of Matter at all; that was excellent, with good pacing of the main storyline, quite a bit of character development, and an interesting overarching plot that integrated the annoying primitive-royalty subplot well (in the end). But I didn't like the book. That subplot & all the characters involved in it were just too...annoying. There's a similar thing with movies that I've discussed with friends (specifically regarding whether rating of films on Netflix should be based on how much one liked it or how good it was). Maybe this is true of everything...something can be good; interesting; technically very well executed...but there's no lasting emotional connection, just a slightly bad aftertaste, a desire to move on to something better... Should have figured out how to have IIS redirect requests for things like 'CommentView,guid,8c43204e-2fae-4716-bfba-7c9d3225225d.aspx' to 'CommentView.aspx?guid=8c43204e-2fae-4716-bfba-7c9d3225225d' instead... Now playing: Basia Bulat – Heart of My Own – 07 If Only You
Also, because I'm feeling extra artistic: (that's totally a dragon, not a cat with orange whiskers...the orange is *totally* fire...that's how you know it's a dragon! (otherwise, yeah, it would be a cat)) In case anyone is wondering, yes, I took art classes instead of band or orchestra or choir back in school. I also had to handwrite a lot of stuff. Apparently neither helped much (but I'm okay with that! :P)... Also, (actually, this is unrelated to the above...) tickets are booked for Berkeley! Fly down February 24th, and back February 28th. As a further aid to any potential criminals who would like to advantage of my absence & rob my apartment, my address is 1000 SW 3rd Ave, Portland, OR. Ignore the signs that say "Courthouse" & "FBI" & "U.S. Marshall"...that's just the management company's way of cheaping out on security... Oh well, that is all. Back to watching Andromeda & laughing at the awful badness until tears come...or maybe I'll just listen to the new Basia Bulat album some more while looking at URL normalization through rewrite rules...ah, the tough life of weekends! ;) Now playing: Basia Bulat – Heart of My Own – 05 Heart of My Own
Originally, this post was going to be a rant about how SQL Server Reporting Services is useless, and how Excel was so much easier for creating graphs & doing useful analysis of data. Then I spent an hour and a half messing around writing queries, executing queries, exporting & importing result sets, and then manipulating the data. So all the "oomph" has kind of gone out of that rant. Besides, I shouldn't even be messing around with this data; there are a bunch of very nice programs/scripts sitting around on the Internet to do the analysis & reporting for me. But doing things the easy way would be cheating. So instead I keep mucking around with my own custom tools & processes. In any case, here's a bunch of pretty graphs showing the human-like page views per week broken out by country of origin. Data for other views is a bit...messy...right now. The per-country stuff is fairly clean because I'm just using a geoip database to map requesting IP address to source country. (yes, one would have probably been sufficient to show what I was doing, but hey, if one is good, five is even better?) (also, in all honesty, I'm guessing I don't have enough consistent traffic to make looking at a week-by-week view meaningful; better would probably be to focus on longer time spans, like a month or so) Now playing: Matthew Barber – Ghost Notes – 06 One Little Piece of My Love
|
About the author

Jeffrey Stults is a software developer currently in Portland, Oregon. He is contactable at:
stultsj@ntldr.net
Archive
| | Sun | Mon | Tue | Wed | Thu | Fri | Sat |
|---|
| 28 | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 14 | 15 | 16 | 17 | 18 | 19 | 20 | | 21 | 22 | 23 | 24 | 25 | 26 | 27 | | 28 | 29 | 30 | 31 | 1 | 2 | 3 | | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
Disclaimer
Disclaimer
The opinions expressed herein are my own personal opinions and do not represent
my employer's view in any way.
© Copyright
2012
Jeffrey Stults, Jr.
Statistics
Total Posts: 256 This Year: 0 This Month: 0 This Week: 0 Comments: 23
Utilities
Pick a theme:
Sign In
|