IP address is not identity

I’m using Cloak as a VPN provider while travelling. Great product, excellent MacOS VPN client. Unfortunately they terminate your VPN links at random servers in VPS clouds like Linode. And those IP addresses are blocked by sites like Yelp and Pinterest. Pinterest goes so far to say as “there’s a bot in your network”, which really means “we blocked that block of IP addresses because someone once ran a bot there”.

Stupid.

Apple hates signals

Why do so many MacOS apps fail to quit in response to a simple kill command? softwareupdated, mtmd, I think ocspd and maybe even mdsworker. kill doesn’t kill them, have to kill -9. That doesn’t help anything.

Today’s mess: I deleted 20 old files from my Downloads folder. So now Time Machine is insisting on pegging one CPU at 100% and running the battery down, preparing another backup or something. The backup drive isn’t plugged in, this is the local backup thing which I generally like when it’s not being stupid. Even better; after the kill -9 launchd spawned the process again. Of course.

 

MacOS file sharing and CPU usage

Why does MacOS file sharing take so much CPU? I’m rsyncing 30GB of files from one Mac to another. Using MacOS file sharing, 10.9.4 server and 10.9.2 client. The client is a MacBook Air and the fan is whirring away. Some kernel_task associated with the copy is taking 50% of one CPU; the rsync processes are taking another 13%. It’s not awful, but that’s a shitton of CPU for doing something that should be low impact. The iMac server is using 15% of a CPU to serve the files too.

Automatic Dashboard

JeffN was kind enough to point out the new Automatic Dashboard. Automatic is a gizmo that plugs into your car service data port and relays data to an iPhone app. It records fuel usage, speed, GPS track, etc. Neat data, but the presentation has been really limited so far to a mobile-only experience. Well now they have a webapp and it looks great.

The map view is most interesting to me. All built using MapBox.js. The data for it is stored in URLs like https://api.automatic.com/v1/trips?page=1&per_page=100&start=1407222000000&end=1409756534672. Requires authentication, my eyebrows slightly raised that my user ID isn’t in the URL: implicit by authentication.

trips returns an array; one example element below. I’ve zeroed some of the IDs. The path data is most interesting to me. It looks to be pre-encoded as a polyline, which the javascript renders in SVG. It doesn’t load more detailed data when you zoom in, I think this is it. A bit of a hassle to reverse engineer this to normal lat/lon data, but it’s probably all some standard MapBox data format so should be possible. Update: apparently it’s the Google Maps polyline format.

The graphs are nice. They’re SVG and I see nvd3 is loaded in the page, so I assume that’s what they’re using.

{
  "vehicle": {
    "uri": "https://api.automatic.com/v1/vehicles/C_0000000000000000",
    "color": "",
    "id": "C_0000000000000000",
    "display_name": "Audi A6 Quattro",
    "year": 2005,
    "model": "A6 Quattro",
    "make": "Audi"
  },
  "score": {
    "score2": 50,
    "score1": 50
  },
  "drive_events": [],
  "average_mpg": 20.803669567728743,
  "uri": "https://api.automatic.com/v1/trips/T_0000000000000000",
  "end_time_zone": "America/Los_Angeles",
  "duration_over_75_s": 0,
  "duration_over_80_s": 0,
  "path": "karlFrrzaVCf@Er@c@Gc@IcAQmAU}Bk@cDw@{D{@qA]oAe@iAo@}@_@]EK~Bg@pHMbBa@Kg@Wi@c@aB{Ae@a@iBsAcBiAgCsByBeBcAo@sHqEWM{Ac@kBg@cCw@_GeD_BeAw@u@mCeDoCeDq@k@e@YiAe@cCm@kA]y@k@KOkCzDu@|Aq@nBShAM~@IfAEpA?hCNxBVpBVjArAbEvCdJbAhDb@|Bj@zDP`CZlGh@~O\\hFTlBb@~CZ|A~@zDfChKb@nBh@xCZhCVjCNfCh@fZh@nSNlFBzCAtCGrDo@nLQjEIxEC~CBjBFbDHT@bD?pIGP?PC|BBlBDhAXElBc@a@iDQ]K_AAg@Fg@N[xCm@JB|ChE^zAa@J",
  "end_location": {
    "lon": -121.0936601,
    "lat": 38.9406032,
    "display_name": "Bell Rd, Auburn, CA",
    "name": "2705 Bell Road, Auburn, CA 95603, USA",
    "accuracy_m": 10
  },
  "distance_m": 6805.27783203125,
  "end_time": 1409172044053,
  "start_time": 1409171491960,
  "id": "T_0000000000000000",
  "duration_over_70_s": 0,
  "fuel_cost_usd": 0.753902077674866,
  "fuel_volume_gal": 0.203262895345688,
  "hard_brakes": 0,
  "hard_accels": 0,
  "user": {
    "id": "00000000000000000000"
  },
  "start_location": {
    "lat": 38.9280456,
    "lon": -121.0552683,
    "display_name": "Lincoln Way, Auburn, CA",
    "name": "13500 Lincoln Way, Auburn, CA 95603, USA",
    "accuracy_m": 50
  },
  "start_time_zone": "America/Los_Angeles"
}

 

Screen Shot 2014-09-03 at 8.16.43 AM

First light: WebTule

I’m working on a data exploration tool. Sort of a simplified version of GGobi, for web usage. Give it a CSV file and it lets you explore scatterplots of various columns. I did a custom version for Battlefield 4 a few months ago, now working on a generic tool.

So here’s “first light”, taking the HYG Database of stars and trying to recreate the Main Sequence diagram. It’s visibly at least a little right, once you realize the Y axis (magnitude) is inverted.

Screen Shot 2014-09-02 at 5.46.08 PM

Pie chart alternative

Pie charts are bad; they’re hard to read, particularly for small percentages. This Pornhub Insights report (SFW) has an interesting alternate type of pie chart.

pornhub-traffic-mobile2The angle of each wedge is constant, 360°/5 = 72° in this graph. It’s the radius of each wedge that conveys the data. In other words it’s basically a bar chart, but turned into a circle. That’s a nice compact layout. And it visually conveys that the numbers sum to 100%. If I measure this right the wedge radius is proportional to the square root of the value, so that the wedge area is proportional to the value. That’s more correct for visual perception. It also works well for showing a 40:1 ratio like the data above; in a linear bar chart the 1% data would only be a couple of pixels high.

I’m sure Pornhub didn’t invent this, but it’s a neat technique I haven’t picked up on before.

Update: Mike B tells me this is called a Polar Bar Chart. Or a Coxcomb chart, after no less than Florence Nightengale.

youtube-dl rate limiting bumpiness.

The results of using youtube-dl to download at 50 kbytes/second:

Screen Shot 2014-08-28 at 9.22.15 AM

Basically it uses max bandwidth for a bit, then stops. The average rate is indeed 50 kbytes/sec, but it’s 1 second of 300 kbytes/sec (max rate) followed by 6 seconds of none. Not exactly the intended effect.

I’m not clear on how much a user-space app can even do to throttle bandwidth on a TCP socket like this. I’d assumed they were stalling the pipe, only reading 60 kbytes/second, and the server is filling the pipe and something’s buffering. But that graph looks more like youtube-dl reading the whole buffer all at once, then sleeping a long time.

The code looks like it’s doing something reasonable. If I understand the main loop right, it reads block_size bytes (1024), then sleeps for a carefully calculated amount of time to maintain the rate. So it’s at least trying to read little bits in short intervals, I wonder why it’s not working? I should test it on a faster network and see if it does the same weird thing.