This speaks for itself. It’s a simple script I made to test whether two servers are serving roughly the same content.
kkinder@lappy ~/utils> ./server_diff -h
usage: server_diff [-h] [--diff-command DIFF] [--username USERNAME]
SERVER1 SERVER2 URL [URL ...]
Tests URL against two servers and shows the output.
SERVER1 First server
SERVER2 second server
URL URL(s) to test
-h, --help show this help message and exit
--diff-command DIFF Application to use for showing diff
--username USERNAME Username (for http authentication)
--password PASSWORD Password. If username is specified, but password is
not, user will be prompted.
Then run something like this:
kkinder@lappy ~/utils> ./server_diff --div-command meld --username kkinder --password YOURMOM \
https://beta.example.com/ https://production.example.com/ \
/ /about /url2 "/search?x=1"
At this point, if the /about page is different, meld would be launched, showing the differences. After you exit meld, it would continue to the next URL.
Notably, this script does not:
- Handle methods other than GET
- Deal with headers.
- Recognize substantive vs superfluous differences in HTML (whitespace, etc).
This does basically what you would do:
- When you open a tag, it increases the indent level.
- When you close a tag, it decreases the indent level.
- Closing tags starting a line follow their parents’ indent level.
- Invalid HTML lines starting with “#” or “< !" and ignored.
- Other HTML irregularities are ignored.
I’m going to make this short and sweet.
Scenario: You’re developing directly on Amazon ec2 without a local test environment. You edit Python code in WingIDE and rsync it over when it’s time to test.
Problem: Lack of interactive debugging.
Solution: ssh tunneling combined with WingIDE’s TCP-based remote debugging.
Dun dun dun! This is a plugin for WingIDE. When editing code, I got tired of constantly googling “color picker” when I needed to make a hex color for my CSS.
Over various pints of beer, emails, and late-night twitter tweets, I’ve alone and with others wondered about whether a smart, well-adjusted programmer would use Pylons or CherryPy for all his web programming needs (and whether such a programmer would take the time to convert from CherryPy to Pylons). Pylons is newish to me, but I’ve been using CherryPy (on and off) for years now. What troubles me about CherryPy is that despite all those years of experience, there are still parts of CherryPy I struggle with (and not just this horrible while-true-except-pass loop). Here are my partially collected thoughts. I’ll start with what bugs me enough about CherryPy for me to seek alternatives.
I really like meld as a visual diff tool, but I wanted to have have it show multiple comparisons at once from the commandline. In the GUI, you can create multiple tabs for multiple comparisons, but there is (was) no way to do it directly from the command line. So, I wrote a patch that lets you use it like this:
meld spam.orig spam.mine - eggs.orig eggs.mine - pants.orig pants.mine
The usage is the same as it was before, but now you can specify multiple comparisons, separated by “-”. We’ll see if the patch is accepted; I posted it to the mailing list. In the meantime, you can download it here.
No such module existed, so I wrote one. Using it is pretty simple:
As opposed to having it print to stdout. Here’s how…
Courtesy of CherryPy:
lockfd = os.open(path, os.O_CREAT|os.O_WRONLY|os.O_EXCL)
self.locked = True
Really people, really? We silently loop until an error goes away? Really?