Prefetch Technologies // Keeping your cache lines cozy

Archive

Posts in Python

Monitoring DNS domain name expiration with dns-domain-expiration-checker

networkingpythonAug 2, 2017 2 min read

Several years ago I wrote a simple bash script to check the expiration date of the DNS domains I own. At the time I wrote this purely for my own needs but after receiving 100s of e-mails from folks who were using it (and submitting patches) I decided to enhance it to be more useful. As time has gone on Registrar WHOIS data formats have changed and I came to the realization that there is no standard time format for expiration records. I needed a more suitable solution so I spent last weekend re-writing my original script in Python…

$ read more →

Simplifying python development with virtual environments

pythonJul 19, 2017 2 min

Over the past year I've spent a considerable amount of time beefing up my development skills. One of the best ways I've found to improve my skills is by reading code from well respected developers, watching udemy and youtube videos, fixing bugs in code I'm not familiar with (you will find some doozies this way) and benchmarking code to see what the system and resource ramifications of a change are. To allow myself to experiment in isolation I've relied heavily on Python virtual environments. Virtual environments are code sandboxes and everything (libraries, packages, etc.) in a given virtual environment is isolated from everything else on your system…

$ read more →

Making Python code more readable with list comprehensions

pythonOct 21, 2016 1 min

This post is added as a reference for myself. As I mentioned previously I've been spending a good deal of time learning how to write efficient and readable Python code. Jeff Knupp's Idiomatic Python videos are absolutely incredible and have definitely helped me become a better programmer. In his first video he turned me on to list comprehensions and how they can make code more readable…

$ read more →

Python generators you had me at first yield

pythonOct 8, 2016 1 min

This post is added as a reference for myself. I've been reading a lot about writing clean, readable and performant Python code. One feature that I now adore are generators. In the words of Python guru David Beazley a generator is: "a function that produces a sequence of results instead of a single value" The presentation above is an incredible overview of this amazing feature and I've been taking advantage of it whenever I can…

$ read more →

Python console editing with VIM

pythonOct 7, 2016 1 min

I'm a long time console guy and haven't found a graphical Python development tool that suits my needs as well as vim. It takes a couple of amazing vim plug-ins but the experience is great IMHO. I'm currently using the vim-jedi, pylint and vim-syntastic plug-ins which can be installed with yum on CentOS/Fedora machines: To enable syntax highlighting and auto indentation you can add the following to your $HOME/.vimrc: Once these are in place your code will be highlighted with a nice set of colors, hitting return will generate the correct spacing and pylint will be run automatically to note problems with your code. If you are using other plug-ins let me know via a comment.

$ read more →