CSO Compression and Decompression Tool

Introduction I have a number of backed up ISO files that were taking up quite a bit of space. I wanted to save some space and I decided to compress them. Instead of putting them into something like a ZIP archive, I decided that compressing into CSO would be the most usable option. Sadly, there is a lack of CSO compression and decompression tools that can be easily installed using something like homebrew....

November 21, 2022 · John

Full Text Search with Jekyll

Introduction When I switched from WordPress to Jekyll I gave up searching posts. I knew this was a limitation of running a static site and I didn’t think it would be too big a deal. After a year I’ve found I actually look up some old reference posts just enough that search to be useful. Trying to remember which tags given posts use became a bit of an annoyance. I really started to miss the ability to search....

June 10, 2020 · John

Python Http Server

Introduction Quite often I find that I need to serve some files for viewing in a web browser. Most recently, I needed to do this with an in progress OpenAPI document as rendered by ReDoc. All I needed was something that can serve static files. I really didn’t want to take the time to setup and configure something like Apache or Nginx. These are overkill for static files on a developer machine....

December 10, 2019 · John

Python Self Signed Cert Gen

Introduction Sometimes I need to write a simple network server to emulate an application I’m integrating with. Typically, this is ends up being a throw away Python script that allows me to easily inspect at a request and returns a basic response. It’s handy to verify what I’m sending isn’t malformed. Also, it helps to ensure my response parser is at least somewhat sane. The software I work on requires a TLS secured connection to all remote end points....

November 14, 2019 · John

Python Binary to C Header

Introduction Once again I needed to embed some text files into a C application. The right way to do this is turn the data into a byte array and compile it in. At least it’s the most portable way because some compilers have string length limitations. xxd -i is the easiest way to format the data so it can be compiled in. However, just like the last time, I don’t have access to xxd -i....

October 9, 2019 · John

Binary Headers

Introduction Earlier in the year I wrote a Lua implementation of xxd -i (it’s at the bottom under the “Embedding” section). I wrote this because a few platforms I was working with didn’t support xxd. I didn’t want to attempt compiling and installing it. I had Lua installed on these platforms so it was easier to write a Lua script to do the same thing. I only needed -i output so implementing all of xxd wasn’t necessary....

October 23, 2015 · John

Cybook t4b Format Specification

The new epub thumbnail files (.epub.thn) are what Bookeen calls t4b files. They are very similar to the older t2b thumbnail files they were using in earlier versions of the Cybook firmware. As the name suggests instead of using 2 bits to represent color values 4 bits are now used. This increases the number of colors from 4 to 16. In addition to the increased color range the t4b files now require a header of “t4bp” without the quotes....

January 14, 2010 · John

Unidecoder

A while back I made a post about ASCIIizing Text. With it was a simple python application that would convert Unicode characters to ASCII equivalents. It doesn’t do a basic conversion but also Latinizes the characters when they are outside of the ASCII range. The uni2ascii package I made has a few short comings I’ve decided to fix. The three major problems with it are: 1) Very basic permission checking, 2) Only accepts one file, 3) Required all input to be UTF8 encoded, 4) The decoder was a very literal port of a the ruby version....

October 31, 2009 · John

Niw Markdown Editor

For the past three weeks I’ve been working on an editor for working with plain text files and making it easy to add markdown syntax to them. My main goal is to make it easier to format the large number of ebooks I have. Almost all of them are plain text files. It’s a python project using PyQt4 and I’m hosting it on Launchpad. here is the project page and you can find some screen shots here....

August 31, 2009 · John

QPlainTextEdit With In Line Spell Check

Update: Simplified Highlighter.highlightBlock function One thing Qt lacks is an integrated spell check in the text entry components. For a project I’m working on this is necessary. Using python-enchant and the QSyntaxHighlighter I was able to implement this functionality. Here is how to add an in line spell check support to a QPlainTextEdit. #!/usr/bin/env python # -*- coding: utf-8 -*- __license__ = 'MIT' __copyright__ = '2009, John Schember ' __docformat__ = 'restructuredtext en' import re import sys import enchant from PyQt4....

August 22, 2009 · John