skip to main content - dyslexic font - mobile - text - print

Hacker Public Radio

Your ideas, projects, opinions - podcasted.

New episodes Monday through Friday.

Correspondent

Jon Kulp


Host ID: 238

Music professor, open-source software enthusiast, Lafayette, LA.
http://jonathankulp.org


email: jonlancekulp.nospam@nospam.gmail.com
episodes: 25

hpr1779 :: Cowsay and Figlet

Released on 2015-05-28 under a CC-BY-SA license.

Basic commands

Make default cow speak:

cowsay "Hacker Public Radio"

Result:

 _____________________
< Hacker Public Radio >
 ---------------------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Modes

  • -b Borg mode;
  • -d dead;
  • -g greedy mode;
  • -p causes a state of paranoia to come over the cow;
  • -s makes the cow appear thoroughly stoned;
  • -t yields a tired cow;
  • -w is somewhat the opposite of -t, and initiates wired mode;
  • -y brings on the cow's youthful appearance.

Use "tired" cow mode:

cowsay -t "Ken is tired of begging for shows"

Result:

 ___________________________________
< Ken is tired of begging for shows >
 -----------------------------------
        \   ^__^
         \  (--)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

Specify different images with -f

Threaten someone with a dragon:

cowsay -f dragon 'record and upload a show OR ELSE!'

Result:

 ___________________________________
< record and upload a show OR ELSE! >
 -----------------------------------
      \                    / \  //\
       \    |\___/|      /   \//  \\
            /0  0  \__  /    //  | \ \    
           /     /  \/_/    //   |  \  \  
           @_^_@'/   \/_   //    |   \   \ 
           //_^_/     \/_ //     |    \    \
        ( //) |        \///      |     \     \
      ( / /) _|_ /   )  //       |      \     _\
    ( // /) '/,_ _ _/  ( ; -.    |    _ _\.-~        .-~~~^-.
  (( / / )) ,-{        _      `-.|.-~-.           .~         `.
 (( // / ))  '/\      /                 ~-. _ .-~      .-~^-.  \
 (( /// ))      `.   {            }                   /      \  \
  (( / ))     .----~-.\        \-'                 .~         \  `. \^-.
             ///.----..>        \             _ -~             `.  ^-`  ^-_
               ///-._ _ _ _ _ _ _}^ - - - - ~                     ~-- ,.-~
                                                                  /.-~

On Linux, praise Ahuka with a Random Cow:

echo 'Ahuka Rocks!' | cowsay -f $(locate *.cow | shuf -n1)

One Result:

 ______________
< Ahuka Rocks! >
 --------------
        \    ,-^-.
         \   !oYo!
          \ /./=\.\______
               ##        )\/\
                ||-----w||
                ||      ||

               Cowth Vader

Figlet

Make ASCII banner text with figlet. This one uses the default font and wraps the lines at 45 characters:

figlet -w 45 "Hacker Public Radio"

Result:

 _   _            _             
| | | | __ _  ___| | _____ _ __ 
| |_| |/ _` |/ __| |/ / _ \ '__|
|  _  | (_| | (__|   <  __/ |   
|_| |_|\__,_|\___|_|\_\___|_|   
                                
 ____        _     _ _      
|  _ \ _   _| |__ | (_) ___ 
| |_) | | | | '_ \| | |/ __|
|  __/| |_| | |_) | | | (__ 
|_|    \__,_|_.__/|_|_|\___|
                            
 ____           _ _       
|  _ \ __ _  __| (_) ___  
| |_) / _` |/ _` | |/ _ \ 
|  _ < (_| | (_| | | (_) |
|_| \_\__,_|\__,_|_|\___/ 
                          

Use an alternate font with -f option:

figlet -f digital "Community News"
+-+-+-+-+-+-+-+-+-+ +-+-+-+-+
|C|o|m|m|u|n|i|t|y| |N|e|w|s|
+-+-+-+-+-+-+-+-+-+ +-+-+-+-+

Links


hpr1774 :: Router Hacking

Released on 2015-05-21 under a CC-BY-SA license.

Router Hacking

What

  • Flashing a router with alternate firmware

Why

  • Provide additional features
  • Improve performance
  • Privacy (gets rid of unwanted spyware)
  • Fun

Where

How: Steps for My Latest Hack

  1. Find used Netgear WNDR3400 router on shelf at local Goodwill store, priced at $3.99.
  2. Use my smartphone to check the dd-wrt database to see if this router is hackable.
  3. Grin broadly upon seeing the green "Yes" beside router WNDR3400.
  4. Double-check that power supply is included, find an AC outlet and plug in to be sure it powers on and my phone sees its ESSID. Yep and yep.
  5. Take router to cashier and purchase.
  6. Do hard reset of router to clear any previous configuration.
  7. Hook a laptop up to router using ethernet patch cable (turning off WiFi adapter on laptop).
  8. Access router's configuration in web browser at default router address of 192.168.1.1 just to confirm that it works.
  9. Go back to the dd-wrt router database and find the router again, then download the corresponding "mini" and the "mega" versions of dd-wrt firmware (The mega version has the most features—including USB support, which I wanted—but on many routers, including this one, you have to install the mini version first or else you could brick the router)
  10. Read over the dd-wrt wiki page for this specific router just to see if there's anything unusual about the hack. There's not.
  11. Go to the router's stock configuration page again and find the "Firmware upgrade" button.
  12. Click the button and choose the "mini" version of the dd-wrt firmware, and click upgrade, then wait while crossing fingers until it says firmware successfully upgraded.
  13. Refresh the configuration page at 192.168.1.1 and see the new dd-wrt configuration interface.
  14. Pat myself on the back because I have just hacked another router. Hray!
  15. Find the upgrade firmware area on the new dd-wrt interface, and this time choose the "mega" firmware file and submit, then wait and cross fingers as before. Celebrate when it works.
  16. Configure newly hacked router as wireless bridge (this is NOT going to be my main router), enable the USB and printer support, hook up our formerly-usb-only printer to the router, and configure household computers to be able to print wirelessly to the newly-networked printer.
  17. Enjoy kudos from appreciative family.

hpr1770 :: The OpenDyslexic Font

Released on 2015-05-15 under a CC-BY-SA license.

In this episode I talk about how you can take advantage of the OpenDyslexic font as a user, and also how as a content provider you can use it to help your readers. Incidentally, we also talked about this for a while during episode 1418, one of the 2013 New-Year shows.

Links


hpr1760 :: pdftk: the PDF Toolkit

Released on 2015-05-01 under a CC-BY-SA license.

Hacking Apart and Re-Assembling PDFs

Extract pages 3–5 from file foobar.pdf:

pdftk foobar.pdf cat 3-5 output excerpt.pdf

Same thing but also grab the cover page:

pdftk foobar.pdf cat 1 3-5 output excerpt.pdf

Combine multiple PDFs:

pdftk file1.pdf file2.pdf file3.pdf cat output combined.pdf

Reassemble a 50-page document with all of the pages in reverse order (I once actually did this for my wife and she was very grateful—she had scanned an article at the library and it ended up with all of the pages in the wrong order from last to first. This command solved her problem in about one second.):

pdftk wrongorder.pdf cat 50-1 output rightorder.pdf

Check the pdftk man page for all kinds of other manipulations you can do, including "bursting" a PDF into its component pages, rotating pages in any direction, applying password protection, etc.

Embedding “Bookmarks” as a Table of Contents

You can also use pdftk to embed a table of contents in a flat PDF file. This is incredibly useful, as it can make large, unwieldy files very easy to navigate. All you have to do is add some bookmark data in a fairly straightforward format as shown below. As a starting point you should that dump the current metadata content of the file with this command:

pdftk foobar.pdf dump_data_utf8

Save the contents of this data dump in a text file and then add bookmark information just below the NumberOfPages value. Here is an excerpt from the huge anthology of public-domain scores I assembled for my music history class:

InfoBegin
InfoKey: ModDate
InfoValue: D:20150106100000-06'00'
InfoBegin
InfoKey: CreationDate
InfoValue: D:20150106100000-06'00'
InfoBegin
InfoKey: Creator
InfoValue: pdftk 2.02 - www.pdftk.com
InfoBegin
InfoKey: Producer
InfoValue: itext-paulo-155 (itextpdf.sf.net-lowagie.com)
PdfID0: ece858bf9affbcad3b575cf3891a187f
PdfID1: 23f89459e103dd43c6e7bc92028245c0
NumberOfPages: 765
BookmarkBegin
BookmarkTitle: Beethoven: Symphony no. 5 in C minor Op. 67
BookmarkLevel: 1
BookmarkPageNumber: 205
BookmarkBegin
BookmarkTitle: Beethoven 5: I. Allegro con brio
BookmarkLevel: 2
BookmarkPageNumber: 205
BookmarkBegin
BookmarkTitle: Beethoven 5: II. Andante con moto
BookmarkLevel: 2
BookmarkPageNumber: 235
BookmarkBegin
BookmarkTitle: Beethoven 5: III. Allegro
BookmarkLevel: 2
BookmarkPageNumber: 256
BookmarkBegin
BookmarkTitle: Beethoven 5: IV. Allegro
BookmarkLevel: 2
BookmarkPageNumber: 275

And here is the command to update the PDF with the table of contents embedded. This tells it to take the input file foobar.pdf and update its metadata using the file foobar.info (with utf8 encoding) and output the results as foobar_with_toc.pdf.

pdftk foobar.pdf update_info_utf8 foobar.info output foobar_with_toc.pdf

Links

Update

I made a screencast as a follow-up, showing the process of embedding bookmarks to make a table of contents: https://m.youtube.com/watch?v=5dv_02v0zzc


hpr1754 :: D7? Why Seven?

Released on 2015-04-23 under a CC-BY-SA license.

In this episode I respond to one of the community-requested topics ("Music Theory") and try to explain what seventh chords are and why they are used. Below are some of the terms that I use in the course of the discussion.

  • Interval: The distance between two pitches (sounded either consecutively or simultaneously)
  • Consonance: Relatively stable sound between two or more pitches
  • Dissonance: Relatively unstable sound between two or more pitches. Dissonance often needs a "resolution" to consonance
  • Chord: three or more notes sounded together
  • Chord progression: a succession of chords
  • Triad: a chord with 3 pitches, the adjacent pitches separated by the interval of the 3rd.
  • Seventh chord: a chord with 4 pitches, the adjacent pitches separated by the interval of the 3rd.
  • Tonality: harmonic system that governs the use of major and minor keys
  • Tonic: the central tone of a piece of music
  • Mode: major or minor [e.g. Symphony no. 5 in C minor]
  • Modulation: the process of changing keys within a piece of music
  • Scale: Ascending or descending series of notes that define a key or tonality, with a specific arrangements of half-steps and whole-steps. Major and Minor scales are most common in Western music

Free public-domain music reference book: Music Notation and Terminology by Karl Wilson Gehrkens: http://www.gutenberg.org/ebooks/19499 (see ch. 18)

Free Online Music Dictionary: http://dictionary.onmusic.org/


hpr1750 :: xclip, xdotool, xvkbd: 3 CLI Linux tools for RSI sufferers

Released on 2015-04-17 under a CC-BY-SA license.

Basic commands

Type the words "foo bar" with xvkbd:

xvkbd -xsendevent -secure -text 'foo bar'

Types out the entire contents of the file "foobar.txt" with xvkbd:

xvkbd -xsendevent -secure -file "foobar.txt"

Send text to the clipboard:

xclip -i

Send clipboard contents to standard output:

xclip -o

Do virtual Ctrl+C key combination with xdotool:

xdotool key Control+c

Save this complicated command as an environment variable—then the variable "$KEYPRESS" expands to this command.

export KEYPRESS="xvkbd -xsendevent -secure -text"

Examples

With virtual keystrokes and CLI access to the clipboard, you're limited only by your imagination and scripting ability. Here are some examples of how I use them, both for the manipulation of text and for navigation. The words in bold-face are the voice commands I use to launch the written commands.

Capitalize this. Copies selected text to the clipboard, pipes it through sed and back into the clipboard, then types fixed text back into my document:

xdotool key Control+c && xclip -o \
| sed 's/\(.*\)/\L\1/' \
| sed -r 's/\<./\U&/g' \
| xclip -i && $KEYPRESS "$(xclip -o)"

Go to grades. This example takes advantage of Firefox "quick search." I start with a single quote to match the linked text "grades" and press the Return key (\r) to follow the link:

$KEYPRESS "'grades\r"

First Inbox. From any location within Thunderbird I can run this command and it executes the keystrokes to take me to the first inbox and put focus on the first message:

xdotool key Control+k && $KEYPRESS "\[Tab]\[Home]\[Left]\[Right]\[Down]" && sleep .2 && xdotool key Tab

single ex staff. Type out an entire Lilypond template into an empty text editor window:

xvkbd -xsendevent -secure -file "/path/to/single_ex_staff.ly"

Paragraph Tags. Puts HTML paragraph tags around selected text:

#!/bin/bash

KEYPRESS='xvkbd -xsendevent -secure -text'

xdotool key Control+c

$KEYPRESS '<p>'
xdotool key Control+v
$KEYPRESS '</p>'

Launching commands with keystrokes in Openbox

I normally use blather voice commands to launch the scripts and keystroke commands, but I have a handful of frequently-used commands that I launch using keystroke combos configured in the Openbox config file (~/.config/openbox/rc.xml on my system). This block configures the super+n key combo to launch my examplelink.sh script.

<keybind key="W-n">
  <action name="Execute">
	<startupnotify>
	  <enabled>true</enabled>
	  <name>special</name>
	</startupnotify>
	<command>examplelink.sh</command>
  </action>
</keybind>

Links


hpr1732 :: Renovating another Public-Domain Counterpoint Textbook

Released on 2015-03-24 under a CC-BY-SA license.

I mistakenly referred to episode 1516 while I was speaking. I meant to say 1512. The two musical bumpers I used in the show are by J.S. Bach, examples 90 and 91 in the textbook "Applied Counterpoint," by Percy Goetschius. These are my own MIDI renditions so they have no copyright burden upon them.

My html-to-epub conversion command (requires calibre):

ebook-convert foobar.html foobar.epub \
--output-profile=tablet \
--disable-font-rescaling \
--smarten-punctuation \
--change-justification=left \
--preserve-cover-aspect-ratio \
--cover=./pathto/cover.jpg \
--use-auto-toc \
--level1-toc "//h:h1" \
--level2-toc "//h:h3"

Links


hpr1657 :: Hacking Gutenberg eBooks

Released on 2014-12-09 under a CC-BY-SA license.

Links to stuff I mentioned in the podcast:


hpr1568 :: Blather Speech Recognition for Linux

Released on 2014-08-06 under a CC-BY-SA license.

Blather Speech Recognition for Linux: Jon has a conversation with his computer

In this episode I have a blather conversation with my computer. This is a sort of appendix to an episode I released earlier (hpr 1284 http://hackerpublicradio.org/eps.php?id=1284) which was a conversation with Jezra, the lead developer of the blather speech recognition program for Linux. The current episode will make much more sense if you listen to the previous one first.

For the most part I use blather as an accessibility tool, to manipulate my desktop and generally to save myself hundreds of keystrokes a day. This is important because of my repetitive strain injuries. Blather allows me to do many “productivity” tasks using only my voice. I also like to have fun with it, though, and this “conversation” is an example of the sort of goofy stuff I like to do. When the computer hears me say certain predefined phrases, it runs commands. For example when I say “what’s for dinner,” it shuffles the contents of a plaintext file that has about 20 options for dinner, chooses the top option and pipes it through my default text-to-speech program, which is either espeak or festival, depending on what I set as the environment variable in my blather startup script. When it hears me ask for certain other information, such as “what day is it?” and “what’s today’s date?”, it runs the appropriate system command and pipes the output through the text-to-speech program. For information about blather, the various back-end things that make it work, examples of my blather scripts and configuration files, visit the links below.


Links


hpr1538 :: Overhauling the School of Music website

Released on 2014-06-25 under a CC-BY-SA license.

I discuss the process of overhauling a badly out-of-date website to make it conform to accessibility standards and give it a responsive design. I also discuss how I came up with my own content management system by Bash scripting.

Links


hpr1512 :: Adopting and Renovating a Public-Domain Counterpoint Textbook

Released on 2014-05-20 under a CC-BY-SA license.

In this episode I discuss the problem of increasingly expensive college textbooks, and share with you the solution I devised to combat the problem in my counterpoint class at the University of Louisiana at Lafayette.

Part of the solution is to adopt a public-domain textbook that's more than 100 years old, and to give the text a 21st-century makeover that I believe will make it even better-suited for the digital age than any other comparable book in the market at any price.

http://jonathankulp.org/gratis.html: The counterpoint page on my website, with source files and information about my creative-commons counterpoint workbook, "Gratis ad Parnassum," as well as links to the 1910 counterpoint textbook by Percy Goetschius: http://en.wikipedia.org/wiki/Percy_Goetschius entitled "Exercises in Elementary Counterpoint."

My html version of the Goetschius textbook (in progress): http://jonkulp.net/350/Goetschius/goetschius.html


hpr1368 :: How to Fold a Fitted Sheet

Released on 2013-10-30 under a CC-BY-SA license.

How to Fold a Fitted Sheet

In this episode I try to teach you how to fold a fitted sheet, something that could earn you sheet-folding duties for the rest of your life. See the photo gallery at https://pics.jonkulp.net/index.php?/category/17.


hpr1349 :: Melissa Dupreast helps me with Audio Compression

Released on 2013-10-03 under a CC-BY-SA license.

I impose upon Melissa Dupreast to help me learn about audio compression and I make a recording of our session for HPR. Missy is a professional audio engineer, working locally for radio and live sound reinforcement. She is also a recent graduate of our masters program at the University of Louisiana at Lafayette and is currently teaching 3 classes for us as an adjunct instructor.


hpr1339 :: Legacy Technology: My Victrola

Released on 2013-09-19 under a CC-BY-SA license.

I talk about and demonstrate my wonderful 1917 Victrola, purchased in Austin, Texas sometime around 1993 from a private individual.

Photo Gallery: https://pics.jonkulp.net/index.php?/category/14


hpr1313 :: How I Manage Contacts

Released on 2013-08-14 under a CC-BY-SA license.

How I Manage Contacts

About a year ago I decided to try to clean up my contacts.

The problem: CRUFT!

  • Importing, exporting re-importing in different accounts and in different email clients and several computers etc over span of ~10 years.
  • 1200+ gmail contacts
  • Many duplicates

What I wanted:

  • 1 set of contacts across platforms with single source file from which all others are generated
  • plain-text format, easy to use w/scripting & text editor
  • No duplicates
  • no cruft
  • easy to maintain
  • easy to import/export in T-bird, ownCloud
  • sync with phone

Steps to Success:

  1. Turn off Gmail default setting that saves every incoming email address in your address book
  2. Deleted all extraneous contacts (went from ~1200 down to about 400)
  3. Tedious part here: compare duplicates, consolidate info
  4. Decide on source-file format
  5. T-bird = LDIF
  6. OwnCloud = vCard
  7. LDIF wins b/c found script to convert to vCard, but not good script for other direction
  8. Convert all disparate contacts lists to LDIF, begin consolidating into one file
  9. LDIF ready? Import to T-bird
  10. Perl script to convert LDIF to vCard –> import to ownCloud
  11. CardDAV-sync to sync from o.c. to phone
  12. Bash script to create new LDIF entries, convert to vcf, add to master file easily

Wishlist

  1. Make t-bird sync w/owncloud (t-bird SOGO extension broken)
  2. CLI API to update owncloud contacts via a script instead of having to use the web interface

Links


hpr1304 :: Jon Kulp and His Son Talk Hacking

Released on 2013-08-01 under a CC-BY-SA license.

I chat with my son about the concept of hacking, Linux, Blacksmithing, and about some of the other stuff he does that smacks of hacking.


hpr1301 :: Conversation with Nybill and Jon Kulp

Released on 2013-07-29 under a CC-BY-SA license.

While I am on vacation near New York City, fellow HPR host NYbill drives down from upstate and we meet for the first time face-to-face. Of course we have to record a conversation for posterity. Topics include activities at LUG meetings, Cory Doctorow, Neal Stephenson, blather speech recognition (a live demonstration!), guitars, and more. Outtakes after the outro.

Links


hpr1299 :: What’s in my Bag

Released on 2013-07-25 under a CC-BY-SA license.

I go through the usual stuff in my bag. One thing I forgot to say is that my laptop is a Toshiba Satellite with i3 processor, 6gb of RAM, 750gb hard drive running Crunchbang Linux. Here are links to two of the items mentioned in the episode.


hpr1284 :: Blather Speech Recognition for Linux: Interview with Jezra

Released on 2013-07-04 under a CC-BY-SA license.

Jon's Recumbent Bicycle
A conversation with Jezra, sometime HPR host and the lead developer of the Blather speech recognition program for Linux.

Links:


hpr1282 :: My Homemade Recumbent Bicycle

Released on 2013-07-02 under a CC-BY-SA license.

Jon's Recumbent Bicycle
The Green ♲ Machine

In this episode I discuss my experience building a Recumbent Bicycle from donor bikes. A couple of things I forgot to mention while recording the podcast. First of all I had to use tandem bicycle cables for the brakes and the rear derailleur because they had to be very long. I also forgot to talk about the time when I was in a panic that the rear triangle was a bit out of alignment with the front, such that it would make the bike turn a little bit to the left by default. I called Andrew Carson and asked him if there was anything I could do to fix it and his solution was just awesome. What he told me to do was to put a spare hub in the rear triangle to keep the seat- and chain stays from collapsing together, lay the frame on the ground with the front end propped up on a step or something, and then just stand on it, jumping up and down slightly on it if necessary until I could feel it bend back a little bit. This actually worked! It straightened the frame right out. :) Finally, the total cost for this project was under $300. The most expensive single part of it by far was the powder coat, which cost $120. Here are links to resources mentioned in the podcast or simply of general interest.


hpr1280 :: Homemade Antennas for OTA Hi-Def TV

Released on 2013-06-28 under a CC-BY-SA license.

In this episode I discuss my experience building and using antennas for over-the-air hi-def TV.

Here are pictures of my two main antennas:

Bow-Tie style

Jon's bow-tie antenna

Gray-Hovermann style

Jon's gray-hoverman antenna


hpr1276 :: Two Hacker Public Radio hosts meet face-to-face for the first time

Released on 2013-06-24 under a CC-BY-SA license.

I have known windigo for more than 4 years as a virtual acquaintance, first on the Linux Outlaws forums, then on identica, and finally on the Federated Statusnet network. It was awesome when he and his girlfriend stopped by my house today to visit while on a massive road trip around the United States. We took advantage of the opportunity to record a brief conversation for Hacker Public Radio. Here's a photo of windigo, me, and Dingle the cat between us.

windigo, dingle, and Jon Kulp

Links


hpr1270 :: Fathers Day Special: Jon Kulp interviews his Dad

Released on 2013-06-14 under a CC-BY-SA license.

While my parents are visiting from Tennessee I take advantage of the opportunity to talk to my dad for awhile about his early days of computing. He has a PhD in statistics and has been using computers since the 1960s. we talk about his programming in Fortran and Cobol, about building Heathkit projects, about his duties as a VP for information technology at a small private university in Nashville, and about his more recent programming in Windows.


hpr1247 :: Recording Terrestrial Radio with bash scipts and cron jobs

Released on 2013-05-14 under a CC-BY-SA license.

In this episode I talk about my solution for capturing terrestrial radio so that I can listen to it at my own convenience. I use a bash script, cron jobs, and the streamripper package. here are some links to things I mentioned in the podcast.

Jezra's command-line audio player sap (simple audio player): http://www.jezra.net/projects/sap

Streamripper: http://streamripper.sourceforge.net/

Radio station KRVS 88.7 FM, Lafayette, Louisiana, USA http://krvs.org/

And you can see the whole radio-recording script here: http://jonathankulp.org/archives/647


hpr1197 :: What I do with bash scripts

Released on 2013-03-05 under a CC-BY-SA license.

In this episode I talk about the way I use shell scripting on a day-to-day basis. I am not employed in a technical field, so the fact that I use shell scripts at all surprises most people. I am just a music history professor with an enthusiasm for Linux and free software. Although I have dabbled a bit with Python, I don't feel nearly as comfortable with Python as I do with bash, so all of the scripts I mention in this episode are written for bash.

Here are links to blog posts about some of the scripts mentioned in the show.

markdown2latex: http://jonathankulp.org/archives/570

Cowsay stuff: http://jonathankulp.org/archives/346

"stick" scp script: http://jonathankulp.org/archives/441

MyIP: http://jonathankulp.org/archives/620


Become a Correspondent