mverdone

blog

Python Twitter Tools 1.8.0

May 13, 2012

Python Twitter Tools 1.8.0 is now available. This release features two new scripts submitted by GitHub user StalkR:

  • twitter-archive: a command to archive all of a user’s tweets to a file, for archiving, or semantic analysis, or whatever
  • twitter-follow: a command to find all of a user’s followers (or followees) and print them on the command line

StalkR uses these commands and a clever shell script to archive tweets and the tweets of followers for mysterious and intriguing purposes. A very cool use case.

This release also includes bug fixes, and the documentation is now visible on the PyPI project page, because some users had a hard time finding it.

As always you may:

pip install twitter

Or download the release from PyPI.

Python Twitter Tools is five years old now. I will do a retrospective.

No Comments

Article about Instagram in Culture Magazine

April 21, 2012

(Cult)ure Magazine have published one of my screeds, this one about Instagram. Go read it, if you have the inclination.

No Comments

Arcseconds Release: What’s Your Astrological Sign? / Money

April 18, 2012

New release: Arcseconds – What’s Your Astrological Sign / Money; now available on my Bandcamp page.

More Arcseconds stuff coming this year. It’s happening.

2 Comments

Tiger’s Milk

November 6, 2011

This is a recipe for a breakfast milkshake I loved when I was a kid (and probably still love though I haven’t made it lately). Maybe it will tell you something about my childhood, though I’ll leave it to your interpretation as to what.

Tiger’s Milk

Makes 2 portions.

  • 3/4 cup plain yogourt
  • 1 egg (raw)
  • 1–2 tbsp. honey
  • 1 banana
  • 1/2 to 3/4 cup orange juice
  • 3–4 tbsp. brewer’s yeast or nutritional (hippie) yeast

Process in blender or shake in a jar. Drink.

No Comments

Let’s talk about that Nikon social media meltdown

September 29, 2011

Hokay, so, Nikon posted this message on their Facebook wall social media thing and, well, even talking about it is giving it more play than it deserves and this is basically just gossip at this point but… well… seriously, they wrote this:

I mean, what? What?!

Reaction was swift, and justice was served in the only way that thousands of wronged Internet users can provide: a torrential flood of outraged and sarcastic comments.

For those who don’t know the correct way to think about photographic equipment comes by way of an Ansel Adams quote:

The single most important component of a camera is the twelve inches behind it.

The ever respectable Ken Rockwell expanded and expounded on this idea, too.

So it’s mystifying what must have happened inside Nikon for them to post that. I’m still waiting to learn that today was Japanese April Fools’ day and it was all a joke gone wrong.

This is a good a time as any to say that I haven’t used my Nikon in months. A few months ago I picked up a Casio point and shoot, and I’ve had a lot more fun with it, and taken a lot of rewarding photos.

It’s a lot more limited than the Nikon because you can’t really control the lens or shutter without digging into a pile of menus, but 90% of the time it auto-adjusts itself to produce exactly what I would have settled on with an all-manual camera. This frees me to think about the layout and content of a photo, which is a lot more interesting.

Thing is, there is no such thing as a professional camera brand any more. There are very fancy cameras, yes, that require a significant amount of training and skill to use at their fullest. And I know people who I consider professional photographers not only because they make money, but because they can do things with a fancy camera that are way beyond my technical skill. But, both Canon and Nikon are firmly planted in the “pro-sumer” market.

That’s a horrible term, by the way, “pro-sumer”. I actually think amateur is a better product class. To my mind amateur means, “contains the features you need to have fun and take the photos you want.” Pro-sumer means “we put a lot of fancy shit in your camera to distract you from actually taking photos. Please buy more accessories.”

It occurs to me I have talked about this already. But it doesn’t hurt to repeat it: tools are fun, and good tools are worth using, but it’s what you make that matters. It’s sad when a company can’t even pretend that that’s the case.

1 Comment

buildawall: a script for Minecraft

September 14, 2011

I created buildawall — a utility for Minecraft server admins to put a wall around their world.

Minecraft is a terribly addictive (but worthwhile) game where you try to survive in a harsh, unforgiving wilderness made of Lego-like cubes. And once you learn how to survive, then you build the Eiffel tower, or a cool cave fortress, or stuff like that.

Each Minecraft world is driven by a seed — a single number that powers the world-creation algorithm. The world is almost infinitely large. (Much larger than the Earth, in scale). However, the game only creates the parts of the world that you visit. The creation of new world “chunks” always happens just outside your view so you never notice it.

When a new Minecraft update is released, sometimes the world generator is changed. This makes the world seed create a new and different world than it did with the previous version. The player notices this when they enter new terrain and discover jarring discontinuities. Mountains cleaved in half, that sort of thing.

In order to stop this, I created a program that takes the Minecraft world you’ve visited so far and builds a wall around it. The wall creates a psychological and in-game barrier that delineates “old world” from “new world.”

It also poses a challenge to players as the wall is cored with impenetrable material. Players have to build a staircase to get over the wall, or they can tunnel deep below the earth to get under it. The players’ reward for getting around the wall is a new and exciting world.

If you run a multiplayer Minecraft server and are faced with a world-altering version update (such as right now as the game goes from 1.7.3 to 1.8) I would recommend you try buildawall to mark the end of the world and the beginning of the new one.

2 Comments

Whitepaper: Building a shoebox media server on the cheap

September 12, 2011

I wanted a media server for my place because my laptop hard drive is pretty small, and I have a bunch of movies and music scattered about on a bunch of external hard drives. I had a few requirements:

  • Completely silent. No fans.
  • Large storage (~ 3 Tb or more)
  • Support backing up to cloud backup service (eg. Crashplan, Backblaze)
  • Small
  • Cheap
  • Headless

I looked at home NAS units but found that they wouldn’t support cloud storage. (Cloud backup guys refuse to back-up network storage, so the system has to contact the cloud server autonomously). This also ruled out the Apple Time Capsule.

The Mac Mini was ruled out for not having sufficient space, and being too expensive for this purpose, given that most of its shiny features would be wasted on a headless system.

Most off-the-shelf PCs featured large power supplies with fans, which was not what I wanted.

So I decided to build a cheap PC from parts.

The Hardware

Mainboard: ASUS AT4NM10T-I

I don’t know what all the gibberish characters mean, but it’s a pretty cheap mainboard with an Intel Atom D425 CPU. It draws very little power and it’s 64 bit and stuff. It has four SATA connectors for hard drives and USB2 or whatever. Curiously it also has a PS/2 mouse/keyboard port, a parallel port, and a COM port. Why? You’d think they’d save some money on components by ditching these features. Whatever.

I guess it also has sound outputs. Oh, and gigabit Ethernet. That’s important.

Hard disk: Seagate 2 Tb “Green” or something

It’s got 2 Tb of storage which is plenty big. It’s 5400 RPM, which is slower than average, but consumes less power and is quieter. That’s important.

I also have a Western Digital 1.5 Tb “Green” hard disk, which I think is a bit louder and power-hungry. That will be the second disk at some point.

Power supply: PicoPSU 160 XT

This is cool: the PicoPSU 160 XT is a tiny, fanless power supply that delivers 160 watts (peak 200 W). That’s quite a bit for a low-power system. I suspect I can get the mainboard and three 3.5” hard disks running from this thing.

The bulk of the power supply is external, like a laptop. I bought it as a kit with the power supply and an external power transformer (110-220 V AC to 12 V DC). The transformer is about the size of the one from the original XBox 360. If you’re not a nerd, that means too big. But it’s fine.

The Software

I got Linux from the Internet.

I used Ubuntu Server 10.04 LTS. Basically, Ubuntu is great and so easy to use some people claim it’s “not Linux”. I’d stay away from 11.04, though. From previous experience it’s pretty buggy, and you don’t need bleeding edge for a media server.

The Installation

As I said, I wanted this to be a headless server, and beside my laptop, I don’t own a keyboard or screen. The challenge was to get a working OS onto the hard disk and then install it in the machine.

To begin, I installed VirtualBox on my mac and set up Ubuntu Server in a virtual machine. (Note: do not use LVM) I bound the virtual hard disk to 8 Gb even though I had a 2 Tb target disk. This is important.

Then, I converted the VirtualBox VDI (virtual disk image) to RAW format. The command is basically this:

VBoxManage internalcommands converthd hard_disk.vdi hard_disk.raw

That gives you an 8 Gb file.

Next, I connected my 2 Tb hard disk to a USB drive enclosure and plugged it in. OS X complained about the unformatted drive, but I told it to shut up. The disk appeared at /dev/disk1 (note: sometimes it was /dev/disk2. If you are doing the same thing as me, this right here is the first step that could hose your laptop if you do it wrong. Make sure you pick the right disk.)

Using the magical dd command, I dumped the raw disk file onto the physical hard disk.

dd if=hard_disk.raw of=/dev/disk1

This took a while.

(Astute readers might wonder why I didn’t direct VBoxManage directly onto the disk. That’s because VBoxManage is a jerk and refuses to write to an existing file.)

Problem: now we have a 2 Tb hard disk with an 8 Gb partition table. Oh, and Apple’s partition table is different from Linux so it’s dicey to go and change it there.

Solution: we need to mount the disk in Linux. It’s possible, albeit slightly insane, to mount a physical disk in a VirtualBox image. Here’s the magic command to do it:

VBoxManage internalcommands createrawvmdk -filename disk.vmdk -rawdisk /dev/disk1

Then I booted disk.vmdk into VirtualBox and got my Linux. Easy.

From there I was able to use fdisk and fiddle with the partition table. The most important tip here is to ensure the starting cylinder/byte of your root partition is unchanged. Swap and stuff can be fixed later.

# In your virtual terminal:
sudo fdisk /dev/sda

After a reboot your partition is bigger but the filesystem is still at 8 Gb. Now you must tell the filesystem to fill the extra space. Linux has an insane feature that lets you resize a filesystem while it is running. No really. Crazy shit.

sudo resize2fs /dev/sda1

This took, like, four hours. Remember, we’re on a slow-ass USB disk here. You could do this after the disk is installed in the media server, actually. Probably would have been smarter.

Finally, I connected the hard disk to the mainboard. I needed an enclosure.

As previously mentioned, all the small enclosures on the market are too small for 3.5” disks, and those that are big enough come with noisy fan-filled PSU’s. I grabbed a shoebox and some duct tape (fact: most duct tape is non-conductive because it’s actually duck tape). I shoved all the pieces in there.

The last step was convincing the mainboard to boot. See, I didn’t have a power button. I looked in the manual and found the power button pins on the mainboard. Then I shorted those pins with a copper coin. The system started up.

(Fact: booting a PC by shorting pins on the mainboard is basically the most bad-ass nerdy thing you can do).

The system booted and didn’t appear on the network. Crap.

I disconnected the disk, reattached it via USB and booted in a virtual box again. By examining logs I found that Ubuntu got confused by the new network adapter and gave it a port of eth1, which was not configured. I modified /etc/network/interfaces and added these lines:

auto eth1
iface eth1 inet dhcp

This finally convinced the PC to connect to the network and I could ssh to it and finish the install.

Results

It works! The thing lives!

I still need to configure Crashplan for offsite storage, and install the second hard disk, but basically the experiment was a wonderful success.

2 Comments

F’ yeah web safe colors dot tumblr dot com

September 7, 2011

I really like dead technology. Obsolete ideas are really interesting because there’s always a story behind them: why were they made, why were they maintained, and where were they killed?

I’m on record as an ironic fan of Swatch Internet Time, a bizarre invention of the early nineties that consisted of timezone-free time format that counted from zero to 999 every day. It looked like this:

@846

It was basically a marketing concept from Swatch based on the idea that we’d spend so much time online chatting with people from other timezones that synchronizing time would be a huge problem. It is a problem now, but not one to warrant the invention of an alternate, metric time format. Most online interactions have become asynchronous.

Every time I think about Swatch Internet Time I think about all the people who came up with and promoted that idea, their reasons for doing so, and the spectacular hubris of its failure and obsolescence.

A discussion at work about theoretically most pointless “fuck yeah” tumblr blogs inspired me to create one: fuckyeahwebsafecolors.tumblr.com. If you’re not an old school Internet nerd you probably won’t get it. Basically, back in the day computers were embarrassingly limited in that they could only display 256 colours on the screen at a time. When you tried to display more than that, you would get ugly hatch-mark patterns on the screen. (You can see this yet in animated GIFs which are also limited to 256 colours and are making some sort of ironic-retro-art comeback).

After some intense thinking the brains of the World Wide Web decided on a palette of 216 “web-safe colors.” The theory was that all websites in the world would agree to use only these 216 colours in order to prevent the horrors of dithering. The remaining 40 colours of the palette were left to the operating system to do as was its wont.

The plan never really worked, though, because any non-web application on the screen would also attempt to allocate some of the computer’s 256 colors, and stomp all over the web-safe palette, thus bringing on the unsightly hash marks. Not only that, the web-safe palette was made up of a lot of really ugly, bright, clashing colours.

The era of web-safe colours was over quickly. New display systems came on the market within a couple of years that were capable of displaying 16.7 million colours simultaneously. Websites using web-safe palettes suddenly looked hilariously out-of-date. The whole concept, now irrelevant, vanished.

At fuckeyeahwebsafecolors.tumblr.com we’ll be going through the web-safe colors, one at a time, with no commentary. I urge you to meditate on the colors. What do they say to you?

2 Comments

Textural Backgrounds for You

September 3, 2011

While procrastinating from vacuuming my apartment (which is tiny and can be vacuumed in ten minutes but yes I am that lazy) I made these backgrounds. I am quite pleased with them. Click to embiggen to 1680×1050 res.     I got the textures from a few places, like from Dioma on DeviantArt. (Another pack by Dioma). And Playingwithbrushes on flickr.

No Comments

Unexpected Features of OS X Lion

August 29, 2011

Actually, most of the stuff in Lion is really, really awesome and I’m glad I upgraded. However, here are some of the WTF’s that nobody is talking about:

  • Built-in Emoji characters! If you had OS X Lion you would see that this glyph is a little smiling pile of poop: 💩
  • You have to download Java as a separate installer, but once you do Minecraft performance is improved! (maybe)
  • In the User Switcher menu, user icons are now inside circles. Because circles are awesome.
  • Ships with Python 2.7.1 (though any sane person would disregard that and install an official package, or compile it via MacPorts the way God intended)
  • Broken compatibility with RME professional audio interfaces so you can go to their forum and scream like a maniac until they fix it fix it fix it fix it fix it…
  • It’s 64 bit! You don’t know what that means but more bits sounds great!
  • Text autocorrector will correct your text or, failing that, transform German and French words into utterly wrong English words and mess up your tweets until you turn it off. (System Preferences -> Language & Text -> Text -> Correct spelling automatically (unckeck))
  • Finder is vastly changed with awkward font sizing in UI elements, and complete failure to respond to Back, Forward, or Up trackpad gestures (I mean, why would you want to navigate back or up in your filesystem amirite?)
  • By default new Finder windows open an All My Files view which sorts by file type and puts the most recently added photos of you totally wasted at a party at the top of the window in front of your boss because you’re doing a presentation and are connected to the projector aaaaaaaaaahhhh!
  • Safari is improved or something I dunno you use Google Chrome, right? You don’t? What the heck is wrong with you?
  • You know that Finder view with all the files on display and they flip in from left to right? I think it’s called Coverflow, only it’s for files. Dear Fileflow: why do you still exist?!

2 Comments