184 lines
11 KiB
Plaintext
184 lines
11 KiB
Plaintext
|
|
Episode: 1779
|
||
|
|
Title: HPR1779: Cowsay and Figlet
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr1779/hpr1779.mp3
|
||
|
|
Transcribed: 2025-10-18 09:11:18
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
This is HPR episode 1,779 entitled, Kausei and Figglet.
|
||
|
|
It is hosted by John Colp and in about 16 minutes long.
|
||
|
|
The summary is Kausei and Figglet.
|
||
|
|
Too far has context commands.
|
||
|
|
This episode of HPR is brought to you by an honesthost.com.
|
||
|
|
Get 15% discount on all shared hosting with the offer code HPR15.
|
||
|
|
That's HPR15.
|
||
|
|
Better web hosting that's honest and fair at An Honesthost.com.
|
||
|
|
Hey everybody, John Colp and Lafayette Louisiana here.
|
||
|
|
And today I'm going to talk about a couple of fun Linux commands that I like to use for
|
||
|
|
various reasons that I'll get into in just a moment.
|
||
|
|
But the commands are Kausei and Figglet.
|
||
|
|
Kausei and Figglet are both commands that you can use to do fun things with text.
|
||
|
|
Kausei will have either a cow or some other animal or image or something.
|
||
|
|
Say the words that you tell it to.
|
||
|
|
And Figglet creates a kind of ASCII text banner for you.
|
||
|
|
So I don't really know whether Kausei comes by default installed on Linux systems or
|
||
|
|
not.
|
||
|
|
I don't remember, but it's very easy to install with just apt-get install Kausei or whatever
|
||
|
|
you use on your Linux distribution.
|
||
|
|
You can also probably get it on the various versions of BSD or on a Mac system or something
|
||
|
|
like that.
|
||
|
|
But once you have Kausei installed, it's very easy to run in a terminal.
|
||
|
|
You simply type the word Kausei, space, and then in quotes, whatever you want the cow
|
||
|
|
to say.
|
||
|
|
And on the show notes, I will give you a few examples.
|
||
|
|
The first one is Kausei, space, open quote, hacker public radio, close quote.
|
||
|
|
And then I show the result of it there.
|
||
|
|
There's a little cow that says hacker public radio.
|
||
|
|
Now there are various modes of Kausei and you can look at the man page for a rundown of
|
||
|
|
all of them.
|
||
|
|
The modes are Borg mode, dead with a D flag.
|
||
|
|
A G flag will give you greedy mode and that turns the eyeballs into dollar signs.
|
||
|
|
Let's see, P flag causes a state of paranoia to come over the cow.
|
||
|
|
That's what the manual page says.
|
||
|
|
And I don't remember what the change to the eyeballs is.
|
||
|
|
Most of these things change either the eyeballs or the tongue or both.
|
||
|
|
The S flag makes the cow appear thoroughly stoned.
|
||
|
|
T yields a tired cow and W is somewhat the opposite of T and initiates wired mode.
|
||
|
|
All of these things are right from the man page.
|
||
|
|
Y brings on the cow's youthful appearance.
|
||
|
|
So in the show notes I give an example where I use the tired mode.
|
||
|
|
And to do that you do Kausei space dash T to give it the tired flag.
|
||
|
|
And then I say, Ken is tired of begging for shows and so that results in a cow with hyphens
|
||
|
|
for eyeballs saying Ken is tired of begging for shows.
|
||
|
|
So those are different ways to make the cow look different and say different things.
|
||
|
|
Now you can also make stuff besides the cow appear.
|
||
|
|
There's a whole bunch of, I think on my system there are 46 different cow say images.
|
||
|
|
And you use the different cow say files by using the F flag.
|
||
|
|
So if the example that I give in the show notes I use a dragon, cow say space dash F space
|
||
|
|
dragon space.
|
||
|
|
And then I give the dragon something to say.
|
||
|
|
In this case I say you can threaten someone with a dragon.
|
||
|
|
The dragon here is saying record and upload a show or else.
|
||
|
|
So then you can see the dragon saying this.
|
||
|
|
There's also a way to make the animals think these things so that you get like little thought
|
||
|
|
bubbles instead of a speech bubble.
|
||
|
|
But I couldn't figure out how to do that.
|
||
|
|
Interestingly there's an Android app for cows say that is actually easier to do these things.
|
||
|
|
You get little drop down menus to choose which image you want to use.
|
||
|
|
And then you can choose which mode from another drop down menu.
|
||
|
|
And then you can share it either by it will make an image out of it or you can send it
|
||
|
|
as text in an email or something like that.
|
||
|
|
Okay, so then the next example that I give in the show notes shows how you can pipe something
|
||
|
|
through cow say.
|
||
|
|
So you don't have to start with the cow say command here I do an echo.
|
||
|
|
And you guys might want to look at this command in the show notes.
|
||
|
|
I like this one.
|
||
|
|
On Linux, praise a hookah with a random cow.
|
||
|
|
I thought I would praise a hookah because he's such a frequent contributor to this show
|
||
|
|
that he's worthy of praise.
|
||
|
|
So I do echo single quote a hookah rocks exclamation point single quote.
|
||
|
|
And then a vertical bar to pipe it through cow say space dash F space.
|
||
|
|
And then I have a command that will choose a cow randomly by first finding all of the
|
||
|
|
cow say files.
|
||
|
|
So to do that, I do locate asterisk dot cow vertical bar.
|
||
|
|
So that that finds them all.
|
||
|
|
And then to select one randomly, I use the chef command that's SHUF.
|
||
|
|
I guess that's short for shuffle.
|
||
|
|
And then I on the chef command, I give it the N one flag, which tells it to bring back
|
||
|
|
only one result.
|
||
|
|
So it shuffles them all and then just brings back the top one.
|
||
|
|
And I enclose that whole thing in a dollar sign open parenthesis, locate space asterisk.
|
||
|
|
. cow vertical bar, chef space dot N one, close parenthesis.
|
||
|
|
So cow say will use the file that is the result of that whole command.
|
||
|
|
Anyway, it's probably easier to go to the show notes and look at that thing.
|
||
|
|
But if you paste that into your terminal and run it, after you have cow say installed,
|
||
|
|
and incidentally you might have to install chef as well.
|
||
|
|
I don't remember whether that comes as a default package or not.
|
||
|
|
But in the time that I did it, it came back with the Calth Vader image saying a hook
|
||
|
|
a rocks.
|
||
|
|
Now, I used single quotes that time because I was using an exclamation point.
|
||
|
|
When I said a hook a rocks, I followed it with an exclamation point.
|
||
|
|
And if you don't use the single quotes, then the shell will treat that exclamation point
|
||
|
|
as some kind of operator.
|
||
|
|
So you have to use the single quotes instead of double quotes there.
|
||
|
|
All right.
|
||
|
|
So that's how you use cow say now, you might wonder what good is this?
|
||
|
|
Why would I need to make cows or other images say things?
|
||
|
|
And the reason is it's fun.
|
||
|
|
And the way I use them is every once in a while I will send somebody a message that way.
|
||
|
|
But you kind of have to be careful sending asky images in email because they don't always
|
||
|
|
look right.
|
||
|
|
Most email clients are not configured to display plain text properly.
|
||
|
|
They'll try to interpret it as HTML and then the images get all garbled.
|
||
|
|
But the way I use these things the most is just in little comments to myself inside my
|
||
|
|
source files.
|
||
|
|
So in my counterpoint books or in my course syllabi or any other documents that I write in HTML
|
||
|
|
or LATAC or anything like that for subheadings or just sections where I want to divide one
|
||
|
|
part from another, I will generate one of these cow say images that say,
|
||
|
|
I don't know, chapter three or something like that and then enclose it in comment code
|
||
|
|
so that it shows up as a comment and nobody else can see it.
|
||
|
|
It's just kind of a nice thing that makes me smile when I see it there in my code.
|
||
|
|
I also use cow say to post little fun messages like this for my counterpoint students.
|
||
|
|
I will display them as HTML labels on Moodle.
|
||
|
|
And so I don't know, it's just kind of a fun thing.
|
||
|
|
Another thing I do that I think is kind of fun and I've come to rely on it is on my Raspberry
|
||
|
|
Pi.
|
||
|
|
I have a script that every day at I think 5 a.m. it runs this script and it does an e-links
|
||
|
|
command, an e-links dump command that downloads in plain text the contents of weather.com for
|
||
|
|
my zip code and it scrapes out just the information I want which is the current temperature.
|
||
|
|
And it finds the current temperature on that page and gets rid of everything else and
|
||
|
|
then formats that for me using a random cow say image and then e-mails it to me.
|
||
|
|
So every morning when I wake up there's an e-mail waiting for me from my Raspberry Pi with
|
||
|
|
a random cow say image telling me what the current temperature is.
|
||
|
|
And so it's kind of fun and something that I'm used to.
|
||
|
|
For sending the e-mail I use a package called send email which I think is just a perl script
|
||
|
|
where you set up some kind of little configuration file with your details or in the script itself
|
||
|
|
you can tell it what username and password and e-mail address to use and all that stuff.
|
||
|
|
So that's how I use cow say now figlet does not use images like that it just prints out
|
||
|
|
text but it does it in sort of banner style.
|
||
|
|
So I would encourage you to look on the show notes where I give some examples.
|
||
|
|
The first one I give is figletspace-w that's the wrap option it tells you how many characters
|
||
|
|
to go before it starts wrapping to a new line.
|
||
|
|
I do figletspace-w space 45 telling it to wrap after 45 characters.
|
||
|
|
Space open quotes hacker public radio close quote and then I show you the result on there
|
||
|
|
and it does hacker public radio in very large letters one word per line because of the
|
||
|
|
wrap option that I put there.
|
||
|
|
If I had given no wrapping option it would put it all just right out in a single line.
|
||
|
|
And figlet has several different fonts that you can use including slanty ones small ones.
|
||
|
|
You can tell it to keep the letters from touching each other or you can have them snuggle
|
||
|
|
up next to each other and that's the default option.
|
||
|
|
They also allow you to print out text with stuff around each letter and I use one of those
|
||
|
|
for another example in the show notes use an alternate font with the dash f option.
|
||
|
|
So in this one I use the digital font which puts little pluses and minuses and vertical
|
||
|
|
bars around every letter.
|
||
|
|
So here the command is figletspace-f-digital that tells it to use the digital font and
|
||
|
|
then whatever you want it to say.
|
||
|
|
In this case I used community news and then I show you the result on the show notes there
|
||
|
|
community news with a bunch of pluses and minuses and vertical bars surrounding every
|
||
|
|
letter.
|
||
|
|
So and I use figlet in much the same way that I use cow say I'll have a section headings
|
||
|
|
inside my source code done up in figlet to make it easier to see as I'm scrolling through
|
||
|
|
and also to make it kind of fun.
|
||
|
|
So that's it.
|
||
|
|
I'm going to put some links in the show notes also.
|
||
|
|
One of the links is to my random cow say is it Friday yet web page and this is where
|
||
|
|
I think every half hour or so my web server runs my script for is it Friday which checks
|
||
|
|
what day it is and depending on what day it is it'll say either yes it's Friday or no
|
||
|
|
it's not Friday you've got so many days left until Friday and the whole thing is told
|
||
|
|
to you by a random cow say image and the script generates a bit of static HTML and sticks
|
||
|
|
it in place on my server.
|
||
|
|
So you can look at that I'm also going to link to the cow say for Android app and then
|
||
|
|
the cow say and figlet man pages.
|
||
|
|
So cow say and figlets good fun on the terminal on a unix system go make yourself some
|
||
|
|
masky text by yo.
|
||
|
|
You've been listening to hecka public radio at hecka public radio dot org we are a community
|
||
|
|
podcast network that releases shows every weekday Monday through Friday.
|
||
|
|
Today's show like all our shows was contributed by an hbr listener like yourself.
|
||
|
|
If you ever thought of recording a podcast then click on our contribute link to find
|
||
|
|
out how easy it really is.
|
||
|
|
Hecka public radio was founded by the digital dog pound and the infonomicon computer club
|
||
|
|
and is part of the binary revolution at binrev.com.
|
||
|
|
If you have comments on today's show please email the host directly leave a comment on
|
||
|
|
the website or record a follow up episode yourself unless otherwise stated today's show
|
||
|
|
is released under creative comments, attribution, share a light 3.0 license.
|