Blog
- Examining Product Correlation in Customer Purchase Baskets
My self-assigned task was to look at all of the purchasing our customers have done and see whether there are any strong correlations between any purchased items. If we can find some strong correlation
- Using a Python Program to Post to an SFTP Server
We have a client that requested that we deliver a daily file with some data to their SFTP site. They planned to import the data into their systems in order to do some internal reporting. We are a Pyth
- Parsing Variable Numbers of Command Line Arguments in a Python Program
As part of the day job, I end up writing a lot of command utility-type scripts (programs). These are often scripts that are used very occasionally, like once per quarter. By the time a script is going
- Concatenating Lists in Python
We frequently come across situations where we need to add together two Python lists. We do have a couple of syntax options available to us as developers and they do, of course, have their tradeoffs. T
- Creating a Variety of Dummy Order Ids in Python
I have a work task to give our sales reps a tool where they can add dummy customer requests into our system. Since we ingest data from a variety of vendors, we have “order ids” that are in a variety o
- Using Python to Select and Load a Random File
I had a task to create a mechanism to load sample data so that we could do some demonstrations. Our incoming data is in JSON format so I took a bunch of requests and put them into individual text file
- Capturing Video of Your iPad or iPhone App in Action
If you’re developing iOS apps there will come a time when you want to capture some video of your app in action. It may be for the marketing team. Or it may be for you to use to publish your app in App
- Parsing JSON into Swift Objects
One of the kind of neat, newer features in Swift is that you can create classes that are Codable. In the app, I get some JSON from the server. Here’s the abridged JSON: You can create Swift structs th
- How I accessed a top tier networking company’s own internal network (using Server Side Request Forgery)
I have used DNSstuff and its great online tools for many years to help test the various DNS setups. As a matter of fact, the company I work for was a paying client for some of its advanced professiona
- Using Python to Read Windows Event Logs from Multiple Servers
Reading Windows Event Logs In our shop, we have to monitor a whole bunch of Windows servers to try to keep aware of any issues. We have monitoring systems that let us know if computers or services fai
- How to post a file to an AWS S3 from a Windows Python 3 program
Amazon Simple Storage Service (Amazon S3) gives you an easy way to make files available on the internet. They host the files for you and your customers, friends, parents, and siblings can all download
- Starting and Stopping an Amazon AWS Instance from a Windows Python Program
Sometimes you end up with a situation where you want to start (or stop) an Amazon AWS instance from your own program instead of using the AWS interface. It’s those occasions where something weird is g
- How to send a message to Slack from your Python program
We use and love Slack for team messaging. We’re all in and out Slack throughout the day (and night). We depend on it for communication of our geographically distributed team. We also have lots of auto
- Reading the SSH Output
Reading the SSH Output – about 20 minutes Our next step is conceptually pretty straightforward, but the details are a bit complicated. We’re using Paramiko to pretend programmatically like we are a hu
- Getting started
Getting started – about 10 minutes We’ll start by writing a little program to that can test out whether we can successfully connect to an SSH host device. This will be a short program but it will lay
- Merging SSH connectivity and database access
Merging SSH connectivity and database access – about 10 minutes We already have some amazingly useful functionality. Now we can start to tie things together. We have the code to connect to an SSH host
- Saving the SSH command results
Saving the SSH command results – about 10 minutes Way back in the beginning we talked about this project being able to save config info locally. And then we talked a bunch about databases, SSH connect
- Moving from low class to high class
Moving from low class to high class – about 15 minutes Our class has done a reasonable job of wrapping up our concept of a host. We can make some improvements to the class that make it a little easier
- Base class
Base class – 30-40 minutes This can be a confusing topic if you don’t already have experience with object-oriented programming. It takes some reading, some thinking, maybe some re-reading, and the con
- Speaking more languages
Speaking more languages – 15 minutes Since we have refactored some code into a base class and have now implemented the SSH class, we’re ready to add a new protocol. Let’s get this bad boy talking over
- Speaking telnet better
Speaking telnet better – 10 minutes In our last iteration of the program we introduced the TelnetHost class. However, the class didn’t really fully implement Telnet communications. It just executed a
- Refactoring
Refactoring – 5 minutes When we consider what’s going on in these classes there are some subtle improvements we can make. For example, our TelnetHost and our SSHHost classes each have their own send_c
- Efficiency
Efficiency – 5 minutes There’s no need to recreate the database every time we run our program. So let’s check whether the database exists and only create a database if it doesn’t exists. We can start
- Adding a little class to our project
Adding a little class to our project – about 30 minutes We actually have a pretty useful little utility at this point. It can keep a list of devices, connect to all of those devices, and save the outp
- Adding a little database
Adding a little database – about 15 minutes We want to be able to have our application back up information from the host devices on our network. Devices, plural. And I think that if I had to list out
- Setting Up Your Environment
Setting Up Your Environment – about 20 minutes Python Itself We’ll presume you’re using a civilized operating system and that you already have Python installed. If you’re not in this situation then yo
- Using Python to Automate Network Administration Task
Using Python to Automate Network Administration Task So I rolled into work, grabbed my second cup of coffee for the day and sat down at my desk. I had to make some network config changes, but I had pu
- How to list Active Directory groups with Python
Getting a listing of the user groups from Active Directory (AD) is very similar to getting the list of users. We are making use of the ldap3 module. Giovanni Cannata provided us a pretty sweet tool. S
- Listing Active Directory Users Using Python
Sometimes it’s nice to be able to take a quick look at your Active Directory (AD) users and see what’s there and who is actually active. Here’s a quick little Python program to list out your current u
- Finding uptime of computers in Python
