RSSAmplifier

Blog

Python Monty

z3ugma.github.ioRSS feed ↗30 posts

Latest posts

A Comma and a Question Mark Redux

I am a decent user of the terminal, but I am not strong at remembering find flags - or rsync , or grep for that matter. I read Rémi Louf’s post about wiring a comma and a question mark into his shell and immediately wanted the same thing. The idea is simple: type , <description> and get a shell command that does what you described. Type ? <question> and get an AI answer right in your terminal.…

Warm Up Your MacBook

You’ve been there - after putting your backpack in a frigid car, walking against the Wisconsin wind, or biking across the frozen lake, you arrive at work. You rest your palms on the keyboard to begin typing your password, and recoil in pain from the sudden cold of the metal sucking the heat from your skin. How do you quickly warm up a laptop? Make it do a lot of work. Here’s a one-line, built-in…

Persuasion: Getting Your Tech Widely Adopted

These are the slides from a talk I’m giving at Chippewa Valley Code Conference this weekend. Download the slides here Here’s the talk abstract: Brilliant developers, project managers, and IT professionals build tools perfectly suited to their users. So why don’t those users use them? In this talk, you’ll learn new ways to frame your discussion of your technology to make your users excited about…

Connecting an Apple Cinema Display to a 2017+ MacBook Pro with Thunderbolt 3

When I started my new job, I was provided a new MacBook Pro to use as my work computer. I wanted to fit my new MacBook into my existing 27” Apple Cinema Display from 2010, which I’ve been using with my personal 2013 MacBook Air for 5 years. Should be easy, right? They’re both Apple products? Wrong. It turns out that Apple doesn’t even offer a first-party solution to connect the new Thunderbolt 3…

Products I Love

We are in the middle of a “stuff” revolution. The success of Mario Kondo’s book The Life-Changing Magic of Tidying Up and its Netflix successor Tidying Up speaks to what earlier books like Stuffocation have realized about our era: most of us have too much crap. I fit neatly into the generational shift towards preferring experiences over things, but I’m also a hobbyist with a short attention span.…

An Introduction to M: The NoSQL Database with a Programming Language

I originally wrote this for a tutorial on learnxinyminutes.com , which attempts to teach you the basics of a new programming language. I use M daily at work, and it gets a lot of unfair criticism in tech journalism for its age and its terseness. I liken M to Python in its usefulness for procedural scripting. It’s also got a very nice debugging tool that lets you pause code mid-execution and…

WasherBot and DryerBot, Part 5: A Measurement Algorithm and Text Message Integration

Table of Contents Part 1: How to Tell If an Appliance Is Running Part 2: Current Sensors and Burden Resistors Part 3: Connecting to the Pi and Building a Voltage Divider Part 4: A Low-Pass Filter and Reading From Laundry Appliances Part 5: A Measurement Algorithm and Text Message Integration As we saw in Part 4, the “thicker” the AC wave appears on a graph of our MCP3002 measurements, the more…

WasherBot and DryerBot, Part 4: A Low-Pass Filter and Reading From Laundry Appliances

Table of Contents Part 1: How to Tell If an Appliance Is Running Part 2: Current Sensors and Burden Resistors Part 3: Connecting to the Pi and Building a Voltage Divider Part 4: A Low-Pass Filter and Reading From Laundry Appliances Part 5: A Measurement Algorithm and Text Message Integration When I was following the OpenEnergyMon guide I noticed they were including a capacitor in their circuit:…

WasherBot and DryerBot, Part 3: Connecting to the Pi and Building a Voltage Divider

Table of Contents Part 1: How to Tell If an Appliance Is Running Part 2: Current Sensors and Burden Resistors Part 3: Connecting to the Pi and Building a Voltage Divider Part 4: A Low-Pass Filter and Reading From Laundry Appliances Part 5: A Measurement Algorithm and Text Message Integration Time to get started with the Pi. First, we need to hook the ADC up to the Pi. There are several good…

WasherBot and DryerBot, Part 2: Current Sensors and Burden Resistors

Table of Contents Part 1: How to Tell If an Appliance Is Running Part 2: Current Sensors and Burden Resistors Part 3: Connecting to the Pi and Building a Voltage Divider Part 4: A Low-Pass Filter and Reading From Laundry Appliances Part 5: A Measurement Algorithm and Text Message Integration As you read in Part 1 , I’ve now got a plan to get my washer and dryer to talk to me. Clip a CT sensor to…

WasherBot and DryerBot, Part 1: How to Tell If an Appliance Is Running

The time indicators on my washer and dryer are notoriously unreliable. Also, my and Mel’s busy brains occasionally forget that we started doing laundry. I wanted to build a system that would text me when my washer or dryer finished running . Table of Contents Part 1: How to Tell If an Appliance Is Running Part 2: Current Sensors and Burden Resistors Part 3: Connecting to the Pi and Building a…

Tiny Rainstorm

I like listening to RainyMood while I work to keep focused. The site isn’t that big, just 327kb, but its usability isn’t great and it’s full of tracking code. The site hits my adblocker(s) (plural at work per GPO) and so is slow to load. With some “inspect element” I found the source files and made a tiny (just 35k) version that loops, is visually attractive, doesn’t track me, and loads instantly.…

Damn, That Design

Bartaco, West Hartford, CT I grew up 10 miles from here, in the hills of northwest Connecticut. My childhood was very whitebread and suburban, but there were always plenty of woods around my house to explore. Whenever I visit, New England surprises me in how different the landscape is from Madison. I don’t expect it because the people are so similar – focus on hard work, pragmatism, and…

A Weekend in DC's Neighboroods

Mel had a conference in DC this weekend, right in the Woodley Park/Adams Morgan neighborhood. This part of DC is a lot like some old parts of Madison like Vilas/Monroe and the waterfront near Atwood/Jenny St. Lots of mature, old trees, walkable streets with moderate traffic and gorgeous hundred-year-old houses that are fun to stroll by and imagine life in. We stayed right near the Metro stop in…

Skyscraper Seeds

Acorn, RiNo, Denver The drive to Acorn is unreal compared to other neighborhoods in Denver. Living in Englewood, I get a gradual shift to downtown - suburbs give way to rows of old bungalows, youthful hipster neighborhoods, then sports stadiums and high-rise apartments relective of the explosive urban growth experienced by Denver. The drive from the north is diametrically different. Rolling…

Sexy Pizza

Sexy Pizza - South Pearl, Denver I took a 5K sunset hike in Morrison, CO, today, a solid 20 minutes beyond surburban Denver and into the foothills. Afterwards, I was starving for an uncomplicated meal, and my friend Shauna has been after me to try Sexy Pizza for some time. It was right on the way home, so I stopped in. Pearl Street was unusually quiet so late at night, and I sat near the street in…

Sing a Song for Sixpence

I’ve been wanting to do this for some time, and I think I’m taking the plunge - you’ll start seeing restaurant reviews on here as well as code. Four and Twenty, East Johnson, Madison To start with, I can’t believe I’ve never been here. Well, actually, it stands to reason - Four and Twenty stands in a tiny commercial space amid tightly-knit ranch houses and sandwiched between the thoroughfares of…

A Homegrown Recipe App That Helps You Cook

I do love to cook. All of my favorite recipes are stored in my head, are improvised off the cuff, or found in a gross stack of crinkled papers held together with a binder clip in my cabinet. I do a lot of looking up recipes online, but every recipe website I’ve seen has a big flaw. These sites are not designed to help you actually read the recipe. They are designed to keep you clicking around,…

Delicious Vegan Biscuits and Gravy

Next up, a departure from my usual programming entries to another hobby - cooking. It’s Veganuary ! It’s a month of sacrifice for me, in the name of shedding holiday pounds. The single hardest thing for me about going vegan is finding quick meals to make that aren’t a piece of fruit. I think it’s similar to when I stopped eating meat. At first, I started cooking the same old meals, just with the…

LibUSB and Python to Overcome Bad USB Design

Last October, I began recording temperatures for my homebrew setup. It used a C program called pcsensor that someone reverse-engineered from the Windows version available on the CD that came with my TEMPer1v1.4 sensors. The problem with these sensors is that they have no unique identifier - reading the value in from pcsensor with multiple sensors installed often resulted in the data series being…

InfluxDB Augments My Homebrew Temperature Monitor

Last October, I began recording temperatures for my homebrew setup. It was early in my explorations of Python and scripting, and ran in a pretty silly fashion. It went something like this: Echo the output of a C program that read the temperatures into a log file Parse that logfile using python to create a JSON file for Google Charts to use Use PHP embedded in HTML via an AJAX callback function to…

Keeping VirtualBox and Vagrant Boxes Alive Through Reboots

I recently switched from a dedicated Windows 7 PC for my home server to a Mac Mini, mostly for the better electricity consumption and the fact the the PC was having nightly bluescreen crashes and restarting. I have always been a fan of RDP, and my office uses PCs - so to keep the convenient RDP access to home, I installed VirtualBox and created a Windows VM. This has a bridged network adapter, so…

A new platform

I switched from Octopress to Jekyll. I find that it is cleaner, easier to understand, and doesn’t require me to puzzle through Git branches and remotes.

Find all the casks

There’s a great package manager for Mac called Homebrew that acts sort of like Aptitude on Ubuntu; it makes it really easy to quickly install software for your Mac from the command line. The Casks platform is built on top of Homebrew - it allows you to install your commonly-used desktop apps for Mac. This makes writing a setup script for when you reformat easy. It also makes Casks a great place to…

Using Python to Pay Parking Tickets

Using Python to Pay Parking Tickets An enterprising fellow from Milwaukee built a site to automatically pay parking tickets in his city and in Madison. Unfortunately, the city of Madison changed around their ticket-payment website, so the site is not working. I thought it would be a good programing challenge for me. How Do You Work with Web Services When They Have No API?### Since the City of…

Sending an Email on Microsoft Exchange with Python

Part 2: Getting the Python EWS Client to Send an Email Now that I’ve got a client connect to the Exchange server, I can actually use the SOAP API methods as documented in the WSDL and on Microsoft’s documentation . Suds has great built-in methods and classes for working with SOAP, but as this post confirms , bugs in both Suds and EWS mean that I’ll have to manually build the XML and inject it…

Using cURL To Test Exchange Web Services

From this post , I learned how to write a little shell script that uses cURL to check to see if I’m connecting to the Exchange Web Services server correctly. This made testing my Python EWS script easier, especially when I accidentally connected to the wrong WiFi network and couldn’t contact the EWS server. curl -u username@domain:password -L https://exchange_server/ews/exchange.asmx -H…

Getting Python Working on Microsoft Exchange

Creating an Internal Emailing Wikibot in Python You know how they say that when all you have is a hammer that everything looks like a nail? For now, Python is my hammer. I understand that C# or VB would be a better choice for this project, particularly since Microsoft Exchange plays much more nicely with them than Python, but as I’m just starting out I think I’m still in the phase of learning how…

Hello World

A First Toast By which, I clearly meant post. I’m now using GitHub pages to serve my blog. Before, it was on a Wordpress site hosted on a laptop in my bedroom. I’m using a theme engine called Octopress . There’s a link in the footer. It’s a neat little static site generator. Posts are created in markdown (something else I’m trying for the first time), and a ruby Rake (still not sure what that…

Homebrew Temperature Monitoring

A few weeks ago, I embarked on a project to monitor the temperature of my homebrews as they ferment and bottle-age. The Data In order to record temperatures, I ordered 3 TEMPer temperature-logging modules from eBay. These were recommended by lots of homebrewers on HomeBrewTalk as cheap and effective, although occasionally users reported large variances in temperatures and DOA sensors. These are…