Category: Simple Stuff I Forget

The Magic of Logparser

I had a slew of IIS FTP logs to dig through for a work project. I needed unique visitor details, and I needed it from a month of logs. Some of these daily logs were in excess of 40mb. I threw together a PowerShell script to do just so, kicked it off, and waited. And waited. I reconfigured the script to be more efficient in its processing, kicked it off again, and waited. And waited. And researched, because this was taking far too long. And – late to the game, I know – I found Microsoft’s Logparser. Logparser is a free tool, and it’s filled with magic. With one simple query it managed to pull the raw data I needed from the log files in *seconds*.

#log files in c:\temp\iis, results to same path

logparser "SELECT DISTINCT c-ip, cs-username INTO C:\temp\iis\results.txt FROM 'C:\temp\iis\*.log'" -i:W3C -o:W3C


In less than a minute I had a text file of unique visits gleaned from 550 MB worth of plaintext log files. From there I could use PowerShell to filter out any IP dupes (some connections do not have user details, thus producing some leftover duplication) and resolve hostnames from IP addresses to create a final masterlist. I’m not sure how Logparser does what it does so quickly.

Windows 10, NVidia, and Paint Shop Pro

I’m a luddite – I love Paint Shop Pro 9. Yeah, I use Illustrator and Photoshop and Inkscape and Gimp and all that goodness but, in a pinch, PSP9’s been my go-to quick and dirty image manipulator forever.

Then I got a fancy new laptop with a fancy new video card… and PSP9 wouldn’t work. It wouldn’t produce a window on launch, even though I could see it there in the task manager, running. And when I uninstalled and tried to reinstall, it hung for infinity on “registering modules.”

Continue reading

RW Elephant Inventory WordPress Plugin and Divi

This is an obscure one. I have a client that uses this combination for their business. RW Elephant put out their new plugin v2x rather than update their old v1x plugin, and it’s basically like starting over. Honestly, configuration worked pretty well, but there were some problems. Firstly, it defaulted to full browser width on its primary inventory screens, which looked like poop. This was fixed by heading to their rw-elephant.min.css in wp-content\plugins\rw-elephant-retail-inventory\lib\assets\css and changing the .rwe-inventory margin setting to auto and width to 80% in order to shrink and align the inventory content.

Continue reading

No-IP DUC (Dynamic Update Client) for Raspberry Pi as a Service

I originally followed No-IP’s instructions for installing their DUC on a Raspberry Pi, and thought things were fine until I discovered upon IP change that updates weren’t. Updating, that is. With a little research I came across this extremely helpful site which outlines how to install the No-IP DUC as a service on Raspbian. Be aware, the instructions start from scratch, assuming that you don’t have the DUC installed yet.

For the bit highlighted above, you’re going to instead want to navigate to whatever the directory is that your DUC installation dir is within. In other words, if the NoIP DUC lives in /home/pi/noip/noip/noip-2.1.9-1 you’re going to want to navigate to /home/pi/noip before pulling down and unpacking that .tar as instructed in line 2/3 there. Other than that, this worked like a champ. Thanks site person!

TTRSS – Call to undefined function mcrypt_decrypt()

I upgraded my TTRSS installation to PHP 7.2, and suddenly I started seeing this pop up when it would attempt to update certain feeds:

When I’d click on those feeds to try and edit them, I’d get this:

Basically something akin to this:

Fatal error: Uncaught Error: Call to undefined function mcrypt_decrypt() in …/include/crypt.php:12 Stack trace: #0 …/classes/pref/feeds.php(633): decrypt_string(‘+rn7weUKbTMS3Ks…’) #1 …/backend.php(130): Pref_Feeds->editfeed() #2 {main} thrown in …/include/crypt.php on line 12

I did a little digging and discovered that mcrypt is defunct in PHP 7.2. Threads on the TTRSS forum spoke of hitting update.php with an argument via command line, but I don’t have command line access to my installation. I dared not ask on the forum as while I love TTRSS, those on the forum are notoriously self-important and assholey, happier to lambast you for being an idiot than actually help. Instead, I started doing some poking and discovered that all the feeds causing this problem had one thing in common – a populated auth_pass field in the ttrss_feeds table in the database. I ran a simple:

update ttrss_feeds set auth_pass=”

(After doing some testing, of course) and the problems disappeared. The communications warning went away, feeds started updating, and I could successfully open the edit dialogs on all my feeds.

SQL Powershell tools

I’m not sure why MS makes it so convoluted to install these tools on a server that isn’t running SQL.  Regardless, head here:

And don’t click download.  All that gets you is a text file.  Instead, head down the page and expand Install Instructions.  From there, search for and download the following modules:

  • Microsoft® System CLR Types for Microsoft® SQL Server® 2012 (SQLSysClrTypes.msi)
  • Microsoft® SQL Server® 2012 Shared Management Objects (SharedManagementObjects.msi)
  • Microsoft® Windows PowerShell Extensions for Microsoft® SQL Server® 2012 (PowerShellTools.msi)

If you get a 2503 or 2502 error while trying to install, as I did, you may not have sufficient rights.  Try either killing explorer.exe and restarting it with admin privs or invoking the msi from within an elevated command prompt.

Then just install modules a la:

Import-Module sqlps -DisableNameChecking