Linux shortcut to connect to Bluetooth speakers

We have a Bluetooth speaker in our office that we often use to play music through. My Linux machine, however, didn’t automatically connect to the Bluetooth speaker, and even after connecting it, I’d have to switch the output to be that speaker.

I ended up creating a shortcut on my menu bar that would connect to the Bluetooth speaker and set it as the default audio output, all in one click.

First, I went and set up the audio like I normally would, making sure to note the Mac address of the device: Continue reading Linux shortcut to connect to Bluetooth speakers

1850s San Francisco maps vs Today

Wikimedia Commons holds a few remarkable maps of San Francisco from the 1850s. These maps, done as part of the US Coast Survey (now the National Geodetic Survey) were made a half century before the 1906 earthquakes and show a San Francisco that was largely limited to the Northeast part of the current city.

I went ahead and matched up an 1853 map and an 1859 map to today’s map of San Francisco using the amazing Map Warper tool. Shown below are mostly the 1853 maps. All modern-day street maps are copyrighted by the OpenStreetMap contributors. (See bottom of post for links to this map on Map Warper.)

Map Warper - 1853 San Francisco

We see a city that doesn’t extend much past 3rd Street. Continue reading 1850s San Francisco maps vs Today

Heroku changing up dyno pricing

Heroku is trialling new pricing levels for their dynos. Here’s the verbatim text they gave:

Free – Experiment in your own dev or demo app with a web and a worker dyno for free. Sleeps after 1 hr of inactivity. Active up to 12 hours a day. No custom domains. 512 MB RAM.

Hobby – Run a small app 24×7 with the Heroku developer experience for $7/dyno/mo. Custom domains. Run a maximum of one dyno per Procfile entry. 512 MB RAM.

Standard 1X, 2X: Build production apps of any size or complexity. Run multiple dynos per Procfile entry to scale out. App metrics, faster builds and preboot. All Hobby features. 512MB or 1GB RAM. $25 or $50/dyno/mo.

Performance – Isolated dynos for your large-scale, high-performance apps. All Standard features. Compose your app with performance and standard dynos. 6GB RAM. $500/dyno/mo.

Continue reading Heroku changing up dyno pricing

Fun networking stories: connecting three machines away via SSH

We had a hardware unit that was Ethernet enabled. To configure and manage it, the vendor provided us with a Windows program that, given the unit’s IP, could establish a TCP connection to the unit’s port 3300 and do all of its fancy management things.

The only problem was, the hardware unit was a hundred miles away on a private subnet at a client’s building, and the only thing that could directly talk to it was Linux computer A that we installed alongside the unit. We had the foresight to install Hamachi on computer A, and my own Linux computer B here also had Hamachi. My clunker Windows laptop C that could actually run the software was hooked up directly to computer B via Ethernet.

So, computer C had the Windows program and could talk to computer B via direct Ethernet. Computer B could talk to computer A via the Internet using Hamachi. And computer A could talk to the hardware unit via its local VLAN.

C -> B -> A -> hardware unit

The transitive property of hooking-up-computers states that if C can talk to B and B can talk to A, then C can talk to A. But how?

Well, when you only have SSH, every problem looks like an SSH connection.

  1. Computer B connected to computer A and established an SSH tunnel. The SSH tunnel forwarded B’s localhost:5000 port to A’s hardwareunit.local:3300. computer-b$ ssh -L5000:hardwareunit.local:3300 computer-a.local
  2. Computer C connected to computer B and established an SSH tunnel. The tunnel forwarded C’s localhost:3300 to B’s localhost:5000. computer-c$ ssh -L 3300:localhost:5000 computer-b.local
  3. Windows program on C connected to C’s localhost:3300, which actually goes to B’s localhost:5000, which actually goes to the hardware unit’s port 3300 via A.

Yes, everything was passed along via two SSH connections in a row, but it worked quite well, and it will save us from driving down to the client in the rare case that we need to do this again.

Not all STEM fields are created equal

Alternate title: “Why do people forget about psychology when talking about STEM?”

STEM majors! Everyone needs to be a STEM major! We have a huge shortage of STEM majors! Quick, get your sons and daughters (especially daughters) to major in a STEM field!

STEM stands for “science, technology, engineering, and mathematics” and we often use it as a big bucket of Things We Want More Of. You hear the president promoting STEM fields, along with the Department of Education. A lot of money is being thrown at convincing more people to major in STEM fields in college, especially towards the issue of getting more women into STEM. Continue reading Not all STEM fields are created equal

[transl.] You went overseas—are you happy? (“出国的你 快乐吗”)

Found the below article through so-called “social media”. Don’t have any affiliation with the author nor the WeChat group, but thought it was worth being translated.

Original post at: http://mp.weixin.qq.com/s?__biz=MzA4ODQwMTkyOQ%3D%3D&mid=200035572&idx=1&sn=6fc8fba95e4c22b96616f5cd79b99437


[n.b. photos from original post omitted]

大家看着留学生在国外照的照片,不停说,好羡慕,好美好的生活。
Everyone looking at the photos from students studying abroad keeps saying, “Wow, what a wonderful life. I’m jealous.”
千万不要羡慕,这条路看去光鲜亮丽,其实每走一步就多一个伤痕。
Don’t be jealous, because the road they take might seem bright and glamorous, but every step taken is another scar suffered.

Continue reading [transl.] You went overseas—are you happy? (“出国的你 快乐吗”)

Workaround for HipChat on Linux: “can’t find build id”, “HashElfTextSection”

The new version of HipChat added support for video and screen-sharing. It also introduced the new requirement of OpenGL 2.0. On my computer, HipChat would crash on startup with repeated messages of

can't find build id
HashElfTextSection
can't find build id
HashElfTextSection
can't find build id
HashElfTextSection
can't find build id
HashElfTextSection

I wasn’t going to try video chatting on my old netbook anyways, so there’s no reason I needed hardware support for rendering text and emoticons.

First, get your system’s OpenGL info by running `glxinfo | grep OpenGL` and find your version string:

Continue reading Workaround for HipChat on Linux: “can’t find build id”, “HashElfTextSection”

What concurrency in Node.js could have been

People wrote a lot of good comments on my last post about Node.js. (They also wrote some bad comments, but the worst have been modded out.)

One of the key points I was trying to make was that the way concurrency is written in Node.js sucks, so it blew my mind that people kept referring to new libraries that supposedly fixed things: bluebird, fibers, etc. You see, the callback-hell problem is something that is impossible to fix in “user space”. You either have to modify Node.js internals or design a new language that compiles to JavaScript.

Let me explain.

In a language that allows you to write concurrent code, you might write something like:

Continue reading What concurrency in Node.js could have been

The emperor’s new clothes were built with Node.js

There are plenty of people lambasting Node.js (see the infamous “Node.js is cancer”) but proponents tend to misunderstand the message and come up with irrelevant counterpoints. It’s made worse because there are two very different classes of people that use Node.js. The first kind of people are those who need highly concurrent servers that can handle many connections at once: HTTP proxies, Websocket chat servers, etc. The second are those who are so dependent on JavaScript that they need to use JS across their browser, server, database, and laundry machine.

I want to address one-by-one all of the strange and misguided arguments for Node.js in one place.

Update: Please keep sending in anything I missed! Moderation of comments will probably continue to lag behind, but I do read them and will continue fixing and tightening up this article as best as I can.

TL;DR: what’s clothing that doesn’t use threads and doesn’t block (anything)?

Node.js is fast!

This is actually too imprecise. Let’s break it down into two separate claims:

Continue reading The emperor’s new clothes were built with Node.js

OpenStreetMap provider CloudMade shuts its doors on small users

(Original email at bottom.)

CloudMade, a company selling mapping services (many based on OpenStreetMap data) that competed head-to-head with Google, let its users know that as of May 1st, they’ll stop serving anyone who’s not on an enterprise plan. This is rather sad, because they were one of the main alternatives for custom OpenStreetMap tiles.

Their map tiles definitely left something to be desired. The OSM data that they were using seems to have been last refreshed around the time Steve Coast left (maybe that’s a wee bit of an exaggeration) and the rendering was never very polished—ugly icons and labels getting cut off on tile boundaries. But for $25/1M tiles (with the first 500k free), could you really complain?

CloudMade even listed Steve Coast, founder of OpenStreetMap, as a co-founder. Steve Coast left in 2010, and it was hard to tell what the company was trying to become. Now, we see that they’re gunning for enterprise services, along the lines of Navteq and TomTom. Instead of dealing with small fries like us, they’re apparently focusing on bigger deals like providing data for hardware and consumer electronics.

Maybe they just got tired of my emails to support asking why this or that was broken or when they’d update their data. Now, we’re left with almost no options for custom hosted OSM tiles. MapBox is one popular choice, but their online map customizer is elementary compared to CloudMade’s (and CloudMade’s was not super advanced). MapBox also have stricter terms of how their map tiles can be used. No proxying/caching of MapBox tiles is allowed, for example, especially since they charge based on usage.

CloudMade helpfully gave some alternative providers for us small fries to switch to. Still, one less provider means more risk when using a hosted provider. For example, who are we going to turn to when MapQuest decides to shut off its routing services?

Here’s to hoping people will step up and fill the gap that CloudMade is leaving. Us little users who will only pay a couple hundred dollars per month will then have somewhere else to go.

This is what came through today:

Hi [username],

We want to let you know about some changes we’re making to the CloudMade APIs. As of May 1st we’re switching to an enterprise model that supports the medium to large sized users of the CloudMade APIs. As part of this transition we’ll stop serving Map Tile, Geocoding, Routing and Vector Stream Server requests coming from your API keys below as of May 1st, unless you take action.

Your active CloudMade API keys are: W,X,Y,Z

If you wish to continue using the CloudMade services after April 30th you’ll need to upgrade to an enterprise plan. Enterprise plans are available for customers with 10,000,000 or more transactions per month. The plans include dedicated hosting, custom SLAs, 24×7 support from a named customer support representative and custom data loading. You can find out more about upgrading and request more information on the Web Portals page.

If your monthly usage is less than 10,000,000 transactions, or you don’t wish to upgrade to an enterprise plan, you should take action to update the app or website that’s using the CloudMade API keys shown above to use an alternative provider. There are a number of alternative providers of Map Tiles, Geocoding and Routing services based on OpenStreetMap data, for example:

– Mapquest (Map Tiles, Routing, Geocoding)

– MapBox (Styled Map Tiles)

Thanks for using CloudMade’s APIs over the past months and years. If you don’t switch to an enterprise plan, we wish you a smooth transition to the new service provider you choose.

[…]

Disclaimer: Nothing written here represents my employer in any way. I am/was a mostly satisfied user of many OSM-based services out there, including MapBox, MapQuest, and CloudMade.