Sunday, September 9, 2018

New release: Short Stories, Collection One

So...  My 2nd book has been released on Amazon.  Still a Kindle book. 

Short Stories, Collection One is available for sale for a whopping $2.99. 

I think it has some of my best work to date.  Probably because I wrote it.  There's nothing wrong with a little shameless self promotion as long as it is described as such.

I suppose I haven't had much to say as of late.  A lot of doing, but not much talking or describing.  I know I should probably do more describing, but eh well. 




Thursday, August 9, 2018

Favorite powershell command of the moment

Get-Content "file path" -wait

It's the Linux equivalent of    tail -f "file path"

Great for watching log files.   Easy to use.   Easy to test.

Yay for good powershell commands.

Friday, May 25, 2018

1,000 lines of Python


Did I ever think I'd intentionally write 1000 lines of python code?   Not really.   But I'm getting up there.

Python is pretty good for parsing through XML files and gathering the data.  From there, it can be used to compare that data to expected results.  Auditing.  

When I first thought of the idea of auditing Verifone Commander configurations, I never contemplated what it would take in time, code, and labor.   It's been a lot of all of.  But now I'm almost up to 1,000 lines of code to audit a Verifone Commander system.  

I wish Verifone would make their equipment scale better.  Enterprise level management would be awesome.  Then I wouldn't have to cobble tools together using Python, Powershell, and AutoIt.  

So how does all this work?   AutoIt is used to automatically backup every single site.   Once the backups are complete, the audit script will run over the files to examine what the settings are in comparison to what they should be.   


So at the point of originally writing this, the code was just barely reaching 1,000 lines.   It has since broken into numerous modules and is closer to 4,000 lines.  And I've still got about a dozen files to go.

Maybe I need to spend more time researching better Python coding.  Or a way to organize libraries better.  But going through 1 file that's more than a 1,000 lines of code is a pain.  So it's easier to break the things into separate modules. 


I guess the other part of this....  is it worth it spending probably 40 hours writing an estimated 6,000 lines of code to audit a system? 

Yes, yes it is.


Wednesday, May 2, 2018

Baby dos and don'ts

This one is going to be long way off from anything I've discussed recently, but that's okay.  It's my blog and I'll post what I want to...

Baby Do's and Don'ts.

First: I'm not a medical doctor.  I don't play one on TV.  This from my experience.

This is going to be more of a cheat sheet than anything else... 

Do: get a swing.   Let the baby sleep in the swing.   

As a parent, you will get better sleep faster.

Why?  As a mom walks around, she sways back and forth constantly, rocking the baby to sleep.  So the baby is used to getting rocked to sleep.  After birth, we expect them to instantly fall asleep on their backs (which they haven't been laying on for the last 9 months) on a stationary object.   That's a recipe for disaster. 

Just try and change the way you sleep.  Go ahead.  I'll wait. 

And for the record, I've done this before.  Even minor sleeping changes are a pain.

Do: ignore the schedule the hospital gave you.   

Yes, you should feed the baby.  Yes, you should verify the baby is peeing and pooping enough.    But mechanical feeding every 4 hours?   Get real.  Since when do you do that?  If the baby is hungry, it will tell you.  By yelling at you and crying. 

Don't: pay super strict attention to the schedule the hospital gave Mom.

What?  You mean you don't want Mom blocked in sunless room devoid of exercise for the first two weeks?    No. I don't. 

Sunlight and light exercise (walking.   Just walking)  are the best things to stop post partum depression before it starts.  Depending on the delivery, and how your body feels go for walks and gets some sunlight. 

If those two things are normally linked to getting rid of depression, then you should probably do them. 



That is all for this round. 
And yes, I do have kids.   4 of them, now. 

Friday, April 20, 2018

The Brilliance of Companies

I've worked for various companies over the years, and I've realized a few things.

The most important one is this: the crowd is not smarter than you.

Perfect example of this kind of logic: we don't like situation X because of the way we did this.

Let's go build another one with the same problem as X.


I wish I could be more specific, but it's an ah-ha moment when it happens.  It's the smartest people in the room complaining for 20 straight minutes about a design they created, then refusing to fix it in the next new design.

People: this happens everywhere.   The Abilene Paradox is still alive and well.


Monday, February 26, 2018

Network Security on the Cheap, part 2: Graylog

So, I've spent the last couple of weeks setting up GrayLog in a cluster.

Giant pain in the butt.

My build was Ubuntu 16.04.  And that works fine.

Lots of stuff that is not mentioned, or even thought about.

A few things I had to solve...

1) Elasticsearch needs to be on the same version
2) Mongodb needs to be at least version 3 or higher.
3) The web URI information is badly documented.
4) A cluster won't form until you are using the same database for all servers.

I set up a router in front of my setup, resulting in a NAT'd public IP address and the cluster behind.  Gives plenty of room for growth without ever readdressing anything externally.

Based on recommendations, I changed the listening port to 12900.   Not sure the implications or reasoning of that.  But it seems to work for me.

So, private IP is IP of the server.
Public IP is the NAT'd IP of the server. 


rest_listen_uri =  private ip/api/
web_listen_uri = private ip
web_endpoint_uri = public ip/api/
rest_transport_uri = private ip/api


forgetting the /api/ on the web_endpoint_uri causes a specific issue




It's the cannot POST issue.

Don't forget the /api/ setting.

Once that is done

I also load balanced the web interface using HAProxy.

Final thing about Graylog, and one I wondered about...

Once I've got the cluster up and working, do I need to load balance my UDP syslog traffic?

Short answer: probably not.

Though it doesn't look like the other servers in the cluster are doing anything, they are.  Easy way to tell is look at the number of messages waiting and processing.  With 2 servers in my cluster, my waiting and processing at 4,000 messages per minute sits in the dozens.  There's never a queue.

So, with two low power computers and a whopping total of 14 GB of RAM, I process 4,000 messages a minute with zero wait.  That includes bursts of up to 6,000 messages per minute.

I'm not saying you won't need to load balance the UDP traffic.  I'm saying you need to base it off your scenario.  And figure out how many messages per minute you are getting.

Generally, UDP is low overhead network traffic anyways.  The general problem is not that you can't receive enough data.  It's that the data takes too long to process, resulting in a queue.  That's the purpose of building a cluster.

Total cost at this point?  3 cast off computers that aren't good for much else.  One of my computers runs 6 GB of RAM and runs 100% CPU usage.   Yet it still handles enough to reduce the load of the primary computer.