Voder-Vocoder

The Log of Hal Canary

Navigation: Home | THE LOG | Log Archives | Resume | Contact Info | Public Key | SSL | Math Applets | Site Map | RSS2 | Atom | Backend

Archive for 2009-09

Email Advice:

I’ve spent a lot of time writing email the past few weeks, so this is on my mind.

1) Keep your work email separate from personal. People change jobs, your friends shouldn’t lose track of you because of this.

2) Don’t use the email account that comes with your ISP subscription. The next time you move or change ISP you will be forced to get a new email account. Combined with (1), this leaves two options: pay for a hosted email solution, maybe with a personal domain-name, or use one of the free email providers. I suggest Google’s gmail.com, which offers IMAP connection so that you can check you mail using your favorite email client (Mozilla Thunderbird, Apple’s Mail.app, Novell Evolution, Microsoft Outlook, Novell GroupWise, et cetera) as well as on the web.

3) Configure your email client to send plain-text email by default. This usually produces much smaller message sizes and can easily be read by the most email clients.

4) When replying to a email, delete most of the quoted message, leaving only enough to give your reply context. At the very least, delete the signature.

5) If you are not replying to something in a previous message, don’t hit reply; instead, compose a new message. This makes a new thread in clients that organize mails into threads.

6) Don’t top post.

7) If you are going to compose your message in a word processor before sending it, copy-and-paste it into the email’s body instead of sending an attachment.

8) If you must send an attachment, use an open file format.

9) This is one I am very guilty of. If you don’t have time to compose a proper reply to an email that requires a reply, you should shoot off a quick acknowledgement message.

10) If you are at all technically savvy, go ahead and install GnuPG (if your system didn’t already have it) and configure your email client to make use of it to sign your emails.

Hal Canary | Computers & Code, Life | 2009-09-27 22:08:01 UTC
Permanent Link |
Comments Off (but feel free to email)

software for ubuntu

If you are a LTS user like me and stuck on Hardy Heron, sometimes packages are availible that have the newest shiniest thing prepackaged for you. Emacs 23 can be installed with a simple

sudo apt-get install emacs-snapshot-gtk

and then I wrote a little script to launch emacs with my favorite font:

#!/bin/sh
exec emacs-snapshot \
  -fn "Monospace-11" "$@" 

* * *

Another bleeding-edge thing to check out is Google Chrome’s native Linux edition. Go get it from this page.

Hal Canary | Computers & Code | 2009-09-27 22:01:37 UTC
Permanent Link |
Comments Off (but feel free to email)

recent music purchases

Hal Canary | Music | 2009-09-27 21:05:33 UTC
Permanent Link |
Comments Off (but feel free to email)

Cloud City

The 1980s was, stylistically, an attempt to recreate the awesomeness that was the various set designs of Cloud City

Hal Canary | Art, Movies | 2009-09-26 22:40:39 UTC
Permanent Link |
Comments Off (but feel free to email)

Command-line Package Tools

Command-line package commands for Debian and Ubuntu-type systems that you should know:

apt-get update
resynchronize the package index files
apt-get dist-upgrade
install the newest versions of all packages currently installed and handle changing dependencies
apt-get install PKG
install a package and figure out dependancies
apt-get remove PKG
remove a package
apt-get clean
clear out the local repository of retrieved package files
apt-cache showpkg PKG
displays information about the package
apt-cache search REGEX
search all available package lists for a regex pattern
dpkg-query --list PATTERN
list installed packages matching given pattern
dpkg-query --status PKG
report the status of specified package
dpkg-query --listfiles PKG
list files installed to your system from a package
dpkg-query --search FILENAME
search for a filename from installed packages
sudo dpkg --install DEBPKGFILE
install a .deb package

Hal Canary | Computers & Code | 2009-09-26 18:54:45 UTC
Permanent Link |
Comments Off (but feel free to email)

ssh-show-key-fingerprint

#!/bin/sh
## ~/bin/ssh-show-key-fingerprint
## Prints out SSHD Key Fingerprints
## Written 2004-2009 Hal Canary
## Dedicated ott he Public Domain.
test "$#" -eq 0 && \
  exec "$0" /etc/ssh/ssh_host_*_key.pub
for file in "$@" ; do
  ( cd `dirname "$file"`;
    /usr/bin/ssh-keygen -l \
      -f  `basename "$file"`; )
done

What to do with this info? first of all, print out the fingerprints and put them in your wallet.

Here’s another thing I do:

ssh-show-key-fingerprint | \
  sudo tee -a /etc/issue.ssh > /dev/null
echo 'Banner /etc/issue.ssh' | \
  sudo tee -a /etc/ssh/sshd_config > /dev/null

This, of course, is in no way a secure way to check your fingerprint, since it is just as vulnerable to a man-in-the-middle attack. But it works as a backup plan.

And some legal theories say you should insert these additional lines into your /ets/issue.ssh file:

 UNAUTHORIZED ACCESS PROHIBITED.

 USE OF THIS SYSTEM BY ANY USER, AUTHORIZED OR UNAUTHORIZED,
 CONSTITUTES CONSENT TO THIS MONITORING, INTERCEPTION,
 RECORDING, READING, COPYING, or CAPTURING and DISCLOSURE
 by SYSTEM OWNER.

Hal Canary | Computers & Code | 2009-09-26 13:01:31 UTC
Permanent Link |
Comments Off (but feel free to email)

MakeBookmarksFile

#!/usr/bin/env python
# MakeBookmarksFile - convert a text file containing
# URLs into a HTMl file with clickable links.
#
# Copyright 2008 Hal Canary
#
# Permission is hereby granted, free of charge, to any
# person obtaining a copy of this software and
# associated documentation files (the 'Software'), to
# deal in the Software without restriction, including
# without limitation the rights to use, copy, modify,
# merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom
# the Software is furnished to do so, subject to the
# following conditions:
#
# The above copyright notice and this permission notice
# shall be included in all copies or substantial
# portions of the Software.
#
# THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF
# ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
# LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
# EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

import sys,re
fi = sys.stdin
fo = sys.stdout
s=fi.readline().strip()
## The first line of the input is a title.
head='<!DOCTYPE html PUBLIC \
"-//W3C//DTD HTML 4.01//EN" \
"http://www.w3.org/TR/html4/strict.dtd">\n\
<html><head>\n<meta http-equiv="Content-Type" \
content="text/html; charset=utf-8">\n\
<title>%s</title>\n</head><body><div>\n\
<h1>%s</h1>\n'
fo.write(head % (s,s))
for line in fi:
  s=line.strip()
  if (s == "") :
    continue
  ## convert & to &amp; and so on.
  s=re.sub('&','&amp;',s)
  s=re.sub('<','&lt;',s)
  s=re.sub('>','&gt;',s)
  s=re.sub('"','&quot;',s)
  fo.write("<a href=\"%s\">%s</a><br>\n" % (s,s))
fo.write('</div></body></html>\n')

Hal Canary | Computers & Code | 2009-09-24 12:51:50 UTC
Permanent Link |
Comments Off (but feel free to email)

netbook network mp3 player

I wanted to access my desktop's music library from my living room and play it through the amplifier and speakers there. So I grabbed my netbook, and after fumbling around with NFS for too long, I just tried:

yum install sshfs

(It's a OLPC XO-1, so it's Redhat-based.) And then wrote a little script:

#!/bin/sh
## ~/bin/mount-music
mkdir -p "${HOME}/music"
sshfs hal@sloop:/d/music "${HOME}/music"

I installed mpg123-alsa (by the simple expedient of copying the executable) and wrote a little script to run it.

#!/bin/sh
test -f "${HOME}/music/index.txt" || \
    sshfs hal@sloop:/d/music "${HOME}/music"
cd "${HOME}/music"
exec mpg123-alsa --control --long-tag \
    --shuffle --list index.txt

And index.txt is a file created with the find command on the server:

#!/bin/sh
# run this script to refresh the index file.
cd $HOME/music
find . -type f -a -name '*.mp3' > index.txt

Hal Canary | Computers & Code, Music | 2009-09-16 15:37:59 UTC
Permanent Link |
Comments Off (but feel free to email)

Economic Badness

We may be out of the recession (in that gross domestic product is no longer shrinking), but with a growing population, people delaying retirement because investments failed, and increases in productivity (GDP-per-worker) unemployment rates will continue inching upward. The stimulus package was not big enough to return us to full employment. So once the stimulus spends itself out next year, we may be in worse shape.

What do we need to do?

1) Fix the fundamental issues with our economy.

1.a) Encourage energy efficiency with a Pigovian tax on carbon emissions. This will reduce energy imports, help our trade deficit, and bring jobs home. Instituting a border carbon tax adjustment will help.

1.b) Keep health-care from rising more. Subsidize health-care for the lower-middle class. Regulate health insurance to get rid of the preexisting condition unfairness. Nationalize the insurance companies if they refuse to play nice.

1.c) Insure the insurers. Just like the FDIC insures banks and charges a premium to pay for potential bailout costs, do the same for insurance companies. Call it the Federal Insurance Insurance Corporation (FIIC). So even in the worst disasters, where insurance companies can go bankrupt, there would be an institution that can step in and make things right. The FIIC would refuse to re-insure a company like AIG , keeping it from becoming too-big-to-fail.

1.d) Get serious about other reforms of the financial markets. Does the financial system really deserve to make such huge profits? Do they add that much value to the economy as a whole? You will know that a financial system is properly regulated when investment bankers make the same salary as an accountant.

2) Continue with the monetary stimulus until we see real indications of inflation. So far, there are no indications, so we are not printing cash fast enough.

3) A new fiscal stimulus bill big enough to close the unemployment gap within 12 months. If we paid people to dig ditches and fill them back in, that would have the desired effect, but we can do better. Let us invest in more energy-efficiency projects, like the cash-for-guzzlers program. Let us start with a high-speed rail from Miami to Montréal. I know it is not shovel-ready, but it could be if we threw enough dollars and workers at it.

4) I have said it before: Short-term cyclic deficits are good, long-term systemic deficits are bad. We need to get rid of the our systemic deficit. I do not think we can reign in spending. Left-wing Democrats have got to realize that we have to be the world's policeman and that is not going to be cheap. And Republics should (but will not) admit that wars and defense spending must be paid for with taxes on the rich. Running a federal deficit during the bubble years was inexcusable. In fact, higher taxes would have kept the bubble in check, to some extent. So we should immediately pass higher taxes on the highest bracket, along with a provision that they will be automatically reduced to current levels for as long as national unemployment is over 6%.

(discussion)

Hal Canary | Economics | 2009-09-16 11:42:54 UTC
Permanent Link |
Comments Off (but feel free to email)

Setting the Gnome Desktop Background With a Script

#!/bin/sh
## Written 2009 Hal Canary
## based on numerous examples
## DTPD
if [ "$#" -lt 1 ] ; then
   X=`basename "$0"`
   echo "Useage:  $X FILENAME"
   exit 1
fi
D=`dirname "$1"`
B=`basename "$1"`
cd $D
X=`pwd`/$B
cd -
if [ ! -f "$X" ] ; then
  echo "not a file: '$X'."
  exit 1
fi
echo "New background: '$X'"
gconftool-2 -t str --set \
  /desktop/gnome/background/picture_filename \
  "$X"
gconftool-2 -t str --set \
  /desktop/gnome/background/picture_options \
  "centered"
exit 0

Hal Canary | Computers & Code | 2009-09-10 18:23:48 UTC
Permanent Link |
Comments Off (but feel free to email)

that someday the sun would die

[] “Don’t worry about the sun dying! You and everyone you know will be long gone by then!” (link)

Hal Canary | Books, Movies | 2009-09-04 08:30:56 UTC
Permanent Link |
Comments Off (but feel free to email)

Copyright 1997-2012 by Hal Canary.
mailto: halcanary at gmail dot com
http://halcanary.org