SysAdmin
Sysadmin Shell Joy: Renaming Archived logs to useful names
Submitted by Steve on November 26, 2008 - 4:20pm.One of the things that (mildly) irritates me about sysadmining Unix boxes is the log rotation. ie /var/log/messages gets rotated to /var/log/messages.1 then finally /var/log/messages.2.gz.
So You Want to Learn Regular Expressions? Part 7: Examples: IP Addresses
Submitted by Steve on November 9, 2008 - 7:05pm.The full list of Regular Expression Articles I've done:
In this article I'm going to take you a little through the method and madness of creating regular expressions for filtering or identifying IP Addresses and Ranges.
It will demonstrate and combine the concepts explored in previous articles. Hopefully cast some illumination on the method of solving Regular Expression problems, and highly coincidentally, show how to filter your corporate network from your Google Analytics stats.
So You Want to Learn Regular Expressions? Part 6: Errr... Or...
Submitted by Steve on November 9, 2008 - 7:02pm.The full list of Regular Expression Articles I've done:
In the previous article with our box of chocolates, we used a method for choosing between one or more of several, more or less random, characters. [abc]+ for example.
But a common task in any web analytics is to be able to choose between several different items and treat them identically.
eg Images: gif, jpg, png
or, Pages: htm, html, cfm, php, asp and so on.
Or to put the first case pretty bluntly in English, we want "gif" or "jpg" or "png" at the end of a file name request.
So You Want to Learn Regular Expressions? Part 5: Just Like a Box of Chocolates
Submitted by Steve on November 9, 2008 - 6:59pm.The full list of Regular Expression Articles I've done:
- What and How? - Wherein we look at What a Regular Expression actually is, and How they basically work.
- Wild Cards - A starting look at the use of wildcards. Ways to find lots of stuff.
- Positioning - Finding stuff is good. Being able to specify where stuff may be found is better.
- More Wild Cards - More ways to find lots of stuff.
- Just Like a Box of Chocolates - The Ultimate Analogy. Single choices from between Square Brackets.
- Choices, Choices, Choices.... - Exposing bigger choices: Err... Or.
- Filtering IP Addresses - Wherein I bore the reader to tears explaining how to RegEx for IP Addresses.
"Just Like a Box of Chocolates"?? Yeah. Pretty cool analogy isn't it! Just wait! 
I hope we're all familiar with the principle of being offered to pick a choccy from a box of Chocolates. Pick one and one only. But any one of the myriad of choices arrayed before you.
Well those clever Regular Expressions supply a tasty Box of Chocolates as well.
So You Want to Learn Regular Expressions? Part 4: More Wildcards
Submitted by Steve on November 9, 2008 - 6:56pm.The full list of Regular Expression Articles I've done:
- What and How? - Wherein we look at What a Regular Expression actually is, and How they basically work.
- Wild Cards - A starting look at the use of wildcards. Ways to find lots of stuff.
- Positioning - Finding stuff is good. Being able to specify where stuff may be found is better.
- More Wild Cards - More ways to find lots of stuff.
- Just Like a Box of Chocolates - The Ultimate Analogy. Single choices from between Square Brackets.
- Choices, Choices, Choices.... - Exposing bigger choices: Err... Or.
- Filtering IP Addresses - Wherein I bore the reader to tears explaining how to RegEx for IP Addresses.
In this instalment of this series on Regular Expressions, I'll expose a wee lie from part 2, and show how wildcards can be less wild. More controlled. And hence more useful.
A LIE????
Urm. Yes. Not to put too fine a point on it. A school/teaching progression type of lie. You see a ".*" construct isn't actually a wildcard. The asterix is the wild card. All on its very own. Similarly the plus "+" in ".+".
So You Want to Learn Regular Expressions? Part 3: Positioning
Submitted by Steve on November 9, 2008 - 6:51pm.The full list of Regular Expression Articles I've done:
- What and How? - Wherein we look at What a Regular Expression actually is, and How they basically work.
- Wild Cards - A starting look at the use of wildcards. Ways to find lots of stuff.
- Positioning - Finding stuff is good. Being able to specify where stuff may be found is better.
- More Wild Cards - More ways to find lots of stuff.
- Just Like a Box of Chocolates - The Ultimate Analogy. Single choices from between Square Brackets.
- Choices, Choices, Choices.... - Exposing bigger choices: Err... Or.
- Filtering IP Addresses - Wherein I bore the reader to tears explaining how to RegEx for IP Addresses.
If you've been tracking the public discussion on Robbin Steif's blog regarding this series, you'll no doubt be aware that she was prompting me (in a really unsubtle fashion ;-) ) to explain the use of the "beginning" and "end" characters. ^ and $ respectively.
So that's what this episode in the series will be focusing on.
So You Want to Learn Regular Expressions? Part 2: Wild Cards
Submitted by Steve on November 9, 2008 - 6:49pm.The full list of Regular Expression Articles I've done:
- What and How? - Wherein we look at What a Regular Expression actually is, and How they basically work.
- Wild Cards - A starting look at the use of wildcards. Ways to find lots of stuff.
- Positioning - Finding stuff is good. Being able to specify where stuff may be found is better.
- More Wild Cards - More ways to find lots of stuff.
- Just Like a Box of Chocolates - The Ultimate Analogy. Single choices from between Square Brackets.
- Choices, Choices, Choices.... - Exposing bigger choices: Err... Or.
- Filtering IP Addresses - Wherein I bore the reader to tears explaining how to RegEx for IP Addresses.
In the previous article (So You Want to Learn Regular Expressions?) I hopefully managed to explain the underlying concept of using regular expressions via the Analogy of a jail.
In this article we'll start to explore the use of wild cards - what they are when to use them, and more importantly, when NOT to.
When NOT to use Wild Cards
Yes. You see, a regular expression will usually have two implied wild cards.
So You Want to Learn Regular Expressions?
Submitted by Steve on November 9, 2008 - 6:10pm.The full list of Regular Expression Articles I've done:
- What and How? - Wherein we look at What a Regular Expression actually is, and How they basically work.
- Wild Cards - A starting look at the use of wildcards. Ways to find lots of stuff.
- Positioning - Finding stuff is good. Being able to specify where stuff may be found is better.
- More Wild Cards - More ways to find lots of stuff.
- Just Like a Box of Chocolates - The Ultimate Analogy. Single choices from between Square Brackets.
- Choices, Choices, Choices.... - Exposing bigger choices: Err... Or.
- Filtering IP Addresses - Wherein I bore the reader to tears explaining how to RegEx for IP Addresses.
Perhaps you've been forcibly inducted into the Joy Of Regular Expressions through the use of tools like Google Analytics. Unfortunately while perfectly correct, the Google Analytics help for Regular Expressions is brief and does not explain the why of when to use X vs Y.
Hopefully the following article will get you through the why. I’m going to assume you’ve had at least some exposure to using Regular Expressions already.
On manually migrating a subversion repository to Launchpad/BZR
Submitted by Steve on November 6, 2008 - 10:04pm.I'd migrated one of my projects here (AWFFull ) from subversion to a bazaar repository hosted on Launchpad some time ago.
Works well, but were a few niggles and tricks in the process.
- all the code imported as 'steve' - which is accurate
but a little deflating to ones ego. - imported some of my earlier faffing around with subversion - again isn't a problem per-se, but would have been nice to clean it away.
So when it came time to migrating DNSHistory , I figured I'd have a go at fixing these niggles. Herein are the steps used.
KDE konqueror - not showing image previews
Submitted by Steve on May 25, 2008 - 4:11pm.One of those "blindingly obvious with hindsight" problems.
Problem: When browsing all our digitized images I noticed that many were not showing up as preview icons. Entire directories of images would have no previews, yet others would have 2 or 3 of 30+; others would have all.
Weird.
Google-Fu wasn't remotely successful. But did lead to the right place.
Konqueror ; Settings ; Configure Konqueror...
Scroll down to "Previews & MetaData"
Underneath the box of protocols to choose from "Select Protocols" is a horizontal slider.
"Maximum File Size". It's not obvious what this means or does from context or name. On my system that was having the issue, this was set to 1Mb. Increased to 5Mb and the problems went away.
Obviously, with the benefit of hindsight, what this actually means is the Maximum File Size to enable a preview to occur. Doh!


