Sirius Stuff

Sirius Stuff header image 2

Using custom fonts on a web page, including internet explorer

May 18, 2011 at 11:00 AM | categories: Web, Education, Home Schooling | View Comments
Making CSS Custom Font works with IE, Firefox, Opera and Safari has a clear explanation of how to use custom fonts on your site.

This was very for I Teach Math on the lcd clock page.

Namebench for the win! Bad DNS makes my mac slow

April 29, 2011 at 04:00 PM | categories: Web, Mac | View Comments
Really bad performance on my MacBook has been driving me up the wall the past few days. Closing all un-needed programs didn't help. I ran several Mac utilities on my system, rebooted and so on and so forth.

Still no good.

There's 8GB of RAM in my (latest model - fall 2010) white MacBook and that really sped things up when it replaced the stock 2GB. It was very frustrating.

Activity Monitor (in your Application/Utilities folder) didn't reveal anything interesting. Everything seemed slow, from opening a file with vi to browsing to a web page.

Searching for "slow mac" brought up references to pages loading slowly. And that reminded me of namebench, a program that tests the fastest DNS servers for you.

Picking the fastest DNS servers isn't as simple as using OpenDNS or Google's public DNS because some sites like Netflix return different answers depending on where you are and what internet provider you're using. What's right for OpenDNS may be much slower for you.

After running namebench, it detected that, the DNS provided by Comcast, my ISP, was not working. Using the advice from namebench I put 3 different DNS providers into the router, including two other Comcast addresses and a Google Public DNS.

Today, it's like I have a new machine it's so fast. Opening files is faster, browsing web pages is much faster, etc., etc.

Because of things like Dropbox or other background processes running, it seems like those slowed everything down, even something like vi on a local file.

So if your machine seems inexplicably slow, try using namebench and follow its advice.

Script to update Blogofile blog on Amazon S3

April 29, 2011 at 03:00 PM | categories: Blogging | View Comments
Because BlogofileBlogofile (at least the 0.7.1 version I'm using) regenerates every file and directory every time it makes it hard to update just the changed files on >Amazon's S3 (Simple Storage System).
So I wrote a shell script that updates only the changed files and also pings GooglePing so that Google and other services come along and read your update.
Over time, the difference between what the old page 2 on S3 has and what it should be will build. There's a simple answer, which is to just upload all of the page files.
Every 10 blog posts or so, you could just update all the category and archive files as well. Maybe that's somthing to automate as well

# !/bin/bash
# jdeibele [ at ] gmail . com
# What this does:
#   builds your blog with blogofile, then builds a list of key 
#   files that have changed.  Blogofile is a python program
#   that uses Mako to generate static pages.
# Blogofile:
# For me, these files are:
#   the post itself
#   the first page of the categories it appears in 
#   feeds for the categories (RSS and atom)
#   the archive page (year/month) 
#   the first page of /page/
#   feed for the blog (RSS and atom)
#   the main page (index.html) for the blog
BLOGNAME="Sirius Stuff"
blogofile build
rmdir *
# blogofile builds extra directories for these but they're empty
cd $BLOGHOME/_posts
file=`ls -t * | head -1`
permalink=`grep "^permalink:" $file | cut -f3 -d: | cut -f4 -d"/"`
archive=`grep "^date:" $file | cut -f2 -d: | cut -f1,2 -d/ | sed 's/ //g'`
# "slugify" the category names 
categories=`grep "^categories:" $file | tr [:upper:] [:lower:]  | cut -f2 -d: | sed s'/^ //' | sed s'/ /-/'`
echo $categories
cd $BLOGHOME/_site
echo index.html > /tmp/postit
for category in $categories
    echo category/$category/index.html >> /tmp/postit
    echo category/$category/1/index.html >> /tmp/postit
    echo category/$category/feed/index.xml >> /tmp/postit
    echo category/$category/feed/atom/index.xml >> /tmp/postit
echo archive/$archive/1/index.html>> /tmp/postit
echo feed/index.xml >> /tmp/postit
echo feed/atom/index.xml >> /tmp/postit
echo page/1/index.html>> /tmp/postit
# s3cmd can be installed with homebrew - brew install s3cmd
# s3cmd needs -recursive to upload a new directory
s3cmd put --recursive $BLOGHOME/_site/$permalink s3://$BLOGURL
while read file
    s3cmd put $BLOGHOME/_site/$file s3://$BLOGURL/$file
    echo $BLOGHOME/_site/$file

What's not perfect with Blogofile

April 28, 2011 at 03:00 PM | categories: Web, User Interface, Blogging | View Comments
In Switched from WordPress to Blogofile there are two good things about using Blogofile:
  • flat files are almost impossible to hack
  • Amazon's S3 (Simple Storage System) can scale incredibly high

There's some downsides:
  • blogofile build seems to copy or regenerate every single file
  • it's not totally happy being on S3 - it doesn't make index.html files for the archive and category directories.
  • there's no easy way to post-via-email or send a link to start a post

Right now I'm writing this with vi and that's far less comfortable than WordPress's editor which I really liked. But I'm sure I'll find TextWrangler or something as suitable for writing blog posts.

Switched from WordPress to Blogofile

April 28, 2011 at 01:24 PM | categories: Web, User Interface | View Comments
I really like WordPress for the huge number of themes and utilities that it has. What I don't like, though, is the need for constant vigilance to make sure that your blog hasn't been hacked. When I started the conversion, I found two blog posts that had been secretly altered so that they had links to spam sites. I wasn't sure whether to be grateful that only two had been altered or disappointed that my blog mattered so little that that's all they did.

So it's with some relief that I've switched to Blogofile, a python program that generates flat files that can be hosted on Amazon's S3 (Simple Storage System). This has the advantage of being almost impossible to hack. It also can scale even if this blog was featured on the front pages of Digg and Reddit and Daring Fireball and Slashdot and ...

Not that that's likely to happen little ol' me but it's comforting to think that everyone in the world could read my incredible prose.

Right now I'm writing this with vi and that's far less comfortable than WordPress's editor which I really liked. But I'm sure I'll find TextWrangler or something as suitable for writing blog posts.