A while back I wrote about Diceware, a system for generating password using dice and a word list. I also include a Ruby script that use virtual dice.

The diceware passwords of reasonable length are strong, they have high entropy. However, most password security requirements aren’t based on entropy, but instead are made up, with people throwing in requirements for capital letters, numbers, and symbols because they sound good.

Well, we don’t get to set policy, so I’ve modified my script to generate passwords with numbers and symbols as separators.

This is one of the blog posts to set something in my mind that I’m always looking up. Linux has lovely tools for adding and managing users, but I can never remember them. I’m old skool and BSD-centric, so I tend to just use vipw, but it’s better to use the tools. So, with no further ado:

Every wondered what the timestamps on files on UNIX sytems mean?

Unix keeps three or four timestamps per file (or directory (or other random thing in the file system).

How to you take a list of files and do something with them in the UNIX shell? xargs is the key.

If you’ve run in to xargs, it’s probably in it’s most simple form:

xargs rm < list.txt

I’ve touched on shell aliases and functions a few times, today I wanted to get in to a little more detail on passing arguments to them.

BASH aliases don’t actually take arguments, but they will automatically append any argument to the underlying command line.

alias t=tail -f
t /var/log/apache/access.log
# expands to tail -f /var/log/apache/access.log

Another progress update on my RepRep 3D Prusa Mendel. After digging into the laying issue, I narrowed it down to a likely slicing issue. And, after a lot of research I was able to find the specs I needed for the particular hot end on my printer (a no longer supported version from Makergear).

The problem was that the layer height was to tall for extruder nozzle diameter, creating the gaps. Armed with the specs, I reconfigured Slic3r and the results are clearly better!

Previously while talking features of the HTTP Range header I wrote:

Last and likely least , you can read the last N bytes of a file by requesting a negative offset: […] Honestly, I’ve never come up with a use case for that.

A friend pointed out a possible use case, “tailing” a file on a server.

In my previous post about codeless APIs I made use the HTTP Range header to download only a portion of the file from a web server or cache (byte serving).

Because I was working in client side Javascript, I didn’t provide a Ruby example, which would look like:

require 'uri'
require 'net/http'

uri = URI("http://example.com/file-I-want")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.path)
request['Range'] = 'bytes=64-1024'
response = http.request(request)

For bonus points, response.code == 206 tells you that you got your “Partial Content”. A code of 200 would tell you that the Range was ignored and you got the whole file.

There a couple of other features of the Range header that are worth mentioning…