John's Recount

Thoughts, Questions, and Challenges

Notes &

How I use Google Apps

I use Google Apps as my e-mail service for gaelicWizard.net. Here’s why and what-for.

Gmail

Gmail is almost the best e-mail service ever. This is not actually saying much, though. Most e-mail systems merely replicate a directory tree. A directory tree is just not a good way of storing human-centric information. Gmail ditches this. The storage of e-mail is abstracted away. Gmail doesn’t talk about storing e-mail. Gmail talks about organising e-mail, using labels.

It also integrates certain little features that most e-mail clients ignore entirely, or support as an afterthought. One such example is threading. Gmail groups all messages into “conversations.” Always. Labels apply to conversations, not individual messages, so that you can’t forget to label them.

Unfortunately, Gmail lacks a few obvious features and at least one not-so-obvious,-but-would-be-wicked-useful-to-me feature. For example, Gmail’s filters can only match a very limited set of headers. Fortunately, list and delivered-to are included in that set. Unfortunately, most everything else isn’t.

Catch All

The killer feature for me would be, sadly, rather niche. I use Gmail’s catch-all feature in order to receive e-mail addressed to any address which end up at my domain. This means that I have absolute control over everyone who wants to send me e-mail.

Example: I sign up for Formspring. I tell them my e-mail address is John.Formspring@…. Then, if I ever receive a message addressed to that address which is not directly from Formspring, I would know that Formspring sold my e-mail address to spammers. Even better: I can block that entire e-mail address, and only the spammers and Formspring lose contact with me. (I should note that this has never happened with Formspring; its just an example.)

NeXTSTEP

Gmail does this. What I want Gmail to do is one step further. I want Gmail to filter based on the incoming address, automatically. I can set up filters, and I do, but I have to set up a filter manually for each incoming address. I want my e-mail system to automatically parse the delivered-to header, tokenise the domain-dependent portion, drop the “John”, and use the rest as a label.

I could achieve this with procmail(1), but I would need to route my e-mail through a system running procmail. That would mean no Gmail. I don’t want to lose all the other benefits of Gmail.

1 note &

Blogging for RWU Law

Update

I’m gunna be blogging for my law school. The blog will be targeted at prospective students, so it might be interesting to some of you out there in blogger land.

I’ll put up a link to the blog once I know the URL. Here’s what should be the starting-content on the new blog.

Bio

I’m not an honour student. I’m not on Law Review. I’m a regular joe schmoe. Well, I’m a regular law student, at least. I didn’t graduate from high school. I spent five years at a community college. When I transferred to the University of California for undergrad, I majored in Philosophy, with a co-major in Law and Society. Now, I’m a 2L.

Three Weeks In

I’m sitting here contemplating my position on the first day of the fourth week of my 2nd year; the day after labour day.

Although one semester seems like a long time, and two is twice as long, law school goes by fast. I already need to be planning for summer internships and it’s barely even September! I didn’t internet last summer since I went on the London Study Abroad trip and needed at least some time for my wife (i.e., to travel to visit the in-laws). So, I’m feeling a bit pressured as to what to do with my 2nd (and last) summer of law school.

The coursework itself, however, is much more manageable this time around. Only one of my professors seems to want to “make sure” that a student never comes unprepared twice. (First year, all my professors seemed to go out of their way to impress upon us the importance of being prepared.) Combined with the fact that we’re mostly all still smarting from last year’s emphasis on preparedness and it means for a more fluid lecture. The professors seem to sense this, and so when a student isn’t prepared, they’re much more willing to give him/her the benefit of the doubt and move on to another victimstudent.

Don’t be confused, though: I have hundreds of pages to read every single day. That’s not really as scary as it sounds, but it’s nothing to sneeze at. Speaking of reading, I’ve got some to go do.

1 note &

Dropbox

I tried [Dropbox]. The promise of working cross device file sync sounded really intriguing, but the final straw was [Elements]. Elements is a great app. I purchased, downloaded, and launched it. I signed up for Dropbox right there, then downloaded Dropbox onto both my laptop and my desktop.

Installation was drag-and-drop. From what I’ve heard, the sync works wonderfully. However, when I first launched the app on my laptop, it asked for my administrative user name and associated password. That’s a bit odd for any app, especially one which does not modify the system in any way, so I investigated a little. Dropbox installs three pieces into one’s system when it first runs.

The first one is the app itself, but when launched it marks two files within the app bundle as set-user-id-root (suid). This is extremely strange and extremely dangerous, from both a stability and a security perspective.

The second is a Contextual Menu Item, which is a plugin which adds an item to the right-click menu. However, in addition to the extra feature added to the context menu, this plugin also injects an additional “plugin” when it loads. This is extremely strange and extremely dangerous, from both a stability and a security perspective. (This plugin was for finder.)

Third, it installs a file named “.dropbox” (w/o quotes) in one’s home folder. The placement of this file is strange (the appropriate places would be ~/Library/Application Support/Dropbox and ~/Library/Caches/Drbox), but not at all dangerous.

Some of these mistakes come from Dropbox’s recent addition of Mac support. That is, they just don’t know any better. On windows, significant stability damage through the use of novel and unexpected code injection is the norm. A carefully designed “plugin” would put no more strain on the system than what comes on the system from the original manufacturer. (I’m not saying that windows is more stable with “plugins,” but that nobody would notice the instability introduced by these “plugins.”) On Linux, suid binaries are entirely normal. In fact, significant parts of the user land live entirely in root space, e.g. the X window system itself. There, the security implications are dealt with through over engineering and careful disclosure, while the stability implications are expected to be dealt with by the system administrator (read: end user).

On Mac, however, stability and security are two of the platform’s primary draws. Those two reasons are exactly why I, myself, use a Mac. Furthermore, as a software developer, I can clearly see solutions to the problems that Dropbox appears to have been attempting to solve. For example, the contextual menu could be provided by a “service”, thereby bypassing the need for that plugin. The code-injected Finder “plugin” could be scrapped entirely and replaced with careful use of custom folder icons, supported by the very same folder-change-monitoring system used to watch for actual content changes. Actual content changes could be provided by the system that Apple built into the platform for that very purpose: FSEvents. This is part of the system that Spotlight and Time Machine use.

I uninstalled Dropbox shortly after my investigation. Perhaps I’ll try it again once they’ve had a change to fix up their Mac support.

0 notes &

Bash’s init files

I finally understood the shell init files for Bash. I think my block might have been due to a left-over confusion from tcsh.

  1. When bash is interactive it runs profile or bashrc, not both.

    1. If its interactive and login, it runs profile.
    2. If its interactive and not login, it runs bashrc.
  2. If its not interactive, it runs neither (unless you tell it to).

Easy, right?

My problem was that I was always thinking that a login shell might not be interactive, and so profile might run when not interactive.

There is an environment variable to set to get some init done in non-interactive shells, but normally nothing is done for non-interactive shells. ($ENV or $BASH_ENV.)

The only remaining problem is the “unless you tell it to” from above. This problem, however, is much easier to work with conceptually. In the simple sense, only profile can be easily told to load for non-interactive shells by passing —login. So, bashrc is exclusively interactive and profile is presumptively interactive. Sadly, because of this minor difference, it’s not as simple as it sounds to separate.

I’m still not quite sure how to deal with this. The easy solution is just to source one from the other. That is, source bashrc from within profile. This is the solution that is adopted by almost every GNU/Linux distribution that I’ve ever seen. I believe this to be slightly suboptimal. It defeats the entire purpose of the separation.

Really, though, my problem is that I don’t know what should be in one file and what should be in the other. What, exactly, should I make sure is loaded in login shells that is not as important in non-login shells?

0 notes &

Back from London, Back to School

This summer I spent five weeks in London with RWU Law’s very own Professor Robert Webster. Around thirty other students and I explored the history of the common law, and where it has led to, right where it began. That, and we explored London and the surrounding area… and Dublin.

The focus of the program was Comparative Trial Advocacy. Now, I have never intended to be a litigator, but not only did I enjoy the adventure and learn a great deal about what it takes to tango in the High Court, but I also learned that litigation isn’t exactly what I had thought. I can see myself as a litigator (although it’s still not on the top of my list).

The last two weeks, an optional extension for an additional 3 units, really tickled my fancy. This second part was entitled Comparative Constitutional Perspectives. The focus was privacy. I’ve come away with a whole new appreciation for both perspectives on privacy, new vocabulary for describing those perspectives, and a whole new theory all my own. (You’ll have to wait for me to publish that one later.)

Finally, two weeks to relax with my wife and now school is back on. My favourite class this semester? You guessed it: constitutional law. Well, that or Professor Santoro’s Business Organisations.

0 notes &

purge(8)

Warning

IMPORTANT: DOING THIS TOO OFTEN WILL SIGNIFICANTLY REDUCE PERFORMANCE. Furthermore, the equivalent happens automatically. THIS IS A TOY ONLY.

Fun With Debugging Tools

Do you like it when Activity Monitor reports large amounts of free memory, regardless of actual performance? Try this: open Terminal and just type “purge” (without quotes).

OMG WTF BBQ

Pretty neat, eh?

Details

The purge(8) utility is a debugging tool which interacts with the Unified Disk Cache. Basically, Mac OS X (and all modern OSes) keeps recently (or frequently) used files in RAM, since it is fairly likely that they’ll be used again very shortly. This does, in fact, happen more often than not.

Most files are tiny and read once and “never” again. (We’re talking about seconds here, so re-opening the same file tomorrow or after lunch is like talking about how your house will look in the year 2256. Its just as good to say “never.”) These files drop out of the disk cache quickly enough, since they’re closed (programatically) as soon as they’re opened. Other files are enormous (many megabytes) and are rarely merely loaded and closed. Instead, these files are frequently read partially, again and again, and often modified in-place. Often, these files aren’t ever read start-to-finish, and certainly aren’t closed once read. Examples include databases, any sort of for-editing media (audio, video, images, animation, &c.), and even not-for-editing consumer-targetted media files (like a 1.4GB movie downloaded from iTunes).

Most applications interact with files in ways that lets Mac OS X know which category they fall into: open and “discard”, or frequent access. Even when they don’t, Mac OS X is fairly good at guessing.

When an application behaves as though it is clearly within the frequent access category (i.e., working with enormous files that simply couldn’t fit into RAM at all), an app may nevertheless explicitly tell the system that it is really in the other category. Creating a new ZIP or TAR archive, or exporting from source material to ProRes, are some examples of this sort of exception.

The problem comes in when an application is working with those aforementioned enormous files, but neglects to tell the system that it really should be in the other category. The purge(8) utility exists so that a developer or system administrator can debug this situation.

Purge(8)

The purge(8) utility merely empties the aforementioned disk cache. That’s all.

Just like all caches, the purpose of the cache is to increase performance. And, just like all caches, emptying the cache is usually pointless and generally unnecessary. Just like all caches, it will clean itself over time. Unlike the cache in a web browser, though, “over time” is minutes not days or weeks. However, just like the cache in a web browser, it is extremely unlikely that you will get any performance improvement by manually emptying it.

In rare situations, however, a developer or system administrator may know specifically of a situation where the built-in heuristics will guess wrong, or at least not guess quickly enough.

0 notes &

Not HD _yet_

I haven’t jumped on the HD bandwagon yet. Here’s Why.

Subjective Quality

One of the reasons that I don’t use Blu-Ray or choose HD when purchasing from iTunes is that I don’t need it. 480p, that is full-resolution, progressive-scan, DVD-quality, is good enough for me. My television is only 33 inches diagonal. Its widescreen and LCD and all that HD goodness. It’s also full 720p, not that almost-720p 1280x800 nonsense. 480p looks damn good on it. 720p looks better. I can see the difference, but only when I’m looking for it. (Music Videos are an easy way for me to compare since I have both 480p and 720p versions of a few. The difference is apparent, but only when looking for the difference.)

At the end of the day, 480p looks good enough.

AppleTV

720p

I use an AppleTV. This is my AppleTV. There are many like it, but this one is mine. I don’t “hack” it, either. It runs stock, Apple-supplied software only. (I have upgraded the hard drive, but that’s not a “hack” in any real sense.)

The AppleTV happily plays 720p25. Movies, generally shot at 24 fps, play just fine in HD on the AppleTV (@ 720p24). PAL-formatted TV Shows (and other PAL-formatted content) also play just fine since PAL runs at 25 fps.

Unfortunately, American TV runs at 30fps. The AppleTV doesn’t play 720p30. For some unfathomable reason, content which is not, never was, nor ever will be produced for television broadcast, will invariably appear at 30 fps if produced in the USA. Thus, this content won’t play in HD. (Actually, it won’t play at all on the AppleTV, but I’m assuming that I’d be able to get it in 480p (or 540p, see below).)

While this sucks, and I would likely purchase a new AppleTV should Apple opt to release (significantly) upgraded hardware, that’s the way it is.

So, some 720p content plays. That’s a recipe for frustration. While movies should encode to 720p24 just fine, some won’t. The result will be that I’ll have to re-encode, wasting much of my time. Or, I’ll have to instruct my encoder to hit a ceiling at 25 fps. That just bugs the frak out of me. I do not want to mess with framerates. That’s a quick way to run quality into the ground. Either way, I’ll end up with some good-looking 480p content, some “great”-looking 720p content, and some not-great-looking 720p-ish content. That would then lead me to become even more desensitised to the quality of the video and might very well leave me indifferent to high-versus-low quality, meaning that I might not notice when something worse than 480p makes it into my library. That, or it’ll drive me nuts (more likely).

540p

The AppleTV will play 540p at 30 fps. I could just encode HD video to 540p, thus solving my problem with 720p. However, now I’m no longer in magical-HD-land, but I’m above SD-lan, so I’m somewhere in in-between land. Depending on how I deal with 720p30 content, I might end up with good 480p, better 720p, and in-between 540p. Again, leading to the mixed-and-matched frustration I just mentioned.

This might be a viable option, but seems like an awful lot of work for a minor increase in resolution with compromise baked-in from the get-go.

iPhone/iPod touch/iPod classic

The iPhone and iPod touch both play 480p content just fine. While Apple’s official specifications seem to indicate that they are limited to 640x480, this is not true. Anything 480p (widescreen or 4:3, including anamorphic) will play on any iPhone or iPod touch.

The iPod classic will even play 480p content, but will squeeze it to 4:3 somewhat unceremoniously (by basically ignoring the anamorphic settings). I haven’t tested this in a long while, so its possible that the iPod classic isn’t as flexible as I recall. Its definitely close though. (By close, I mean that it will play 480p, but perhaps there are other limitations that make it somewhat incompatible with the 480p on the iPhone.)

I very much like having the ability to put my media anywhere I like. I like to be able to bring my Podcasts and TV Shows, and even a movie once in a while, with me wherever I go. Admittedly, I don’t do this much, but I do do it sometimes and I value the ability to do so. I would, of course, still be able to bring all my 480p media with me, but the new 720p content would fail to sync. Having to check if something is 480p or 720p before deciding if I want to bring it along for the flight will most likely end in frustration for me and my wife, who is more than happy to ignore any technical explanation I offer as to why Dexter won’t sync.

Now that I think about it, my wife does regularly sync our media to her iPhone, so really this isn’t just a vehicle for frustration but is, in fact, a show stopper.

Ripping & Encoding

Until recently, it wasn’t entirely clear that reasonably full-featured ripping/encoding solutions were available for Blu-Ray. While I’m as able as the next guy to recompile my linux-kernel with the appropriate drivers and more than capable to step through the Blu-Ray debugger in order to grab decoding keys, it just seems like an awful lot of work for what I’ve already explained isn’t really all that compelling to begin with.

Nowadays, of course, there are much simpler ways of ripping and encoding from Blu-Ray, but they’re still not as streamlined as for DVD. For DVD, most tools can read directly from disc and encode directly to H.264. Tools like HandBrake don’t do this themselves, but are designed so that you can add one plugin to do that actual DeCSS work outside of HandBrake itself. Its about as simple and Mac-like as you can get.

Blu-Ray, to my knowledge, requires a three step process. First, rip. Then, extract. Finally, encode. The rip itself can be done with Mac BluerayRipper Pro. Once that’s done, a somewhat-shady but nevertheless reputable MakeMKV can be used to grab a given “title set” (a single movie or single featurette) into a single file. (I think that MakeMKV can read directly from the disc, if necessary.) MakeMKV, thankfully, doesn’t do any encoding at all. It merely copies the data into a new container package, for easy access. Finally, HandBrake will happily encode H.264 from the MKV container into a nice MP4 wrapper.

For DVDs, I use RipIt to get a DVDMedia bundle, and then HandBrakeCLI to encode. (As mentioned above, HandBrake can read directly from the DVD if VLC is installed.) I’ve written a set of small scripts which make this amazingly painless. I’d have to either expand or replace those scripts for Blu-Ray, again seemingly much work for seemingly small profit.

1080p

My TV doesn’t show 1080p. My AppleTV doesn’t play 1080p. My MacBook Air doesn’t show 1080p, and likely couldn’t play it anyway (or at least not very well). My iPhone doesn’t play 1080p. My Blu-Ray — wait, I don’t have a Blu-Ray player.

Conclusion

In short, its just not worth it for me right now.

In the future, however, I’m sure that I’ll jump on the HD bandwagon. Its just a matter of time. 720p and 1080p seem to have gained popularity at the same time and are often confused with each other (since both are referred to as “HD”). I’m thinking that once its clear what format content will be available in (1080p), and that such content is high-quality, I’ll flip the Blu-Ray switch: buy a new TV, buy a new (upgraded) AppleTV, buy a Blu-Ray drive, buy Mac BlurayRipper Pro, rewrite the scripts, and start encoding to 540p — oh, wait.

HD is an expensive project.

33 notes &

Prostitution, Politics, and Human Trafficking

There’s a young woman in my class who is both smart and highly motivated. (Actually, there are several people like that.) This last year she led a campaign to make prostitution illegal in Rhode Island, and succeeded. I was always curious about why she was so passionate about it, though. Whenever she talked about it, she rarely spoke about the business/institution/practice of prostitution. Instead, she spoke about Human Trafficking a.k.a. slavery.

While both topics have a connotation of less-than-moral, they’re still quite distinct and I wasn’t quite sure how they overlapped. Certainly, slavery can be used to “employ”** prostitutes, but slavery can also be used to “employ” farm workers. Arguably, the conditions surrounding undocumented immigrant farm workers are just as bad if not worse than those surrounding legal prostitution in Rhode Island. Why campaign just against prostitution? Why not campaign against undocumented/coerced farm workers too?

(Just to be clear, since I do expect to be misunderstood here, I am morally and politically opposed to slavery in all its forms. I believe it to be wrong, I think its already illegal, and I believe that it should be illegal.)

(I’d like to point out that I’ve never interacted personally with the person who prompted this blog entry. I know nothing about her except what I’ve heard from her during lecture discussions or observed visually.)

I think I’ve figured out why. She, like I, is opposed to human trafficking. She is also, separately, opposed to men having sex with women. That sounds absurd, but please read just a few more sentences before you think I’m making an ad hominem attack.

I took a course on feminism during my last semester in undergrad. The professor for that course, who was a fantastic professor, was married and had one child. Her husband and her split the child care responsibilities. She worked Monday, Wednesday, and Friday and he worked Tuesday, Thursday, and either Saturday or Sunday. Or something like that. On days when she was at home with their child, she would make dinner for her and her child. She deliberately would never make enough for her husband to eat when he got home later in the evening. She was already making dinner, and already cooked for two. However, she deliberately never cooked for three. On purpose.

Her husband would come sit with them at the dinner table with a bowl of cereal.

Since she teaches a feminism course, you can probably guess that she is a feminist. Her blind opposition to traditional roles was so strong that she not only avoided the role but avoided the appearance of the role. Since women have traditionally made dinner for their husbands, she now refuses to make dinner for her husband even though she is already in the kitchen making dinner. There’s something not quite right about that. (Her husband does cook for her.)

I think that my classmate’s opposition to prostitution is feminist in nature, and not merely a moral objection to slavery.

Why does the nature of her opposition matter? It matters because of her choice of what to campaign against. She campaigned against one thing, while using rhetoric directed against another thing. The arguments in favour of subjugating men as “pay back” for their historical subjugation of women are completely different from the arguments in favour of stronger slavery legislation. That, in turn, is significant because there isn’t as much support for the subjugation of men as there is for anti-slavery legislation. Not only would virtually all (but not absolutely all) men be opposed to male-subjugation, but the vast majority of women would be similarly opposed.

0 notes &

Check Your Phone Bill

Did you know that any company can just add a ten dollar charge to your phone bill?

I had a charge for $9.99 added to my bill without my permission. I called AT&T. They said that any company can add any charge to your bill at any time without my knowledge or permission. If I have never sent a single text message to anyone, let alone this random company, they can still charge my bill without my permission.

I only noticed because my credit card expired and I went online to put in the new expiration date and decided to look through my bill while I was at it. It’s been on there for months.

I checked the incoming and outgoing text messages for the line. Two months ago my sister-in-law (on my “family plan”) RECEIVED three text messages from this company. She never replied. She did not sign up or “activate” anything.

The woman I spoke to at AT&T was very friendly and helpful and informed me that this was standard operating procedure for AT&T. She said that many customers call in to complain and that AT&T had a policy of refunding all unauthorised charges when the customers complain and can block accounts from using the “feature”. However, AT&T has since changed this policy. Now, only 90 days worth of charges may be refunded.

The moral of the story? Fuck AT&T. and check your bill.

UPDATE: Ars Technica has a story about this practice and how “crammers” can make quite a bit of money off it. http://arst.ch/fwv

0 notes &

English Dubbing

So, I’ve been watching Bleach for a while now. I’m getting it on Netflix, so I’m roughly three years behind what’s on-air in Japan. I really enjoyed seasons 1, 2, and 3. Seasons 4 and 5 are filler, and therefore suck ass. I’m hoping season 6 will be as enjoyable as the first three.

My wife, @RussianDina, refuses to watch it with me. Why? Because she can’t get past the embarrassingly ridiculous voice-acting. We’re watching it in English, and I keep trying to explain that the original Japanese is much better, but she has a point. The English-language voice-acting just sucks ass. Not only is the acting bad, but the translations are positively horrible. Its like they’re translated by a marketing committee. (Watching with Japanese audio and English subtitles wouldn’t work for her either because English is her second language and it would be too distracting for her to watch and read simultaneously.)

We would enjoy the series much more if I were to steal it via BitTorrent or just watch on YouTube. Why? Because the fan-made subtitles are vastly superior to anything to be found on the official DVDs. That is sad. The translations are true to the spirit and letter of the original dialogue. What’s more, the fan-made subtitles will often add little explanations (at the top of the screen instead of the bottom, so as not to be confused with dialogue) helping to explain phrases or expressions which can’t be adequately translated.

Its sad, really, that to get the best experience I would have to steal my content. Why can’t I pay for what I want? If big-content want to survive this decade and next, they’ll have to figure out how deliver what the fans want.

This isn’t just Bleach. If it were just bleach, then I’d just complaint about Cartoon Network/Adult Swim, Viz Media, et al. This is a common problem for nearly all anime. Its almost as if the marketing committees just don’t realise that this is real art. This isn’t Blue’s Clues. These aren’t children’s programs. The amount of violence and sex should make that quite clear. Most of these shows have lesbian lovers. Sailor Moon, e.g., featured full frontal nudity in the opening credits of every single episode, and often in the episode content itself. (You’ll have to go steal a Japanese rip to see it. They censored the American releases.) Nearly the entire second half of Evangelion, e.g., is rated TV-MA. If you don’t have HBO or similar, then you’ve never seen a TV-MA program. They’re not broadcast on regular TV. TV-MA is adult. Its not like an R rating. Its like an NC-17 rating.