New Homebrew Question/Answer site

I’ve been active on the programming question & answer site, StackOverflow.com for a few years now, and in the past several months, the company behind that wonderful resource has branched out into other topics.  This week, the new Homebrew.StackExchange.com site launched in public beta.

The software this site runs on is finely tuned for asking questions, and getting useful answers quickly.  It is specifically designed not to be used for discussion, since other forum software handles discussions relatively well (but is really cumbersome for asking questions, and evaluating which answer is the most helpful).

So, the way the site works is:

  • You ask your question.  You provide a title for the question, and then go into as much detail as you feel is necessary in the body of the question.  Of course, the more detail you can provide, the easier it will be for people to understand both what you are asking, and why you are asking it, so they can give you a useful answer (or answers :))
  • People see your question, and post comments asking for clarification, if they feel it is needed.  You can then edit your question to add more details.  This is important, because then if people find this page later, because they have a similar question, all the relevant details are in one place, and there is no need to sift through 12 pages of forum posts trying to understand the problem and solution.
  • People post answers to your question.  Again, they should be posting as much detail as possible, to try to give you a useful solution to your problem.
  • People will read your question and the posted answers, and vote on each, indicating how helpful they feel each answer is, and also on how valuable the question is.
  • You will read the answers posted, and post comments on them if you need more details (just like the people posted comments on your question asking for clarification, you can do the same if the answer is unclear).  You can also vote each answer either up or down, based on whether you think it is helpful or not.
  • You can then mark one of the answers as ‘accepted’, to indicate that it solved your problem.  This servers as a ‘thank you’ to the answerer, and closes the feedback loop.


profile for pkaeding at Homebrew, Q&A for dedicated home brewers and serious enthusiasts
All of this voting will build up ‘reputation’ points for the users of the site.   To the left is my reputation badge on the new site. As you gain reputation, the system ‘trusts’ you more, and gives you access to more tools to help maintain the site.  The site is very much driven by the community, and really does a great job of building and nurturing the community.

Also, all of the data gathered by the site (questions, answers, etc) is released in a monthly data dump under a Creative Commons license, so you don’t have to worry about the site taking all of this content, and then turning it into a for-pay site, or anything.  If that happened, you could just take the data dump, and start your own site with it.

Posted in homebrewing/beer | Tagged , , | Leave a comment

Prioritizing Netflix traffic with DD-WRT

Im in ur internet... clogging ur tubesNetwork traffic shaping is an interesting topic, that allows you to ensure that certain traffic gets priority over other traffic.  When applied at the ISP level, this can get controversial, as you start getting into Network-Neutrality issues (where one company’s traffic gets priority over another company’s, which could lead to large media corporations silencing grassroots communication).

At the local network level, though, it means that you can ensure that certain traffic (like streaming Netflix videos) won’t be slowed down just because other, less important traffic (like an off-site backup job), is also flowing through your WAN connection.  DD-WRT makes all of this possible (and not too difficult) on the NAT/QoS->QoS tab.

NAT/QoS->QoS

In the first section, titled ‘Quality of Service (QoS)’, set the following options:

  • Start QoS => Enable
  • Port => WAN
  • Packet Scheduler => HTB
  • Uplink => (whatever your ISP gives you for an uplink speed)
  • Downlink => (whatever your ISP gives you for an downlink speed)

You may want to check out speedtest.net or a similar service to see what your uplink and downlink speeds are.  If you can get this information from your ISP, that would be better, since the more accurate these values are, the better this will work.  If you enter too high of a value, the shaping won’t kick in because the router will think that it has more bandwidth to paly with.  If you choose too low of a value, you will end up wasting bandwidth, and your router will not use it all.

Now, if you only ever watch Netflix from a device that won’t be sending low-prioirty traffic as well (such as a Wii or Roku box), you can just enter that device’s MAC address in the MAC Priority section.  Add the MAC address(es) and then select ‘Premium’ for the priority.

MAC Priority Settings

On the other hand, if you have a home server connected to your television, and you use this both as a file server (which runs off-site backup jobs to ensure your data is not lost in the event of fire, burglary, or other catastrophe) and as a media player, you will want more fine-grained control, since not all of the traffic to that device will have the same priority.

So, we will need to set up some Netmask Priority rules.  This will give traffic to/from Netflix a higher than normal priority.  Inspired by Jonathan Kamens, I first set my offsite backup (to Amazon’s S3 service) a lower than average priority.  Then, I followed the same approach to itentify the subnet used by Netflix to stream their movies.

Using Little Snitch, I learned that Netflix uses LibSyn’s content-delivery network to stream the data.  Specifically, I noticed a lot of traffic coming from netflix-380.vo.llnwd.net.  Now, that server alone is not enough, because no doubt every time you connect, you will get a different server int he pool (like netflix-379…, netflix-381… etc).  So, I got the IP address for this server using the ‘ping’ command:

[pkaeding@tripel:~] 22:35:43
% ping netflix-380.vo.llnwd.net
PING netflix-380.vo.llnwd.net (208.111.173.130): 56 data bytes
64 bytes from 208.111.173.130: icmp_seq=0 ttl=56 time=15.002 ms
64 bytes from 208.111.173.130: icmp_seq=1 ttl=56 time=16.956 ms
64 bytes from 208.111.173.130: icmp_seq=2 ttl=56 time=14.714 ms

Now that we have the IP address (208.111.173.130), we need to know what block of IP assignment it belongs to.  IP addresses are assigned to companies in blocks, so it is a good bet that we want to prioritize all traffic to that network in the same way.  The ‘whois’ command will help us learn this information:

[pkaeding@tripel:~] 20:26:16
% whois 208.111.173.130
GeekTools Whois Proxy v5.0.5 Ready.
Checking access for 67.174.196.72... ok.
Final results obtained from whois.arin.net.
Results:
#
# The following results may also be obtained via:
# http://whois.arin.net/rest/nets;q=208.111.173.130?showDetails=true&showARIN=false
#

NetRange:       208.111.128.0 - 208.111.191.255
CIDR:           208.111.128.0/18
OriginAS:       AS22822
NetName:        LLNW-3
...

What we are interested in is the ‘CIDR’ field.  This is what refers to the block of IP Addresses that we are trying to prioritize.  Go back to DD-WRT, and in the ‘Netmask Priority’ section, add an entry for this network.  Then, assign it to the ‘Premium’ priority.  (In the screenshot, you can see that I have the S3 network set to ‘Bulk’ as well as the Netflix traffic set to ‘Premium’.

Netmask Priority Settings

In the end, I can watch movies while my 130GB photo collection is copied to Amazon’s cloud service!

Posted in computers | Tagged , , , | 10 Comments

Experimenting with Panoramic Photography

On a recent backpacking trip to Yosemite National Park, I decided to experiment panoramic photos. There are so many astounding views from the heights above Pate Valley and the Grand Canyon of the Toulomne, I was hoping to capture at least a fraction of that beauty with my camera.

grand_canyon_of_the_toulumne2_resized

Now, I don’t have a fancy camera, it is just a Sony Cybershot DSC-N2 point & shoot variety. Don’t get me wrong, this is a great little camera; it is very compact goes anywhere, and takes great photos.  (I have been thinking of getting a nice DSLR soon, though, for my landscape/nature photography.)
Read More »

Posted in Uncategorized | Tagged , , , , | Leave a comment

Speed Improvements for Mapping Site

Here is just a quick update on my site that allows you to map multiple locations on Google Maps. If you use the site regularly, you may have noticed that it has been slow, and sometimes unresponsive, lately. (Also, you may have noticed some very wonky behavior today, but that was because I was tweaking it).

The site has been growing in popularity lately, and that has been causing some performance problems, as the server it runs on just couldn’t handle the load. As of today, I have added a second server to help share the load, and keep you guys plotting your maps!

As always, please let me know if you experience any problems or have any questions.

Posted in gmaps.kaeding.name, Uncategorized | Tagged | 3 Comments

Hexadecimal arithmetic in Google

Did you know that you can do hexadecimal arithmetic in Google? I didn’t, but I knew that Google’s calculator feature would often just do ‘the right thing’, so I decided to try it out.

I wanted to use the Google Chart API to create a grouped bar chart. I wanted each of the four bars in the group to be a different shade of blue. So, I picked two shades of blue to be my ‘book ends’. These book end colors were:

  • c6d9fd
  • 0000f9

Notice that the blue portion of those colors, ‘f9′, is the same. So, I wanted to find two shades of blue that were equally between those bookends. I needed to find the difference between c8d9 and 0000, and then divide that by three. Well, the fact that one of these book end numbers is zero makes this a bit easier:

c8d9 / 3

But how do I do this calculation on my handy desktop calculator? It only operates in base-10. As it turns out, you can get Google to do this calculation for you:

0xc6d9 / 3 Google Screenshot

I couldn’t get it to give me that result in hexadecimal, but at least now I know that 0xc8d9 / 3 = 16,968.3333 in decimal. Now, I just needed to find the two points that are in the middle of my two bookends. So, I need to calculate (in Google terms):

(0xc6d9 - 16968) in hex
(0xc6d9 - (16968 * 2)) in hex

In the end, I found my four colors:

  • c6d9fd
  • 8491f9
  • 4249f9
  • 0000f9

And then, I used these colors in my chart, and got a nice gradient effect in the bars:

Bar Chart Final Product

Posted in computers | Tagged , , , , | 1 Comment

a tip to prevent deadlocks on database connections (or, at least detect them early)

It seems there were a lot of points in our code base at work that are ripe for deadlocking on database connections. We are acquiring a connection, and then calling some other methods, and a few frames down the stack, we acquire another connection (before releasing the first). This, of course, can result in a deadlock, and it will only be detectable during PERF testing, which is always a bad time to discover a whole category of bugs in the code.

These deadlocks manifest themselves as ConnectionWaitTimeoutExceptions, with stack traces like this:

Caused by: com.ibm.websphere.ce.j2c.ConnectionWaitTimeoutException: Connection not available, Timed out waiting for 180003
	at com.ibm.ejs.j2c.FreePool.createOrWaitForConnection(FreePool.java:1615)
	at com.ibm.ejs.j2c.PoolManager.reserve(PoolManager.java:2422)
	at com.ibm.ejs.j2c.ConnectionManager.allocateMCWrapper(ConnectionManager.java:937)
	at com.ibm.ejs.j2c.ConnectionManager.allocateConnection(ConnectionManager.java:611)
	at com.ibm.ws.rsadapter.jdbc.WSJdbcDataSource.getConnection(WSJdbcDataSource.java:449)

Read More »

Posted in computers | Tagged , , , , , | Leave a comment

Bottle Conditioning in Growlers

Well, today seemed to be a busy day for people asking me beer-related questions on facebook. I like to repost things like this here, since the facebook wall doesn’t really stick around very long.

So, a friend of mine who is just getting into homebrewing, posed this question:

hey, So the directions I have say no screw top bottles. I was planning on filling mostly just growlers, is that cool? and why is it that the net has so much contradicting information? mostly about the times for fermenting and carbonating

Well, I’ve experimented some with bottle-conditioning in growlers, with some mixed (but never disastrous) results. I’ve also heard the warning from people on the Internet about bottle bombs.

Read on for my response, which I elaborated on somewhat to fit this format (my blog), since facebook imposes character limits on wall posts and comments.

[ad]

Read More »

Posted in homebrewing/beer | Tagged , , , | Leave a comment