I want to sit at a bar with Chris McMillian behind it!
I have an itch. I want to create a podcast. Not of myself talking on & on about something of importance to me. (I do this in my day job and in the mirror.) What I want is a podcast of the long articles or papers of interest that I discover. I want to be able to access these in the car or when I am otherwise not able to read them online or in print. A podcast of readings of these longer texts subscribed to in iTunes would be very helpful. And so I am now thinking about implementing a service to achieve this.
The "Narrator" service is a very simple pipeline. At this stage it looks like this:
I will keep this posting updated as I find out more about implementing this service. If these already exists, then please tell me.
Update: The Umano app and service is getting close to what I want.
tail -F foo.log | grep bar | chirpSave the following to /usr/local/bin/chrip
#!/usr/bin/perl -w
use strict;
use POSIX qw(strftime);
$::timeout = 5;
$::format = "%F %T";
while ( @ARGV ) {
my $arg = shift @ARGV;
if ( $arg eq "-t" ) {
$::timeout = shift @ARGV;
}
elsif ( $arg eq "-f" ) {
$::format = shift @ARGV;
}
elsif ( $arg =~ /^-/ ) {
print "usage: chirp [ -t seconds ] [ -f strftime-pattern ]\n";
exit 1;
}
}
local $SIG{ALRM} = sub {
print strftime( $::format, localtime ), " chirp\n";
alarm $::timeout;
};
alarm $::timeout;
while ( <> ) {
print strftime( $::format, localtime ), " ", $_;
}
# END
The following story is not pretty. I am hoping there is an easier way in the future. Until then, here is how I installed a music server on a Mac.
We have a Mac Mini that is used to hold the family's music collection. However, since this machine is also used by the kids for homework, iTunes is not always running. I finally got around to installing a DAAP server on the machine so I could expect to find the music available when I wanted it. I used brew to build and install the mt-daapd server. Assuming you have brew installed you need only run
brew install mt-daapd
However, for some reason the brew recipe did not complete the installation. This turned out to be fortuitous as I continue to want use iTunes to manage the music located in my home directory. And so I configured mt-daapd to run from within my home directory. First I created the /Users/ajg/Library/Application Support/mt-daapd directory for mt-daapd data. Then created a configuration file at /Users/ajg/Library/Application Support/mt-daapd/mt-daapd.conf containing
[general]
web_root /usr/local/share/mt-daapd/admin-root
port 3688
admin_pw password
mp3_dir /Users/ajg/Music/iTunes/iTunes Media/Music
db_dir /Users/ajg/Library/Application Support/mt-daapd
servername Minimac Fulltime
runas nobody
extensions .mp3,.m4a,.m4p,.wav,.wma,.aiff,.ogg
logfile /Users/ajg/Library/Application Support/mt-daapd/mt-daapd.log
rescan_interval 600
process_m3u 1
scan_type 0
compress 1
Your configuration should be the same except, perhaps, for port (the default is 3689 which conflicts with iTunes), password, mp3_dir, and servername. To test the installation run the following and then open iTunes so see the "Minimac Fulltime" server.
/usr/local/sbin/mt-daapd -y -c '/Users/ajg/Library/Application Support/mt-daapd/mt-daapd.conf' -f -d 1
Once it is working, the next step is to keep it running using OS X's launchd. Create the file /Users/ajg/Library/Application Support/mt-daapd/mt-daapd.plist containing
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>mt-daapd</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/sbin/mt-daapd</string>
<string>-y</string>
<string>-c</string>
<string>/Users/ajg/Library/Application Support/mt-daapd/mt-daapd.conf</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
Install it and start the server running
launchctl load "/Users/ajg/Library/Application Support/mt-daapd/mt-daapd.plist"
launchctl start mt-daapd
I can now listen to music on any of my devices around the house; which includes a first generation iPod Touch using Simple DAAP Client. And if I need to check the server's status I can open http://localhost:3688/.
Update: A link to the FireFly Media Server at the Internet Archive.
(function(){
var link_pattern = new RegExp(
"^evernote:\/"+
".*"+
"\/"+
"([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"+
"\/"+
"([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})"+
"\/"+
"$");
var link = "";
for(;;) {
link = window.prompt("Evernote link?",link);
if ( link ) {
var m = link_pattern.exec(link);
if ( m ) {
var url = "https://www.evernote.com/view/notebook/"+m[1]+"?&n="+m[2];
window.location.assign(url);
break;
}
}
else {
break;
}
}
}
)(); Show in Everynote.
private static final ScriptEngineManager factory = new ScriptEngineManager();
...
ScriptEngine engine = factory.getEngineByName("JavaScript");
Object result = engine.eval(script);
return result.toString();
. ./build.xml ./src/atlassian-plugin.xml ./src/com/andrewgilmartin/confluence/plugins/script/JavaScriptPlugin.java
package com.andrewgilmartin.confluence.plugins.script;
import java.util.Map;
import com.atlassian.renderer.RenderContext;
import com.atlassian.renderer.v2.macro.BaseMacro;
import com.atlassian.renderer.v2.macro.MacroException;
import com.atlassian.renderer.v2.RenderMode;
import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
public class JavaScriptPlugin extends BaseMacro {
private static ScriptEngineManager factory = new ScriptEngineManager();
@Override
public boolean isInline() {
return true;
}
@Override
public boolean hasBody() {
return true;
}
@Override
public RenderMode getBodyRenderMode() {
return RenderMode.COMPATIBILITY_MODE;
}
@Override
public String execute(Map params, String body, RenderContext renderContext) throws MacroException {
try {
ScriptEngine engine = factory.getEngineByName("JavaScript");
engine.put("params", params);
Object evalResult = engine.eval(body);
String result = evalResult.toString();
return result;
}
catch (ScriptException e) {
throw new MacroException(e);
}
}
}
// END
<atlassian-plugin
name="JavaScript Macro Plugin"
key="com.andrewgilmartin.confluence.plugins.script">
<plugin-info>
<description>A JavaScript macro plugin</description>
<vendor name="Andrew Gilmartin" url="http://www.andrewgilmartin.com" />
<version>1.0</version>
</plugin-info>
<macro
name="javascript"
class="com.andrewgilmartin.confluence.plugins.script.JavaScriptPlugin"
key="com.andrewgilmartin.confluence.plugins.script.javascript">
<description>A JavaScript macro plugin. Place the script to execute within the body of the macro.</description>
</macro>
</atlassian-plugin>
<project name="com.andrewgilmartin.confluence.plugins.script" default="dist">
<property environment="env" />
<path id="build.classpath">
<fileset dir="${env.HOME}/lib/atlassian-confluence-4.3.3/confluence/WEB-INF/lib">
<include name="**/*.jar"/>
</fileset>
<pathelement location="${basedir}"/>
</path>
<target name="dist">
<javac
classpathref="build.classpath"
srcdir="${basedir}/src"
destdir="${basedir}/src"
source="1.5"
target="1.5"/>
<jar
destfile="${basedir}/confluence-plugins-script.jar"
basedir="${basedir}/src"/>
</target>
<target name="clean">
<delete>
<fileset dir="${basedir}" includes="**/*.class"/>
<fileset dir="${basedir}" includes="**/*.jar"/>
</delete>
</target>
</project>
What I am focusing on in this photo is that he is using a computer and a notebook. I do the same. It suddenly occurred to me that every crafts person, since the beginning of time, uses this work arrangement. Tool to one side and notes to the other side. This is a great pattern. Why do we not perpetuate it today? Why put both on one machine? Some places have. When I worked at Lotus we always had a "development" machine and an "administration" machine. Perhaps some places do.
<h1>Lightweight Markup Languages</>
<p>According to <i>Wikipedia</>:
<blockquote>
A <a href="http://is.gd/gns">lightweight markup language</>
is a markup language with a simple syntax, designed
to be easy for a human to enter with a simple text
editor, and easy to read in its raw form.
<p>Some examples are:
<li>Markdown
<li>Textile
<li>BBCode
<li>Wikipedia
Markup should also extend to <i>code</>:
<pre>
10 PRINT "I ROCK AT BASIC!"
20 GOTO 10
[NOTE: The A tag is hard to read. Perhaps assume href.]
*/5 * * * * $HOME/bin/watch-directory-and-mail
-t 1234567890@txt.att.net
-o $HOME/var/data-2012-09-18.watch
-w $HOME/var/data-2012-09-18/
This says to watch the directory "$HOME/var/data-2012-09-18/", keep the record of previous directory size in "$HOME/var/data-2012-09-18.watch", and to raise an alarm by sending email to "1234567890@txt.att.net" (AT&T's email-to-SMS service). The "$HOME/bin/watch-directory-and-mail" script is
#!/bin/bash
function send-message() {
echo "$3" | mail -s "$2" "$1" >/dev/null 2>&1
}
TO="$USER"
WATCH="$(pwd)"
OUTPUT="$WATCH.watch"
SUBJECT="$(basename $WATCH)"
while getopts "t:s:w:o:h" opt
do
case $opt in
t) TO=$OPTARG ;;
w) WATCH=$OPTARG ;;
o) OUTPUT=$OPTARG ;;
s) SUBJECT=$OPTARG ;;
*) echo "usage: $(basename $0) \
-t email \
-s subject \
-w directory/file \
-o status-file" ;;
esac
done
V1=$(du -s $WATCH|cut -f 1)
if [ -r "$OUTPUT" ]
then
V0=$(cat "$OUTPUT")
if [ $V0 -eq $V1 ]
then
send-message $TO $SUBJECT "$(basename $WATCH) unchanged size at $V1"
fi
else
send-message $TO $SUBJECT "$(basename $WATCH) initial size is $V1"
fi
echo $V1 >$OUTPUT
# END
I was reading this and it sparked an idea for the combined use of Marked and a command line script. I often would like to simply collect notes as I work at the command line. The notes can all go into the same file and I will sort them out afterwards (GTD "inbox" style). So the simple command line
function n() { echo "$(date): $*" >>~/Inbox/Note.txt; } defines a "n" command that works well enough. Usage is simply to type "n this is my note" at the command line and the script will put the timestamp and the "this is my note" text in to the file ~/Inbox/Note.txt. The spark, however, was that I could use Marked to display an automatically updated view of the note file's contents. Further, I could add a little markdown notation to the script to help visually separate the notes. The final script is
function n() { printf "\n### %s\n%s\n" "$(date)" "$*" >>~/Inbox/Note.txt; } Here the date is formatted as a header and the note's text as a paragraph. The end result is a window like this