Tuesday, October 22, 2013

Sturdy shipping tube for art

Since my last post, I've moved to Cambridge, MA. The movers damaged two "ink on parchment" (thangkas) I had, and the only repair person I could find is in New York City (btw, it's Alan Farancz Painting Conservation Studio and they do great work). I couldn't find a decent crate to ship the pieces in, and I also couldn't find a larger diameter shipping tube (so the art wouldn't be rolled too tightly), so I made my own:

I made this:
  1. Start with two foot section of six inch pvc pipe
  2. Get a 6" pvc pipe cap, use hacksaw to reduce the depth a bit, just to save a bit of weight and make it less lopsided-feeling. Glue pipe cap on pipe with pvc cement.
  3. Cut three pieces of cardboard circles to form cap at other end. I used wood glue to stick them to each other offset by ~60 degrees so that they support each other.
On the inside, I added foam and used some stiff paper to fill the middle and provide structure so that thangkas didn't collapse on themselves. I rolled everything up using a few layers of thin bubble wrap. Total cost was << $50. The tube itself was $16. Hopefully this is helpful to anyone else who is trying to figure out how to make a sturdy shipping tube.

Thursday, September 27, 2012

Offline reference for javascript, jquery, jquery-ui and d3.js

For anyone who'se looking to do some javascript/jquery/d3 hacking on a plane without internet, here's the API references I've been able to dig up.

HTML/CSS/SVG

The official spec at www.w3.org is fine as a reference and the non-draft standards have a PDF option to download the spec. See generally http://www.w3.org/standards/webdesign/, and for HTML/CSS/SVG specifically the most recent ones as of this post seem to be:

Javascript

The best doc I could find is in CHM (windows help file format). You can read this file with xchm (e.g., sudo aptitude install xchm). The file itself is at: http://starcraft73.tripod.com/javascript/javascript.zip

Jquery and Jquery-UI

There's a single CHM file that includes docs for both jquery and jquery-ui at https://github.com/Yahasana/jqdoc-parser/blob/master/jQuery-UI-Reference-1.8.chm?raw=true There's a PDF version of just JQuery at https://bitbucket.org/greydwarf/jquerydoc/downloads/jquery_ref.pdf

D3.js

Getting D3 docs available offline requires a bit more work. Following roughly this guide, here are the steps:
  1. sudo aptitude install libxml2-dev libxslt-dev ruby1.8
  2. gem install gollum
  3. git clone https://github.com/mbostock/d3.wiki.git d3.wiki
  4. cd d3.wiki ; gollum
  5. Navigate your browser to http://localhost:4567/ or whatever port gollum starts up on (it prints it out when it starts up).

Monday, September 24, 2012

Repairing crashing Juniper VPN client on Ubuntu 12.04

In case anyone else is running into issues with their juniper VPN client on Ubuntu, here are two tricks that work for me. First, if it looks like the applet is crashing as it is establishing a connection, it could be because your /etc/resolv.conf is broken or missing. Try following: which details running sudo dpkg-reconfigure resolvconf to restore resolve.conf. There's probably a bug in juniper VPN client that makes it crash if resolv.conf is not to its liking. Another blunt thing I've sometimes had success with is good old rm -rf ~/.juniper_networks, which removes the applets and juniper config information and forces it to redownload it. Hope this helps!

Sunday, August 21, 2011

How to stream audio from mog.com on Ubuntu laptop to remote linux box

The problem: I recently got a linux set-top box that I have connected to my stereo in my living room. I use the internet music service mog.com and I'd like to be able to play it on my stereo and control it from my linux laptop.

I've tried lots of approaches that didn't work, like using vnc/nx/etc and setting up pulseaudio with module-tunnel-sink.

The way that seems to work the best for me is to first, setup pulseaudio on the settop box to install the module-native-protocol-tcp by adding the following line to /etc/pulse/default.pa:

load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16

and restart pulseaudio with:

pulseaudio --kill ; pulseaudio --start

This tells pulseaudio to accept network connections from other machines on the local network.

Then, on my laptop, I run google-chrome as follows:

PULSE_SERVER=tcp:[settop box hostname] google-chrome --user-data-dir=/home/redstone/tmp/chrome-mog --app=http://mog.com

This starts a separate chrome session that will stream audio to the settop box. Note: you are free to simultaneously start google-chrome without the flags and start a google chrome sessions that will use your local laptops speakers as well. The reason for the user-data flags is that you can only specify the pulse server to use when chrome starts a new session, and if you don't start chrome with the user-data flags, it will just open a new window in your existing chrome session rather than start a new one.

You may want to run:
PULSE_SERVER=tcp:[settop box hostname] pavucontrol
to fiddle with the audio settings on the settop box.

I suspect that this approach should work with any other internet music streaming service like spotify/pandora/etc.

Saturday, August 20, 2011

Back and internal pictures of Niles Audio PS-1 Phono/Aux A-B Switcher

For those of you who are considering buying a Niles Audio PS-1 and are wondering what it looks like on the back and inside, I took a few pics. Here they are:







Subscribing to a twitter feed in Google reader

Google reader is a bit picky about the types of feed URLs you can paste into it to subscribe to feeds. I found that the following works:

http://api.twitter.com/1/statuses/user_timeline/[username].atom

where you substitute [username] for the actual usename. For example, to subscribe in google reader to Facebook's twitter feed (http://twitter.com/#!/facebook) you click on 'Add a subscription' in reader.google.com and paste in:

http://api.twitter.com/1/statuses/user_timeline/facebook.atom

There is more documentation on this API at https://dev.twitter.com/docs/api/1/get/statuses/user_timeline. It's listed at the bottom in the 'Extended description' section with the words 'not recommended' :). The 'recommended' API, using URL parameters, doesn't work in google reader. Further note: I initially tried getting RSS feed format to work and didn't have any luck.

Plotting the ratio of two stocks

I found a website, stockcharts.com, that let's you plot the ratio of two stocks. In the 'symbol' field, you specify the two stocks separated by a ':'. For example, "goog:$SPX" to plot the ratio of Google and the S&P 500. As a side note, there is a link partway down, 'linkable version' that let's you bookmark the chart. A recent one I was interested in:

GOOG versus S&P 500 over the past year