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.