Technitribe

interesting problems (and a few solutions, too)

Technitribe
  • About the Authors
  • Log In
  • Log Out
  • Lost Password
  • Register
  • Reset Password
    • 5 Apr 2014

      Red Hat Summit 2014 – JBoss In The Trenches

      Written by Tim Bielawa

      Just a heads up, at Red Hat Summit this year I’ll be co-presenting a session with Andy Block. The presentation is on Wednesday, April 16 from 3:40 pm – 4:40 pm.

      JBoss In The Trenches

      In this session (my first time presenting at a conference! w00t!) we’ll be going over the enormous year-long migration from JBoss EAP 4/5 to 6.1 we undertook last year in RH IT. As we move through the different stages of the migration we’ll introduce you to industry best practices and implementation decisions to consider when deploying EAP6 clusters. Here’s some teaser slides!


      1 Comment
    • 5 Jul 2013

      A Munin plugin for OpenShift

      Written by Tim Bielawa

      I created a munin plugin to chart the number of gears present/idle on OpenShift application node instances. The plugin was written for/tested against OpenShift Enterprise 1.2.

      Chart: One Host

      Present/Idle gears on a host

      These charts show the number of gears present/idle on a single OpenShift application node instance. Nothing special required to set this plugin up. Just copy the script/configuration to your node and then restart the munin-node service.

      Chart: District

      Gears present across a district

      This is a combined/multigraph chart showing the number of gears present on all nodes representing my “small” district. This chart is created using the munin concept of ‘loaning’ data.

      GitHub: openshift-munin-plugins

      Interested in trying it out yourself? The code is up on github: tbielawa/openshift-munin-plugins.

      Along with the actual plugin you can find example munin server configs for creating the multigraph chart of gears across all nodes in a district.

      0 Comments
    • 4 Apr 2013

      Using TTF fonts with DocBook and dblatex

      Written by Tim Bielawa

      Update 2013-06-23:

      Updating to the 0.3.4 version of dblatex has fixed many of the issues detailed in The Aftermath (end of this blog post). See the blog post for more information.

      The Problem:

      You’re writing a book in DocBook XML, publishing it with dblatex, and you dislike (or want to customize) the fonts it uses in the rendered PDF.

      You hunt around the internet and find a nice family of fonts you want to use in your final product. Best of all, they’re free and released under the Open Font License!(Thanks, Adobe!)

      The dblatex documentation shows you how to set your fonts, but you can’t seem to get it to work.

      • What do you put in for the names anyway?
      • Do spaces matter, or do you enter file names?
      • Where do you install the fonts?
      • OTF, TTF? What type of font must they be?
      • Does the TeX engine even support this?

      The Solution:

      1. Find The Family Names

      Caveat: I can verify that this solution works for TTF type fonts, I can not comment on how well it works for other font types.

      First, you will need to identify the actual family name of the fonts you want to use. If your font is not installed on your system there is a command called otfinfo that can tell you the family of the font file (despite sounding specific to OTF fonts, this works on TTFs as well). The otfinfo command is provided by the lcdf-typetools package:

      If your desired font is already installed on your system you can use the fc-list command instead to find the same information (fc-list is provided by the fontconfig package):

      2. Install New Font Files

      If this is a new font on your system then you’ll need to install it. There are (at least) two locations that work:

      • $HOME/.fonts
      • /usr/share/fonts/truetype/

      The Font Manager application (package: font-manager) also provides a graphical way to install font collections.

      (Optional) Rebuild Font Cache

      Rebuild your font caches with the fc-cache -f -v command. If I recall correctly, you need to have super user permissions to run this. I may be wrong though.

      3. Configure dblatex

      The necessary changes to consume your custom fonts isn’t difficult. Assume that up until now you’ve been rendering your PDFs from XML source like this:

      • dblatex -o output/Virtual-Disk-Operations.pdf Virtual-Disk-Operations.xml

      We need to use XSLT stylesheets to define what our chosen font families are going to be. In this example I’m using Source Sans Pro for the body font and Source Code Pro for monospaced sequences.

      First, make a directory called xsl and put a file like this in it:

      Next, slightly modify the command you run to build your PDFs (new parts are in bold text):

      •  dblatex -p xsl/dblatex-pdf.xsl -b xetex -o output/Virtual-Disk-Operations.pdf Virtual-Disk-Operations.xml

      -p xsl/dblatex-pdf.xsl: This tells dblatex that we’re providing a “user stylesheet” to use when transforming the XML. This stylesheet only has our font customizations in it, but you can put much more in them than just that.

      -b xetex: This tells dblatex that instead of rendering our PDF with pdftex we want to use a different backend driver (or “TeX engine”). Specifically we want to use the xetex driver. We choose the xetex driver because of it’s superior font handling abilities via the fontspec LaTeX package. When we use the xetex engine dblatex will insert some special macros into the intermediate LaTeX document it generates, this process is transparent to the end user:

      After this, dblatex runs any custom post-compilation scripts, and then hands the intermediate file off to xetex where it is finally transformed into PDF format.

      4. The Aftermath

      In my case there were some unexpected side-effects from switching backends. Here’s what I’ve noticed so far:

      • remark elements no longer appear in PDF output
      • The DRAFT watermark no longer appears
      • screen elements no longer show a ‘wrapping character’ in long lines
      Compare new formatting with old

      On the left is the book rendered with xetex and the new fonts. On the right is the book rendered with pdftex and no special font customizations.

      The only thing that really bothers me is the broken word-wrapping character. I can deal with the others breaking. I had intended to remove them from the final product anyway.

      1 Comment
    • 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
    • 12 Oct 2012

      Running despotify on Fedora 17 x64

      Written by Tim Bielawa

      Spotify is pretty damn cool. I think we can all agree on this. What’s even cooler (if you’re an Open Source/Linux geek) is running a third-party ncurses client to connect to Spotify. Here’s what I had to do on Fedora 17 (64 bit).

      1. Install the necessary packages to checkout and build the application
        1. Per the Open Grieves instructions, install the following packages: subversion libtool libogg-devel libvorbis-devel pulseaudio-libs pulseaudio-libs-devel zlib-devel gstreamer-devel libao-devel openssl-devel ncurses-devel
      2. Checkout the despotify source code from SVN
        1. svn co https://despotify.svn.sourceforge.net/svnroot/despotify despotify
      3. Move into the despotify/srcdirectory
        1. cd despotify/src
      4. Build and install the application
        1. make
        2. sudo make install
      5. Because we’re specifically talking about an x64 installation we need to fix how libdespotify.so.0 got installed. Now, I’m sure there’s a more intelligent way to do this (please tell me if you know by commenting on this blog post, or hit me up on twitter: @tbielawa), but lacking the necessary knowledge, I opted use symbolic links (note: this fixes the “despotify: error while loading shared libraries: libdespotify.so.0:" cannot openerror message you may be seeing)
        1. cd /usr/lib64
        2. sudo ln -s ../lib/libdespotify.so.0
      6. Run the application (protip: Press the “?” key to see a list of shortcuts. ctrl+e is a shortcut for :connect)
        1. despotify
      7. If you try and log in now you’re most likely going to receive a “User not found” error message. Per the information in this thread on the archlinux forumsI did the following:
        1. Logged into the Spotify web interface
        2. Went into the “Edit Profile” page
        3. Went to the “Set a password for your devices” page
        4. This page will give you a number you will use as your despotify user name, save it somewhere for the next step. Click the link/button to receive an email which allows you to set the password for this account
        5. Read said email, click link in email, set “device” account password
      8. Now, using the account credentials created in the last step, you can log into the despotify application

      That’s everything I had to do. So, is it worth it? No. Not really. But it was a fun little experiment/challenge.

      The interface is immature, at best. It’s lacking most/all of the functionality I really enjoy in the official Spotify client, such as creating and listening to artist/song based radios, receiving/sending music suggestions to friends, Starring songs for offline listening later, etc…

      What you can do is search for artists/tracks and play the results, and, impress your friends? I guess. (probably not though)

      2 Comments
    • ←
    • →
    Page 2 of 3
    • 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

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