blog.git
10 years agoposts:simple-servers: Fix 'incomming' -> 'incoming' typo
W. Trevor King [Wed, 28 May 2014 15:11:53 +0000 (08:11 -0700)]
posts:simple-servers: Fix 'incomming' -> 'incoming' typo

10 years agocontact:pubkey.txt: Update with a new subkey (6DF2897C)
W. Trevor King [Wed, 28 May 2014 15:10:07 +0000 (08:10 -0700)]
contact:pubkey.txt: Update with a new subkey (6DF2897C)

10 years agoposts:harvest: Add a post on Harvest and hcl
W. Trevor King [Fri, 21 Mar 2014 18:22:14 +0000 (11:22 -0700)]
posts:harvest: Add a post on Harvest and hcl

10 years agoposts:bugs: Record my Emacs XTerm version-detection patch
W. Trevor King [Mon, 24 Feb 2014 23:34:58 +0000 (15:34 -0800)]
posts:bugs: Record my Emacs XTerm version-detection patch

10 years agocontact: Add my name to the contact page
W. Trevor King [Fri, 21 Feb 2014 21:45:00 +0000 (13:45 -0800)]
contact: Add my name to the contact page

And remove the other email addresses, now that tremily has been
working for a few years.

10 years agoposts:package-cache: Add a homepage for my package-cache package
W. Trevor King [Fri, 21 Feb 2014 21:40:20 +0000 (13:40 -0800)]
posts:package-cache: Add a homepage for my package-cache package

Also list it on the Gentoo-overlay page.

10 years agoposts:salt-stack: Use rc-service and mention particular-id install
W. Trevor King [Fri, 21 Feb 2014 19:39:21 +0000 (11:39 -0800)]
posts:salt-stack: Use rc-service and mention particular-id install

Also remove a tremily reference and replace it with the generic
example.net.

10 years agoposts:x.509-certificates: Use --outfile with --generate-privkey
W. Trevor King [Sun, 29 Dec 2013 18:34:29 +0000 (10:34 -0800)]
posts:x.509-certificates: Use --outfile with --generate-privkey

Instead of redirection.  This sets up restricted permissions
(-rw-------) automatically, even if you have a permissive umask.

10 years agoposts:x.509-certificates: Fix 'directoy' -> 'directory' typo
W. Trevor King [Sat, 28 Dec 2013 02:54:40 +0000 (18:54 -0800)]
posts:x.509-certificates: Fix 'directoy' -> 'directory' typo

11 years agoposts:gentoo-overlay: Drop app-crypt/monkeysphere
W. Trevor King [Mon, 16 Dec 2013 17:07:23 +0000 (09:07 -0800)]
posts:gentoo-overlay: Drop app-crypt/monkeysphere

It's landed upstream [1].

[1]: https://bugs.gentoo.org/show_bug.cgi?id=313253#c13

11 years agoposts:docker: Link to LXC CONFIG_MEMCG fix
W. Trevor King [Fri, 13 Dec 2013 16:48:02 +0000 (08:48 -0800)]
posts:docker: Link to LXC CONFIG_MEMCG fix

11 years agoposts:bower: Add a post on Bower
W. Trevor King [Thu, 12 Dec 2013 18:17:38 +0000 (10:17 -0800)]
posts:bower: Add a post on Bower

11 years agoposts:geopy: Update URL now that GeoPy has moved to GitHub
W. Trevor King [Tue, 1 Oct 2013 17:24:09 +0000 (10:24 -0700)]
posts:geopy: Update URL now that GeoPy has moved to GitHub

11 years agoposts:jam: Discuss the user-facing JavaScript packager
W. Trevor King [Fri, 20 Sep 2013 18:38:43 +0000 (11:38 -0700)]
posts:jam: Discuss the user-facing JavaScript packager

11 years agoposts:salt-stack: Add Salt post
W. Trevor King [Thu, 12 Dec 2013 17:34:46 +0000 (09:34 -0800)]
posts:salt-stack: Add Salt post

11 years agoposts:docker: Add a Docker blog post
W. Trevor King [Thu, 12 Dec 2013 17:23:08 +0000 (09:23 -0800)]
posts:docker: Add a Docker blog post

11 years agogallery.py: Pass page data through .index()
W. Trevor King [Mon, 9 Dec 2013 06:09:40 +0000 (22:09 -0800)]
gallery.py: Pass page data through .index()

Otherwise http://localhost:4000/?pp=2 will still get you the first
page.

11 years agogallery.py: Handle query and path separately for ._url()
W. Trevor King [Mon, 9 Dec 2013 05:59:47 +0000 (21:59 -0800)]
gallery.py: Handle query and path separately for ._url()

This avoids computing a relpath for:

  /full/path/to/gallery?pp=2

from a base-path of:

  /full/path/to/gallery

and getting:

  ../gallery?pp=2

instead of the expected:

  ?pp=2

We could avoid this by using gallery/ in the first place, but keeping
query data as a dict until the last possible moment is also nice.

11 years agogallery: Use byte-compatible sys.stdout for CGI output
W. Trevor King [Mon, 9 Dec 2013 05:27:29 +0000 (21:27 -0800)]
gallery: Use byte-compatible sys.stdout for CGI output

We're going to be writing bytes.  In Python 2 they should go to
sys.stdout, but in Python 3 they should go to sys.stdout.buffer.

11 years agogallery.py: Convert '--scgi' to '--mode=scgi' and add a 'wsgi' mode
W. Trevor King [Mon, 9 Dec 2013 05:21:21 +0000 (21:21 -0800)]
gallery.py: Convert '--scgi' to '--mode=scgi' and add a 'wsgi' mode

This is useful for serving a one-off gallery when you don't want to
bother setting up a real frontend for the CGI servers.  We use the
ProcessingComplete exception to pass out the header OrderedDict for
start_response.

11 years agogallery.py: Rework headers to use an OrderedDict
W. Trevor King [Mon, 9 Dec 2013 05:17:06 +0000 (21:17 -0800)]
gallery.py: Rework headers to use an OrderedDict

This makes it easier to manipulate and access headers (e.g. to extract
the charset).  Also:

* Use CRLF line endings for headers [1], instead of our old LF.
* Encode text/ content to bytes (other content should already be in
  bytes) [2].  The encoding used for text/ content is configurable.

[1]: http://tools.ietf.org/html/rfc2616#section-6.1
[2]: http://www.python.org/dev/peps/pep-0333/#unicode-issues

11 years agogallery.py: Python-3-compatible integer division
W. Trevor King [Mon, 9 Dec 2013 05:11:02 +0000 (21:11 -0800)]
gallery.py: Python-3-compatible integer division

Avoid:

  Traceback (most recent call last):
    …
    File "/.../gallery.py", line 610, in page
      self._page(path=file_path, stream=stream)
    File "/.../gallery.py", line 719, in _page
      gallery_page = '{}/?pp={:d}'.format(gallery, page + 1)
  ValueError: Unknown format code 'd' for object of type 'float'

11 years agogallery.py: Use HTTPError.content (not .message) for custom responses
W. Trevor King [Mon, 9 Dec 2013 05:02:28 +0000 (21:02 -0800)]
gallery.py: Use HTTPError.content (not .message) for custom responses

.message should only hold the standard reason phrase from RFC 2616
[1].

[1]: http://tools.ietf.org/html/rfc2616#section-6.1

11 years agogallery.py: Python-3-compatible parse_qs import
W. Trevor King [Mon, 9 Dec 2013 04:37:05 +0000 (20:37 -0800)]
gallery.py: Python-3-compatible parse_qs import

Python 2's urlparse.parse_qs moved to urllib.parse.parse_qs in Python
3.

11 years agogallery.py: Use Python-3-compatible exception syntax
W. Trevor King [Mon, 9 Dec 2013 04:34:05 +0000 (20:34 -0800)]
gallery.py: Use Python-3-compatible exception syntax

Avoid:

    File "/home/wking/bin/gallery.py", line 120
      except OSError, e:
                    ^
  SyntaxError: invalid syntax

11 years agogallery.py: Factor out page extraction to CGIGalleryServer.page_from_query
W. Trevor King [Mon, 9 Dec 2013 03:49:32 +0000 (19:49 -0800)]
gallery.py: Factor out page extraction to CGIGalleryServer.page_from_query

This reduces duplicated code.

11 years agogallery.py: Fix 'stream' -> 'output' typo in serve_scgi
W. Trevor King [Mon, 9 Dec 2013 03:41:33 +0000 (19:41 -0800)]
gallery.py: Fix 'stream' -> 'output' typo in serve_scgi

This only gets hit for invalid URLs.

11 years agogallery.py: Update copyright for 2013
W. Trevor King [Mon, 9 Dec 2013 03:41:01 +0000 (19:41 -0800)]
gallery.py: Update copyright for 2013

11 years agoposts:ecryptfs: Add a post on eCryptfs usage
W. Trevor King [Mon, 28 Oct 2013 23:36:15 +0000 (16:36 -0700)]
posts:ecryptfs: Add a post on eCryptfs usage

Covering both ~/Private and arbitrary directories.

11 years agomonfold.sh: Use $(...) instead of `...` for command substitution
W. Trevor King [Sat, 21 Sep 2013 17:31:14 +0000 (10:31 -0700)]
monfold.sh: Use $(...) instead of `...` for command substitution

It's nestable [1], and it just looks nicer.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_03

11 years agomonfold.sh: Use tabs instead of mixed tabs/spaces for indentation
W. Trevor King [Sat, 21 Sep 2013 17:24:34 +0000 (10:24 -0700)]
monfold.sh: Use tabs instead of mixed tabs/spaces for indentation

Then folks can set the tab width to whatever they want and still get
indentation that makes sense.

11 years agomonfold.sh: Use here-documents to write GPFILE
W. Trevor King [Sat, 21 Sep 2013 17:18:15 +0000 (10:18 -0700)]
monfold.sh: Use here-documents to write GPFILE

Instead of wasting a call to echo.  Here-documents are in POSIX [1].

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_04

11 years agomonfold.sh: Update inotify-tools link to GitHub URL
W. Trevor King [Sat, 21 Sep 2013 17:17:19 +0000 (10:17 -0700)]
monfold.sh: Update inotify-tools link to GitHub URL

Don't just mention the Ubuntu package.

Also set the executable bit for this script.  We need Bash (and not a
generic POSIX shell) because of the process substitution:

  <(...)

feeding the while loop.

11 years agoposts:comcast: Add an update on Comcast's port blocking
W. Trevor King [Fri, 20 Sep 2013 16:20:43 +0000 (09:20 -0700)]
posts:comcast: Add an update on Comcast's port blocking

And clean up the old Comcast post.  The links are likely dead, but I
was able to rescue some of my old Liki notes.

11 years agoposts:node: Add a post on Node and npm
W. Trevor King [Fri, 20 Sep 2013 00:20:18 +0000 (17:20 -0700)]
posts:node: Add a post on Node and npm

11 years agobeep.py: Fix tab -> spaces indentation
W. Trevor King [Mon, 19 Aug 2013 00:01:42 +0000 (17:01 -0700)]
beep.py: Fix tab -> spaces indentation

11 years agoposts:dvd-backup: Fix "you're" -> "your" typo
W. Trevor King [Thu, 15 Aug 2013 03:52:19 +0000 (20:52 -0700)]
posts:dvd-backup: Fix "you're" -> "your" typo

11 years agoposts:dvd-backup: Fix 'congfig' -> 'config' typo
W. Trevor King [Thu, 15 Aug 2013 03:51:11 +0000 (20:51 -0700)]
posts:dvd-backup: Fix 'congfig' -> 'config' typo

11 years agoposts:relative-submodules: Add a post promoting relative URLs
W. Trevor King [Sat, 13 Jul 2013 15:02:29 +0000 (11:02 -0400)]
posts:relative-submodules: Add a post promoting relative URLs

11 years agoposts:relative-submodules: Add SVG exports of Dia graphics
W. Trevor King [Sat, 13 Jul 2013 14:56:32 +0000 (10:56 -0400)]
posts:relative-submodules: Add SVG exports of Dia graphics

11 years agoposts:relative-submodules: Add Dia source for graphics
W. Trevor King [Sat, 13 Jul 2013 14:55:57 +0000 (10:55 -0400)]
posts:relative-submodules: Add Dia source for graphics

11 years agoposts:open-hardware-analog-io: Add post on open analog I/O
W. Trevor King [Wed, 19 Jun 2013 13:16:21 +0000 (09:16 -0400)]
posts:open-hardware-analog-io: Add post on open analog I/O

Also update the open source force spectroscopy post to link to my
thesis.

11 years agoposts:NOAA-charts: Add short post pointing to historicalcharts.noaa.gov
W. Trevor King [Tue, 11 Jun 2013 00:49:27 +0000 (20:49 -0400)]
posts:NOAA-charts: Add short post pointing to historicalcharts.noaa.gov

11 years agocrunch.py: Extract unfolding frequency from unfold-protein curves
W. Trevor King [Fri, 31 May 2013 18:55:26 +0000 (14:55 -0400)]
crunch.py: Extract unfolding frequency from unfold-protein curves

11 years agoposts:open_physics_text: Fix "bureaucrat's" -> "bureaucrats" typo
W. Trevor King [Fri, 31 May 2013 18:54:42 +0000 (14:54 -0400)]
posts:open_physics_text: Fix "bureaucrat's" -> "bureaucrats" typo

11 years agoposts:bugs: Mention when my SCons dir-lookup fix landed
W. Trevor King [Fri, 31 May 2013 18:53:59 +0000 (14:53 -0400)]
posts:bugs: Mention when my SCons dir-lookup fix landed

11 years agoposts:package_management: Add post following SWC discussion
W. Trevor King [Fri, 31 May 2013 18:45:05 +0000 (14:45 -0400)]
posts:package_management: Add post following SWC discussion

11 years agocontact:pubkey.txt: Update with a new subkey (1A3646ED)
W. Trevor King [Mon, 27 May 2013 20:17:08 +0000 (16:17 -0400)]
contact:pubkey.txt: Update with a new subkey (1A3646ED)

11 years agoposts:bibtex: Update with crossref ordering notes
W. Trevor King [Sat, 18 May 2013 00:39:12 +0000 (20:39 -0400)]
posts:bibtex: Update with crossref ordering notes

Fool me once, shame on... shame on you.  Fool me... you can't get
fooled again.

11 years agoposts:entrez: Link to BibTeX post
W. Trevor King [Sat, 18 May 2013 00:37:47 +0000 (20:37 -0400)]
posts:entrez: Link to BibTeX post

11 years agoplotpick.py: Reroll around `picker` API and bump to version 0.3
W. Trevor King [Sun, 12 May 2013 19:24:14 +0000 (15:24 -0400)]
plotpick.py: Reroll around `picker` API and bump to version 0.3

11 years agoplotpick.py: Force a redraw after changing the mouse-move crosshairs
W. Trevor King [Sun, 12 May 2013 18:17:43 +0000 (14:17 -0400)]
plotpick.py: Force a redraw after changing the mouse-move crosshairs

There should be a way to just redraw the axes in question, but I'm not
sure what it is.

11 years agocompare-unfold.py: Add --contact-slope and --output options
W. Trevor King [Wed, 1 May 2013 16:59:24 +0000 (12:59 -0400)]
compare-unfold.py: Add --contact-slope and --output options

For more quantitative comparisons and easier automation respectively.

11 years agogyang_curve.py: Allow auxiliary files in the curve directory
W. Trevor King [Fri, 19 Apr 2013 15:07:51 +0000 (11:07 -0400)]
gyang_curve.py: Allow auxiliary files in the curve directory

I haven't bothered to trace this down to a particular version of the
LabVIEW VIs, but some of my archived experiments have the auxiliary
files in a 'params' subdirectory and some do not.  With this patch,
gyang_curve can successfully read both layouts.

11 years agoposts:rss2email: Mention the rss2email project to raise visibility
W. Trevor King [Sun, 14 Apr 2013 00:44:22 +0000 (20:44 -0400)]
posts:rss2email: Mention the rss2email project to raise visibility

In case anyone actually follows this blog ;).

11 years agoposts:one-off-git-daemon: Add an --enable=receive-pack section
W. Trevor King [Fri, 29 Mar 2013 17:13:22 +0000 (13:13 -0400)]
posts:one-off-git-daemon: Add an --enable=receive-pack section

Also add headings for serving a single repository and serving a few
repositories, since with --enable=receive-pack the post was getting a
bit long for one section.

11 years agoposts:nginx: Fix spawn-fcgi.fcgiwrap rc-update invocation
W. Trevor King [Wed, 27 Mar 2013 12:54:13 +0000 (08:54 -0400)]
posts:nginx: Fix spawn-fcgi.fcgiwrap rc-update invocation

We need a four-space indent (not three) for Markdown <pre> blocks.
We're also using `#` to mark a root shell, so we don't need sudo.

11 years agoposts:nginx: Export HOME=/ to spawn-fcgi process for gitweb
W. Trevor King [Wed, 27 Mar 2013 12:47:56 +0000 (08:47 -0400)]
posts:nginx: Export HOME=/ to spawn-fcgi process for gitweb

Since Git's 96b9e0e (config: treat user and xdg config permission
problems as errors, 2012-10-13), `git` dies with:

  fatal: unable to access '/root/.config/git/config': Permission denied

when it doesn't have access to the HOME directory where it think's its
config files are stored.  Running an strace shows:

  access("/root/.config/git/config", R_OK) = -1 EACCES (Permission denied)

Since this error is fatal, we need to set the HOME environment
variable to somewhere where the server process (the `nginx` user on my
box) *does* have access.  Regardless of the user, `HOME=/` should be
pretty safe ;).

11 years agogit-grepall.sh: Add a script for grepping all local branches
W. Trevor King [Thu, 21 Mar 2013 19:34:53 +0000 (15:34 -0400)]
git-grepall.sh: Add a script for grepping all local branches

Sometimes I have a lot of branches (e.g. per-assignment branches for a
single class, to support sharing work between assignments), and I
forget which feature is in which branch.  Now I can run:

  $ git-grepall.sh PATTERN

to search all the local branches.

11 years agopca.py: Update Newcastle SPSS link
W. Trevor King [Tue, 19 Mar 2013 13:12:27 +0000 (09:12 -0400)]
pca.py: Update Newcastle SPSS link

The internet archive page appears to be gone (which is scary ;), but I
found a URL pointing to the current page, which has all the same
stuff.

11 years agopca.py: Add ability to drop columns (questions) from input data
W. Trevor King [Tue, 19 Mar 2013 13:04:30 +0000 (09:04 -0400)]
pca.py: Add ability to drop columns (questions) from input data

11 years agopca.py: Add principal component analysis script
W. Trevor King [Mon, 18 Mar 2013 01:32:44 +0000 (21:32 -0400)]
pca.py: Add principal component analysis script

A good deal of this script is a huge docstring full of tests comparing
my analysis with other examples I found online.  You can run the
doctests with:

  $ python -m doctest pca.py

References:

Hervé Abdi.  Factor Rotations in Factor Analyses.  In: Lewis-Beck M.,
  Bryman, A., Futing T. (Eds.) (2003). Encyclopedia of Social Sciences
  Research Methods. Thousand Oaks (CA): Sage.
Trevor Park.  A Note on Terse Coding of Kaiser's Varimax Rotation
  Using Complex Number Representation.  (March 2003).
Andrew Wiesner's factor analysis notes.
Daniel Denis's factor analysis notes.  (2009).
Archived version of the University of Newcastle upon Tyne's "How to
  Perform and Interpret Factor Analysis using SPSS".  (November 2005).

11 years agoposts:factor_analysis: Add a post on Factor Analysis
W. Trevor King [Sat, 16 Mar 2013 17:02:53 +0000 (13:02 -0400)]
posts:factor_analysis: Add a post on Factor Analysis

This is the statistical approach used to analyze Software Carpentry
surveys, so I've been figuring out how it works.

11 years agoposts:catalyst: Link to HOWTO commit and fix 'amd64' -> 'x86'
W. Trevor King [Sat, 9 Mar 2013 17:50:05 +0000 (12:50 -0500)]
posts:catalyst: Link to HOWTO commit and fix 'amd64' -> 'x86'

11 years agoposts:catalyst: Add post about building the SWC bootable ISO
W. Trevor King [Wed, 6 Mar 2013 17:50:19 +0000 (12:50 -0500)]
posts:catalyst: Add post about building the SWC bootable ISO

11 years agoposts:sympy: Add post demonstrating usage
W. Trevor King [Wed, 27 Feb 2013 12:51:53 +0000 (07:51 -0500)]
posts:sympy: Add post demonstrating usage

11 years agoposts:one-off-git-daemon: Add a git://192.168.1.2/ example
W. Trevor King [Tue, 19 Feb 2013 01:25:13 +0000 (20:25 -0500)]
posts:one-off-git-daemon: Add a git://192.168.1.2/ example

Sometimes requiring a project name is not useful (e.g. all students
are sharing the same project).

11 years agoposts:bugs: Mention comments on Python's #9263
W. Trevor King [Tue, 19 Feb 2013 00:44:57 +0000 (19:44 -0500)]
posts:bugs: Mention comments on Python's #9263

This came up while digging into an rss2email report by Dmitry Bogatov
[1].

[1]: http://article.gmane.org/gmane.mail.rss2email/13
     http://article.gmane.org/gmane.mail.rss2email/14

11 years agoposts:bugs: Update URL for my utf_8 iText patch
W. Trevor King [Tue, 19 Feb 2013 00:42:51 +0000 (19:42 -0500)]
posts:bugs: Update URL for my utf_8 iText patch

The original patch page is gone, but the change has been accepted
upstream via the itext-questions@ list.

11 years agoposts:bugs: Mention my Gnuplot '<&n' file descriptor patch
W. Trevor King [Tue, 19 Feb 2013 00:41:42 +0000 (19:41 -0500)]
posts:bugs: Mention my Gnuplot '<&n' file descriptor patch

Now accepted :).  Thanks Ethan!

11 years agoposts:One-off_Git_daemon: Add post describing ad-hoc usage
W. Trevor King [Mon, 18 Feb 2013 23:59:31 +0000 (18:59 -0500)]
posts:One-off_Git_daemon: Add post describing ad-hoc usage

11 years agomw2txt.py: Update to version 0.2 (mostly Python 3 conversion)
W. Trevor King [Thu, 7 Feb 2013 21:41:30 +0000 (16:41 -0500)]
mw2txt.py: Update to version 0.2 (mostly Python 3 conversion)

Also:
* Use logging module instead of `if debug: print(...)`.
* Rework coloring to work with a logger (e.g. don't print debugging
  info directly to stdout).
* Upgrade from optparse to argparse.
* Add --verbose argument.

11 years agopdf-merge.py: Bump to version 0.3
W. Trevor King [Tue, 29 Jan 2013 18:40:38 +0000 (13:40 -0500)]
pdf-merge.py: Bump to version 0.3

Changes since 0.2:

77a9ba6 pdf-merge.py: Upgrade to Python 3.x
0c3b4c3 pdf-merge.py: Add KEYWORD metavar for --keyword.
8003741 pdf-merge.py: Add -v/--version option
8966242 pdf-merge.py: Fix 'perserving' -> 'preserving' typo in module doctest
5cef5f7 pdfmerge.py: Bump copyright year
71c7be5 pdf-merge.py: Update dump parser for pdftk v1.45
c75bc05 Add `--pdfmarks` option to pdf-merge.py.
abdbff4 Remove `[:-len('&#0;')]` from Unicode parsing of pdftk output in pdf-merge.py.
8efa8f6 Credit Larry Cai <larry.caiyu@gmail.com> for suggesting Unicode handling.

11 years agopdf-merge.py: Upgrade to Python 3.x
W. Trevor King [Tue, 29 Jan 2013 18:39:40 +0000 (13:39 -0500)]
pdf-merge.py: Upgrade to Python 3.x

This probably breaks Python 2.x support.  If you can't upgrade your
Python implementation, you'll have to stick to older versions of this
script.

11 years agopdf-merge.py: Add KEYWORD metavar for --keyword.
W. Trevor King [Tue, 29 Jan 2013 18:09:15 +0000 (13:09 -0500)]
pdf-merge.py: Add KEYWORD metavar for --keyword.

This should make the `--keyword KW1 --keyword KW2 ...` usage more
obvious.

11 years agopdf-merge.py: Add -v/--version option
W. Trevor King [Tue, 29 Jan 2013 17:27:18 +0000 (12:27 -0500)]
pdf-merge.py: Add -v/--version option

11 years agopdf-merge.py: Fix 'perserving' -> 'preserving' typo in module doctest
W. Trevor King [Tue, 29 Jan 2013 17:20:52 +0000 (12:20 -0500)]
pdf-merge.py: Fix 'perserving' -> 'preserving' typo in module doctest

11 years agopdfmerge.py: Bump copyright year
W. Trevor King [Tue, 29 Jan 2013 16:31:14 +0000 (11:31 -0500)]
pdfmerge.py: Bump copyright year

11 years agopdf-merge.py: Update dump parser for pdftk v1.45
W. Trevor King [Tue, 29 Jan 2013 16:23:46 +0000 (11:23 -0500)]
pdf-merge.py: Update dump parser for pdftk v1.45

On Tue, Jan 29, 2013 at 08:15:57AM -0800, Tsung-Han Yang wrote:
> I've attached the dumpdata message. I've just installed pdftk on
> windows yesterday. I've attached the diff file with -u, too.
> ...
> It looks like my pdf has some metadata like "InfoBegin" without ":"
> in the line.

The new lines in the dump are due to the addition of m_begin_mark in
pdftk between v1.44.1 and v1.45:

Sid Stewart wrote:
> Added record delimiters to dump_data output to help make parsing
> more reliable.

11 years agoposts:mutt-ldap: Add title, README link, and PiPI tag.
W. Trevor King [Sun, 20 Jan 2013 20:30:57 +0000 (15:30 -0500)]
posts:mutt-ldap: Add title, README link, and PiPI tag.

11 years agoposts:mutt-ldap: Mention Wade and Niels and add tags
W. Trevor King [Sun, 20 Jan 2013 18:38:08 +0000 (13:38 -0500)]
posts:mutt-ldap: Mention Wade and Niels and add tags

11 years agomutt-ldap.py: Pulled out into its own repository
W. Trevor King [Sun, 20 Jan 2013 18:26:59 +0000 (13:26 -0500)]
mutt-ldap.py: Pulled out into its own repository

11 years agoscript-publish.py: Fix double-spacing in <pre> by removing \n
W. Trevor King [Thu, 17 Jan 2013 22:06:27 +0000 (17:06 -0500)]
script-publish.py: Fix double-spacing in <pre> by removing \n

This makes the HTML less readable, but it's not worth the trouble to
make these HTML-readability endlines optional.

11 years agoscript-publish.py: Don't print raw strings to the log
W. Trevor King [Sun, 13 Jan 2013 15:23:08 +0000 (10:23 -0500)]
script-publish.py: Don't print raw strings to the log

Print their repr() instead, since the strings may contain funky
characters and missed control codes.

11 years agoscript-publish.py: Add DOCTYPE and <meta charset="..." />
W. Trevor King [Sun, 13 Jan 2013 15:18:19 +0000 (10:18 -0500)]
script-publish.py: Add DOCTYPE and <meta charset="..." />

<meta charset="..." /> is new in HTML5.

11 years agoscript-publish.py: More newlines in the output HTML source
W. Trevor King [Sun, 13 Jan 2013 14:52:32 +0000 (09:52 -0500)]
script-publish.py: More newlines in the output HTML source

These newlines don't affect the rendered HTML, but they make the HTML
source more readable.  The `previous_tail` bit keeps unstyled text
from clobbering newlines that were attached to a preceding <br />.

11 years agoscript-publish.py: Use -o/--output instead of -t/--target
W. Trevor King [Sun, 13 Jan 2013 14:45:23 +0000 (09:45 -0500)]
script-publish.py: Use -o/--output instead of -t/--target

This seems to be more conventional.  As a side benefit, we can now use
-t as the short form of --term.

11 years agoscript-publish.py: Drop empty text chunks
W. Trevor King [Sun, 13 Jan 2013 14:42:10 +0000 (09:42 -0500)]
script-publish.py: Drop empty text chunks

Firefox 10.0.11 was having trouble with:

  <span style="..." />

Which, instead of being a no-op, was changing the default styling of
every element after that tag.

11 years agoscript-publish.py: Add more control codes (reset1, reset2, ...)
W. Trevor King [Sun, 13 Jan 2013 14:34:24 +0000 (09:34 -0500)]
script-publish.py: Add more control codes (reset1, reset2, ...)

These new codes were from a typescript where I had used the `reset`
command.  Xterm doesn't support rs3, but I thought I'd add it for
completeness.

The reset commands are listed in order of decreasing complication
(rs3, rs2, rs1), so that if rs1 is a subset of rs2, we don't match
part of an rs2 entry with our rs1 regexp and leave the rest unmatched.
Ideally, we'll only match the low level escape codes, and compound
escapes like rs2 will be handled automatically by taking care of their
constituent parts.  Until we get to that point, we'll need to be
careful about the order of ControlCodes.

11 years agoscript-publish.py: Add debugging output for the chunk stream
W. Trevor King [Sun, 13 Jan 2013 13:49:46 +0000 (08:49 -0500)]
script-publish.py: Add debugging output for the chunk stream

So you can take a look at the raw stream before we start dumping
stuff.  I also made the SGR skipping message more explicit.

11 years agoscript-publish.py: Also reference the console_codes(4) man page
W. Trevor King [Sun, 13 Jan 2013 13:24:55 +0000 (08:24 -0500)]
script-publish.py: Also reference the console_codes(4) man page

This page discusses the console escapes and control codes implemented
by the Linux console.

11 years agoscript-publish.py: Use Unicode horizontal tabs
W. Trevor King [Sun, 13 Jan 2013 13:06:05 +0000 (08:06 -0500)]
script-publish.py: Use Unicode horizontal tabs

Replace the ControlCodeMatch instances with textual tabs, since they
are appropriately handled in `<pre>` blocks.

11 years agoscript-publish.py: Allow emulator selection with --term
W. Trevor King [Sun, 13 Jan 2013 12:50:55 +0000 (07:50 -0500)]
script-publish.py: Allow emulator selection with --term

This means we have to delay ControlCode initialization until the user
has actually selected a terminal.  The curses.setupterm() logic also
assumes that the selected terminal doesn't change after the initial
call.  For our script, this is a safe assumption.  If that assumtion
eventually breaks down, you'll have to cache the last-setup terminal
somewhere, and call setupterm() whenever the current control code's
`.term` doesn't match the cached value.

I also fixed a bug where args.encoding was not being passed to
ScriptServerApp.

11 years agoscript-publish.py: Add my terminal-escape-to-HTML conversion script
W. Trevor King [Sun, 13 Jan 2013 01:10:51 +0000 (20:10 -0500)]
script-publish.py: Add my terminal-escape-to-HTML conversion script

So students can follow along (and easily archive) the instructor's
live terminal session.  I convert all the escape sequences that turned
up during some simple messing around (including opening an Emacs
window), but there are surely some escape sequences that I don't catch
yet.  Also, the HTML output doesn't understand anything about windows
or cursors, so anything inside a curses application (e.g. Emacs) will
probably come out horribly mangled.  Still, things should recover
quickly once you get back to the command line.

If you do want to record curses sessions, you'll probably want to
record scripts with timing information and play them back in an actual
terminal emulator ;).

11 years agofont:GoodCityModern-reduced: Update to add a 0x20 (space)
W. Trevor King [Wed, 9 Jan 2013 18:48:45 +0000 (13:48 -0500)]
font:GoodCityModern-reduced: Update to add a 0x20 (space)

Still compiled with:

  $ font-reduce.py -r 0x9f,0x9f -t 0xfc,0xfc -o GoodCityModern-reduced.woff /usr/share/fonts/freefonts/gocmseq_.pfb

but, I just tweaked font-reduce.py, so the new font has a space
character.  On Gentoo, gocmseq_.pfb is bundled in the
media-fonts/freefonts package.

11 years agofont:Pecita-reduced: Upgrade to Pecita 4.0.0 alpha and add 0x20 (space)
W. Trevor King [Wed, 9 Jan 2013 18:40:35 +0000 (13:40 -0500)]
font:Pecita-reduced: Upgrade to Pecita 4.0.0 alpha and add 0x20 (space)

Upgrade from 3.3.0 to a recently downloaded 4.0.0 alpha and reduce with:

  $ font-reduce.py -s 'http://pecita.eu/police-en.php' -l 'OFL (SIL Open Font License)' Pecita.otf

I just tweaked font-reduce.py, so the new font has a space character.

11 years agofont-reduce.py: Add special space handling
W. Trevor King [Wed, 9 Jan 2013 18:38:51 +0000 (13:38 -0500)]
font-reduce.py: Add special space handling

For some reason, FontForge doesn't like selecting spaces with
`select(('ranges',),...)`.  No idea why, but this works around the
problem.

Reported-by: David Loyall <david.loyall@nebraska.gov>
11 years agofont-reduce.py: Improve ranges/targets error handling and logging
W. Trevor King [Wed, 9 Jan 2013 18:20:36 +0000 (13:20 -0500)]
font-reduce.py: Improve ranges/targets error handling and logging

Now the ranges in the fontlog reflect the actual ranges (instead of
being hardcoded to match the defaults).  Also raise an explicit error
if the number of ranges does not match the number of targets.

11 years agomkogg.py: Upgrade from optparse to argparse
W. Trevor King [Mon, 31 Dec 2012 12:06:20 +0000 (07:06 -0500)]
mkogg.py: Upgrade from optparse to argparse

11 years agomkogg.py: Prefix imports with underscores for a clean namespace
W. Trevor King [Mon, 31 Dec 2012 11:52:18 +0000 (06:52 -0500)]
mkogg.py: Prefix imports with underscores for a clean namespace