Technitribe

interesting problems (and a few solutions, too)

Technitribe
  • About the Authors
  • Log In
  • Log Out
  • Lost Password
  • Register
  • Reset Password
    • 24 Sep 2013

      Mac OS X, Sed, and strange document encoding

      Written by Tim Bielawa

      The Problem

      You’re on Mac OS X (somewhere around 10.7.5) and you’re using the sed command to replace characters from the latin1 or Windows-1252 character encoding with their utf8 equivalents. Unfortunately you get an error like the following:

      sed: 1: "s/#/’/g
      ": RE error: illegal byte sequence

      Luckily you’re not alone!

      • vim_dev
      • homebre-deps
      • HamDecks
      • stackoverflow

      This happened to me while working on HamDecks, a small project that creates Mnemosyne decks to help you study for the Amateur Radio Operator exams using questions from the official ARRL Question pools. The source question pool files (Technician, General, Extra) though have some problems… There’s a lot of characters with strange/exotic encoding in the ARRL pool files that could not be imported into Mnemosyne. That’s how I got myself into this whole mess in the first place.

      Options

      The stackoverflow link above makes two suggestions:

      1. Use the iconv utility
      2. Use a PERL one-liner

      Your Mileage May Vary, but neither of those suggestions worked for me. So what did work then?

      Potential Solution

      Once again, we will visit our system locale settings.

      Here’s what worked for the HamDecks project:

      Instead of just prefixing the sed command with LANG=C, we prefix it with LANG=C LANG_ALL=C. I’m not saying this is a silver bullet, just that it worked for me and might work for you too.

      0 Comments
    • 13 Jan 2013

      Updated Docs: Setting up an OpenGL project using Apple Xcode

      Written by abutcher

      Documentation for Setting up an OpenGL project using Apple Xcode has been updated for Xcode 4.2.5.

      I got an email earlier this afternoon from someone seeking help on the topic and promptly updated it to go along with Xcode’s new interface.  I’ve also added new sample code from a texture project I did at the university to help adequately test the set up.

      Side note:  I was not aware how high the doc was on google search results!

      0 Comments
    • 15 Oct 2011

      Mac OS X 10.7 – Getting songs off an iPod

      Written by Tim Bielawa

      A while back I wanted to backup the songs I’ve saved to my iPod. I was running Mac OS X Leopard (10.5). When I searched around I found a tool called iPodDisk. It worked great! Then Snow Leopard (10.6) came out.

      The way the launcher for iPodDisk was written meant it only would launch on 10.4 or 10.5. When you launched iPodDisk you would receive the message:

      “Sorry iPodDisk requires OS X 10.4 or later”

      Fixing this was pretty simple. After searching their google code issue tracker I quickly came across issue #34, “Sorry iPodDisk requires OS X 10.4 or later“. The fix was simple, reply #3 in the thread said to just edit one line in the launcher so that the version check accepted a higher version.

      Time goes on and eventually I did a full OS reinstall (for some reason or another) and just recently upgraded to 10.7 (Lion). I’d bought a new network storage unit (Western Digital My Book Live) and wanted to back up my iPod again. Of course, upon downloading and launching iPodDisk again it produced the same error it did previously. It was clear to me that iPodDisk was clearly not being maintained.

      While searching for the fix again I decided to read some newer posts on the issue tracker. Reply #51 referenced MacFuse. The project site for that hasn’t made a new release since 2008 though. Reply #60 had the information I was finally looking for.

      So the final solution that allowed me to backup my iPod on OS X 10.7, Lion, was to install these two pieces of software:

      • iTunesFS
      • OSX Fuse
      The result was perfect. The same functionality I had when using iPodDisk previously. When you launch iTunesFS it opens a new Finder window showing all mounted volumes. Navigate to the iTunesFS volume and you’re set.
      5 Comments
    • 22 Sep 2010

      Lots more docs published on PeopleAreDucks.com

      Written by Tim Bielawa

      While I’ve been gone from the blogging world I’ve still been working on projects. Mostly I’ve been working on documentation.

      • Debian/Fedora Package Management comparison. Since switching my Slice to Fedora from Ubuntu I’ve picked up plenty of commands for managing packages. This is just a quick wiki page giving the roughly equivalent commands from Debian/Ubuntu to Fedora/RedHat.
      • regexp basics is a brief tutorial on regular expressions. My roommate abutcher put it together for his WVU CS210 (Advanced File and Data Structures) course. The DocBook 5 sources are available in git.
      • The biggest doc project I’ve been working on again (finally) is my Virtual Disk Guide aimed at power users and sysadmins. Currently it’s a rough draft and is constantly undergoing major changes and additions. It’s available as a single HTML document, chunked into multiple pages, and in PDF format. You can get the DocBook 5 formatted source to it through my GitHub account.

      My Project Templates project has seen some much needed attention recently. The DocBook starter project has been completely redone. Here’s some reasons you might want to use it.

      • Includes a basic starter document with most of the available informational tags present but commented out so all you need to do is uncomment the elements you need for your document.
      • Inclues a customizable Makefile that can adapt itself to different operating systems (Debian/Ubuntu, Fedora/RedHat, and Mac OS X) by just uncommenting the proper directory paths for the schema and stylesheet files.
      • The Makefile has targets for: cleaning up, creating schema locator files for nxml-mode in emacs, publishing PDFs, and publishing chunked or single HTML documents.
      • The comments in the Makefile also tell you what packages you need to install to get the schema and stylesheet files.

      Using the Makefile for publishing only requires having xsltproc and dblatex installed. Both of which are available through your favorite package manager.

      1 Comment
    • 4 Dec 2009

      Installing dblatex from the latest MacPorts

      Written by Tim Bielawa

      I ran into this issue while installing dblatex (0.2.10) from the most recent MacPorts tree today:

      Traceback (most recent call last):
        File "/opt/local/bin/dblatex", line 16, in 
          from dbtexmf.dblatex import dblatex
      ImportError: No module named dbtexmf.dblatex
      

      I got past it by exporting PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages, but clearly this was not optimal. I was about to file a bug report about the issue but before I did that I read their new ticket guidelines which requested the full build log be included in the ticket.

      In the build log was the solution. I would have missed it had my shell scrollback not been set to unlimited. Nestled a good 182 lines back in my buffer was this little message:

      --->  Installing python26 @2.6.4_0+darwin
      --->  Activating python26 @2.6.4_0+darwin
      
      To fully complete your installation and make python 2.6 the default, please run
      
      sudo port install python_select
      sudo python_select python26
      

      I did as instructed, and sure enough, dblatex started working! I just wanted to post this on the blog in case anyone else ran into this and missed it like I did.

      4 Comments
    • →
    Page 1 of 2
    • The Authors
    • Virtual Disk Guide

      Interested in virtualization? Do QCOWs rule your filesystem? Are you a libvirt or KVM+QEMU wizard? I wrote a book about virtual disk management. Check out the The Linux Sysadmin's Guide to Virtual Disks online for free at ScribesGuides.com.


      Consider supporting the author by purchasing a hard copy of the first edition for just $10.00 on Lulu.com.

    • bitmath

      bitmath is a Python library for dealing with file size units (GiB's, kB's, etc) in a sane way. bitmath supports arithmetic, rich comparison, conversion, automatic best human-readable representation, and many other utility functions. Read some examples on the docs site or check out the source on GitHub.

    • latest posts

      • Using jq to filter an array of objects from JSON September 9, 2019
      • Two Year Break — And we’re back! November 16, 2018
      • [Updated] GitHub + Gmail — Filtering for Review Requests and Mentions January 20, 2017
    • tags

      bitmath blog conference css dblatex DNS DocBook eclipse Emacs Erlang Fedora fedora 22 filter GNU Screen Haiku Introduction java jboss LCSEE Linux locale locales fix slicehost ubuntu Macports module nist nXML-Mode opengl open source OS X package packaging pki prefix units presentation project pypi Python scholarship si summit Tutorial ubuntu xcode XML XMPP
    • h4ck teh world

      tbielawatbielawa
      • Create
        aos-cd-jobs
        October 27, 2020 - 1:45 pm UTC
      • Pull Request
        openshift/aos-cd-jobs
        October 27, 2020 - 1:45 pm UTC

Creative Commons License
Technitribe by Tim Bielawa is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.