tag:blogger.com,1999:blog-102494702024-02-22T08:07:35.491-08:00amohrRandom thoughts I'd like to shareAlex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.comBlogger26125tag:blogger.com,1999:blog-10249470.post-19069280815085181582020-06-01T01:30:00.000-07:002020-06-01T01:30:27.200-07:00Fixing random volume on Cambridge Soundworks FPS2000<div class="tr_bq">
<span style="font-family: "arial" , "helvetica" , sans-serif;">Back before 2000, I bought a Cambridge Soundworks FPS 2000 in Berkely to go along with my Creative SoundBlaster Live. To this day I think it was one of the best purchases I made. The price wasn't too much for the time, and the sound was awesome for the price. So good was it that I still have it to this day. </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Unfortunately as time has passed it suffered some damage. I first had to replace the volume connector due to a bad connection, which ended up being easy because it's just a PS/2 connector. The recent issue was more complicated. While playing music the volume would randomly go soft, and then eventually roar back on its own. Given it was a periodic issue I felt like it must be due to an issue similar that what I fixed on my <a href="http://hesiod.blogspot.com/2016/01/how-to-fix-humming-on-polk-psw111.html" target="_blank">Polk subwoofer</a>. So I took it apart, and wow were there a lot of electrolytic capacitors. </span></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">Here's a partial list:</span></span><br />
<blockquote>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><u>main board</u></span> </span></blockquote>
<blockquote>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;">c3 + c3a + c3b + c3c + c2a + c14 + + c4c + c4 + c4b +c11 c4a + c3: 1uf 50v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c39: 10uf 35v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c40: 100uf 16v</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c41: 100uf 25v</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c42: 220uf 25v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c26 + c25: 470uf 16v</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c22: 470uf 25v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c42: 220uf 25v</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c27: 47uf 25v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c33 c30 c28: 4700uf 25v</span></span></blockquote>
<blockquote>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><u>side board</u></span> </span></blockquote>
<blockquote>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;">c100a: 470uf x4 16v</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c102: 10uf 35v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">c101: 0.47 50v</span><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span></span></blockquote>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"></span><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">So I went ahead and bought a "few" capacitors and a tester:</span></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<table><tbody>
<tr> <td><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=qf_sp_asin_til&ad_type=product_link&tracking_id=thehesiod0e-20&marketplace=amazon&region=US&placement=B07TWCT2ZB&asins=B07TWCT2ZB&linkId=d5755760f34a8a992456e39daaafa61a&show_border=false&link_opens_in_new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff" style="height: 240px; width: 120px;"><br />
</iframe></td> <td><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=thehesiod0e-20&marketplace=amazon&region=US&placement=B07PJW24LH&asins=B07PJW24LH&linkId=0e57bd77f307935c667c2a17a25dc615&show_border=false&link_opens_in_new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff" style="height: 240px; width: 120px;"><br />
</iframe></td><td><iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=thehesiod0e-20&marketplace=amazon&region=US&placement=B07C5LC486&asins=B07C5LC486&linkId=251a20fd9aa7303aa984e7126700857e&show_border=false&link_opens_in_new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff" style="height: 240px; width: 120px;"><br />
</iframe></td> </tr>
</tbody></table>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">I took my Hakko 808 (<a href="https://www.hakkousa.com/products/desoldering/hakko-808-desoldering-tool-6069.html">https://www.hakkousa.com/products/desoldering/hakko-808-desoldering-tool-6069.html</a> desoldering gun, which makes light work of removing parts, not sure what the best replacement is, perhaps this):<br />
<iframe frameborder="0" marginheight="0" marginwidth="0" scrolling="no" src="//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=thehesiod0e-20&marketplace=amazon&region=US&placement=B07BFVFMS9&asins=B07BFVFMS9&linkId=b50cfe5b27e9f1baba60b369fddaefe5&show_border=false&link_opens_in_new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff" style="height: 240px; width: 120px;"><br />
</iframe><br />w</span><span style="font-family: "arial" , "helvetica" , sans-serif;">ent ahead and opened it up and found this little guy (C42) in there that looked suspicious:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDcdgU8JwLjyogZJWjKkyKUpYVC_C_Jp2ubydVp_4sdHC5kygzmOnAh2ikYxJwYKh-d2RJeOdzGx0HqO7Q_l5Rh4rvWOSeObh3JllAcUp3w7KMd1c_FbEkynMdMVRXaRQFoZIY5w/s1600/IMG_20200531_162606.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDcdgU8JwLjyogZJWjKkyKUpYVC_C_Jp2ubydVp_4sdHC5kygzmOnAh2ikYxJwYKh-d2RJeOdzGx0HqO7Q_l5Rh4rvWOSeObh3JllAcUp3w7KMd1c_FbEkynMdMVRXaRQFoZIY5w/s320/IMG_20200531_162606.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9cB-K2utXwJrfHEGcH6Cw6eaxfFY4nm_bUyDDMbz6x9VeSTAD-X5ZfYZFnBSQLMUxLroALduQ31LZywn7MytYWdw9rLP4R-EhYvt4I6zIlMOwJq2G9F_VA0Bpagm9pHsoVs5jlQ/s1600/IMG_20200531_162621.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh9cB-K2utXwJrfHEGcH6Cw6eaxfFY4nm_bUyDDMbz6x9VeSTAD-X5ZfYZFnBSQLMUxLroALduQ31LZywn7MytYWdw9rLP4R-EhYvt4I6zIlMOwJq2G9F_VA0Bpagm9pHsoVs5jlQ/s320/IMG_20200531_162621.jpg" width="240" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgonXNxxpXVLBAYpCkadVtIT_tV9e2puIm4uNGOK89IurCw_UWBdIz5uTebKs20lcD-5q1JvoVd_C1EG3XKsGi3sGnKg69AyLdFN92uiq397Vxk__an-eN27FdnvJIEh7L8-ezKyA/s1600/IMG_20200531_162601.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgonXNxxpXVLBAYpCkadVtIT_tV9e2puIm4uNGOK89IurCw_UWBdIz5uTebKs20lcD-5q1JvoVd_C1EG3XKsGi3sGnKg69AyLdFN92uiq397Vxk__an-eN27FdnvJIEh7L8-ezKyA/s320/IMG_20200531_162601.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">You'll note the top of the capacitor has a small hole and some yellow gunk. Also suspicious in that it's a different color than most of the other capacitors. I put it in the tester (I have to say this little guy is really neat) and measured this:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG0zFd2VQu8HGRgt0p52kYcYrAh0Uss0w40L22yw65CYWy5MxgW2QJSyy7JDRtj9quQv7xrTaYQbPDLSH_qVzwdB6byDdFmmIT8M_buYiZB-gUHvgvagwY7le63o0ZWlB01uK8UA/s1600/MVIMG_20200531_162615.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1600" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhG0zFd2VQu8HGRgt0p52kYcYrAh0Uss0w40L22yw65CYWy5MxgW2QJSyy7JDRtj9quQv7xrTaYQbPDLSH_qVzwdB6byDdFmmIT8M_buYiZB-gUHvgvagwY7le63o0ZWlB01uK8UA/s320/MVIMG_20200531_162615.jpg" width="240" /></a></div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">This guy is supposed to be 220 uF and not pF so something is very wrong with it. I went ahead replaced it, put it all back together and success! :) Hope this helps someone!</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com7tag:blogger.com,1999:blog-10249470.post-49197617573103359442019-01-04T02:14:00.000-08:002019-01-04T02:14:28.066-08:00Removing old Injector Seats from Audi A4<span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">I have a 2001 Audi A4 1.8T. </span><span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">I'm in the process of overhauling the injector an PCV systems as the injectors were leaking, and the PCV system is leaking all over the place after > 220,000 miles. </span><br />
<span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;"><br /></span>
<span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">There are several articles talking about how to remove these, and there are strategies like removing them when the engine is hot, using ethanol, acetone, and using the right hex tool (2001 is 20mm), however these strategies fail spectacularly at this age as the cups just disintegrate because the plastic has gone brittle. So don't </span><span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">waste your time trying to find a 20mm tool at that point. It doesn't matter what tool you use they're nearly impossible to remove cleanly at that age.</span><br />
<br style="background-color: #f9f9f9; box-sizing: border-box; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;" /><span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">The strategy I've come up over the last few hours that seems to work is chiseling out the cap on the top, and the tail at the bottom, and then grinding out the bulk in the middle with round wood sand paper moto tool attachment, and then using a round steel brush moto attachment to grind out the plastic bits from the threads. There's a strategy to the steel brush tool, you basically use speed 4 or so, and then push straight down into the thread until you can see the metal, and then move to a new spot. After you can see the threads, can can press down a little more to grind a bit into the threads, the threads sound be ok with this. Then you start picking away with a precision flat head screwdriver. If you're lucky, the heat from the metal brush detaches the plastic from the epoxy so you can carefully peel away a few rounds of the plastic from the threads. After all the plastic comes you, the really time intensive part starts, that's picking out the epoxy that's glued to the threads. Here you have to use the precision flat head screw driver and leverage against the edge of the cup and start scraping following the threads. Eventually you'll figure out the amount of pressure you need to remove the bulk.</span><br style="background-color: #f9f9f9; box-sizing: border-box; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;" /><br style="background-color: #f9f9f9; box-sizing: border-box; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;" /><span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">After it looks good, you'll put the new cups in and find out that it sticks in certain areas, and now comes round 2 of the scraping with the screw drivers.</span><br style="background-color: #f9f9f9; box-sizing: border-box; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;" /><br style="background-color: #f9f9f9; box-sizing: border-box; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;" /><span style="background-color: #f9f9f9; color: #222222; font-family: Verdana, geneva, lucida, "lucida grande", arial, helvetica, sans-serif; font-size: 13.33px;">HOURS of fun. After one night I'm half way done <sigh>. After all this work I'm chucking my new plastic cups and just ordered a set of billet cups. NEVER AGAIN.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-6805192109909194342018-10-02T21:19:00.000-07:002018-10-02T21:19:25.063-07:00Review of Kirkland Signature Rotisserie Chicken Noodle Soup<span style="font-family: Arial, Helvetica, sans-serif;">In two words, very good. Another two, highly recommended :) A perfect pairing is with the Kirkland Potato Chive Focaccia, yum.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-58657600457418581852018-05-23T15:05:00.003-07:002018-05-23T16:12:11.665-07:00tracking memory leaks in python<span style="font-family: "arial" , "helvetica" , sans-serif;">Tracking leaks in python is difficult for a multitude of reasons:</span><br />
<br />
<ol>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">It's GC'd language, which means things don't get freed immediately</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">It uses pool allocators</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">the re module has a cache of compiled expressions</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">tracemalloc may not give you good call stacks: <a href="https://bugs.python.org/issue33565">https://bugs.python.org/issue33565</a></span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">the ThreadPoolExecutor creates a thread per submit until you hit max_workers, default max workers is os.cpu_count() * 5</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">When using tracemalloc it will consume memory for using the traces</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">When using modules like request/aiohttp/aiobotocore/etc which use sockets they typically have a pool of connections whose size may fluctuate over time</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">memory fragmentation</span></li>
</ol>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">Here are a set of work-arounds around these issues</span></div>
<div>
<ol>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">gc.collect() from a place that isn't holding onto object references when you want a stable point)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">from 3.6 forwards use PYTHONMALLOC=malloc</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">call re._cache.clear() from a similar place to #1</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">no known work-around (I'm trying tohelp ensure it does something better in the future)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">when you start tracemalloc ensure you start after all the threads have been created, this means you've submitted at least max_worker jobs to the pools. Another hack is temporarily changing the ThreadPoolExecutor to create all threads on first submit</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Don't rely on RSS when using tracemalloc</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Try to make the pool sizes 1</span></li>
<li><span style="font-family: arial, helvetica, sans-serif;">Run your leak tests for longer periods, or if using large chunks of memory try to reduce the chunk sizes</span></li>
</ol>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br /></span></div>
</div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;">The way I approach it is two-fold:</span></div>
<div>
<ol>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Try to use tracemalloc to figure out specifically where leaks are coming from, I use a helper like: <a href="https://gist.github.com/thehesiod/2f56f98370bea45f021d3704b21707a9">https://gist.github.com/thehesiod/2f56f98370bea45f021d3704b21707a9</a></span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">using memory_profiler module to binary search through the codebase to figure out what is causing a leak from a high-level. This basically means disabling parts of your application until you find the trigger.</span></li>
</ol>
<div>
<br /></div>
</div>
<div>
<br /></div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-20163679609488086422018-02-03T16:33:00.000-08:002018-02-03T16:33:02.442-08:00Epson Document Capture Pro Crash Recovery<span style="font-family: Arial, Helvetica, sans-serif;">Today I was scanning about a thousand pages of documents with Document Capture Pro and my Epson DS-510. I had already scanned several hundred pages without issue and was on the last batch of 200 so as I hit save I decoded to let me wife start shredding what I had scanned...and sure enough about half way through saving it crashed....nooooooo!</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I looked in the target folder and there was no trace of file...I was hoping that it would have written out half the file but no luck. My last hope was that there was a temporary file with some of the document somewhere. So I fired up process monitor and tried saving a sample scan and saw it was writing to AppData\Local\Temp. So I start looking around and low and behold there's a EpsonScanIO folder with all the lost images!</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">phew!</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">Hope this tip saves people some time!</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-19291046292893113792017-10-03T16:03:00.002-07:002017-10-03T16:49:59.685-07:00mocking AWS Lambdas<span style="font-family: "arial" , "helvetica" , sans-serif;">When dealing with AWS services it can be tedious mocking the endpoints. Luckily there's a wonderful module called <a href="https://github.com/spulec/moto" target="_blank">moto</a> which takes care of this for you. moto supports a majority of the AWS backends in various degrees of completeness. Recently <a href="https://github.com/spulec/moto/pull/1048" target="_blank">I overhauled</a> the lambda backend and added support for running lambdas in the environment they're specified to run in (JS, python, etc) as well as linking to SNS events and cloudwatch logging.</span><br />
<div><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span></div><div><span style="font-family: "arial" , "helvetica" , sans-serif;">In my use-case I had:</span></div><div><ol><li><span style="font-family: "arial" , "helvetica" , sans-serif;">My test-cases running on bare-metal, including:</span></li>
<ol><li><span style="font-family: "arial" , "helvetica" , sans-serif;">Mocking sns, lambda, s3, kms, logs, and cloudwatch endpoints via moto.</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Registering an AWS lambda that connects to a mocked SNS endpoint</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Mocked google endpoints via custom aiohttp server</span></li>
</ol><li><span style="font-family: "arial" , "helvetica" , sans-serif;">docker container which forwarded messages from a Google PubSub endpoint (mocked via <a href="https://cloud.google.com/pubsub/docs/emulator" target="_blank">PubSub Emulator</a>) to the SNS moto mocked endpoint which triggered the mocked lambda. </span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Another container that registered subscriptions from mocked google services to PubSub endpoint, along with occasionally triggering lambda via SNS endpoint</span></li>
</ol><div><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span></div></div><div><span style="font-family: "arial" , "helvetica" , sans-serif;">Each moto mock endpoint was created via my helper class:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span></div><div><pre><code class="language-python">class MotoService:
""" Will Create MotoService.
Service is ref-counted so there will only be one per process. Real Service will
be returned by `__aenter__`."""
_services: Dict[str, Any] = dict() # {name: instance}
def __init__(self, service_name: str, port: int=None):
self._service_name = service_name
if port:
self._socket = None
self._port = port
else:
self._socket, self._port = get_free_tcp_port()
self._thread = None
self._logger = logging.getLogger('MotoService')
self._refcount = None
self._ip_address = get_ip_address()
@property
def endpoint_url(self):
return 'http://{}:{}'.format(self._ip_address, self._port)
def __call__(self, func):
async def wrapper(*args, **kwargs):
await self._start()
try:
result = await func(*args, **kwargs)
finally:
await self._stop()
return result
functools.update_wrapper(wrapper, func)
wrapper.__wrapped__ = func
return wrapper
async def __aenter__(self):
svc = self._services.get(self._service_name)
if svc is None:
self._services[self._service_name] = self
self._refcount = 1
await self._start()
return self
else:
svc._refcount += 1
return svc
async def __aexit__(self, exc_type, exc_val, exc_tb):
self._refcount -= 1
if self._socket:
self._socket.close()
self._socket = None
if self._refcount == 0:
del self._services[self._service_name]
await self._stop()
@staticmethod
def _shutdown():
req = flask.request
shutdown = req.environ['werkzeug.server.shutdown']
shutdown()
return flask.make_response('done', 200)
def _create_backend_app(self, *args, **kwargs):
backend_app = moto.server.create_backend_app(*args, **kwargs)
backend_app.add_url_rule('/shutdown', 'shutdown', self._shutdown)
return backend_app
def _server_entry(self):
self._main_app = moto.server.DomainDispatcherApplication(self._create_backend_app, service=self._service_name)
self._main_app.debug = True
if self._socket:
self._socket.close() # release right before we use it
self._socket = None
moto.server.run_simple(self._ip_address, self._port, self._main_app, threaded=True)
async def _start(self):
self._thread = threading.Thread(target=self._server_entry, daemon=True)
self._thread.start()
async with aiohttp.ClientSession() as session:
for i in range(0, 10):
if not self._thread.is_alive():
break
try:
# we need to bypass the proxies due to monkeypatches
async with session.get(self.endpoint_url + '/static/', timeout=0.5):
pass
break
except (asyncio.TimeoutError, aiohttp.ClientConnectionError):
await asyncio.sleep(0.5)
else:
await self._stop() # pytest.fail doesn't call stop_process
raise Exception("Can not start service: {}".format(self._service_name))
async def _stop(self):
try:
async with aiohttp.ClientSession() as session:
async with session.get(self.endpoint_url + '/shutdown', timeout=5):
pass
except:
self._logger.exception("Error stopping moto service")
raise
finally:
self._thread.join()
</code></pre><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span></div><div><span style="font-family: "arial" , "helvetica" , sans-serif;">My setUpClass looked something like the following:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><br />
<pre><code class="language-python">@classmethod
def setUpClass(cls):
cls._pubsub_port = get_free_tcp_port(True)
cls._gcloud_enumlator = subprocess.Popen(["gcloud", "beta", "emulators", "pubsub", "start", "--host-port={}:{}".format(IP_ADDRESS, cls._pubsub_port)], preexec_fn=os.setsid)
boto_service_names = {'sns', 'lambda', 's3', 'kms', 'logs', 'cloudwatch'}
cls._boto_svcs = {}
async def start_svc(svc_name):
cls._boto_svcs[svc_name] = await MotoService(svc_name).__aenter__()
try:
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.gather(*[start_svc(svc_name) for svc_name in boto_service_names]))
cls._mock_env_vars = {'{}_mock_endpoint_url'.format(name): svc.endpoint_url + '/' for name, svc in cls._boto_svcs.items()}
cls._mock_env_vars['PUBSUB_EMULATOR_HOST'] = '{}:{}'.format(IP_ADDRESS, cls._pubsub_port)
cls._mock_env_vars['AWS_DEFAULT_REGION'] = AWS_DEFAULT_REGION
for name, value in cls._mock_env_vars.items():
os.environ[name] = value
session = botocore.session.get_session()
cls._boto_clients = {svc_name: session.create_client(svc_name) for svc_name in boto_service_names}
except:
cls.tearDownClass()
raise
</code></pre><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">After which things like S3/KMS were set up. One of the more interesting ones was the lambda function which connected to SNS which looked like this:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<pre><code class="language-python">with open(os.path.join(CURRENT_DIR, '..', 'lambda_image', 'lambda_labeler_image.zip'), 'rb') as zip_file:
lambda_response = self._boto_clients['lambda'].create_function(
FunctionName=LAMBDA_FUNCTION_NAME, Runtime='python3.6',
Role='test-iam-role', Handler='lambda_function.lambda_handler',
Timeout=15, MemorySize=128, Publish=True,
Code={'ZipFile': zip_file.read()},
Environment={
'Variables': {**mock_env_vars, 'LOG_LEVEL': str(logging.DEBUG), 'UNITTEST': 'true'}
})
# now subscribe lambda function to SNS topic
self._boto_clients['sns'].subscribe(TopicArn=self._sns_topic_arn, Protocol='lambda', Endpoint=lambda_response['FunctionArn'])
</code></pre><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Note I forward the *_mock_endpoint_urls via environment variables.<br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">I linked all the containers via a docker compose file that had something like the following: </span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;"></span><br />
<pre><code class="language-yaml">environment:
- AWS_ACCESS_KEY_ID=dummy
- AWS_SECRET_ACCESS_KEY=dummy
- sns_mock_endpoint_url=${sns_mock_endpoint_url}
- lambda_mock_endpoint_url=${lambda_mock_endpoint_url}
- s3_mock_endpoint_url=${s3_mock_endpoint_url}
- kms_mock_endpoint_url=${kms_mock_endpoint_url}
- logs_mock_endpoint_url=${logs_mock_endpoint_url}
- google_mock_endpoint_url=${google_mock_endpoint_url}
- PUBSUB_EMULATOR_HOST=${PUBSUB_EMULATOR_HOST}
- AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION}
</code></pre><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">Now each container (including the lambda) ran the following to enable API call forwarding to the mocked endpoint:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<pre><code class="language-python">def _wrapt_boto_create_client(wrapped, instance, args, kwargs):
def unwrap_args(service_name, region_name=None, api_version=None,
use_ssl=True, verify=None, endpoint_url=None,
aws_access_key_id=None, aws_secret_access_key=None,
aws_session_token=None, config=None):
if endpoint_url is None:
endpoint_url = os.environ.get('{}_mock_endpoint_url'.format(service_name))
return wrapped(service_name, region_name, api_version, use_ssl, verify,
endpoint_url, aws_access_key_id, aws_secret_access_key,
aws_session_token, config)
return unwrap_args(*args, **kwargs)
def patch_boto():
"""
Will patch botocore to set endpoint_url to: {SERVICE_NAME}_endpoint_url if
available
"""
wrapt.wrap_function_wrapper(
'botocore.session',
'Session.create_client',
_wrapt_boto_create_client
)
_redir_prefix = {
'https://www.googleapis.com/',
'https://accounts.google.com/',
'https://people.googleapis.com/'
}
def _replace_url_prefix(url: str, redir_endpoint: str):
if not redir_endpoint:
return url
if url.startswith(redir_endpoint):
return url
for prefix in _redir_prefix:
if url.startswith(prefix):
url = url.replace(prefix, redir_endpoint)
return url
assert False
def _wrapped_discovery_resource_init(wrapped, instance, args, kwargs):
redir_endpoint = os.environ.get('google_mock_endpoint_url')
def unwrap_args(http, baseUrl, model, requestBuilder, developerKey,
resourceDesc, rootDesc, schema):
baseUrl = _replace_url_prefix(baseUrl, redir_endpoint)
return wrapped(http, baseUrl, model, requestBuilder, developerKey,
resourceDesc, rootDesc, schema)
return unwrap_args(*args, **kwargs)
def _wrapped_oath2_credentials_init(wrapped, instance, args, kwargs):
redir_endpoint = os.environ.get('google_mock_endpoint_url')
def unwrap_args(access_token, client_id, client_secret, refresh_token,
token_expiry, token_uri, user_agent, revoke_uri=None,
id_token=None, token_response=None, scopes=None,
token_info_uri=None):
revoke_uri = _replace_url_prefix(revoke_uri, redir_endpoint)
token_uri = _replace_url_prefix(token_uri, redir_endpoint)
return wrapped(access_token, client_id, client_secret, refresh_token, token_expiry,
token_uri, user_agent, revoke_uri, id_token, token_response, scopes, token_info_uri)
return unwrap_args(*args, **kwargs)
def patch_google_client():
wrapt.wrap_function_wrapper(
'googleapiclient.discovery',
'Resource.__init__',
_wrapped_discovery_resource_init
)
wrapt.wrap_function_wrapper(
'oauth2client.client',
'OAuth2Credentials.__init__',
_wrapped_oath2_credentials_init
)
# Run in start-up code
test_mock_endpoints = {name: value for name, value in os.environ.items() if name.endswith("_mock_endpoint_url")}
if test_mock_endpoints:
patch_boto()
test_google_endpoint_url = os.environ.get('google_mock_endpoint_url')
if test_google_endpoint_url:
patch_google_client()
</code></pre><span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span><span style="font-family: "arial" , "helvetica" , sans-serif;">Along with several helpers, my test-case would look something like this:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<pre><code class="language-python">user_svc = self._google_svcs.dir_svc.users[ADMIN_EMAIL]
# personal address
headers = {
'Date': email.utils.format_datetime(datetime.utcnow().replace(tzinfo=timezone.utc), True),
'From': "{}".format(personal_email_addr),
'To': '{} <{}>'.format(user_svc.user_obj['primaryEmail'], user_svc.user_obj['name']['fullName']),
'Subject': "Dummy",
}
archive_msg_obj = user_svc.add_message([ARCHIVE_LABEL_NAME, 'FOLDER'], headers, 'dummy message')
await self._wait_for_log_entry("Finished processing messages for user: {}".format(ADMIN_EMAIL))
for msg in user_svc.messages.values():
lbl_names = user_svc.get_lbl_names(msg['labelIds'])
self.assertEqual(set(lbl_names), {EXPECTED_LABEL_NAME, 'FOLDER'})
</code></pre><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">This way each container and lambda invocation will forward AWS + <a href="https://developers.google.com/gmail/api/v1/reference/" target="_blank">Google client API</a> calls to the mocked endpoints. The end result is that by hitting a mocked google endpoint, a message would get published to the mocked google PubSub endpoint, triggering the message to get forwarded to a moto mocked SNS endpoint, triggering a lambda, which would log to cloudwatch, and be picked up by my test-case. If others are interested in the google endpoint mock I can amend this post with that information as well. All in all I'm really happy with the workflow as it duplicates running in production almost exactly </span><span style="font-family: "arial" , "helvetica" , sans-serif;">with minimal changes to the production code, </span><span style="font-family: "arial" , "helvetica" , sans-serif;">helping ensure no issues pop up when pushed to production.</span></div>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com1tag:blogger.com,1999:blog-10249470.post-23300911727719162932017-01-11T18:17:00.000-08:002017-10-03T16:50:54.536-07:00Python not as slow as you may think<span style="font-family: "arial" , "helvetica" , sans-serif;">I've read a lot of articles about how python is slow and you need to use modules like numpy to speed things up like: <a href="http://www.labri.fr/perso/nrougier/from-python-to-numpy/">http://www.labri.fr/perso/nrougier/from-python-to-numpy/</a> where it was claimed that numpy was an order of magnitude slower than Python.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">I decided to try one of the first examples out on my own, it resulted in the following script:</span><br />
<br />
<pre><code class="language-python">import random
import numpy as np
from timeit import timeit
Z1 = random.sample(range(1000), 100)
Z2 = random.sample(range(1000), 100)
def add_python():
return [z1+z2 for (z1, z2) in zip(Z1, Z2)]
def add_numpy():
return np.add(Z1, Z2)
assert add_python() == add_numpy().tolist()
setup_str = "from __main__ import Z1, Z2, add_python, add_numpy"
print("add_python:", timeit("add_python()", setup_str))
print("add_numpy:", timeit("add_numpy()", setup_str))
</code></pre><br />
<br />
<span style="font-family: "arial" , "helvetica" , sans-serif;">The result is that in both python 3.5.2 and 2.7.13 python is in fact faster than numpy :)</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-58706079524851837492016-09-10T23:50:00.000-07:002016-09-11T00:07:02.295-07:00How to Make a Great Homemade Pulled Pork Sandwich without the Fuss<span style="background-color: white; color: #1d2129; font-family: "arial" , "helvetica" , sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">We just put together a really tasty pulled pork sandwich so I want to both share it with everyone and record it so we can make it again! :)</span><br />
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">We started by buying a big package of pork from <a href="http://www.costco.com/" target="_blank">Costco</a> since it's cheap, freezes well, and is easy to make. So we bought a 4 pack of Pork Sirloin Tip Roast from costo, ended up being a little over 8 pounds. We immediately put it in the freezer.</span><br />
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">A couple days when we were ready to have some pulled pork we put contents of one frozen package of the pork in a slow cooker for ~20hrs following this recipe: </span><span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><a href="http://allrecipes.com/recipe/24035/kalua-pig-in-a-slow-cooker">http://allrecipes.com/recipe/24035/kalua-pig-in-a-slow-cooker</a></span><br />
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">After it was done we put it in the fridge.</span><br />
<span style="background-color: white; color: #1d2129; font-family: "arial" , "helvetica" , sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><br /></span>
<span style="background-color: white; color: #1d2129; font-family: "arial" , "helvetica" , sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">When we were ready for the sandwich we went to whole foods and bought a package of their pre-cut slaw packages from the refrigerated pre-cut section, and a few items we were missing from this slaw recipe: </span><span style="background-color: white; color: #1d2129; font-family: "arial" , "helvetica" , sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><a href="http://www.foodnetwork.com/recipes/robert-irvine/cole-slaw-recipe0.html">http://www.foodnetwork.com/recipes/robert-irvine/cole-slaw-recipe0.html</a>, except we changed the white wine vinegar with apple cider vinegar. We bought what turned out to be an awesome BBQ Sauce: Mild <a href="http://www.everettandjones.com/" target="_blank">Everett & Jones</a> Super-Q sauce, which happens to be made here locally in the bay area. We also bought a wonderful sandwich bread: </span><span style="background-color: white; color: #1d2129; font-family: "arial" , "helvetica" , sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"> <a href="https://www.beckmannsbakery.com/shop/shape/rolls-deli/francese-italian-deli-rolls" target="_blank">Beckmann's Francese Deli Roll.</a></span><br />
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;"><br /></span>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmFCJaWuNu-2E05KY8lZVJ0jvHAAyF0bvun5jpRBtgyJFYvXf80uCdci4CEhtfBJSRsUGBG8Kb12bLzI_IvV4_JXR2wB5SwgHnOjYP3rKhbwJIva46upYBkXAjqhrz5co8yq1r3w/s1600/pork+sandwich.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="298" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmFCJaWuNu-2E05KY8lZVJ0jvHAAyF0bvun5jpRBtgyJFYvXf80uCdci4CEhtfBJSRsUGBG8Kb12bLzI_IvV4_JXR2wB5SwgHnOjYP3rKhbwJIva46upYBkXAjqhrz5co8yq1r3w/s400/pork+sandwich.jpg" width="400" /></a></div>
<span style="background-color: white; color: #1d2129; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">We then mixed the ingredients from the recipe for the slaw sauce and mixed it with the cut slaw (5 minutes), and lightly toasted the bread.</span><br />
<br />
<span style="background-color: white; clear: left; color: #1d2129; display: inline !important; font-family: arial, helvetica, sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; margin-bottom: 1em; margin-right: 1em; white-space: pre-wrap;">All what was left was mounting the sandwich and enjoying a wonderful meal! Personally we finished this with some carrot juice, but if you have some sweet tea I think it would have made it perfect.</span><br />
<div class="" data-block="true" data-editor="8k76d" data-offset-key="6rvev-0-0" style="background-color: white; color: #1d2129; font-family: "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">
<div class="_1mf _1mj" data-offset-key="6rvev-0-0" style="direction: ltr; position: relative;">
<span style="font-family: "arial" , "helvetica" , sans-serif;"><span style="letter-spacing: -0.24px;">
</span> <span style="letter-spacing: -0.24px;">d-lish ;)</span></span></div>
</div>
<div class="" data-block="true" data-editor="8k76d" data-offset-key="vkem-0-0" style="background-color: white; color: #1d2129; font-family: "San Francisco", -apple-system, BlinkMacSystemFont, ".SFNSText-Regular", sans-serif; font-size: 14px; letter-spacing: -0.24px; line-height: 18px; white-space: pre-wrap;">
</div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0San Jose, CA, USA37.3382082 -121.8863286000000136.933999199999995 -122.53177560000002 37.7424172 -121.24088160000001tag:blogger.com,1999:blog-10249470.post-81023277818100850942016-01-24T11:40:00.001-08:002017-09-19T13:12:26.864-07:00How to fix humming on the Polk PSW111<span style="font-family: "arial" , "helvetica" , sans-serif;">A few months ago I started noticing that even when I wasn't using my receiver my sub-woofer was making popping sounds at about 1 pop a second. Since I had purchased the</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> sub-woofer about 3 years ago the warranty</span><span style="font-family: "arial" , "helvetica" , sans-serif;"> had expired so I was going to have to either fix it myself or get a new one. Given a new one is ~$150 I decided to try fixing it.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">Since the popping noise was periodic I figured it was probably a capacitor that had gone bad. These are the capacitors I replaced and what you'll need. Note that I'm not sure which/what combination of these fixed the issue as I replaced them all at once. I have a feeling you may only need to replace the 150uF power capacitor.</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<ul>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">1- 400v polarized 150uF capacitor (big one)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">2 - 63v polarized 47uF capacitors (the differently colored ones)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">1 - 35v polarized 100uF capacitor</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">2 - 50v polarized 47uF capacitors</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">small amount of thermal paste</span></li>
</ul>
<span style="font-family: Arial, Helvetica, sans-serif;"><span style="background-color: yellow;">update: It seems like you may only need to replace the </span></span><span style="color: #404040; font-family: Roboto, arial, sans-serif;"><span style="background-color: yellow;">47uF 63V capacitors, thanks to detailed investigation by Craig Brown (See comments below for details). Thank you!</span></span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <span style="font-family: "arial" , "helvetica" , sans-serif;">Here's how I replaced them:</span><br />
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span> <br />
<ol>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Disconnect the unit from power and your stereo system</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Open the back of the unit, there's like 20 screws (for good reason as the thing would shake itself apart otherwise)</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Disconnect the woofer from the circuit board (the pins are labeled so you don't need to worry about taking a picture yet).</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">How comes the fun part..you need to remove the screws holding in the large circuit board, however polk covered them in two types of glue. I used a pair of pliers to kind of chop them off with a knife to remove the glue from inside the screw heads.</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Also remove the heat-sink supports (stuff will now get kind messy as there's thermal paste all over the place.</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">You can now remove the board. </span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Now replace the capacitors. Make sure to remember the polarization of the holes. If you forget I believe there's a crossed circle icon next to the negative leads. I used a desoldering gun to remove the capacitors, however many of the legs were still difficult to remove as the solder tended to stick to the legs.</span></li>
<li><span style="font-family: "arial" , "helvetica" , sans-serif;">Put everything back together (may want to replace some of the thermal paste) and cross your fingers that it works! :)</span></li>
</ol>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLlLBEwGL3oNjaVysXKwQk6CRRX9HpCDVW6fec61ETi_R6Z_FiS4GabB56CxQ1QaAkOv4BPYAXsYS348K6K3sF0-t5EEFx59ygnw1Iyu7zpMp6xA6V5ACJu6FkButFwuhvOKGQxw/w546-h970-no/" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLlLBEwGL3oNjaVysXKwQk6CRRX9HpCDVW6fec61ETi_R6Z_FiS4GabB56CxQ1QaAkOv4BPYAXsYS348K6K3sF0-t5EEFx59ygnw1Iyu7zpMp6xA6V5ACJu6FkButFwuhvOKGQxw/w546-h970-no/" width="180" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
<span style="font-family: "arial" , "helvetica" , sans-serif;"><br />
</span></div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com56tag:blogger.com,1999:blog-10249470.post-62838883457536615112014-10-19T15:26:00.000-07:002017-09-19T13:13:26.375-07:00Whirlpool Duet F11/11F error code resolution<span style="font-family: "arial" , "helvetica" , sans-serif;">Our washing machine has been randomly throwing this error for some time so I did some googling and stumbled upon this thread: <a href="https://www.flickr.com/photos/mysteryonionpatch/471156850" target="_blank">https://www.flickr.com/photos/mysteryonionpatch/471156850</a>. I went ahead and took the CCU out and low and behold I have the same exact issues, the carbonized relay and a cracked soldering job. Whip out my desoldering gun and WD40 + alcohol the contact and it looks like the machine is good as new..yay! Saved $300. Here's my post on facebook: <a href="https://www.facebook.com/photo.php?fbid=10152823024811000&set=a.64395720999.103430.507985999&type=1" target="_blank">https://www.facebook.com/photo.php?fbid=10152823024811000&set=a.64395720999.103430.507985999&type=1</a></span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-84482394143708079042014-09-12T02:02:00.001-07:002017-09-19T13:14:55.316-07:00Turing Test<div dir="ltr">
The way people talk of the Turing test I think is naive (not inspecting the results of the machine). The real idea I believe comes from the corollary, that being if we could prove humans act programmatically, then would we really consider ourselves conscious/alive? That's an interesting thing to ponder! I believe that would mean that if you could code something that was conscious it would by definition (given you can store and replay state) mean that "life" is just a program running on a computer. I'm just imagining "replaying" the life of a program. I mean at the cell level it seems to be true (copying with occasional changes), and postulating that the sum is greater than the parts is pretty dumb given no evidence. But I welcome some new breakthroughs that show we rely on quantum mechanics or some new science (could you imagine the implications from the cell level up?). I put my bets on either we're software running on the universe OS or we have some major breakthroughs ahead of us.</div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-55816526189402370982014-06-05T16:54:00.003-07:002014-06-05T16:54:59.116-07:00How to enable Vino on Upgraded Ubuntu 14.04 server images<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">After installing ubuntu-desktop and vino you may notice that vino won't start. If you're like me you'll be driven mad of what it won't start after enabling it through vino-preferences. So it appears the "correct" way (which works) is by installing dconf-editor, and navigating to org.gnome.desktop.remote-access and checking "enabled" and setting all the other settings to your hearts content. You may need to do this as root.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">After this no more manual launching of vino-server!</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">Also if you're on a VM w/o 3D support I noticed a work-around is by avoiding the session manager by enabling auto-login.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-88129654435751436482014-03-29T21:57:00.000-07:002014-03-29T21:57:03.635-07:00San Jose Water Hardness (FYI Softener Users)<span style="font-family: Arial, Helvetica, sans-serif;">Just measured at 29 gpg!!! That's almost 3x "very high" </span><span style="font-family: Arial, Helvetica, sans-serif;">per </span><a href="http://en.wikipedia.org/wiki/Hard_water" style="font-family: Arial, Helvetica, sans-serif;">http://en.wikipedia.org/wiki/Hard_water</a><span style="font-family: Arial, Helvetica, sans-serif;">.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
They recently had to change the disc on our Kinetico to account for this and thankfully we're now back to having soft water.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
This is what I used</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><a href="http://www.amazon.com/gp/product/B0051V5580/ref=as_li_qf_sp_asin_tl?ie=UTF8&camp=1789&creative=9325&creativeASIN=B0051V5580&linkCode=as2&tag=hesiodblogspo-20"><img border="0" src="http://ws-na.amazon-adsystem.com/widgets/q?_encoding=UTF8&ASIN=B0051V5580&Format=_SL110_&ID=AsinImage&MarketPlace=US&ServiceVersion=20070822&WS=1&tag=hesiodblogspo-20" />Hardness Test Kit (CaCO3)</a><img alt="" border="0" src="http://ir-na.amazon-adsystem.com/e/ir?t=hesiodblogspo-20&l=as2&o=1&a=B0051V5580" height="1" style="border: none !important; margin: 0px !important;" width="1" /></span><br />
<br />
<span style="font-family: Arial, Helvetica, sans-serif;">It seems to be the same kit used by the water softening company.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-85227600851224030862014-01-15T20:07:00.003-08:002014-01-15T20:07:51.533-08:00Cycles of Doom<span style="font-family: Arial, Helvetica, sans-serif;">Cycle 1: Company pays oodles of money to executives, company has poor profit margin, so company cuts employees (and/or pay pittance), stock market approves, repeat.</span><div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">Cycle 2: Companies cut employees, sub Cycle 1, market has fewer people buying products, company makes less revenue long term, repeat</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><sigh> Its just a general lack of respect for employee value.</span></div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-87066782705716026342013-12-25T12:14:00.003-08:002013-12-25T15:57:29.697-08:00Tips for travelling to Negril, Jamaica<br />
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">We just got back from Negril, Jamaica and thought it would be helpful to pass along these tips.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<h3>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Jamaica</b></span></h3>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br />
</b></span></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: justify;">
</div>
<table cellpadding="0" cellspacing="0"><tbody>
<tr><td><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgENQ0qa7zdFkl0yBpGl74I5NWosESToezBfYOmzPCPt9OzjhyRzn-VdrQPX36obaX1vlKxWVvyMPsQqQ3UECGYRaXtmKyAlZ5iiKmtA5Y3yaLdgpc3TNCOZYbULalVQdSHn9W3bg/s1600/IMG_4824+(Medium).JPG" imageanchor="1" style="display: inline !important; margin-left: auto; margin-right: auto;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgENQ0qa7zdFkl0yBpGl74I5NWosESToezBfYOmzPCPt9OzjhyRzn-VdrQPX36obaX1vlKxWVvyMPsQqQ3UECGYRaXtmKyAlZ5iiKmtA5Y3yaLdgpc3TNCOZYbULalVQdSHn9W3bg/s320/IMG_4824+(Medium).JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Negril Beach from Kuyaba Restaurant high table</span></td></tr>
</tbody></table>
</td><td><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-cj0shRFgZ5rMOnm2x_EhTqi57ZlRQKZ-AkzyUMXasxiTsKWe730973khJrpc6Q_xgsJXCKCV86QTcxg2lGc3_sEux3-GAbVRY8KL5KQJKgZZfKfq5Zx91EGQwM3HcdT-zPq8JA/s1600/IMG_4335+(Medium).JPG" imageanchor="1" style="clear: right; display: inline !important; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-cj0shRFgZ5rMOnm2x_EhTqi57ZlRQKZ-AkzyUMXasxiTsKWe730973khJrpc6Q_xgsJXCKCV86QTcxg2lGc3_sEux3-GAbVRY8KL5KQJKgZZfKfq5Zx91EGQwM3HcdT-zPq8JA/s320/IMG_4335+(Medium).JPG" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Beautiful Sunset at Negril Beach</span></td></tr>
</tbody></table>
</td></tr>
</tbody></table>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><b><br />
</b></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">Jamaica is a very pretty country. In terms of cleanliness I would say its actually pretty clean considering how I imagined it would be....however as you travel to the interior you'll note there is a lot of poverty. What struck me is that while the country is small, there are a lot of really interesting things to see.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<h3>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>People in Negril</b></span></h3>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">We noticed that Jamaica is not an integrated society with it being </span><a href="http://www.oxfordaasc.com/public/samples/sample_country.jsp" style="font-family: Arial, Helvetica, sans-serif;">90.9% African American</a><span style="font-family: Arial, Helvetica, sans-serif;">. Coming from a more integrated California/Brazil it felt a little intimidating. My wife is very white, so when we traveled around she got a lot of curious eyes, and some other types of not very nice eyes as well. While the culture is externally known for being very relaxed and accepting we found this not exactly true, at least on first contact. In Negril I would say about 95% of the people that made contact with us were either trying to sell us weed or a taxi ride. It was not uncommon on our walk from the beach to our hotel which was across the street to be pestered by ~5-7 people trying to sell us weed (in various forms) or give us a taxi ride. This left us with the impression that the people don't really care about your visit, they're more interested in getting your money. While they're very aggressive at announcing their wares, at least they're not too insistent once you tell them no thank-you. However in general it left us with a pretty bad impression of Jamaican culture. Also I would say based on our experience with a few locals that education doesn't seem to be a strong suit either. Our bus driver couldn't figure out how many people would fit in his bus given the number of seats, and our private driver didn't know how to take us to the locations we wanted to visit (without informing us before-hand), or how to calculate how much he would spend in gas on the trip, yet insisted he was an educated man. Of course we also did see other locals who were annoyed by the uneducated people from the island.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<h4>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Pitch Techniques</b></span></h4>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">On foot: Expect ~20 pitches per mile of walking (ugh). Whats funny is that in my opinion they abuse the "Respect" way of Jamaica. The way they'll introduce themselves is by trying to grab your attention by saying "respect" and reaching out for a fist bump, and you'll begin to think its a nice gesture, but then comes to pitch for marijuana and/or a taxi ride. Expect this pitch from ANYONE, including people working at your hotel. Another technique is that they'll ask you to remember some fake encounter between the two of you...I guess expecting you to be too stoned to remember either way. Another interesting fact is that if you're not at one of the exclusive resorts (Sandals, etc) you'll notice that while you're eating dinner on the beach side restaurants a bunch of people will be smoking weed and looking at all the people eating dinner...I suppose indirectly selling their "stuff." Another interesting indirect pitch we got was while we were walking in Negril this dude walks up to us and said he could walk with us through the city, I was like ok...and after awhile my wife got tired of this and stated that we wouldn't be paying anyone to walk with us, and he gave a song and dance and then left.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">By car: as you're walking down the road every minute or so a car that's passing by will honk at you and ask if you need a taxi. I mean jeez, if we needed a taxi we'd be hailing a taxi.</span></div>
<div>
<b style="font-family: Arial, Helvetica, sans-serif;"><br />
</b></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">By jet ski: unlicensed jet ski operators will zip back and forth along the coast and stop next to you in the water asking if you'd like to pay $60 for 30 minutes. This happened at least once a day while we were relaxing in the water.</span></div>
<div>
<b style="font-family: Arial, Helvetica, sans-serif;"><br />
</b></div>
<h3>
<b style="font-family: Arial, Helvetica, sans-serif;">Food</b></h3>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA4gQrF6-Me4_nV4_AapUhEF8o_9PA9S8fBsN_Kw07y1LEHHma_npc5KbchoEwy3YtZtXLFJrBj-vbAYrgHB2_an1-kyMlfmtEpInY-q6fWFrulYaA4ipc1hmsyHxsrdtSPmV1CQ/s1600/IMG_4321+(Medium).JPG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="213" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiA4gQrF6-Me4_nV4_AapUhEF8o_9PA9S8fBsN_Kw07y1LEHHma_npc5KbchoEwy3YtZtXLFJrBj-vbAYrgHB2_an1-kyMlfmtEpInY-q6fWFrulYaA4ipc1hmsyHxsrdtSPmV1CQ/s320/IMG_4321+(Medium).JPG" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;">Ackee & Saltfish</span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<span style="font-family: Arial, Helvetica, sans-serif;">Jamaica cuisine seems to be centered around "jerk" seasoning. However there are some traditional plates like </span><a href="http://en.wikipedia.org/wiki/Ackee" style="font-family: Arial, Helvetica, sans-serif;">Ackee</a><span style="font-family: Arial, Helvetica, sans-serif;"> (which the locals claim is a vegetable, but really is a fruit) </span><span style="font-family: Arial, Helvetica, sans-serif;">and Saltfish, and rice and peas that should be tried. There are a lot of really scary (filthy) drum barrel food stands which we avoided. In general we found the food agreeable but still prefer our Brazilian cuisine :)</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br />
</span><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjedmnMGpcf1A-jzM_K8jopfX8FVhCUYBulMEdeAtOhnPMRoyn2JLA9t7j_qN1HevNkvuFpywWHi3K3qgtAgNSjsbt8wtdN8MH6YWaSV2yhZAVvZROta5oFMW3BVXDFbWDnyi-TBw/s1600/IMG_4405+(Medium).JPG" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjedmnMGpcf1A-jzM_K8jopfX8FVhCUYBulMEdeAtOhnPMRoyn2JLA9t7j_qN1HevNkvuFpywWHi3K3qgtAgNSjsbt8wtdN8MH6YWaSV2yhZAVvZROta5oFMW3BVXDFbWDnyi-TBw/s320/IMG_4405+(Medium).JPG" width="213" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-family: Arial, Helvetica, sans-serif;">Appleton Rum Tour</span></td></tr>
</tbody></table>
</div>
<h3>
<span style="font-family: Arial, Helvetica, sans-serif;"><b>Tips</b></span></h3>
<div>
<ul>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Be aware of the pitches. If you're not African American, to avoid pitches go to exclusive resorts and avoid walking in the streets.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Check out <a href="http://www.glisteningwaters.com/">Glistening Waters</a> with a bathing suit, its one of those things you should have on your bucket list for sure! I would also suggest using something like Vibrams if you don't like feeling slimy things on your feet :)</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Check out the <a href="http://www.appletonestate.com/">Appleton Estate</a> rum factory tour. Note that if you want to eat there you need to call ahead...we did not know so ended up here hungry throughout the tour, and did rum tasting at the end with a empty stomach. One thing to note, its scary how dirty the factory is with black mold! Its not wonder you can't take pictures inside.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">If you're not at an all inclusive resort and stroll along the beach to an inclusive resort bar they WILL NOT accept money for payment, meaning you cannot use their bars on the beach.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Be prepared for an assault of pitches and return a lot of no thank you smiles.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Watch the sunset from the beach. The water is this incredible warm milky experience and is shallow for quite a ways out.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">I highly suggest travelling by renting a car. Google Maps does work, however turn by turn is slightly disabled in Jamaica. If you travel by tour bus you'll pay a LOT more, expect ~$150pp for a single location...or we paid ~$300 for a couple for a private driver from the hotel for ~3 locations. And I had to use google maps to let the private driver know how to get to many of the locations <sigh>...so ya, rent a car :)</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Being an island the roads are very curvy. The coastal road is best kept, and the interior roads a lot less so. Expect a LOT of pot-holes, and dirt/asphalt transitions.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">But all your alcohol at the international terminal of the airport on your way back. Its MUCH cheaper and they have almost everything there. If you have connecting flights leave space in your luggage or travel with an extra luggage you can check-in with the alcohol.</span><span style="font-family: Arial, Helvetica, sans-serif;"> </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">There is a HUGE disparity between the big resorts, and smaller hotels that are next to each other in Negril..so do your research on where you'll be staying and what kind of experience you want.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Visit "Times Square" in Nigril if you want to but trinkets...the bad part is that almost all the stores have the same things ;) Another interesting thing we noticed is it seems most of the trinket stores are owned by people from India.</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">At most places everyone disappears ~5-6 pm after the sun sets...I guess they're all avoiding the mosquitoes and sand fleas?</span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Use repellent at night! </span></li>
<li><span style="font-family: Arial, Helvetica, sans-serif;">Expect the occasional cockroach in your room, eeeww :) Thus leave your bags closed!</span></li>
</ul>
</div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-18827124742662948252013-12-14T10:42:00.001-08:002013-12-14T10:42:48.019-08:00Comcast Motorola SBG6580 no internet fix<span style="font-family: Arial, Helvetica, sans-serif;">I noticed the last couple days that Comcast pushed a new firmware update to my router and we pretty much spontaneously lost internet connectivity. It was really strange too, you'd get like 20 seconds of connectivity to the router and internet, and then BAM you'd lose your IP and couldn't even talk with the router.</span><div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">Needless to say Comcast support was useless, reboot this, unplug that, etc etc. The real issue seems to be that some setting from the old firmware was conflicting with the new firmware, so the fix was to use a toothpick to reset the router's settings.</span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span style="font-family: Arial, Helvetica, sans-serif;">result: internet bliss :)</span></div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-60214726663535973222013-11-26T14:58:00.002-08:002013-11-26T14:58:54.312-08:00Chronic Restraunt Food Quality problem<span style="font-family: Arial, Helvetica, sans-serif;">Something is seriously wrong with our restaurants in the bay area. It seems no matter where by wife and I go to eat we'll get sick. This is really terrible. The fact that the county doesn't require restaurants post their recent inspections scores is despicable and should give everyone pause before choosing to eat at ANY establishment :(</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-48101919519087212702013-10-26T12:41:00.000-07:002013-10-26T12:41:43.423-07:00API Designers: Please avoid magic<span style="font-family: Arial, Helvetica, sans-serif;">Just ran into this issue when using the tornado python module as a transparent proxy. It seems that when you call set_status on the HTTPRequest object it tries to map that response code the a default "reason." If there isn't a default value it throws an exception.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">This is NOT the right thing to do because it creates a ticking time bomb. I find this out after my server is running for 12 hours and the remote server responded with a 599 status code, causing my server to go into a weird state.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">My preference would have been to either have this done explicitly, like setDefaultResponse, or, if a default wasn't found in the dictionary it would go to some pre-canned response.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-5599707000169859052013-10-10T02:04:00.000-07:002013-10-10T02:04:21.665-07:00Anarchists: Vote Republican!<span style="font-family: Arial, Helvetica, sans-serif;">Interesting thought graph today: TRMS notes that the Koch brothers spent 250 million to shut down the government, then realizing this is sorta like blood diamond money because politicians love money! Moral politicians should avoid all contact with that money...and with this attempt to defund the government realizing that the basis of government is to essentially hold up morality and ensure progress (all citizens SHOULD support defense of country, all citizens/companies SHOULD behave morally when they do something wrong, we shouldn't make the same building mistakes that kill people, etc..however since we don't, we need government, a system to protect ourselves from ourselves effectively *g*)...so essentially Republicans are saying they want an immoral country where they're free to abuse its citizens.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-3941333507229601192013-07-09T00:31:00.003-07:002013-07-09T00:31:37.873-07:00Comcast Motorola SBG6580 IPV6 supportJust got off support chat and it seems they're testing the IPV6 support to be rolled out sometime in the future. Apparently they consider this a "new" device..I was like, uh, but this is a 3 year old device. Glacial... :)Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-73599068932022076852011-12-23T00:43:00.000-08:002011-12-23T00:44:27.934-08:00FMW Fasteners are great guys!<span style="font-family: Arial, Helvetica, sans-serif;">mad props to FMW Fasteners (<a href="http://www.fmwfasteners.com/">http://www.fmwfasteners.com</a>)!!!! I purchased some screws from them based on some online PDF sizing sheets (yes, using no scale) but I ended up being off by one size. So when I opened my box from them with the right size I found they had packaged a plastic molded screw sizer!!! I guess they either read my blog or felt sorry for me ordering separate small sets of screws. These guys rule!!!! Thanks FMW!!!</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-25435858905466581862011-12-19T15:26:00.000-08:002011-12-19T15:27:26.712-08:00Human Motivation<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">I came across this video today and thought it was brilliant. I think it derives from our social history. To survive as a race humans needed to work together, so obviously we would need an innate want of helping others, so others would want to help us. I think if employers are good with the employees, employees will want to help their employers. The issue is that too often employers are too narrow focused on their own vision that they do not value the contributions the employees often want to make.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">I know I've too often been in the situation where I have what I believe a great idea, however the employer doesn't understand or care about the new idea. And that's where it sums it up, the employer doesn't care, and employee does not feel valued. If the employee does not feel valued, the employee is demotivated regardless of incentive.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;">That actually transitions well to gangs..What is the most often reason for joining gangs? Its because the kids don't feel valued, or feel they have purpose. People want to feel valued and have purpose. In fact, this need is so great people seem to irrationally try to attain it from any corner of society. Just look culturally with the fascination with aliens and other worlds. People want to find their purpose in this world...to know they have a reason to exist. Ideally this purpose is constructive to society...and what better way to fulfill someone's search for value and purpose than at work...its killing two birds with one stone..making people feel wanted and useful...and perhaps making some new friends, and learning together from each other.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span style="font-family: Arial, Helvetica, sans-serif;"><iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/u6XAPnuFjJc?feature=player_embedded' frameborder='0'></iframe></span></div>
<br />Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-57743232672451327422011-12-15T11:38:00.000-08:002011-12-15T11:59:35.488-08:00Saw a nice quote today<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">Humanity,</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> on the long path from</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">"because we can"</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"> to</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">"but didn't, because we shouldn't".</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br /></span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">May we quicken our pace.</span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;"><br /></span><br />
<span class="Apple-style-span" style="font-family: Verdana, sans-serif;">source: <a href="http://www.npr.org/blogs/13.7/2011/12/15/143735486/retirement-home-or-research-lab-report-weighs-fate-of-u-s-chimpanzees?sc=fb&cc=fp">http://www.npr.org/blogs/13.7/2011/12/15/143735486/retirement-home-or-research-lab-report-weighs-fate-of-u-s-chimpanzees?sc=fb&cc=fp</a></span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com0tag:blogger.com,1999:blog-10249470.post-2943084254770698782011-12-13T20:29:00.000-08:002013-12-30T12:11:08.126-08:00Repairing Polk RTi12 speakers<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">So I just got a crazy good deal on some Cherry Polk RTi12s from Fry's (lets just say it didn't break the cost of lunch). That's the good news, the bad news is that they had many issues:</span><br />
<br />
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Missing screws (#6-7/8") (really people?)</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">~$0.50</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Disconnected speakers (uh?)</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">$0 fix</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Blown tweeters</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">luckily $0 fix</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Blown crossover</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Ok so for people that may have the same problem, I can post a diagram of HF crossover board. The issue I found was that a 2 Ohm 5w resister had opened (only external sign was some glue had turned brown on the side of the resistor).</span></li>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">$3.00 fix after a few hours of disassembling the crossover, tracing circuit, and removing and replacing the same resistor in both speakers.</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Missing 1 front cover</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">~$16.00 (not bought yet)</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Missing front face plates and brackets</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">~$30</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Missing rear power ports and brackets</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">~$40</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Missing feet and brackets</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">~$30</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Punctured mid range speaker</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Temporarily $0 fix using nail polish</span></li>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Eventually will be a $50 fix</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Several dings, dents, scratches</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">$0.0, but cost to my pride :) Perhaps fill and paint with something special.</span></li>
</ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">Loose front port cone</span></li>
<ul>
<li><span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">$0, fixed with my glue gun</span></li>
</ul>
</ul>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">So if I were to actually bring this back to all working parts it would be ~$180 total for both. But for now I've spent ~$100 for both.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">So now that they work, the hard part is amplifying these puppies. I love the tweeters, they're bright and really accurate. The issue is that there are three woofers, and two mid-ranges, which means I need a LOT of power to get them all moving.</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;">I have a Panasonic SA-XR57, rated 100 wpc RMS x 7 @ 6 ohm, and tested @ 93 watts with 8 ohm load, which I love terribly. It has both bi-wiring (with HF-LF balance) and bi-amping features. This means in stereo mode I can have 2 amps powering the LF, and 1 amp powering the HF. In this mode the speaker is pretty nice, however I tend to bump up the bass by 1 to sound a little better. The bad part is that in 5.1 mode I'm back to only 1 amp on HF and 1 on LF (using the unused amps . In 5.1 I'm not sure if bi-wiring, or bi-amping would be better.</span><br />
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">I think to really enjoy this speaker I'd need separate amplifier just for these guys. I'll post back after I do more research.</span><br />
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">update: I finally found my diagram. Its slightly different from Zach's in terms of some resistor values and inductor values.</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhOZ8hjzzbtEKeetzu7yws8_TKighUaMzR7v548IGLG2I8sJcn90YijQCHn3HjiPCbQrhbZ5Az21HWPxt7AfXZ-Izve0Pi1NbNF5-s2hDwWTSlzlgdAr8VW89KDyEODQUw7FQwg/s1600/polk+mid-high+filter.PNG" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIhOZ8hjzzbtEKeetzu7yws8_TKighUaMzR7v548IGLG2I8sJcn90YijQCHn3HjiPCbQrhbZ5Az21HWPxt7AfXZ-Izve0Pi1NbNF5-s2hDwWTSlzlgdAr8VW89KDyEODQUw7FQwg/s1600/polk+mid-high+filter.PNG" /></a></div>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;"><br /></span>
<span style="font-family: Arial, Helvetica, sans-serif;">update: Here's a crossover diagram from Zach. He provided me a copy since I think I threw mine away. Thanks!</span></div>
<div>
<span class="Apple-style-span" style="font-family: Arial, Helvetica, sans-serif;"><br /></span></div>
<div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwrZH5AHmD81DU9MzDF6-so7xkUVNDO42ay13DzSzGVD-Yo97l7iqL1lrVEtLppJV94pByTMop0S6FA4ys87OIsW7yjQsFWVfC2GXhUSh4opRskSsJkXgSkUnkVjRBXVy7VXCtxg/s1600/rti12+crossover.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwrZH5AHmD81DU9MzDF6-so7xkUVNDO42ay13DzSzGVD-Yo97l7iqL1lrVEtLppJV94pByTMop0S6FA4ys87OIsW7yjQsFWVfC2GXhUSh4opRskSsJkXgSkUnkVjRBXVy7VXCtxg/s1600/rti12+crossover.jpg" width="272" /></a></div>
<br /></div>
Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com8tag:blogger.com,1999:blog-10249470.post-31128692018248678722011-11-18T14:06:00.001-08:002011-11-18T14:14:26.088-08:00<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: small;">Hmm, today had a difference of</span></div>
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: small;"><br /></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: small;"><br /></span></div>
<table><tbody>
<tr><td><span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: small;">Advertised:</span></td><td><span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: small;">Actual:</span></td></tr>
<tr><td><div class="separator" style="clear: both; text-align: center;">
<span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQKDpbizqYDF0Vwny288TX7OKsASzTbCmILt6zOl1P2Obllc1coa88ROYxVWnjK-e65p7cGrM1xelryLeOrm1TlnGu4PVRTvpXHNCpTQ0ZioTaliq_uLzSZMJNbaAngoWKERloGQ/s1600/ftd+advertised.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQKDpbizqYDF0Vwny288TX7OKsASzTbCmILt6zOl1P2Obllc1coa88ROYxVWnjK-e65p7cGrM1xelryLeOrm1TlnGu4PVRTvpXHNCpTQ0ZioTaliq_uLzSZMJNbaAngoWKERloGQ/s400/ftd+advertised.jpg" width="356" /></a></span></div>
<span style="font-size: small;"><br /></span></td><td><span style="font-size: small;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1O5gRdAqJq8iFpUTUWJVFF8F6g3w6Y0u8OkVff8ZaSIHJGMagdXmfd2WdEWZYtg9mHTqYleKYd7MDuNalGOYdLs3ZVUT1ucZ8CIhhz2QQhyphenhyphendYCyRW_oQiEL-CTFvr8u5J45AmQQ/s1600/ftd+received.jpg" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi1O5gRdAqJq8iFpUTUWJVFF8F6g3w6Y0u8OkVff8ZaSIHJGMagdXmfd2WdEWZYtg9mHTqYleKYd7MDuNalGOYdLs3ZVUT1ucZ8CIhhz2QQhyphenhyphendYCyRW_oQiEL-CTFvr8u5J45AmQQ/s400/ftd+received.jpg" width="300" /></a></span></td></tr>
</tbody></table>
<span style="font-size: small;"><br /></span><br />
<span class="Apple-style-span" style="font-family: Arial,Helvetica,sans-serif; font-size: small;">From FTD.com. I'll be contacting them to help resolve this.</span>Alex Mohrhttp://www.blogger.com/profile/06086216696010533242noreply@blogger.com2