tag:blogger.com,1999:blog-43559188180712824452024-02-20T19:53:19.141-08:00Global Blind SpotVarious wacky and hacky technological research projects, shared with the world so that restless brains may find peace of mind here.t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.comBlogger44125tag:blogger.com,1999:blog-4355918818071282445.post-23821749970452287102019-08-23T05:54:00.000-07:002019-08-23T06:02:27.902-07:00Nirvana live at The Hollywood Palace, California (October 25, 1991)<div style="line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em;">
One month after "Nevermind" was released, Nirvana played at The Palace in Hollywood, on the <a href="https://en.wikipedia.org/wiki/Rock_for_Choice" style="background: none; color: #0b0080; text-decoration-line: none;" title="Rock for Choice">Rock for Choice</a> benefit<sup class="reference" id="cite_ref-1" style="font-size: 11.2px; line-height: 1; unicode-bidi: isolate; white-space: nowrap;"><a href="http://www.setlist.fm/setlist/nirvana/1991/the-palace-hollywood-ca-4bd67f02.html" style="background: none; color: #0b0080; text-decoration-line: none;">[1]</a></sup>. Full bootleg audio of the concert is available online<sup class="reference" id="cite_ref-3" style="font-size: 11.2px; line-height: 1; unicode-bidi: isolate; white-space: nowrap;"><a href="https://www.youtube.com/watch?v=s6mNVVlrftQ" style="background-attachment: initial; background-clip: initial; background-image: none; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0b0080;">[3]</a></sup>.</div>
<div style="line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em;">
<a href="https://en.wikipedia.org/wiki/Jack_Black" style="background: none; color: #0b0080; text-decoration-line: none;" title="Jack Black">Jack Black</a> recalls this concert as being a "historical musical experience" and remembers it happened on the evening <a href="https://en.wikipedia.org/wiki/Bill_Graham_(promoter)" style="background: none; color: #0b0080; text-decoration-line: none;" title="Bill Graham (promoter)">Bill Graham</a> passed away in a helicopter crash<sup class="reference" id="cite_ref-2" style="font-size: 11.2px; line-height: 1; unicode-bidi: isolate; white-space: nowrap;"><a href="https://www.youtube.com/watch?v=-xpt08lS7DY" style="background: none; color: #0b0080; text-decoration-line: none;">[2]</a></sup>. </div>
<div style="line-height: inherit; margin-bottom: 0.5em; margin-top: 0.5em;">
On that same day, Nirvana gave an interview on MTV's <a href="https://en.wikipedia.org/wiki/Headbangers_Ball" style="background: none; color: #0b0080; text-decoration-line: none;" title="Headbangers Ball">Headbangers Ball</a> with Riki Rachtman about which he states: "I did that show for five years, and when Nirvana was coming in, here was a band that I could tell was on the verge of making it huge"<sup class="reference" id="cite_ref-4" style="font-size: 11.2px; line-height: 1; unicode-bidi: isolate; white-space: nowrap;"><a href="http://www.mtv.com/news/articles/1671101/kurt-cobain-nirvana-headbangers-ball-gown.jhtml" style="background: none; color: #0b0080; text-decoration-line: none;">[4]</a></sup>.</div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-52691385126748165372019-08-22T01:26:00.000-07:002019-08-22T01:28:51.657-07:00Making VirtualBox vboxdrv kernel driver 5.1.x compatible with Linux 4.20.x<br />
When Ubuntu 16.04.6 LTS users do:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo apt-get install virtualbox</span><br />
<br />
...they receive VirtualBox 5.1.38-dfsg-0ubuntu1.16.04.3.<br />
<br />
This should also install virtualbox-dkms, which compiles the vboxdrv kernel driver for their Linux kernel. If it doesn't (for example, because virtualbox-dkms is already installed) then it can be reinstalled with:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo apt-get install --reinstall virtualbox-dkms</span><br />
<br />
But if they are running Linux kernel 4.20.x, they will find the following compilation errors in /var/lib/dkms/virtualbox/5.1.38/build/make.log:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"> CC [M] /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.o</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.c: In function ‘VBoxHost_RTTimeNow’:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">/var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.c:175:5: error: implicit declaration of function ‘ktime_get_real_ts’ [-Werror=implicit-function-declaration]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> ktime_get_real_ts(&Ts);</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> ^</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">cc1: some warnings being treated as errors</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">scripts/Makefile.build:291: recipe for target '/var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.o' failed</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">make[2]: *** [/var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.o] Error 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">scripts/Makefile.build:516: recipe for target '/var/lib/dkms/virtualbox/5.1.38/build/vboxdrv' failed</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">make[1]: *** [/var/lib/dkms/virtualbox/5.1.38/build/vboxdrv] Error 2</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Makefile:1563: recipe for target '_module_/var/lib/dkms/virtualbox/5.1.38/build' failed</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">make: *** [_module_/var/lib/dkms/virtualbox/5.1.38/build] Error 2</span><br />
<div>
<br /></div>
<div>
To fix this issue, we need to make the VirtualBox vboxdrv code compatible with Linux 4.20 and after some trial and error, I came up with the following patches:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">--- /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/include/iprt/time.h.orig<span style="white-space: pre;"> </span>2019-08-22 10:09:34.909117248 +0200</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+++ /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/include/iprt/time.h<span style="white-space: pre;"> </span>2019-08-22 10:09:04.949044978 +0200</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">@@ -28,6 +28,7 @@</span></div>
<div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> #include <iprt/cdefs.h></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> #include <iprt/types.h></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+#include <linux/time64.h></span></div>
<div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> RT_C_DECLS_BEGIN</span></div>
<div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">@@ -429,6 +430,13 @@</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> }</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> #endif /* various ways of detecting struct timespec */</span></div>
<div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+// Added for Linux 4.20 compatibility</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+DECLINLINE(PRTTIMESPEC) RTTimeSpecSetTimespec64(PRTTIMESPEC pTime, const struct timespec64 *pTimeval)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+{</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+ return RTTimeSpecAddNano(RTTimeSpecSetSeconds(pTime, pTimeval->tv_sec), pTimeval->tv_nsec);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+}</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> /** The offset of the unix epoch and the base for NT time (in 100ns units).</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> * Nt time starts at 1601-01-01 00:00:00. */</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> #define RTTIME_NT_TIME_OFFSET_UNIX (116444736000000000LL)</span></div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">--- /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.c.orig<span style="white-space: pre;"> </span>2019-08-22 10:12:14.633414691 +0200</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+++ /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/r0drv/linux/time-r0drv-linux.c<span style="white-space: pre;"> </span>2019-08-22 10:12:29.865436296 +0200</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">@@ -171,10 +171,11 @@</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> {</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> IPRT_LINUX_SAVE_EFL_AC();</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 16)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- struct timespec Ts;</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- ktime_get_real_ts(&Ts);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+// Modified for Linux 4.20 compatibility</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+ struct timespec64 Ts;</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+ ktime_get_real_ts64(&Ts);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> IPRT_LINUX_RESTORE_EFL_AC();</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">- return RTTimeSpecSetTimespec(pTime, &Ts);</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">+ return RTTimeSpecSetTimespec64(pTime, &Ts);</span></div>
<div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> #else /* < 2.6.16 */</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> struct timeval Tv;</span></div>
</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
To recompile the module, change to the directory /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv and do:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo make</span><br />
<br />
Finally, to load the vboxdrv module, do:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo insmod /var/lib/dkms/virtualbox/5.1.38/build/vboxdrv/vboxdrv.ko</span><br />
<br />
Enjoy VirtualBox!<br />
<br />t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-49702758467679455912017-05-12T07:48:00.001-07:002017-05-12T07:53:01.720-07:00Waking up Linux from suspend modeTo see wake-up sources on Linux, use acpitool -w:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">acpitool -w</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"> Device<span class="Apple-tab-span" style="white-space: pre;"> </span>S-state<span class="Apple-tab-span" style="white-space: pre;"> </span> Status Sysfs node</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> ---------------------------------------</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 1. UAR1<span class="Apple-tab-span" style="white-space: pre;"> </span> S3<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 2. RP01<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:00:1c.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 3. PXSX<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 4. RP02<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">[cut for brevity]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"> 16. RP08<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:00:1c.7</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 17. PXSX<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:0e:00.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 18. GLAN<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*enabled pci:0000:00:19.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 19. EHC1<span class="Apple-tab-span" style="white-space: pre;"> </span> S3<span class="Apple-tab-span" style="white-space: pre;"> </span>*enabled pci:0000:00:1d.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 20. EHC2<span class="Apple-tab-span" style="white-space: pre;"> </span> S3<span class="Apple-tab-span" style="white-space: pre;"> </span>*enabled pci:0000:00:1a.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 21. XHC<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*enabled pci:0000:00:14.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 22. HDEF<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:00:1b.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 23. TPD4<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 24. TPD7<span class="Apple-tab-span" style="white-space: pre;"> </span> S0<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 25. TPD8<span class="Apple-tab-span" style="white-space: pre;"> </span> S0<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 26. PEG0<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:00:01.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 27. PEGP<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:01:00.0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 28. PEGA<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 29. PEG1<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 30. PEG2<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 31. LID0<span class="Apple-tab-span" style="white-space: pre;"> </span> S3<span class="Apple-tab-span" style="white-space: pre;"> </span>*enabled platform:PNP0C0D:00</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> 32. PBTN<span class="Apple-tab-span" style="white-space: pre;"> </span> S3<span class="Apple-tab-span" style="white-space: pre;"> </span>*enabled platform:PNP0C0C:00</span><br />
<div>
<br /></div>
<div>
To modify:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">sudo acpitool -W 18</span></div>
</div>
<div>
<br /></div>
<div>
Result:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">18. GLAN<span class="Apple-tab-span" style="white-space: pre;"> </span> S4<span class="Apple-tab-span" style="white-space: pre;"> </span>*disabled pci:0000:00:19.0</span></div>
</div>
<div>
<br /></div>
<div>
Or use the raw kernel API:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">cat /proc/acpi/wakeup</span><br />
<span style="font-family: Courier New, Courier, monospace;">echo GLAN | sudo tee /proc/acpi/wakeup</span><br />
<span style="font-family: Courier New, Courier, monospace;">cat /proc/acpi/wakeup</span></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com1tag:blogger.com,1999:blog-4355918818071282445.post-81905009209617031012017-04-06T22:06:00.000-07:002017-04-06T22:06:07.431-07:00Linux shell script to fix LibreOffice 5.1's docx "unknown error" word/document.xml issuesI investigated some issues that caused LibreOffice version 5.1.6.2 to error out when opening certain docx files created with Microsoft Office.<br />
<br />
Here's the error:<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgCq6P_uu3ysoDZ-xL-IzZz8JaCEoVF5WMh-6K9jIpaaC-L-THucPgj1KFUMhzZHpby_lLRYUQj_WnVts50nbbwFKypjqC5vSvfidXUcIeJGAaV3HysDZ0MoMEZF18_RRZJiQO2aKcOA/s1600/Screenshot+from+2017-04-06+08-46-24.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="94" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgCq6P_uu3ysoDZ-xL-IzZz8JaCEoVF5WMh-6K9jIpaaC-L-THucPgj1KFUMhzZHpby_lLRYUQj_WnVts50nbbwFKypjqC5vSvfidXUcIeJGAaV3HysDZ0MoMEZF18_RRZJiQO2aKcOA/s320/Screenshot+from+2017-04-06+08-46-24.png" width="320" /></a></div>
<br />
<div style="text-align: left;">
<span style="font-family: Courier New, Courier, monospace; font-size: x-small;">File format error found at </span><span style="font-family: "Courier New", Courier, monospace; font-size: x-small;"># SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 928831(row,col).</span></div>
<div style="text-align: left;">
<br /></div>
After a deep debugging session, it turns out this is caused by some values of the relativeHeight attributes in the word/document.xml file of the docx.<br />
<br />
I made a script to workaround the relativeHeight issue by setting all relativeHeight attributes to zero which, according to the docx specification, means infinite.<br />
<br />
After fixing this, I ran into another problem where LibreOffice would sometimes duplicate the w:themeColor attribute upon saving in docx format, thereby invalidating the XML. That is also checked and fixed by the code below.<br />
<br />
I figured other people might find this useful, so here's my script:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">#!/bin/sh</span><br />
<span style="font-family: Courier New, Courier, monospace;"># Fix to workaround LibreOffice 5 docx issues</span><br />
<span style="font-family: Courier New, Courier, monospace;"># Copyleft 2017 (c) Tom Van Braeckel <tomvanbraeckel@gmail.com></span><br />
<span style="font-family: Courier New, Courier, monospace;"># </span><br />
<span style="font-family: Courier New, Courier, monospace;"># This fixes these errors I've been getting:</span><br />
<span style="font-family: Courier New, Courier, monospace;"># </span><br />
<span style="font-family: Courier New, Courier, monospace;"># File format error found at </span><br />
<span style="font-family: Courier New, Courier, monospace;"># SAXParseException: '[word/document.xml line 2]: unknown error', Stream 'word/document.xml', Line 2, Column 928831(row,col).</span><br />
<span style="font-family: Courier New, Courier, monospace;">#</span><br />
<span style="font-family: Courier New, Courier, monospace;"># Problematic LibreOffice version:</span><br />
<span style="font-family: Courier New, Courier, monospace;"># --------------------------------</span><br />
<span style="font-family: Courier New, Courier, monospace;"># Version: 5.1.6.2</span><br />
<span style="font-family: Courier New, Courier, monospace;"># Build ID: 1:5.1.6~rc2-0ubuntu1~xenial1</span><br />
<span style="font-family: Courier New, Courier, monospace;"># CPU Threads: 4; OS Version: Linux 4.11; UI Render: default; </span><br />
<span style="font-family: Courier New, Courier, monospace;"># Locale: en-US (en_US.UTF-8); Calc: group</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">tofix="$1"</span><br />
<span style="font-family: Courier New, Courier, monospace;">if [ -z "$tofix" ]; then</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Usage: $0 <filetofix>"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Example: $0 bla.dockx"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>exit 1</span><br />
<span style="font-family: Courier New, Courier, monospace;">fi</span><br />
<span style="font-family: Courier New, Courier, monospace;">cwd=$(pwd)</span><br />
<span style="font-family: Courier New, Courier, monospace;">tofixreal=$(readlink -f "$tofix")</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">tempdir=$(mktemp -d)</span><br />
<span style="font-family: Courier New, Courier, monospace;">cd "$tempdir"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">unzip "$tofixreal"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;"># Fix relativeHeight issue</span><br />
<span style="font-family: Courier New, Courier, monospace;">sed -i "s/relativeHeight=\"[^\"]\+\"/relativeHeight=\"0\"/g" word/document.xml</span><br />
<span style="font-family: Courier New, Courier, monospace;"># and then after saving in LibreOffice 5.2 docx format, we sometimes need this fix:</span><br />
<span style="font-family: Courier New, Courier, monospace;">sed -i 's/w:themeColor="text1" w:themeColor="text1"/w:themeColor="text1"/g' word/document.xml</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">zip -r "$tofixreal" *</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">cd "$cwd"</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">echo "Done! The file $tofixreal has been cleaned from relativeHeight and themeColor issues."</span><br />
<div>
<br /></div>
<div>
To use this script, make sure it is executable and do:</div>
<div>
<br /></div>
<div>
<span style="font-family: Courier New, Courier, monospace;">./fixdocx.sh filename.dockx</span></div>
<div>
<br /></div>
<div>
<br /></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com1België50.944584434950116 2.9882812549.653427934950116 0.40649425000000017 52.235740934950115 5.57006825tag:blogger.com,1999:blog-4355918818071282445.post-63321985053276305092016-10-13T22:02:00.004-07:002016-10-19T03:35:45.719-07:00First successful static firing of tiny steel GALCIT rocket motorWe're happy to report that we have made our first <i>tiny</i> steel GALCIT rocket motor and successfully static fired it to thrust!<br />
<br />
For this experiment session we had 3 goals:<br />
<ol>
<li>build and validate prototype of small scale GALCIT melter based on a deep fryer: success!</li>
<li>build simple steel GALCIT rocket motor and cast the propellant: success!</li>
<li>static firing of the test motor: success!</li>
</ol>
<h2 style="clear: both; text-align: left;">
Small scale GALCIT melter </h2>
<div class="separator" style="clear: both; text-align: left;">
For this prototype of a small scale GALCIT propellant melter we used a standard deep fryer.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In the deep fryer we placed a used, cleaned metal paint can to use as the crucible of the melter. We left the metal net of the fries in to facilitate the handling of the crucible and to provide an extra barrier between it and the heating elements.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Below is a picture of the melting of the asphalt/bitumen, the fuel component of the propellant.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<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/AVvXsEilmKA1ZAuYFf5hgnr0on0ApuS4M0Cse4a25484nlU1D5Ip0aM3ewbITIPMJaP49fd3o1IT-4ybKkzsJDLeCxozN8gXJdfa3Rqvbng8GnvX7_oYffBbluFkYfv8x2KOVkS23Blu3mUl9g/s1600/IMG_20161009_121044.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilmKA1ZAuYFf5hgnr0on0ApuS4M0Cse4a25484nlU1D5Ip0aM3ewbITIPMJaP49fd3o1IT-4ybKkzsJDLeCxozN8gXJdfa3Rqvbng8GnvX7_oYffBbluFkYfv8x2KOVkS23Blu3mUl9g/s320/IMG_20161009_121044.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Melting of bitumen fuel</td></tr>
</tbody></table>
Before adding the oxidizer, we made a simple wooden cover plate around the crucible to prevent the oxidizer from falling in the oil. There is a small gap between the crucible and the cover plate which we plan not to have in the final version of the melter.<br />
<br />
The oxidizer had clumps in it, as expected. We ground and sieved the oxidizer with a standard powder sugar sieve and that worked very well.<br />
<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/AVvXsEj9G_CpFEHWNg7EBgRK63BXhqMmaGuArWA0f3Uui_w_-Ksmi4AtLfrAkDH1hU7J43rNjHzN9ueohXaI9_aRKxJpbyP59TD70FQirILiIE9y-BnRfMe7bNGgLnALTdQgkL3tUzEX_P7Fkg/s1600/IMG_20161009_130304.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj9G_CpFEHWNg7EBgRK63BXhqMmaGuArWA0f3Uui_w_-Ksmi4AtLfrAkDH1hU7J43rNjHzN9ueohXaI9_aRKxJpbyP59TD70FQirILiIE9y-BnRfMe7bNGgLnALTdQgkL3tUzEX_P7Fkg/s320/IMG_20161009_130304.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Adding the KClO4 oxidizer </td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
When measuring the temperature of the oil with an independent sensor, it was found to be 176 degrees Celcius rather than the indicated maximum of 190 degrees Celcius. This gives the propellant slightly more viscosity and makes casting in tiny motors (made out of narrow pipes) more challenging.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Tiny steel rocket motor</h2>
For the motor we wanted to keep things as simple as possible.<br />
<br />
We used a standard 12cm pipe with threads at the ends so it can be closed off with 2 end caps.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKn74Wvmt-KyyF6SfZ-Gu0ryml4PvqTpeIa5sbSxW54DEJWiYnaGfzfjOT5jF_HOR7sfGiXzGBpUeS3smBFSPeYQEROCRo7WwSUoKy_mbPy5ZSMVdxxh9rrdXFZli2Sw0ZnD3KdgC3SQ/s1600/IMG_20161009_130800.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKn74Wvmt-KyyF6SfZ-Gu0ryml4PvqTpeIa5sbSxW54DEJWiYnaGfzfjOT5jF_HOR7sfGiXzGBpUeS3smBFSPeYQEROCRo7WwSUoKy_mbPy5ZSMVdxxh9rrdXFZli2Sw0ZnD3KdgC3SQ/s320/IMG_20161009_130800.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The cylinder needs insulation and/or cooling from the heat of the reaction. We used thick paper rolled into a cylinder to achieve ablative cooling and this worked nicely. Surprisingly, the material stood up during the incredibly long burn time. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinJhTh22xPxqJTZAmsSuEqOoNyYcY1Ism__pf2tL2WSG5Grw836k2JzunkWeFGcl_vHHwAMQPfNT-smh3k2WWjpJkXru8anhA3GVAvj3AafLzl1_iZu3VJ0KeVA2naM0eFsLkXTS-XWw/s1600/IMG_20161009_131143.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEinJhTh22xPxqJTZAmsSuEqOoNyYcY1Ism__pf2tL2WSG5Grw836k2JzunkWeFGcl_vHHwAMQPfNT-smh3k2WWjpJkXru8anhA3GVAvj3AafLzl1_iZu3VJ0KeVA2naM0eFsLkXTS-XWw/s320/IMG_20161009_131143.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The diameter of the propellant grain is 18mm for the right one and 16mm for the left, which has thicker insulation. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We need a nozzle, of course! Again using the simplest design possible, we went for an end cap with a hole drilled into the center.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To be able to drill the hole into the exact center, we fixated the end cap with a reusable wooden holder. We drilled using a drill press.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<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-ipayoTH9khhN2hMRlvGOrkfK6Ut4wwFFKsknTO5M8q5_Istx54F_bWhaUzhSCWwWYYLMfWNuTipJ-_0Q2EVJ8Sc8elxIHKmD4q0YZcZzXVgaVCLyX3knVPptk0a0z7rERuvwwHkoNw/s1600/IMG_20161009_153112.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-ipayoTH9khhN2hMRlvGOrkfK6Ut4wwFFKsknTO5M8q5_Istx54F_bWhaUzhSCWwWYYLMfWNuTipJ-_0Q2EVJ8Sc8elxIHKmD4q0YZcZzXVgaVCLyX3knVPptk0a0z7rERuvwwHkoNw/s320/IMG_20161009_153112.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Nozzle cap holder</td></tr>
</tbody></table>
<div class="separator" style="clear: both;">
We chose the 3mm hole knowing that it is actually way too big rather than risking a <a href="https://en.wiktionary.org/wiki/rapid_unplanned_disassembly" target="_blank">RUD</a> on the first firing test.</div>
<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/AVvXsEjUoPveKFgef9EflAZrM4HU7f2q8NgQZymWlgSIWvS6Mjxr1egeUy69BqDd3RP9K719P4C4tbSMxn4cE8md8sWFBYhLhfDz44pMjVn-nQxF-_3_t_Wg5ZVohR2zfrgI1yaJssuWixcW_g/s1600/IMG_20161009_165610.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUoPveKFgef9EflAZrM4HU7f2q8NgQZymWlgSIWvS6Mjxr1egeUy69BqDd3RP9K719P4C4tbSMxn4cE8md8sWFBYhLhfDz44pMjVn-nQxF-_3_t_Wg5ZVohR2zfrgI1yaJssuWixcW_g/s320/IMG_20161009_165610.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small; text-align: left;">Resulting nozzle cap</span></td></tr>
</tbody></table>
<div class="separator" style="clear: both;">
It is expected that using this simple steel nozzle exit will result in severe erosion because the steel would not be able to resist to the heat of the exhaust for long.</div>
<div>
<br /></div>
<h2 style="clear: both; text-align: left;">
Casting the solid rocket propellant</h2>
Casting takes some skill due to the aforementioned high propellant viscosity but we managed to cast it by letting it ooze down from a metal rod into the motor and pushing it down further with the rod.<br />
<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/AVvXsEgqzv4YFxcY0WipX5F9GMye5Jitnjto8HQUF7MzTqFjXUW5-D5Hshtaa6d6Q6XofxxJt5LH7lGQduJeZVa_SERF5J-qLaPZ6RTSEp4czAbUwMjQLJek-Ef83aoclXLctdbGNoJIChBHfw/s1600/IMG_20161009_144452_filling_cropped.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgqzv4YFxcY0WipX5F9GMye5Jitnjto8HQUF7MzTqFjXUW5-D5Hshtaa6d6Q6XofxxJt5LH7lGQduJeZVa_SERF5J-qLaPZ6RTSEp4czAbUwMjQLJek-Ef83aoclXLctdbGNoJIChBHfw/s320/IMG_20161009_144452_filling_cropped.jpg" width="270" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Casting the propellant</td></tr>
</tbody></table>
A standard electronic match was installed in the propellant, <a href="https://globalblindspot.blogspot.be/2016/09/successful-galcit-61-c-ignition-using.html" target="_blank">described previously</a>.<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<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/AVvXsEhirnQYTq0HWgX805LBVd-UTyV6t-ll5vzDlYThJJiQzcn_G7VLF1WzYAHhQ06LvT6PjDBG-DuCzYTgCmpt4rCXaKIvOSUxVjruB75ZwZF4xMbVuxgn1rzGZzNeP1VYE5DeO8YjmI6tXw/s1600/IMG_20161009_161907.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhirnQYTq0HWgX805LBVd-UTyV6t-ll5vzDlYThJJiQzcn_G7VLF1WzYAHhQ06LvT6PjDBG-DuCzYTgCmpt4rCXaKIvOSUxVjruB75ZwZF4xMbVuxgn1rzGZzNeP1VYE5DeO8YjmI6tXw/s320/IMG_20161009_161907.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Final configuration without end cap nozzle</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<h2 style="clear: both; text-align: left;">
Static test firing</h2>
<div>
For the static firing, we mounted the motor inside a soft plastic bucket, full of with hard sand. The sand serves as a first sound, shock and shrapnel muffler and holds a small low-thrust motor in place very well.</div>
<div>
<br /></div>
<div>
The motor was ignited remotely at a safe distance from behind with a 25cm thick brick wall.</div>
<div>
<br /></div>
<div>
Checkout the slightly long and slightly underwhelming video...</div>
<div>
<br /></div>
<div>
<br /></div>
<iframe frameborder="0" height="390" id="ytplayer" src="https://www.youtube.com/embed/4ZhT0Fy6OWU?autoplay=0" type="text/html" width="640"></iframe>
<br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
That's a burn time of 3 minutes 29 seconds for a 12cm motor, which is huge!</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
From this low burn rate (0.57mm/s) is clear that the motor chamber was severely under-pressurized, as intended. </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br /> <br /><br /><br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzAPfjU5SiA792c9bNl1GXtk7wPDskb9q8u9x5wINSpKHQUr7mJYjC7fyTlAHplhZVBO_N-ps39VXi1fXSQr8PUiZh21w47eIsob09fk9Ra1fhyV2UaS0-aPnBamZ5-57A0bQGE0AZw/s1600/best_image_deinterlaced_cropped_white_balance_color_enhance.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgtzAPfjU5SiA792c9bNl1GXtk7wPDskb9q8u9x5wINSpKHQUr7mJYjC7fyTlAHplhZVBO_N-ps39VXi1fXSQr8PUiZh21w47eIsob09fk9Ra1fhyV2UaS0-aPnBamZ5-57A0bQGE0AZw/s320/best_image_deinterlaced_cropped_white_balance_color_enhance.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgcwC4tPWfF_bucrbdoQ5uhPL4Wy9JnF1TatvY6qdpE2U8dT_UwLCswllLD22d75xSsLXbqJ4Obt_8TBoCqPA50anwwo8SX5L-DQjFjonPN_zJGH4255jWpXi7jp_JdNEdGr3laBHNkg/s1600/second_best_image_deinterlaced_cropped_white_balance.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgcwC4tPWfF_bucrbdoQ5uhPL4Wy9JnF1TatvY6qdpE2U8dT_UwLCswllLD22d75xSsLXbqJ4Obt_8TBoCqPA50anwwo8SX5L-DQjFjonPN_zJGH4255jWpXi7jp_JdNEdGr3laBHNkg/s320/second_best_image_deinterlaced_cropped_white_balance.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc4uN1z4r4u0PfIQ32VPmHDcHbc3SfGR_2PFnku5OeyezoLaSzLW9bOLPSkWo0_SVrHrJQrR8ALNDdGulZaXJCaBAiG8Zq9yjVPpfMVY4Kiezvfyz0_Gs04z6U1Y47L5qhNcMv-JP1A/s1600/best_image_deinterlaced_cropped_white_balance_inverted.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjUc4uN1z4r4u0PfIQ32VPmHDcHbc3SfGR_2PFnku5OeyezoLaSzLW9bOLPSkWo0_SVrHrJQrR8ALNDdGulZaXJCaBAiG8Zq9yjVPpfMVY4Kiezvfyz0_Gs04z6U1Y47L5qhNcMv-JP1A/s320/best_image_deinterlaced_cropped_white_balance_inverted.png" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlyB4YBiB9HC9igvFTM62dejU9U8Lx4dzENuWiCiCNL_nXvQ51t0mbnJts4w58T9OwJHMcB0S7f_9Q6yuhpG5o7ca5xwENXDGUig-0A0_O8VfiPtnwhuCAv8iJdw_YndrKmCmpdXXHUg/s1600/second_best_image_deinterlaced_cropped_white_balance_inverted.png"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjlyB4YBiB9HC9igvFTM62dejU9U8Lx4dzENuWiCiCNL_nXvQ51t0mbnJts4w58T9OwJHMcB0S7f_9Q6yuhpG5o7ca5xwENXDGUig-0A0_O8VfiPtnwhuCAv8iJdw_YndrKmCmpdXXHUg/s320/second_best_image_deinterlaced_cropped_white_balance_inverted.png" /></a> <br /><br /><br /><br /><br /><h2>
Rudimentary thrust measurement</h2>
<div>
<br /></div>
<div>
We measured the thrust with a simple scale. Not very accurate, but enough to verify that the motor was able to generate thrust. From image analysis, we estimate the thrust to be around 1-2 Newton.</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLE-1nT8cacix1K8SKvpn4Ykh8q-tOXR1sAmkX5Ec6IMJgE2J83LZvzUnRWlHg8vVXx7vM7v55uLVleWeXvhhaRA1dgrA8oulmJRqNF3kuYbCafW-Oauma9esa9gUyxox0vs9iBZNfdQ/s1600/scale_before.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLE-1nT8cacix1K8SKvpn4Ykh8q-tOXR1sAmkX5Ec6IMJgE2J83LZvzUnRWlHg8vVXx7vM7v55uLVleWeXvhhaRA1dgrA8oulmJRqNF3kuYbCafW-Oauma9esa9gUyxox0vs9iBZNfdQ/s320/scale_before.png" width="180" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwyvAnXHL2cGJBJvn8h6hjWS21ziu58KlHA1OJVBHmi_9Qz85IPBkyodFZ6PAFsXLIMpRml1BFeZje9JJp30ALmOYzOjkOG6ryw9-4Ckwtkh2vX9w9xZ6U8_g3PSXq0aM8UNIWBJ3JDg/s1600/scale_during.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwyvAnXHL2cGJBJvn8h6hjWS21ziu58KlHA1OJVBHmi_9Qz85IPBkyodFZ6PAFsXLIMpRml1BFeZje9JJp30ALmOYzOjkOG6ryw9-4Ckwtkh2vX9w9xZ6U8_g3PSXq0aM8UNIWBJ3JDg/s320/scale_during.png" width="180" /></a></div>
<br />
<div>
<br />
<h2 style="text-align: left;">
Results</h2>
<div>
<h3>
Thrust</h3>
Some thrust was measured, estimated at 1-2 Newton. In the future we'll measure the thrust more accurately and we obviously intend on generating a lot more thrust.<br />
<br />
<h3>
Propellant burn rate</h3>
<div>
As mentioned, we burned through 120mm of propellant in 209 seconds so that's a burn rate of around 0.57mm/s and we are aiming for a burn rate that's at least 40 times higher.</div>
<h3>
Burn completeness</h3>
<div>
All of the GALCIT burned away and the motor was found to be empty and almost clean.<br />
<br />
<h3>
Nozzle erosion</h3>
Only minor nozzle erosion was observed, which may be due to the low pressure and exhaust velocity.<br />
<div>
<br /></div>
</div>
<h3>
Chamber cap thread leakage</h3>
It was observed that threads of the nozzle end cap had a slightly darker color up until halfway of the thread and some black residue was present. This leads to the conclusion that some gas slowly crept through the threads over the duration of the burn.<br />
<br />
This is expected because we are not using any o-rings or sealing mechanisms for the pressure vessel other than the thread of the pipe. The same pipe filled with water would also start leaking without some seal (such as hemp fibers) on the threads.<br />
<h3>
Residue buildup</h3>
We observed an interesting (and unexpected) residue buildup at the nozzle exit. We're not sure yet what the residue is composed of.<br />
<br />
It may be leftover or incompletely burnt propellant, eroded steel, ash or a mixture of a bit of everything.</div>
<div>
<br /></div>
<div>
The sharp edges of the nozzle hole and the small diameter of 3mm might contribute to the buildup of this material at the nozzle exit so this may go away by itself as we transition to smooth nozzles and/or bigger motors.</div>
<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/AVvXsEjhA0cqzEhg1F5L-1osxLFPflE1qNWomOUD4FWX_VhkyZf5y5e3EYgM0O51MKHoQIz71LsR81w3dH6oLdQbajahU2BTkConlwQzzuSlgnInjIjWGjubab40-8A25luEy2pCxaLfm1QW9Q/s1600/best_view_of_buildup.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjhA0cqzEhg1F5L-1osxLFPflE1qNWomOUD4FWX_VhkyZf5y5e3EYgM0O51MKHoQIz71LsR81w3dH6oLdQbajahU2BTkConlwQzzuSlgnInjIjWGjubab40-8A25luEy2pCxaLfm1QW9Q/s320/best_view_of_buildup.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="font-size: 12.8px;"><div style="font-size: 12.8px;">
Residue buildup at nozzle exit</div>
<div style="text-align: left;">
<div style="font-size: 12.8px;">
<span style="font-size: small;"><br /></span></div>
</div>
</td></tr>
</tbody></table>
<br />
<br />
<br />
<h2>
Conclusion</h2>
<div style="font-size: 12.8px;">
<span style="font-size: small;"><br /></span></div>
<div style="font-size: 12.8px;">
<span style="font-size: small;">The experiments went very well and being able to make a basic functional steel GALCIT motor was a milestone that we really needed to pass.</span></div>
</div>
<div style="font-size: 12.8px;">
<span style="font-size: small;">
</span></div>
<div style="font-size: 12.8px; text-align: left;">
<span style="font-size: small;"><br /></span></div>
<div style="font-size: 12.8px;">
<span style="font-size: small;">
</span></div>
<div style="font-size: 12.8px; text-align: left;">
<span style="font-size: small;">The prototype small scale GALCIT melter also worked adequately well so we will be able to use it for future small scale experiments and tests.</span></div>
<span style="font-size: small;">
</span>
<br />
<div style="font-size: 12.8px;">
</div>
<div style="font-size: 12.8px;">
</div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-47507891998953888972016-09-27T15:54:00.000-07:002016-09-27T16:30:20.871-07:00Successful GALCIT 61-C ignition using standard electrical matchesWe recently experimented with <a href="http://www.dhgate.com/product/0-3m-electric-igniters-100pcs-lot-e-matches/185900865.html" target="_blank">standard electrical matches</a> to ignite GALCIT 61-C propellant samples in combination with an off-the-shelf 433Mhz wireless pyrotechnic ignition system.<br />
<br />
This work is part of our effort to obtain a reliable, cheap and easy method for igniting GALCIT propellant for both small and large scale GALCIT solid propellant rocket motors.<br />
<br />
We learned from the experiments that these igniters work very well when used correctly.<br />
<br />
The correct way to use these igniters with GALCIT 61-C is to make sure they are embedded in GALCIT 61-C in such a way that they have a layer of at least 1 cm of GALCIT 61-C propellant extending from the tip of the igniters.<br />
<br />
This is the wrong way:<br />
<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/AVvXsEjTBqJNQuMHKZTE_rzWhmu12P1IW6SWUnq9KbZqcnpoIWz8uDATx94-p2yKGNVrR_U5cwEHDyI6_IoemoSxY9ejWTc7bHqnYufhgjGX2BOojh99L7769Xfx4HTgTvs68koNCoPKAMN-oQ/s1600/IMG_20160924_125414_poorly_embedded_staged_igniter_with_annotations.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTBqJNQuMHKZTE_rzWhmu12P1IW6SWUnq9KbZqcnpoIWz8uDATx94-p2yKGNVrR_U5cwEHDyI6_IoemoSxY9ejWTc7bHqnYufhgjGX2BOojh99L7769Xfx4HTgTvs68koNCoPKAMN-oQ/s320/IMG_20160924_125414_poorly_embedded_staged_igniter_with_annotations.jpg" width="270" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Wrong way to embed the igniter in the GALCIT propellant with only a few millimeters of GALCIT at the tip of the igniter</td></tr>
</tbody></table>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
When this igniter is used, a small hole is blown through the GALCIT and the hot flames are just heating up air.<br />
<br />
Here's the brief video of the failed ignition:<br />
<br />
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/Ld7VH1fypP0" width="560"></iframe>
</div>
<br />
Here a closeup of the GALCIT sample that failed to ignite:<br />
<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/AVvXsEicFPg8LjivlcDx3S0F1Os4V-4bExSjtUAjYiIHXLWeqjEqR-9TL_Z3afyzuBZY8qgU6xlNXtPvKs45mp4_oB1jPJDdh9HqFc4whX9l72xIC2UQ6GSES-WjoYE-vwwqdgUjX6rv7K_6IQ/s1600/IMG_20160924_132318.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEicFPg8LjivlcDx3S0F1Os4V-4bExSjtUAjYiIHXLWeqjEqR-9TL_Z3afyzuBZY8qgU6xlNXtPvKs45mp4_oB1jPJDdh9HqFc4whX9l72xIC2UQ6GSES-WjoYE-vwwqdgUjX6rv7K_6IQ/s320/IMG_20160924_132318.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Burned through rather than ignited GALCIT sample</td></tr>
</tbody></table>
<br />
<br />
This is the corrected way to embed the igniter in GALCIT:<br />
<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/AVvXsEjjTtHy7W9x3VDb8nNLBY5C1euPmd0VPnQh7lfOMgrx5d8rjPdH0cPLUqIJfdpcWkwRs8Fb5t97Fzp9xFydN92J3yiVn8u40WV8_jIZejd_GGRlcpqitkPMRpKLa5Q3TvManGGhvRerZw/s1600/IMG_20160924_121827_embedded_igniter_with_annotations.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjjTtHy7W9x3VDb8nNLBY5C1euPmd0VPnQh7lfOMgrx5d8rjPdH0cPLUqIJfdpcWkwRs8Fb5t97Fzp9xFydN92J3yiVn8u40WV8_jIZejd_GGRlcpqitkPMRpKLa5Q3TvManGGhvRerZw/s320/IMG_20160924_121827_embedded_igniter_with_annotations.jpg" width="238" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Correct way to embed the igniter in the GALCIT propellant with around 2 cm of GALCIT located at the tip of the igniter</td></tr>
</tbody></table>
<br />
The reason that this works a lot better is that the 2-3 cm long hot flame of the igniter is propelled forward to the tip of the igniter and not (or barely) to the sides. Any GALCIT that is placed will not ignite, although it can still be useful to have it there for practical purposes such as ensuring the igniter adheres properly to the GALCIT.<br />
<br />
Below is a picture of the receiver of the standard RF pyrotechnic igniter that we used. We later added an extension cord to ensure it would not get too hot from being close to the burning propellant.<br />
<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/AVvXsEjKdEl4iLxQFqC2ugqToRzTuF2wIQCXeOOm3mNH15aR8b1zFnDT5WI6wPh8UQpD0L6u83NnTRzII1iqHFtzf6dhx7EpdMzCyD6xYANPvKyGH64SWzbqTQDPBk3elxZ4LOL001tW_atB8w/s1600/IMG_20160924_121834.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKdEl4iLxQFqC2ugqToRzTuF2wIQCXeOOm3mNH15aR8b1zFnDT5WI6wPh8UQpD0L6u83NnTRzII1iqHFtzf6dhx7EpdMzCyD6xYANPvKyGH64SWzbqTQDPBk3elxZ4LOL001tW_atB8w/s320/IMG_20160924_121834.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Receiver of the 433Mhz RF pyrotechnic igniter </td></tr>
</tbody></table>
<br />
In the end, we were able to attain 100% reliable ignition of GALCIT 61-C in 3 out of the 3 tests where we had properly installed the igniter in the propellant.<br />
<br />
We were also successful in achieving <b>contact ignition</b>, where a small burning chunk of propellant ignites a larger one that is in contact <i>with it</i> rather than being embedded <i>in it</i>.<br />
<br />
Below is a close-up of the contact ignition set-up. The igniter, embedded in a small chunk of GALCIT, is placed underneath the big GALCIT sample:<br />
<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/AVvXsEg_gbWKi1i0Pf_V-OR4n47L1OZfElsyo323OBR_lk-swZxMLmzv6xSqrjxO6OVUEStFmMp4TFhf9Xr3ENENGl7lC8t16lG6jxjzfupBgXqFdQXNudu4N5bbOK4dAeJdWrs7FMqkEmQ_gQ/s1600/IMG_20160924_132800.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_gbWKi1i0Pf_V-OR4n47L1OZfElsyo323OBR_lk-swZxMLmzv6xSqrjxO6OVUEStFmMp4TFhf9Xr3ENENGl7lC8t16lG6jxjzfupBgXqFdQXNudu4N5bbOK4dAeJdWrs7FMqkEmQ_gQ/s320/IMG_20160924_132800.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Contact ignition setup</td></tr>
</tbody></table>
<br />
Contact ignition has the benefit that the igniters do not necessarily need to be embedded in the main propellant grain. Instead, they can be embedded into a small chunk of propellant that is in contact with the main propellant grain, which might reduce the complexity of casting propellant and installing igniters into large scale motors.<br />
<br />
Finally, below is a video of one of our successful ignitions:<br />
<div>
<div style="text-align: center;">
<br /></div>
</div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/CbnL-zPQk1s" width="560"></iframe></div>
<div>
<div style="text-align: center;">
<br /></div>
</div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-15204561233107925772016-08-11T08:17:00.001-07:002016-08-12T04:42:51.355-07:00Reverse engineering the SLAB HT2000 CO2, temperature and relative humidity sensor<span style="font-family: "courier new" , "courier" , monospace;"><b>TL;DR: I reverse engineered the SLAB HT2000 CO2, temperature and relative humidity (RH) data logger made by Dongguan Xintai Instrument Corporation. Sourcecode and binaries available at <a href="https://github.com/tomvanbraeckel/slab_ht2000" target="_blank">http://GitHub.com/tomvanbraeckel/slab_ht2000</a></b></span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<br />
I found a great CO2, temperature and relative humidity meter with USB connection. It's made by Dongguan Xintai Instrument Co. in China and branded under the name HT-2000. Available <a href="http://www.aliexpress.com/item/Big-discount-Digital-CO2-Monitor-CO2-Meter-Gas-Analyzer-detector-9999ppm-CO2-Analyzers-With-Temperature-and/32660117001.html" target="_blank">online for less than $100</a>, it is quite cheap for this kind of device.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbdxwiefwE1rZfTB4XjPFaD_PLPUt8haPdOB8w-sIFJMwvTSklAcBHLBHwpmVNsDlVxQfoU1NAftoIFug1GeET1ulkpDtM_gmd8DPft1qK0j7SUFaED4INm6s2bkMQYbsPqh4QjhLL6Q/s1600/Portable-Digital-CO2-Meter-CO2-Monitor-Detector.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhbdxwiefwE1rZfTB4XjPFaD_PLPUt8haPdOB8w-sIFJMwvTSklAcBHLBHwpmVNsDlVxQfoU1NAftoIFug1GeET1ulkpDtM_gmd8DPft1qK0j7SUFaED4INm6s2bkMQYbsPqh4QjhLL6Q/s320/Portable-Digital-CO2-Meter-CO2-Monitor-Detector.jpg" width="303" /></a></div>
<br />
<br />
There's only one downside to a lot of cheap Chinese product and this one is no exception.. it came bundled with:<br />
<ul>
<li>no Windows software or drivers, although I found <a href="https://github.com/tomvanbraeckel/slab_ht2000/blob/master/slab_ht_2000_setup.msi" target="_blank">one</a> online</li>
<li>no manual, although I found <a href="https://github.com/tomvanbraeckel/slab_ht2000/blob/master/Manual.pdf" target="_blank">one</a> online</li>
<li>no Linux software or drivers</li>
<li>no protocol specification</li>
<li>no datasheet</li>
</ul>
So how does one read out the values or communicate with this thing through the USB port?<br />
<br />
With the help of the Linux kernel, of course!<br />
<br />
Connecting the device to a modern Linux (kernel version 4.7) and running lsusb yields in:<br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># lsusb</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">Bus 003 Device 011: ID 10c4:82cd Cygnal Integrated Products, Inc. <span class="Apple-tab-span" style="white-space: pre;"> </span># this is the one!</span><br />
<br />
Cygnal makes USB-to-serial devices that are supported by the cp120x driver but this device actually reports itself to be a Human Input Device in its USB device descriptor:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;"># dmesg | tail</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407925.138165] usb 3-6: new full-speed USB device number 10 using xhci_hcd</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407947.073443] usb 3-6: new full-speed USB device number 11 using xhci_hcd</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407947.203629] usb 3-6: New USB device found, idVendor=10c4, idProduct=82cd</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407947.203632] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407947.203634] usb 3-6: Product: HT2000</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407947.203635] usb 3-6: Manufacturer: SLAB</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">[407947.209156] hid-generic 0003:10C4:82CD.0007: hiddev0,hidraw0: USB HID v1.01 Device [SLAB HT2000] on usb-0000:00:14.0-6/input0</span><br />
<div>
<br /></div>
<div>
And our Linux system creates a /dev/hidraw0 device as a virtual respresentation of the physical hardware device, the CO2 meter.</div>
<div>
<br /></div>
<div>
Manually reading out the device descriptor results in more confirmation that this is a raw HID device:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"># lsusb -v -v -v</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Bus 003 Device 003: ID 10c4:82cd Cygnal Integrated Products, Inc. </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Device Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bLength 18</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bcdUSB 1.10</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDeviceClass 0 (Defined at Interface level)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDeviceSubClass 0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDeviceProtocol 0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bMaxPacketSize0 64</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> idVendor 0x10c4 Cygnal Integrated Products, Inc.</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> idProduct 0x82cd </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bcdDevice 0.00</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> iManufacturer 1 SLAB</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> iProduct 2 HT2000</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> iSerial 0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bNumConfigurations 1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Configuration Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bLength 9</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 2</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> wTotalLength 41</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bNumInterfaces 1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bConfigurationValue 1</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> iConfiguration 0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bmAttributes 0x80</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> (Bus Powered)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> MaxPower 64mA</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Interface Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bLength 9</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 4</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bInterfaceNumber 0</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bAlternateSetting 0</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bNumEndpoints 2</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bInterfaceClass 3 Human Interface Device</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bInterfaceSubClass 0 No Subclass</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bInterfaceProtocol 0 None</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> iInterface 0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Warning: Descriptor too short</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> HID Device Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bLength 9</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 33</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bcdHID 1.01</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bCountryCode 0 Not supported</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bNumDescriptors 2</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 34 Report</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> wDescriptorLength 128</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 31 (null)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> wDescriptorLength 157</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Report Descriptors: </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> ** UNAVAILABLE **</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Endpoint Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bLength 7</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 5</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bEndpointAddress 0x81 EP 1 IN</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bmAttributes 3</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Transfer Type Interrupt</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Synch Type None</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Usage Type Data</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> wMaxPacketSize 0x0040 1x 64 bytes</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bInterval 10</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Endpoint Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bLength 7</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bDescriptorType 5</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bEndpointAddress 0x01 EP 1 OUT</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bmAttributes 3</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Transfer Type Interrupt</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Synch Type None</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> Usage Type Data</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> wMaxPacketSize 0x0040 1x 64 bytes</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> bInterval 10</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Device Status: 0x0000</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"> (Bus Powered)</span></div>
</div>
<div>
<br /></div>
<div>
So we know it's a Human Input Device but we have no further info on how to get data from it.</div>
<div>
<br /></div>
<div>
No data is coming out when just reading from it while the device is making measurements:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">sudo head -c 1 /dev/hidraw0 <span class="Apple-tab-span" style="white-space: pre;"> </span># Never finishes so not a single byte of data comes out here</span></div>
</div>
<div>
<br /></div>
<div>
Time to check out the Linux kernel samples of how to deal with hidraw devices. In the Linux kernel sources (version 4.7) there is an example samples/hidraw/hid-example.c which shows how to read a report from a hidraw device.</div>
<div>
<br /></div>
<div>
This example tool yields the following output:</div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"># sudo ./hid-example /dev/hidraw0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Report Descriptor Size: 128</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Report Descriptor:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">6 0 ff 9 1 a1 1 85 1 95 6 75 8 26 ff 0 15 0 9 1 91 2 85 2 95 3c 75 8 26 ff 0 15 0 9 1 91 2 85 3 95 1 75 8 26 ff 0 15 0 9 1 91 2 85 4 95 2 75 8 26 ff 0 15 0 9 1 91 2 85 5 95 1f 75 8 26 ff 0 15 0 9 1 81 2 85 6 95 3c 75 8 26 ff 0 15 0 9 1 81 2 85 7 95 3c 75 8 26 ff 0 15 0 9 1 81 2 85 8 95 3c 75 8 26 ff 0 15 0 9 1 81 2 c0 </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Raw Name: SLAB HT2000</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Raw Phys: usb-0000:00:14.0-6/input0</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Raw Info:</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>bustype: 3 (USB)</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>vendor: 0x10c4</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>product: 0x82cd</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">ioctl HIDIOCGFEATURE returned: 4</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">ioctl HIDIOCGFEATURE returned: 61</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">Report data (not containing the report number):</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>8 9b a5 22 5 5 9b a3 22 5 5 9b a1 22 5 5 9b a1 22 5 5 9b a1 22 54 5 9b a2 22 54 5 9b a4 22 54 5 9b a5 22 54 5 9b a4 22 84 5 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff </span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">write() wrote 2 bytes</span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">read: Resource temporarily unavailable</span></div>
<div>
<br /></div>
<div>
The "Report data" looks interesting but we are looking for live measurements and these values don't seem to change when running the program multiple times.<br />
<br />
So we need to dig deeper.<br />
<br />
Now, looking at the source code of the hidraw example, I noticed that it is trying to read out report number 9. So I set out to read the other report numbers and seeing whether anything useful comes out.<br />
<br />
Report numbers 1 to 4 all have the same content as the 9, except that the first byte is different and seems to contain the report number itself.<br />
<br />
Report number 5 is interesting though. The report data seems to be live because it is changing slightly after every run:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">5 77 0 c4 e1 0 36 2 8c 1 f7 1 90 3 20 0 64 3 b6 b0 3 1 a1 22 2 73 0 0 7 d0 5 9b</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">5 77 0 c4 c6 0 64 2 8c 1 f9 1 90 3 20 0 64 3 b6 b0 3 0 a1 22 2 75 0 0 7 d0 5 9b</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">5 77 0 c4 e6 0 64 2 8c 1 fa 1 90 3 20 0 64 3 b6 b0 3 0 a1 22 2 7c 0 0 7 d0 5 9b</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">5 77 0 c4 c7 0 64 2 8c 1 f9 1 90 3 20 0 64 3 b6 b0 3 0 a1 22 2 7f 0 0 7 d0 5 9b</span><br />
<br />
AHA! That is live data we are seeing there!<br />
<br />
Comparing these values to the actual measurements on the display allowed me to spit out the following partial reverse engineered specification for this report #5:<br />
<br />
Output:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">5 77 0 c5 f2 0 64 2 97 1 ee <span class="Apple-tab-span" style="white-space: pre;"> </span>1 90 3 20 0 64 3 b6 b0 3 0 ff ff <span class="Apple-tab-span" style="white-space: pre;"> </span>2 e8 0 0 7 d0 ff ff </span><br />
<span style="font-family: "courier new" , "courier" , monospace;"> DD D DD DD T TT H HH C CC</span><br />
<br />
<u>Where:</u><br />
<u><br /></u>
DD D DD DD = a timestamp, seconds since epoch + 2004450700 (magic number)<br />
T TT = the temperature, multiplied by 10 and plus 400 (26.3 degrees Celcius in the example above)<br />
H HH = the humidity, multiplied by 10 (49.4 % R.H. in the example above)<br />
C CC = the CO2 concentration, 744 ppm in the example above</div>
<div>
<br /></div>
<div>
Writing a C program that reads out these values was trivial and <a href="https://github.com/tomvanbraeckel/slab_ht2000" target="_blank">published on GitHub</a>.</div>
<div>
<br /></div>
<h3>
Future work</h3>
<h4>
Report #6</h4>
<div>
Report #6 toggles between 2 different outputs:</div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">6 1 3 20 0 64 3 b6 0 57 22 b5 b6 1 57 22 b5 b6 0 0 0 0 7 d0 0 0 0 0 0 0 0 6 ff ff ff 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</span></div>
<div>
<br /></div>
<div>
and</div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">6 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 fe 20 0 64 1 0 1 b0 1 90</span></div>
<div>
<br /></div>
<h4>
Report #7</h4>
<div>
There seems to be a pattern here, similar to what report #6 outputs:</div>
<div>
<br /></div>
<div>
<span style="font-family: "courier new" , "courier" , monospace;">7 1 3 20 0 64 3 b6 0 57 22 b5 b6 1 57 22 b5 b6 0 64 0 0 7 d0 0 0 0 0 0 0 0 7 ff ff ff 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1</span></div>
<div>
<br /></div>
<div>
<h3>
More features</h3>
</div>
<div>
According to the specifications, this device also contains memory for at least 10000 measurements and can log in different modes (Immediately, Schedule, Real-time & Roll-over) but I could not figure out how to change the default mode without having the Windows PC software. This means the "REC" button does not do anything because the mode is set to "Immediately" instead of "Manual".</div>
<div>
<br /></div>
<div>
Also, recalling minimal and maximal values should be possible on the display but I have no idea how.</div>
<div>
<br /></div>
<div>
If you have any idea on how to use those extra features, leave a comment please. Thanks!</div>
<div>
<br /></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com2tag:blogger.com,1999:blog-4355918818071282445.post-4638261472336442672016-07-19T07:20:00.000-07:002017-05-05T03:36:33.425-07:00Linux shell script to stream audio to a Zavio IP CameraWhile I was showing an apprentice how to reverse engineer closed HTTP interfaces, we figured out how the proprietary Zavio webbrowser plugin streams audio data to the Zavio F3510 IP Cameras and other models from around 2016.<br />
<br />
Then I wrote a rudimentary bash shell script that enables you to play MP3, WAV, FLAC, MIDI or any other file formats that avconv can handle through the camera's poor little speaker.<br />
<br />
Interestingly, you can also use this script to continuously stream live audio from a HTTP URL to the camera and that way you can enjoy music anywhere you've installed your camera's.<br />
<br />
Currently, this script is compatible with bash on Linux but I don't see why it wouldn't work on bash for Windows or Mac OS if you're into that kind of thing. Just make sure you have the necessary dependencies (avconv, curl,...) in your search PATH.<br />
<br />
Enjoy!<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">#!/bin/bash</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># Simple shell script to stream audio to a Zavio F3510 or other Zavio camera's from around the year 2014, 2015 and 2016</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># No configuration is required, just supply the parameters on the command line</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># Supported audio formats: mp3, mp2, wav, ogg and many more, thanks to avconv and all related projects</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># Uses curl, the Swiss Army Knife of networking</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># Copyleft by Tom Van Braeckel, 19-07-2016 🔥</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># How it works:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># =============</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># The Zavio needs to receive pcm_mulaw encoded audio samples</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># at a sample rate of 8000 samples/second (8kHz) mono at 16 bits per sample through a HTTP web interface.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># The data is sent through periodic HTTP requests in chunks of 1000 bytes audio data + HTTP protocol overhead.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># Dependencies:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># -------------</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># - avconv</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># - curl</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># - base64</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># - sleep (a modern one that accepts non-integer arguments, as in: sleep 0.06)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># - echo (a modern one that supports the -e "\r" construct)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># Theoretical note:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># -----------------</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># The HTTP API that we call has no active two-way synchronisation protocol so there will always be timer drift between the rate at which we send samples and the rate at which they are consumed. When there is drift, the Zavio seems to insert a few dummy samples or drop samples to correct the drift. This could theoretically be heard as clicks or cracks when playing long audio clips but it seems to work fine for me.</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># Calculation of the rate at which we need to send chunks of audio to the HTTP API:</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># ---------------------------------------------------------------------------------</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># 1000 bytes/chunk / 2 bytes/sample = 500 samples/chunk</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># 8k samples/second / 500 samples/chunk = 16 chunks/second = 1/16 second/chunk = 0.0625 second/chunk</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">sleep_time_per_audio_chunk=0.06<span class="Apple-tab-span" style="white-space: pre;"> </span># target sleep time (0.0625 seconds) minus around 4% = 0.0025s overhead (forking new sleep process)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">ip="$1"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">auth="$2"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">file="$3"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">boost="$4"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">if [ -z "$ip" -o -z "$auth" -o -z "$file" ]; then</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Usage: $0 ip_address username:password filename/url [volumeboost in dB]"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Example: $0 192.168.4.20 tom:supercool world_domination.wav"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Example: $0 192.168.1.203 admin:admin audiofile.mp3 10"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Example: $0 192.168.1.203 admin:admin http://streamingserver.com/stream -5"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>exit 1</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">fi</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># Default to 0 boost</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">if [ -z "$boost" ]; then</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>boost=0</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">fi</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">echo "boost = $boost"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># Encode the username:password pair in base64 encoding</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">auth64=$(echo -n "$auth" | base64)</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;"># Arbitrary string of text</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">string="--As from earth's Bos om, sprung to sight"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><br /></span>
<span style="font-family: "courier new" , "courier" , monospace;">echo -n "Sending audio sample..."</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># Send the encoded audio to stdout with avconv and amplify it a bit, read it in chunks of 1000 bytes, add the HTTP prefix and let curl do the HTTP 1.0 request</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"># We do this while curl is doing requests of size > 1000 bytes, until the grep no longer exits successfully, which ends the loop</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">avconv -i "$file" -f wav -acodec pcm_mulaw -ar 8000 -ac 1 -af "volume=$boost"dB - | while (echo -en "$string\r\nContent-Type: audio/wav\r\n" ; head -c 1000 ) | curl -v --http1.0 -H "Content-Type: multipart/form-data; boundary=$string" -H "Authorization: Basic $auth64" --data-binary @- http://$ip/cgi-bin/operator/transmit 2>&1 | grep -q "Content-Length: 1[0-9][0-9][0-9]"; do</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>sleep "$sleep_time_per_audio_chunk"</span><br />
<span style="font-family: "courier new" , "courier" , monospace;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo -n .</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">done</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">echo "done."</span><br />
<div>
<br /></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-22295081842460981212016-07-06T07:27:00.002-07:002016-07-07T09:14:26.520-07:00Nichrome and black powder electrical pyrotechnic igniter with GALCIT solid rocket propellantWe've made progress on the pyrotechnic igniter. It now uses nichrome wire because it has a high resistance, so it gets very hot when electricity is forced through it.<br />
<br />
We wind the nichrome in a spiral so that it is longer, again for more electrical resistance, and place it on a paper rectangle of around 5x10cm.<br />
<div>
<br /></div>
<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/AVvXsEgkHHJdLLTPi4pkk8Px8TNS70PSEXah4XkCsY2lvfKQ5zBzO0aXBH26QSQVfDlzBkxOsAtgXB6UhjObWXF6qmXwgf8to898C_Ox9XQ8wTgRHJMZvKwUdrsjIRtL4u7k1wOH4IcK-6mgPQ/s1600/IMG_20160627_205401.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgkHHJdLLTPi4pkk8Px8TNS70PSEXah4XkCsY2lvfKQ5zBzO0aXBH26QSQVfDlzBkxOsAtgXB6UhjObWXF6qmXwgf8to898C_Ox9XQ8wTgRHJMZvKwUdrsjIRtL4u7k1wOH4IcK-6mgPQ/s320/IMG_20160627_205401.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Nichrome wire spiral</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<div>
The nichrome wire has a diameter of 0.2mm and when stretched out is about 150mm long. With a resistance of 34 Ohm per meter, that is around 0.51 Ohm resistance in that piece of 150mm nichrome wire. </div>
<div>
<br /></div>
<div>
Then we pour some black powder over the coil and roll it up into a cylinder, reinforced with some paper tape.</div>
</div>
<div>
<br /></div>
<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/AVvXsEhdfcGdNn0zt4YcKdC8WLuVBM0sXy8R3kMXT_krX4uedTqy-DCU5ToQsRal7IC_VenRNWI_4RxRigACcBMn4PqK0d3lFJunG3QmPmPr3fRq8RuEM58aa3v1ykRaJXCzWUAFcX_rG5cHXw/s1600/IMG_20160627_205509.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdfcGdNn0zt4YcKdC8WLuVBM0sXy8R3kMXT_krX4uedTqy-DCU5ToQsRal7IC_VenRNWI_4RxRigACcBMn4PqK0d3lFJunG3QmPmPr3fRq8RuEM58aa3v1ykRaJXCzWUAFcX_rG5cHXw/s320/IMG_20160627_205509.jpg" width="240" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Black powder in paper with nichrome wire spiral inside</td></tr>
</tbody></table>
<div>
<br /></div>
<div>
<div>
As a test we ignited a bit of leftover GALCIT in a heat resistant 2l lab beaker.</div>
<div>
<br /></div>
<div>
Heat resistant, yes, but as it turns out it was not GALCIT heat resistant. </div>
<div>
<br /></div>
<div>
Our final setup looks like this, placed on a burn pile:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoyivh-Ot818GEuR1xFT2pqqwLHto_aWSViMhAeiG7SUrxM53Os5y9XGZwHAywkxyFnFgbnBEDTnq6jYeN16LW2YRgipkoZUZWnm6Jw7HrchPm5LB-3x6H2CCgk03F0Kk1JVGuteKC6w/s1600/IMG_20160627_205807.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhoyivh-Ot818GEuR1xFT2pqqwLHto_aWSViMhAeiG7SUrxM53Os5y9XGZwHAywkxyFnFgbnBEDTnq6jYeN16LW2YRgipkoZUZWnm6Jw7HrchPm5LB-3x6H2CCgk03F0Kk1JVGuteKC6w/s320/IMG_20160627_205807.jpg" style="cursor: move;" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
Pyrotechnic igniter installed in a lab beaker </div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div>
To get the nichrome to glow red hot, we used a powerful 18V battery from a Makita drill to supply the current through an old UTP cable. But a 4.5A 6V battery should also do the trick.</div>
<div>
<br /></div>
<div>
The ignition went smoothly and the burn was quite spectacular. The jet of fire that was spewed into the air indicated that we were already developing <i>some</i> thrust, which is remarkable with such a huge throat (in this case, beaker) area.</div>
<div>
<br /></div>
<div>
Here's the video:</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/oJGhJ2cKySY/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/oJGhJ2cKySY?feature=player_embedded" width="320"></iframe></div>
<div>
</div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-60550793075887337462016-06-07T14:03:00.000-07:002016-06-07T14:03:52.853-07:00Electrical model rocket black powder igniter with steelwool<br />
<u>Hypothesis:</u> A cheap rocket motor igniter can be made out of steel wool and black powder.<br />
<br />
We tried out the concept by sending an electrical current through some steel wool and got it to ignite at 3 Volt and 5 Ampère.<br />
<br />
<div style="text-align: center;">
<b>Power required = 3 Volt * 5 Ampère = 15 Watt</b></div>
<br />
Readers note: steel wool requires quite some energy to get it to glow red hot and ignite. But 15 Watts is easily reached by using a powerful battery such as an 28 Volts battery of an electrical hand-held drill.<br />
<br />
Here's the video of steel wool igniting at around 15 Watts:<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/bC0sQZlnU5k" width="560"></iframe>
<br />
<br />
Then we arranged the steel wool on some paper tape:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxOGLfDaBh6-qNmReD5ghm0JSBrC_PlpHoPM-sD1uPA5HcirgVGxw3ZOt3ji63TH5H-LxeJfLnWxHP9YOaII5eQi7nMtmj7kT0pn3Vh-DT0OOdQPhlQhO7zUto6nnSjo7AmnfpGKfYag/s1600/IMG_20160606_204632.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhxOGLfDaBh6-qNmReD5ghm0JSBrC_PlpHoPM-sD1uPA5HcirgVGxw3ZOt3ji63TH5H-LxeJfLnWxHP9YOaII5eQi7nMtmj7kT0pn3Vh-DT0OOdQPhlQhO7zUto6nnSjo7AmnfpGKfYag/s320/IMG_20160606_204632.jpg" width="320" /></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 class="separator" style="clear: both; text-align: left;">
Poured black powder on top and simply wrapped it up.</div>
<br />
We made 3 versions:<br />
<br />
<ul>
<li><a href="https://youtu.be/h_Fyv7gER2M" target="_blank">test #1</a>: a black powder igniter with paper tape, pictured above</li>
<li><a href="https://youtu.be/6hL9mNca-y4" target="_blank">test #2</a>: a black powder igniter with a plastic straw</li>
<li>test #3: a black powder igniter with a post-it, rolled up and taped together </li>
</ul>
<br />
Test #3 contained a bit too much black powder than strictly necessary, check out the video. It will be discussed in the"Safety Improvements" section below!<br />
<br />
<br />
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/Jj2GbxyDjPI" width="560"></iframe><br />
<br />
<h2>
Price</h2>
<br />
<ul>
<li>Small amount (2 g) of steel wool: 0.2 euro</li>
<li>Small amount (10 g) of black powder: 0.6 euro</li>
<li>Copper wire (10 cm) to connect to the steel wool: 0.2 euro</li>
</ul>
<div>
Total price per igniter: around 1 euro</div>
<br />
<h2>
Conclusions</h2>
<div>
The hypothesis has been validated; a cheap rocket motor igniter can be made out of steel wool and black powder. The igniter has a power requirement of around 15 Watt.</div>
<div>
<br /></div>
<h2>
Safety improvements</h2>
<div>
To stay focused on safety, we'll conclude every session by trying to find at least one safety improvement to be implemented.</div>
<div>
<br /></div>
<div>
Next time we'll be sure to fixate the camera and leave it unmanned. That will give us a better view of the reaction from close by and will keep us safe at the same time.</div>
<div>
<br /></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-23409401772008372612016-06-07T14:00:00.000-07:002016-06-07T14:09:47.619-07:00Simple do-it-yourself automatic (black)powder mixerThis simple, cheap home-made powder mixer can be used to mix relatively large quantities of powder, such as blackpowder, automatically.<br />
<br />
Since a picture says more than a 1000 words, let's start with 160 pictures in rapid succession:<br />
<div>
<br /></div>
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/lHa8xzubmQY" width="560"></iframe>
<br />
<div>
<div>
<br /></div>
<div>
<i>Above: The powder mixer in action. This video says more than 160 x 1000 words.</i></div>
<div>
<br />
Note that the final model looks slightly different; in the end we moved one of the rolls to the opposite side of the box so that the mixing container is spinning between the powered and the non-powered roll. This reduces the friction on the container so that it spins around more easily.<br />
<br />
<h2>
Shopping list</h2>
<br />
<ul>
<li>1 hand-held drill (battery powered or otherwise is fine) to provide rotation</li>
<li>1 plastic box (cheap at IKEA or simular) to support the axles</li>
<li>2 cardboard cylinders</li>
<li>2 axles (we used metal bars but wood should also work)</li>
<li>glue to attach the cylinders to the axles</li>
</ul>
</div>
<h2>
Mixing container</h2>
<div>
The mixing happens inside a container. We used a metal container with a plastic lid, which is not ideal for pyrotechnic powders - see the "Safety Improvements" section below.<br />
<br />
To ensure proper mixing, we glued a wooden stick to the inside of the mixing container. That way, the powder gets scooped up and dropped down continuously, similar to a concrete mixer.</div>
<div>
<br /></div>
<div>
We also threw in a few plastic cubes, again to have better mixing by creating some "chaos" or randomness in the mixing process.</div>
<div>
<br /></div>
<div>
On the picture below, the wooden stick is barely visible because of the blackness of the powder:</div>
<div>
<br /></div>
<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/AVvXsEhdS3o-LSJzeWl4WbYzNMNaeLtN_bLPs6tKLS-4HbZ7RcCLIG35urV_YVEhcl5rXsJY_IY9D6jzVczT3IeB8VOxbbcVnsFr-EWuyxY_S6uRSHI29SMdYSuCnP0dNg4nzulgYfaszdKjTw/s1600/IMG_20160606_204644.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdS3o-LSJzeWl4WbYzNMNaeLtN_bLPs6tKLS-4HbZ7RcCLIG35urV_YVEhcl5rXsJY_IY9D6jzVczT3IeB8VOxbbcVnsFr-EWuyxY_S6uRSHI29SMdYSuCnP0dNg4nzulgYfaszdKjTw/s320/IMG_20160606_204644.jpg" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;"><span style="font-size: small; text-align: start;"><i>The powder mix container filled with black powder.</i></span></td></tr>
</tbody></table>
<h2>
The results</h2>
<div>
This blackpowder is of the best quality that we have made with any dry mixing process so far.<br />
<br /></div>
<div>
The only superior quality that we obtained in the past was with a liquid mixing processes, such as the process that involves boiling water, a blender and isopropyl alcohol, but that is more cumbersome and the quality we have here will suffice for our igniters.</div>
</div>
<div>
<br />
We will be able to use this powder for our igniter tests, as documented in the article "<a href="http://globalblindspot.blogspot.be/2016/06/electrical-model-rocket-black-powder.html" target="_blank">Electrical model rocket black powder igniter with steelwool</a>".<br />
<br />
<h2>
Safety improvements</h2>
<div>
In hindsight, mixing black powder in a metal container with a plastic lid is not ideal for safety. Should the black powder ignite for whatever reason, and should the plastic lid fail to release, then the pressure would build up inside the container and it could potentially blow up. </div>
<div>
<br /></div>
<div>
In general, it is recommended never to place pyrotechnical substances inside metal or glass containers because they could shatter when the substance ignites. Also, make sure that the container has a lid that easily comes off to ensure no pressure can build up inside. </div>
<div>
<br /></div>
<br /></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-47785805487833785722016-06-01T07:15:00.001-07:002016-06-02T05:03:11.081-07:00Making GALCIT propellant + test burnWe resumed our GALCIT solid rocket propellant preparation that was <a href="http://globalblindspot.blogspot.be/2016/05/first-stab-at-making-solid-rocket.html" target="_blank">started a few days ago</a>.<br />
<br />
<u>High-level plan:</u><br />
<br />
<ol>
<li>Melting the mixture of bitumen and paraffin oil that we made last time</li>
<li>Mixing in 2614.4 grams of potassium perchlorate (KClO4)</li>
<li>Casting the GALCIT into some cardboard test engine tubes and into a small ceramic bowl</li>
<li>Lighting a small amount of GALCIT at atmospheric pressure in the ceramic bowl</li>
</ol>
<br />
<br />
<h2>
Step 1. Melting the mixture of bitumen and paraffin oil</h2>
<br />
Melting the mixture of bitumen and paraffin oil took around 1 hour at 300 degrees Celcius. This is quite slow because the contact surface area between the melting beaker and the temperature controlled hotplate is quite small. To optimize this, we'll use a crucible with a larger base next time.<br />
<br />
For safety, a gas mask and protective gloves were worn during the mixing. The gloves are great, they protect from heat and fluids so they are ideal for bitumen. Without them, this would have been a lot more difficult.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH-NQUrMG1wEkn8lII77jnXbHfy5_n-mTq78ZlxJqnxJmsMYJD7MZ83cRPsb8zpRqSwoIthy28XV4F6feQL7ABu7WRvRc5zpatAX0UJYfPDrG1i-w5YEvJQdTSm1uMftPu_W5GeAP_Sw/s1600/IMG_20160531_211911.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhH-NQUrMG1wEkn8lII77jnXbHfy5_n-mTq78ZlxJqnxJmsMYJD7MZ83cRPsb8zpRqSwoIthy28XV4F6feQL7ABu7WRvRc5zpatAX0UJYfPDrG1i-w5YEvJQdTSm1uMftPu_W5GeAP_Sw/s320/IMG_20160531_211911.jpg" width="320" /></a></div>
<br />
Once the mixture had completely melted, it was quite runny, quite comparable to molten chocolate.<br />
<br />
<br />
<h2>
Step 2. Mixing in potassium perchlorate</h2>
<br />
Mixing in the oxidizer was done in open air for safety reasons, again with protective gear.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzRGwv2Uusx3Lsszi8v9k2S5Ks-LYFQ3GmK1Nx2Wr50igSJdbts0w8Q1OqeD8yseQ4pxl9wECfnC5WQ9Q3pL5q9sKafw8TZcHEjexW-o8cEFoEiWOnQObg3gC449kw7Syalm6EXS42Cg/s1600/IMG_20160531_211928.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjzRGwv2Uusx3Lsszi8v9k2S5Ks-LYFQ3GmK1Nx2Wr50igSJdbts0w8Q1OqeD8yseQ4pxl9wECfnC5WQ9Q3pL5q9sKafw8TZcHEjexW-o8cEFoEiWOnQObg3gC449kw7Syalm6EXS42Cg/s320/IMG_20160531_211928.jpg" width="240" /></a></div>
<br />
<br />
The large volume of propellant in comparison with the small surface contact area with the hot plate meant it was difficult to keep the GALCIT hot enough.<br />
<br />
And since the oxidizer has quite a high heat capacity (111.35 J/mol·K), every time a quantity of the oxidizer was added, the mixture would cool down and stiffen up. Also the volume would increase, so the unfavorable volume/contact area would worsen at every increment.<br />
<br />
In the end, we divided the 2l mixture over two containers and continued with 1l of volume.<br />
That resolved the heating issue and allowed us to finish up our first liter of GALCIT.<br />
<br />
The final GALCIT mixture is quite viscose (similar to wet clay) and very sticky.<br />
<br />
<h2>
Step 3. Casting the GALCIT</h2>
<br />
The viscosity of GALCIT was too high to allow pouring it directly into our cardboard test engine tubes but it was easy enough to scoop it out, smear it into the tubes and pack it together with a stick.<br />
<br />
We filled up 3 cardboard test engine tubes that had a clay stopper on the bottom, those still need to be reinforced, fitted with an ignition and nozzled up.<br />
<br />
To avoid pockets of air in the propellant, which would dramatically increase the surface area, we just tried to pack it tightly. In the future, we might need a better way to ensure no bubbles get trapped inside to ensure a continuous burn.<br />
<br />
<h2>
Step 4. GALCIT burn test</h2>
<br />
Since we had a bit of GALCIT left, we decided to do a small test to see whether we could get it to ignite at atmospheric pressure with 10 grams of (relatively poor quality) black powder that we made on the side.<br />
<br />
We placed around 14cl (around 300g) into a small ceramic bowl and poured the black powder on top.<br />
<br />
This batch of black powder did not easily ignite when placing a burning cigarette into it, although the previous batch did. But that wasn't unexpected, considering the poor quality of the black powder. Luckily, we had a solid plan B for igniting the black powder and the GALCIT, using a simple hand-held propane blow torch.<br />
<br />
The blow torch did the trick. We were surprised of how well GALCIT burns at 1 bar, considering it burns optimally at 70-140 bar.<br />
<br />
Just take a look at the video, at 1m 10s...<br />
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" frameborder="0" height="315" src="https://www.youtube.com/embed/_7JPgZd_it8" width="560"></iframe>
</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<h2>
Timeline of the test burn:</h2>
<ul>
<li>1:10 start of blackpowder ignition</li>
<li>1:20 start of GALCIT ignition</li>
<li>2:05 fade out of GALCIT burn (smaller diameter and surface area at bottom of ceramic cup)</li>
<li>2:13 end of GALCIT burn</li>
</ul>
<br />
Total burn time: 45 seconds<br />
<br />
A total burn time of 45 seconds is <i>huge</i> for such a small amount of GALCIT. It means the burn rate was very slow, about 0.27 mm/s. Consider the excessively high burn rates (~ 36.5 mm/sec) that have been reported and large burning surface area, estimated at around 40 cm3.<br />
<br />
Yet this is to be expected, due to the low atmospheric pressure at which the burn occurred.<br />
GALCIT has a very high pressure exponent so the burn rate increases dramatically with the pressure.<br />
<br />
So the time has come to test the propellant at a higher chamber pressure!<br />
<br />t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-73478542451192883092016-05-30T10:36:00.000-07:002016-05-31T00:36:48.015-07:00First stab at making solid rocket propellant (GALCIT)Last weekend we took a first stab at making the solid rocket propellant GALCIT.<br />
<br />
<u>Long story short</u>: melting bitumen on the temperature controlled hotplate took a lot longer than expected so we weren't able to mix in the potassium perchlorate yet. That's planned for the next session, tomorrow!<br />
<br />
Below is a small report of the session with some visuals.<br />
<br />
***<br />
<br />
The goal was to make 2l of GALCIT, with the following composition:<br />
<ul>
<li>76% Potassium perchlorate (KClO4) Superfino from <a href="http://nitroparis.com/" target="_blank">Nitroparis</a></li>
<li>20% Solid block bitumen from <a href="http://icopal.be/" target="_blank">Icopal</a> through <a href="http://www.defrancq.be/" target="_blank">Defranq</a></li>
<li>4% Paraffin oil from the local drugstore, <a href="https://www.blogger.com/">Estfarma</a></li>
</ul>
<div>
Lots of gratitude to Peter Madsen of the <a href="http://rml.space/" target="_blank">RML spacelab</a> for providing us with this formula and lots of useful pointers. They are doing amazing work.<br />
<br />
Also a big thanks to the mentioned suppliers. Each of them went out of their way to guide us to the proper channels for acquiring these products. They seem to be of great quality!</div>
<div>
<br /></div>
<div>
We are making a volume 2l of GALCIT so at the published density of 1.72 kg/l the total propellant mass computes to 3.44 kg.</div>
<div>
<br /></div>
<div>
Applying the above GALCIT composition, that translates to:</div>
<div>
<ul>
<li>76% = 2614.4 g of potassium perchlorate</li>
<li>20% = 688g of solid block bitumen</li>
<li>4% = 137.6 g of paraffin oil</li>
</ul>
</div>
<div>
The high-level procedure to make GALCIT is:</div>
<div>
<ol>
<li>Heat paraffine oil</li>
<li>Melt bitumen in paraffin oil</li>
<li>Mix in potassium perchlorate through a fine sieve to remove lumps</li>
</ol>
<div>
This is our block of 10kg bitumen:</div>
</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_m92-9K6cpD4DEFQj8M8saLim8Ug6befMoqdN5ksXzhN-iVFWGPm-9ifDbXslSfXYFHSqAXuDxxRKU5Fk7cvhwkN841KUmrrHzgpSjmKQNIVDcZSWA930uleVYuGE3L0YlCS1i4hzMw/s1600/IMG_20160528_104119.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj_m92-9K6cpD4DEFQj8M8saLim8Ug6befMoqdN5ksXzhN-iVFWGPm-9ifDbXslSfXYFHSqAXuDxxRKU5Fk7cvhwkN841KUmrrHzgpSjmKQNIVDcZSWA930uleVYuGE3L0YlCS1i4hzMw/s320/IMG_20160528_104119.jpg" width="320" /></a></div>
<div>
<br /></div>
<div>
Cutting 688g off of it was difficult, as expected. Bart discovered that cutting it with a long, strong, heated knife turned out to be the easiest way to cut slices off. </div>
<div>
<br /></div>
<div>
I was surprised to see that although bitumen looks heavy, it actually has a low density. Look at all that volume to make up just 689.28g! </div>
<div>
<br /></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWxDRe9l-jSyRMmSqnJB55E2Ri6ZIy4EyBhysIQPi6ZPjmaj02rJIM72F-2CWHSXK85WBQ-T-qgmIUYH2zEdz4hxBZUaEVpYgcZsAgippQlQUZqKS_haSuCes0B2DtI_6NSG5OLjFzw/s1600/IMG_20160528_110102.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihWxDRe9l-jSyRMmSqnJB55E2Ri6ZIy4EyBhysIQPi6ZPjmaj02rJIM72F-2CWHSXK85WBQ-T-qgmIUYH2zEdz4hxBZUaEVpYgcZsAgippQlQUZqKS_haSuCes0B2DtI_6NSG5OLjFzw/s320/IMG_20160528_110102.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To melt the bitumen, we are using the RSM-05-H by Phoenix Instrument. This hot plate with built-in magnetic stirrer can stir 20l of water and reach up to 550 degrees Celsius. Having accurate temperature control is important to avoid overheating the propellant. Overheating is in any case unlikely because of the big difference in preparation temperature (less than 200 degrees C) and combustion temperature (500 degrees C).</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
The RSM-05-H has an RS-232 interface to control and monitor it from a computer but we didn't use that this time. And although it came with a probe for accurate in-liquid temperature control, we wanted to spare the poor probe from being dipped into sticky, molten bitumen...</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3EPltELaL1XTAl9vQkORCeXF9elDQRjAVuLYxhh6oBxfxvZUDYKs4P-f6JQ37tLcw7BUUOvdp6oI-CdH6zZ1aA18xZhnAIu08w91klOZyDQErGvSetDS7BDBarKcK8yCw8GtMRqaiow/s1600/IMG_20160528_115556.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3EPltELaL1XTAl9vQkORCeXF9elDQRjAVuLYxhh6oBxfxvZUDYKs4P-f6JQ37tLcw7BUUOvdp6oI-CdH6zZ1aA18xZhnAIu08w91klOZyDQErGvSetDS7BDBarKcK8yCw8GtMRqaiow/s320/IMG_20160528_115556.jpg" width="240" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Melting the bitumen took a lot longer than expected. This is not unusual - bitumen just takes a long time to melt. Also, we did the mixing outside with a light breeze, which is great for ventilation but causes quite some heat loss on the hot plate.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
To speed up the melting process, we turned the temperature up to 200 degrees C, which is without risk as long as the oxidizer (the potassium perchlorate) is not mixed in yet.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
In total, melting 689.28g of bitumen with paraffin oil took around 1 hour and 15 minutes.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
***</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Before melting bitumen, we took the time to make various cardboard test-engines to cast the propellant into. Bart knew that the best way to cut cardboard tubes is with a fine metal saw:</div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip_KDbsWYQ_OYoy6Mq6EWj8zflyuC8WC3OVTfqr4ibu9_iZd9y6M4BPzqYBlBy2O-E4DGOUmL2CseJqMUm9QYAntuxJ8_usOhoKnK6Qy5V1Yhtzj_lfGBy7YwOciGgaLJYtcO1SPcY9A/s1600/IMG_20160528_110708.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEip_KDbsWYQ_OYoy6Mq6EWj8zflyuC8WC3OVTfqr4ibu9_iZd9y6M4BPzqYBlBy2O-E4DGOUmL2CseJqMUm9QYAntuxJ8_usOhoKnK6Qy5V1Yhtzj_lfGBy7YwOciGgaLJYtcO1SPcY9A/s320/IMG_20160528_110708.jpg" width="320" /></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 class="separator" style="clear: both;">
While melting, we experimented with a small amount of ignition powder, composed of 80% potassium nitrate (KNO3) and 20% fine carbon powder.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1tzeo_DDzSdsEMjYeqLHqkYKYNoNK0p_FNKN_uK5tbwUUgoawl06sqjcRqdFOS34zPzjpnpoKDAjFMtuNnn0zW7KPWfrjqGfkGq1JE7ZnohxzeTrnWs8YRt2UyyGZimC7EMp0FW728g/s1600/IMG_20160528_123735.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1tzeo_DDzSdsEMjYeqLHqkYKYNoNK0p_FNKN_uK5tbwUUgoawl06sqjcRqdFOS34zPzjpnpoKDAjFMtuNnn0zW7KPWfrjqGfkGq1JE7ZnohxzeTrnWs8YRt2UyyGZimC7EMp0FW728g/s320/IMG_20160528_123735.jpg" width="240" /></a></div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We were unable to ignite this mixture, not by electrically heating a thin copper wire until melting point and neither with open flames. The video isn't quite as spectacular as we hoped, anti-climaxing at around 0:20s with some smoke:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXGl8_2RdEAOp3bu1GVM4o2n7QKFKsubF15bvIQlUB6ASbH-sielMStOsEYYBDRGmadajfS9rR03e9QOEkv3AqP4V8ku-5sgKdsSKSx9F0BS9s2Gk7Piv4NClLsxhzXfdhnWj-Vl0Zmg/s1600/VID_20160528_124148.3gp" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXGl8_2RdEAOp3bu1GVM4o2n7QKFKsubF15bvIQlUB6ASbH-sielMStOsEYYBDRGmadajfS9rR03e9QOEkv3AqP4V8ku-5sgKdsSKSx9F0BS9s2Gk7Piv4NClLsxhzXfdhnWj-Vl0Zmg/s320/VID_20160528_124148.3gp" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
We posit 2 reasons the powder is not igniting:</div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<ul>
<li>Poor mixing of the ignition powder components</li>
<li>Lack of sulfur in the mixture</li>
</ul>
So next time, we'll add some sulfur to the mix and try to get our hands on an automatic powder mixer.<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-73913061436115986052015-01-07T10:12:00.000-08:002015-01-07T23:24:45.784-08:003D File System Browser (3dfsb) forked back to life and improved<b>7 January 2015, Gent</b> - The decades-old (but very cool!) 3D File System Browser tdfsb has been forked back to life and received new features, improvements, and cleanups. Version 1.0 has just been released under its new name: 3dfsb.<br />
<div>
<br /></div>
<div>
Among the new features are tons of additional supported audio and video formats (with GStreamer), better filetype identification (with libmagic), higher resolution textures and a new "lasergun tool" that allows you to zap your files away in the 3D world to delete them!<br />
<br />
<b>From the author, Tom Van Braeckel:</b><br />
<br />
"I've been cleaning up and improving a very old 3D File System Browser. The original version was called tdfsb, and had been dormant for 7-13 years.<br />
<br />
After trying to get in touch with the original author (Leander Seige) via various channels without reply, I decided it's probably best to fork the original code. Leander was kind enough to release his code under the GPLv2 software license, so no problems there. Thank you, Leander!<br />
<br />
The new software is called <b>3D File System Browser</b>, or <b>3dfsb</b> for brevity.<br />
<br />
The code was, and still is, fairly rough. It's all in one big .c file and comments were few and far between. That's completely understandable, historically speaking. Although I didn't hear from the original author, I imagine that it started out as some kind of a research/educational project to get to know the various libraries it uses.<br />
<br />
And that's exactly why I picked it up: to deepen and refresh my GStreamer, OpenGL, SDL and 3D geometry knowledge. Yes, indeed: 3D geometry, of which you need a lot of when rendering 3D worlds! All in all, it's been very educational, and I hope we can keep improving this cool program further.<br />
<br />
I'm releasing version 1.0 today for your feedback, testing and enjoyment."<br />
<br />
Here's an excerpt of the <a href="https://github.com/tomvanbraeckel/3dfsb/blob/master/CHANGELOG" target="_blank">CHANGELOG</a>:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Version 1.0 (07-01-2015)</span><br />
<span style="font-family: Courier New, Courier, monospace;">************************</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Major changes</span><br />
<span style="font-family: Courier New, Courier, monospace;">-------------</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Extended audio and video support: more than 100 additional container formats and decoders are now supported through the latest GStreamer 1.4.3</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Better file identification: filetype is now determined by the contents of the file (with libmagic) with the extension of the file as a fallback</span><br />
<span style="font-family: Courier New, Courier, monospace;">- High-resolution video previews: cranked up from the old 256x256 pixels to however high your graphics card supports (eg: 8192x8192)</span><br />
<span style="font-family: Courier New, Courier, monospace;">- More fun: you can now zap away at your files with the lasergun tool! For your own protection, nothing is physically deleted from disk, unless y</span><br />
<span style="font-family: Courier New, Courier, monospace;">ou explicitly configure the program to do so.</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Video input device (eg: webcam) file previews: Video4Linux (V4L2) capture devices are now visible in the 3D world and can be viewed just like your movies!</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Minor changes</span><br />
<span style="font-family: Courier New, Courier, monospace;">-------------</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Faster navigation by default</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Visible on-screen info by default</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Uncapped framerate by default</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Uncapped texture size by default</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Higher rendering resolution by default</span><br />
<span style="font-family: Courier New, Courier, monospace;">- Lots and lots of code cleanups and comments added</span><br />
<span style="font-family: Courier New, Courier, monospace;">- No more dependency on libsmpeg</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: Courier New, Courier, monospace;">Performance</span><br />
<span style="font-family: Courier New, Courier, monospace;">-----------</span><br />
<span style="font-family: Courier New, Courier, monospace;">This version runs at 1920x1080 resolution while playing 720p H264 video (2048x2048 texture) on a single-core of the Intel Core i7 at 2.90Ghz.</span><br />
<br />
Here are a few screenshots of the new features:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAjXhR9DZ5Ku2GGQc5gYyEXoXXdOn2se_Xqufdf2rNI3T2SX9ZuN5pCQUo8YULBECMQi_7ISxyaLa3xcZ5w8M8XdW754gimB_y-x1wf9-WP9VTy3Y7kWPz9aTW4zCq4__yNIFx-TTdUw/s1600/Screenshot+from+2015-01-06+16:11:35.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAjXhR9DZ5Ku2GGQc5gYyEXoXXdOn2se_Xqufdf2rNI3T2SX9ZuN5pCQUo8YULBECMQi_7ISxyaLa3xcZ5w8M8XdW754gimB_y-x1wf9-WP9VTy3Y7kWPz9aTW4zCq4__yNIFx-TTdUw/s1600/Screenshot+from+2015-01-06+16:11:35.png" height="225" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<i>Above: all major audio and video formats are supported through GStreamer. Video texture size went up from 256x256 to however high your GPU can go. Think 8192x8192.</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZCgnnKmQsvx_cHl6PmKPRLJo0cUhBuH7WdpuL1nwSvUkXvW62KfG-fqzN8GfG95GFYds0QtP5My7BZd0s0R8FTeJpuH1mJCY9SWNt0nA8UueIVnfbyVLbRwGlr6Sr3u3RhDi3NSiIbA/s1600/Screenshot+from+2015-01-06+16:38:43.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZCgnnKmQsvx_cHl6PmKPRLJo0cUhBuH7WdpuL1nwSvUkXvW62KfG-fqzN8GfG95GFYds0QtP5My7BZd0s0R8FTeJpuH1mJCY9SWNt0nA8UueIVnfbyVLbRwGlr6Sr3u3RhDi3NSiIbA/s1600/Screenshot+from+2015-01-06+16:38:43.png" height="225" width="400" /></a></div>
<div style="text-align: center;">
<i>Above: hardware device files (such as webcams) are visible in the 3D world and can be accessed from it.</i></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcc8EWsXC8ied495IU2rZFCWpBGX_W8kHsqe2n5bB-K_FHj0a1qAHKHaPReJnuqKBxly9WEuNCeyAABx1pkgXe_xd-KPYQJ6ulFjRNzewPQ8mgqhpNXKEcm0h-T7RBR83clZJOnNPRdw/s1600/Screenshot+from+2015-01-06+16:10:38.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcc8EWsXC8ied495IU2rZFCWpBGX_W8kHsqe2n5bB-K_FHj0a1qAHKHaPReJnuqKBxly9WEuNCeyAABx1pkgXe_xd-KPYQJ6ulFjRNzewPQ8mgqhpNXKEcm0h-T7RBR83clZJOnNPRdw/s1600/Screenshot+from+2015-01-06+16:10:38.png" height="225" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<i>Above: filetype detection is much more robust and versatile, relying on libmagic to identify a filetype by its contents. The old method, which is based on filename extensions, is used as a fallback.</i></div>
<div class="separator" style="clear: both; text-align: center;">
<i><br /></i></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYRKjI9NVnPWP_A2uh0NXXm4al7krKUMK0V-ixVt-SNDO2pTXiP1eUjGjaUs-nMAFTzz7pHx5QQnzOsZJADOkWTj0eEnZmYRZl2adEdj2jeZ45UY9boIwVi8lFIaZHk6ATTgf-9-keTg/s1600/Screenshot+from+2015-01-06+17:34:33.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiYRKjI9NVnPWP_A2uh0NXXm4al7krKUMK0V-ixVt-SNDO2pTXiP1eUjGjaUs-nMAFTzz7pHx5QQnzOsZJADOkWTj0eEnZmYRZl2adEdj2jeZ45UY9boIwVi8lFIaZHk6ATTgf-9-keTg/s1600/Screenshot+from+2015-01-06+17:34:33.png" height="225" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<i>Above: you can use different tools to operate on your files, for example: blast them with the laser to delete them! And don't worry: for safety reasons, the program doesn't actually delete them from your disk unless you explicitly configure it to do so.</i></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<b>Download</b><br />
All sources and releases are GPLv2 and published in the <a href="https://github.com/tomvanbraeckel/3dfsb" target="_blank">3dfsb repository at GitHub</a>.<br />
<br />
<b>Support</b><br />
If you need any help, including (but not limited to) packaging this software, don't hesitate to contact me or drop a line in the comment section.</div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-66129942262581851352014-11-08T22:09:00.000-08:002014-11-08T23:39:46.453-08:00Activating A2DP bluetooth stereo headphones in Ubuntu Trusty (14.04.1 LTS)For future explorers who might struggle with this, and possibly for myself :-)<br />
<br />
1) Install recommended software:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo apt-get install pulseaudio pulseaudio-module-bluetooth bluez-audio pavucontrol bluez-firmware bluez-tools blueman</span><br />
<br />
2) Add the below line to the [General] section of /etc/bluetooth/audio.conf:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">Enable=Socket</span><br />
<br />
3) Ensure module-bluetooth-discover is loaded (can't hurt):<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">pactl load-module module-bluetooth-discover</span><br />
<span style="font-family: Courier New, Courier, monospace;"><br /></span>
<span style="font-family: inherit;">Note: you can also disable unloading the module-bluetooth-discover <a href="https://github.com/blueman-project/blueman/commit/b2c3cb014ec3fdf09076936e7945f1766a82e037">this patch</a>.</span><br />
<br />
4) Restart all affected services to take the new configuration into account:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">sudo service bluetooth restart; sudo killall pulseaudio</span><br />
<br />
5) Pair your A2DP bluetooth headset and add the trust attribute. You can do this in the graphical manager, blueman-manager.
6) Activate the bluetooth audio sink in a graphical manager (blueman-manager) or on the command line:<br />
<br />
<span style="font-family: Courier New, Courier, monospace;">bt-audio -c 0C:E0:E4:49:8D:FD</span><br />
<br />
7) Now, in your favorite volume manager, pavucontrol, you can redirect any audio stream to your bluetooth stereo headphones. Enjoy!<br />
<br />
Sources:<br />
<br />
<ul>
<li>https://wiki.debian.org/BluetoothUser/a2dp</li>
<li>http://ubuntuforums.org/showthread.php?t=2144841&page=2</li>
</ul>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com2tag:blogger.com,1999:blog-4355918818071282445.post-65789853582170816092013-05-31T00:42:00.000-07:002016-06-02T05:33:56.251-07:00getChallengeResponse.sh script<pre>#!/bin/sh
# getChallengeResponse.sh - login to my online banking website using the challenge-reponse mechanism
# Purpose of this script (work in progress) is to further automate online banking.
# More info: http://globalblindspot.blogspot.be/2010/07/getting-emvcap-challengeresponse-to.html
# Author: Tom Van Braeckel <tomvanbraeckel gmail.com="">
pin="$1"
challenge="$2"
if [ -z "$pin" -o `expr length "$pin"` -ne 4 -o -z "$challenge" -o `expr length "$challenge"` -ne 8 ]; then
echo "Usage: $0 <pin characters=""> <challenge numbers="">"
echo "Example: $0 3117 12345678"
exit 1
fi
# Can you guess what this method does ?
bintodec() {
bin="$1"
echo "obase=10; ibase=2; $bin" | bc
}
# remove < and " "
compact() {
while read line; do
echo "$line" | tr -d '<' | tr -d ' '
done
}
# args: command to execute on the card
execOnCard() {
cla="$1"
ins="$2"
p1="$3"
p2="$4"
le="$5"
data="$6"
tosend="${cla}${ins}${p1}${p2}${le}${data}"
#echo "Sending $tosend" >&2
echo "$tosend" | scriptor 2>/dev/null | grep -A 10000 "<"
# does not work:
# echo "$cla $ins $p1 $p2 $le $data" | scriptor 2>/dev/null | grep "<"
}
execOnCardRespond() {
cla="$1"
ins="$2"
p1="$3"
p2="$4"
le="$5"
data="$6"
result=$(execOnCard $cla $ins $p1 $p2 $le $data) ; echo "result = $result" >&2
# get length in hex
length=$(echo "$result" | cut -d ' ' -f 3); #echo "length = $length"
execOnCard 00 c0 00 00 $length | compact
}
# Can you guess what this method does ?
hextobin() {
hex="$1"
echo "ibase=16; obase=2; $hex" | bc
}
# do a read data with the correct length...
readData() {
p2="$1"
recordLength=$(execOnCard 80 ca 9f $p2 00 | cut -d ' ' -f 3)
#echo "recordLength = $recordLength" >&2
# cut off first bytes (status code, length)
# cut off last bytes (9000Normalprocessing)
# for some reason we NEED CLA 80 here, 00 doesn't work...
execOnCard 80 ca 9f $p2 $recordLength | compact | tail -c +7 | head -c -23
echo
}
readRecord() {
p1="$1"
p2="$2"
errorWithLength=$(execOnCard 00 b2 $p1 $p2 00)
#echo "errorWithLength = $errorWithLength"
recordLength=$(echo "$errorWithLength" | cut -d ' ' -f 3)
#echo "recordLength = $recordLength"
execOnCard 00 b2 $p1 $p2 $recordLength | compact
}
readRecords() {
SFI="$1" # five most significant bits
recNr="$2" # second byte
lastRecNr="$3" # third byte
if [ "$SFI" = "1" ]; then
p2=0c # (sfi << 3) + 4
else
echo "I don't know p2 !"
sleep 3
fi
# READ RECORD(s)
for i in `seq $recNr $lastRecNr`; do
readRecord 0$i $p2
done
}
zeropadfront() {
targetLength="$1"
# echo "targetLength = $targetLength"
while read line; do
# echo "got line $line"
length=$(expr length "$line")
while [ $length -lt $targetLength ]; do
line="0${line}"
length=$(expr length "$line")
done
echo "$line"
done
}
#################################################################
###################### EXECUTION STARTS HERE ####################
#################################################################
# reset
execOnCard reset
#select file/application
aid=A0000000048002 # securecode aut
#aid=A0000000043060 # maestro (debit)
response=$(execOnCardRespond 00 a4 04 00 07 ${aid})
echo $response
# this is needed, otherwise the commands below fail...
PDOL=$(echo "$response" | grep -o -E "9F38........" | tail -c +7)
echo "PDOL = $PDOL"
# for securecode get a PDOL of "9F3501" (eg "9F38039F3501")
# this is the "Terminal Type" - don't know the value, but I use 00...
# get processing options:
# - Application Interchange Profile (AIP)
# - Application File Locator (AFL)
if [ -z "$PDOL" ]; then
response=$(execOnCardRespond 80 a8 00 00 02 8300); echo $response
# eg: ...94080801030110010201
AIP=3800 # this means "initiate", "data auth", RFU
AFLs="08010301 10010201"
else
# PDOL specifies one tag with value of 1 byte, but I don't know which value...
response=$(execOnCardRespond 80 a8 00 00 03 830100); echo $response
# 770E82021000940808010100080404009000:Normalprocessing.
AIP=1000 # this means "initiate"
AFLs="08010100 08040400"
fi
echo "Found AIP = $AIP and AFLs = $AFLs"
# Read SecureCode records and extract valueable info
cardinfo=$(readRecords 1 1 1)
PAN=$(expr substr "$cardinfo" 9 18)
echo "Application Primary Account Number (PAN) = $PAN"
authinfo=$(readRecords 1 4 4)
bitmap=$(expr substr "$authinfo" 11 22)
echo "Proprietary Authentication Challenge-Reponse Bitmap = $bitmap"
# This works for maestro:
if false; then
readRecords 1 1 3
# second group in AFL
SFI=10 # five most significant bits
recNr=1 # second byte
lastRecNr=2 # third byte
offlineDataRec=1 # fourth byte
# p2=binary(firstbyte)100 left shift 3 OR 100 ???
# p2=binary(firstbyte) shift right 3
# I calculated 84, but it seems to be (13) 14 / (1B) 1C / (23) 24
# and also 03 04 0B 0C but we found those above
p2s="14 1C 24"
# READ RECORD(s)
for p2 in $p2s; do
for i in `seq $recNr $lastRecNr`; do
echo -n "p2 = $p2, recordNr = $i: "
readRecord 0$i $p2
done
done
fi
# get pin try counter length
pinTry=$(readData 17)
echo "pinTry = $pinTry"
if [ "$pinTry" != "02" -a "$pinTry" != "03" ]; then
echo "WARNING: pinTry < 2 !"
sleep 15
fi
# get Application Transaction Counter
echo -n "Application Transaction Counter = "
readData 36
# get Last Online ATC Register
echo -n "Last Online ATC Register = "
readData 13
echo -n "Log Entry = "
readData 4D
echo -n "Log Format = "
readData 4F
# submit pin
execOnCard 00 20 00 80 08 24${pin}FFFFFFFFFF
# generate Application RQ Cryptogram
# p1=80=Authorisation Request Cryptogram
countrycode=0056 # OTF mentions 0000, chip&pin uses 0826
currencycode=0978 # OTF mentions 0000, chip&pin uses 0826
date=$(date +"%y%m%d")
CardholderVerificationMethodResults=010002
# 8000000000 = Terminal Verification Codes: Data authentication was not performed (recommended by optimized to fail)
# 00 = transaction type
# 0000 = ICC Dynamic Number
ARQC_response=$(execOnCardRespond 80 AE 80 00 22 000000000000000000000000${countrycode}8000000000${currencycode}${date}00${challenge}0000${CardholderVerificationMethodResults})
echo "ARQC_response = $ARQC_response"
CID=$(expr substr "$ARQC_response" 11 2)
ATC=$(expr substr "$ARQC_response" 19 4)
AC=$(expr substr "$ARQC_response" 29 16)
#IAD=$(expr substr "$ARQC_response" 51 15)
# testing to see if we get the same response as in chip&pin - we do, so this is OK.
# CID=80; ATC=A52D; AC=AD452EF6BA769E4A; IAD=06770A03A48000; bitmap=00001F00000000000FFFFF00000000008000
# generate Application Cryptogram for challenge 12345678
# 5a33 = Authorisation Response Code, generated by terminal or bank (for online stuff)
IAuthData=0000000000000000000000000000000000000000 # Issuer Authentication Data (NOT Issuer Application Data !)
AC_response=$(execOnCardRespond 80 AE 00 00 2e 5a33000000000000000000000000${countrycode}8000000000${currencycode}${date}00${challenge}0000${CardholderVerificationMethodResults}${IAuthData})
echo "AC_response = $AC_response"
#AC_response="$ARQC_response" # Testing which response we need - normally the second one, but let's try this for a laugh
CID=$(expr substr "$AC_response" 11 2)
ATC=$(expr substr "$AC_response" 19 4)
AC=$(expr substr "$AC_response" 29 16)
# extract response
echo "CID=$CID, ATC=$ATC, AC=$AC, IAD=$IAD"
# length of bitmap is used as the target length for the response
bitmap_hex_length=$(expr length "$bitmap")
bitmap_bin_length=$(expr "$bitmap_hex_length" \* 4)
echo bitmap_hex_length=$bitmap_hex_length, bitmap_bin_length=$bitmap_bin_length
# Do logical AND with bitmap
CIDATCAC_bin=$(hextobin "${CID}${ATC}${AC}${IAD}" | zeropadfront "$bitmap_bin_length")
echo "CIDATCAC_bin = $CIDATCAC_bin"
bitmap_bin=$(hextobin "$bitmap" | zeropadfront "$bitmap_bin_length")
echo " bitmap_bin = $bitmap_bin"
# if a bit of bitmap = 1, then we add the bit from CIDATCAC_bin to filtered_bin
filtered_bin=
for bitpos in `seq 1 $bitmap_bin_length`; do
bitmap_bit=$(expr substr "$bitmap_bin" "$bitpos" 1)
if [ $bitmap_bit -eq 1 ]; then
CIDATCAC_bin_bit=$(expr substr "$CIDATCAC_bin" "$bitpos" 1)
filtered_bin=${filtered_bin}${CIDATCAC_bin_bit}
fi
done
echo "filtered_bin = $filtered_bin"
# Note: if ATC>0x26(38) then response = 8 characters
# if ATC=0xFFFF(65536) then response = 12 characters !!! is this correct ?
filtered_dec=$(bintodec $filtered_bin)
echo "RESPONSE = $filtered_dec"
exit
# this is never executed
if false; then
# Make AND of ARQC and Cap bit Filter:
fortis: 77269F2701 00 9F3602 00B7 9F260886F857BEB767E8FB 9F100F 0601560384B0A80701030000000000
kbc: 77269F2701 00 9F3602 0004 9F260831F94BDAB5DF0F38 9F100F 0601560384B0400701030000000000
kbc: 77269F2701 00 9F3602 0005 9F2608B29D6D20BFE004AD 9F100F 0601560384B0400701030000000000
# extracted values
output 00 00B7 86F857BEB767E8FB 0601560384B0A80701030000000000
output 00 0004 31F94BDAB5DF0F38 0601560384B0A80701030000000000
bitmask 00 00FF 000000000003FFFF
filter .. ..04 ...........30F38
binary 0100 110000111100111000
decimal 1249080
fi
Example protocol log:
Collected from a NatWest reader and card performing a respond computation
(ISO 7816, T=0 protocol). Personal details have been redacted.
Command: 00a4040007 (select application)
Proc: a4
Data: a0000000048002
Proc: 61
Status: 6112 (more data available)
Command: 00c0000012 (application selected)
Proc: c0
Data: 6f108407a0000000048002a5055f2d02656e
Proc: 90
Status: 9000 (OK)
Command: 80a8000002 (initiate transaction)
Proc: a8
Data: 8300
Proc: 61
Status: 6108 (more data available)
Command: 00c0000008 (transaction initiated)
Proc: c0
Data: 8006100008010100
Proc: 90
Status: 9000 (OK)
Command: 00b2010c00 (get static data length)
Proc: 6c
Status: 6c57 (wrong length)
Command: 00b2010c57 (read static data)
Proc: b2
Data: 7055
8e0a 00000000000000000100 (CVM list)
9f5501 a0 (unknown)
9f5612 00001f00000000000fffff00000000008000 (bit filter)
8c15 9f02069f03069f1a0295055f2a029a039c019f3704 (CDOL1)
8d17 8a029f02069f03069f1a0295055f2a029a039c019f3704 (CDOL2)
Proc: 90
Status: 9000 (OK)
Command: 80ca9f1700 (get PIN try counter length)
Proc: 6c
Status: 6c04 (wrong length)
Command: 80ca9f1704 (get PIN try counter)
Proc: ca
Data: 9f170103 (3 remaining tries)
Proc: 90
Status: 9000 (OK)
PIN entered: ?
Command: 0020008008 (verify PIN)
Proc: 20
Data: 24xxxxffffffffff
Proc: 90
Status: 9000 (OK)
Challenge entered: 12345678
Command: 80ae80001d (generate ARQC)
Proc: ae
Data: 0000000000000000000000000000800000000000000000000012345678
Proc: 61
Status: 6114 (more data available)
Command: 00c0000014 (return ARQC)
Proc: c0
Data: 80 1280 0042b7f9a572da74caff 06770a03a48000
Proc: 90
Status: 9000 (OK)
Command: 80ae00001f (generate AC)
Proc: ae
Data: 5a330000000000000000000000000000800000000000000000000012345678
Proc: 61
Status: 6114 (more data available)
Command: 00c0000014 (return AAC)
Proc: c0
Data: 80 1200 00424f1c597723c97d78 06770a03258000
Proc: 90
Status: 9000 (OK)
Response returned: 4822527
</challenge></pin></tomvanbraeckel></pre>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-81228745335235604842013-01-31T11:29:00.001-08:002013-01-31T11:29:37.276-08:00Love is Math As Well<br />
<div style="text-align: center;">
We don't remember what it was like</div>
<div style="text-align: center;">
that first time</div>
<div style="text-align: center;">
what we talked about </div>
<div style="text-align: center;">
whether we showed each other things </div>
<div style="text-align: center;">
which we didn't yet have</div>
<div style="text-align: center;">
the stale wines</div>
<div style="text-align: center;">
in the polished vases</div>
<div style="text-align: center;">
warm bodies in winter</div>
<div style="text-align: center;">
whether we read</div>
<div style="text-align: center;">
from closed books</div>
<div style="text-align: center;">
added ourselves together and </div>
<div style="text-align: center;">
knew we never</div>
<div style="text-align: center;">
would have to divide</div>
<div style="text-align: center;">
together exponential</div>
<div style="text-align: center;">
a multiplication with</div>
<div style="text-align: center;">
in the cross that we</div>
<div style="text-align: center;">
no longer wanted to carry</div>
<div style="text-align: center;">
a conclusive casting out of nines.</div>
<br />
<span style="font-size: x-small;"><div style="text-align: center;">
<span style="font-size: x-small;">[I translated "Liefde is ook Wiskunde" by Bart Plouvier from Dutch to English for </span>the national poetry day in Belgium.]</div>
</span>t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-37633012952964594012012-09-06T12:48:00.001-07:002016-08-12T01:44:23.465-07:00File type associations with xdg-open and xdg-mime (for openbox) example<br />
Just so I don't forget, here is how to do it - it's very simple, really:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">xdg-mime default xarchiver.desktop application/x-compressed-tar</span><br />
<h3>
Why ?</h3>
<br />
When I clicked on a .tar.gz file in chromium, my desktop environment would hang.<br />
<br />
This was caused the fact that chromium calls xdg-open to know which program to use to open the .tar.gz file. xdg-open used "xdg-mime query default application/x-compressed-tar" to figure out what application to use (which was none, because I hadn't configured any default application).<br />
<br />
After that, xdg-open doesn't stop. If /etc/debian-version exists, it additionally uses run-mailcap to figure out which program to use. And mailcap was configured to run "less" somewhere down the line, which stops and apparently, stops it's parent processes for some unknown reason when run in this configuration.<br />
<br />
So I deleted /etc/debian-version because I don't see the point of having it. We'll see if something what breaks.<br />
<br />
<h3>
How ?</h3>
xdg-mime will create the file <span style="font-family: "courier new" , "courier" , monospace;">~/.local/share/applications/mimeapps.list</span> which then contains:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">[Default Applications]</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">application/x-compressed-tar=xarchiver.desktop</span><br />
<br />t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-61050456770564641902012-06-17T08:57:00.004-07:002014-11-09T01:21:05.967-08:00Rudimentary PDF to LaTeX conversion in LinuxI finally got around to trying a rudimentary PDF to LaTeX conversion in Linux.<br />
<br />
"It's like turning a hamburger into a cow" :-)<br />
<br />
Usage:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">./pdftolatex.sh "filename.pdf"</span><br />
<br />
Example output:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;"># pdftolatex.sh test.pdf </span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">PDF to LaTeX conversion script</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Copyleft 2012 (c) Tom Van Braeckel <tomvanbraeckel@gmail.com></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">WARNING: this is a rudimentary first stab. Proceed with caution.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Checking if all dependencies are found...</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">/usr/bin/pdftohtml</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Dependency pdftohtml found.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">/usr/bin/gnuhtml2latex</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Dependency gnuhtml2latex found.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">/usr/bin/pdflatex</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Dependency pdflatex found.</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Converting test.pdf to test.pdfs.html</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-1</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-2</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-3</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-4</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-5</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-6</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-7</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-8</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-9</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-10</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">Page-11</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Fixing up test.pdfs.html to test.pdf_fixedup.html...</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Readying test.pdf_fixedup.html for tex conversion in test.pdf_fixedup_ready_for_tex_conversion.html</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Converting test.pdf_fixedup_ready_for_tex_conversion.html to test.pdf_frompdf.tex</span><br />
<span style="font-family: 'Courier New', Courier, monospace;">The resulting file is in test.pdf_frompdf.tex</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Fixing up test.pdf_frompdf.tex to test.pdf_frompdf_fixedup.tex</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Converting test.pdf_frompdf_fixedup.tex to test.pdf_frompdf_fixedup.pdf for inspection...</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span>
<span style="font-family: 'Courier New', Courier, monospace;">Opening test.pdf_frompdf_fixedup.pdf with Evince - you can try another PDF viewer if you like...</span><br />
<div>
<br /></div>
<div>
Script source code:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">#!/bin/sh</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">file="$1"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">dependencies="pdftohtml gnuhtml2latex pdflatex"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "PDF to LaTeX conversion script"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Copyleft 2012 (c) Tom Van Braeckel <tomvanbraeckel@gmail.com>"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "WARNING: this is a rudimentary first stab. Proceed with caution."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">if [ -z "$file" ]; then</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Usage: $0 <pdf file>"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "The resulting .tex file will be stored somewhere here."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>exit 1</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">fi</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Checking if all dependencies are found..."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">for dependency in $dependencies; do</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>which $dependency</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>if [ $? -ne 0 ]; then</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Dependency $dependency not found, install it using:"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "sudo apt-get install $dependency"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>exit 1</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>else</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>echo "Dependency $dependency found."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><span class="Apple-tab-span" style="white-space: pre;"> </span>fi</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">done</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Converting $file to ${file}s.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">pdftohtml -nomerge "$file" "$file".html</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Fixing up ${file}s.html to ${file}_fixedup.html..."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># This nasty br in a b causes problems later on</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed "s,<br/></b>,</b><br/>,g" "${file}s.html" > "${file}_fixedup.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># ending with bold text menas it is the end of a title and can be on a newline</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s,</b><br/>\$,</b><br/><br/>,g" "${file}_fixedup.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># starting with bold text means it is the start of a title so can be on a new line</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s,^<b>,<br/><b>,g" "${file}_fixedup.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># spaces ?</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s,\&#160;, ,g" "${file}_fixedup.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># there is no use in a space before a newline, and it causes a bogus indent when converting to .tex later on</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s, <br/>,<br/>,g" "${file}_fixedup.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># encoding, although gnuhtml2latex ignores this</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s,<HEAD>,<HEAD><meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />," "${file}_fixedup.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Readying ${file}_fixedup.html for tex conversion in ${file}_fixedup_ready_for_tex_conversion.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">cp "${file}_fixedup.html" "${file}_fixedup_ready_for_tex_conversion.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># br is ignored and should be replaced by a newline</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s,<br/>,<p></p>,g" "${file}_fixedup_ready_for_tex_conversion.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># Remove bogus links - this fixes the empty } problem</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i "s/<A name=[0-9]\+><\/a>//g" "${file}_fixedup_ready_for_tex_conversion.html"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Converting ${file}_fixedup_ready_for_tex_conversion.html to ${file}_frompdf.tex"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># -c = table of contents</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># -s = write to standard out</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># -p Break page after title / table of contents</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># -H use hyperref package to process anchors</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># -g images</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"># -n Use numbered sections</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">gnuhtml2latex -c -s -p -H -n "${file}_fixedup_ready_for_tex_conversion.html" > "$file"_frompdf.tex</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "The resulting file is in ${file}_frompdf.tex"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Fixing up ${file}_frompdf.tex to ${file}_frompdf_fixedup.tex"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">sed -i 's/\\par/\\newline/g' "${file}_frompdf.tex"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">( cat header.inc ; tail -n +7 "${file}_frompdf.tex" ) > "${file}_frompdf_fixedup.tex"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Converting ${file}_frompdf_fixedup.tex to ${file}_frompdf_fixedup.pdf for inspection..."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">pdflatex -interaction nonstopmode "${file}_frompdf_fixedup.tex" > tex_to_pdf_errors_and_warnings.txt</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">echo "Opening ${file}_frompdf_fixedup.pdf with Evince - you can try another PDF viewer if you like..."</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">evince "$file"_frompdf_fixedup.pdf</span></div>
</div>
<div>
<br /></div>
<div>
The script uses one extra file, header.inc, which contains customizations:</div>
<div>
<br /></div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\documentclass[a4paper,11pt,oneside]{article}</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{a4wide} % Iets meer tekst op een bladzijde</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage[dutch]{babel} % Voor nederlandstalige hyphenatie (woordsplitsing) en het euro-symbool</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{amsmath} % Uitgebreide wiskundige mogelijkheden</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{amssymb} % Voor speciale symbolen zoals de verzameling Z, R...</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{url} % Om url's te verwerken</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{graphicx} % Om figuren te kunnen verwerken</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage[small,bf,hang]{caption} % Om de captions wat te verbeteren</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{xspace} % Magische spaties na een commando</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage[utf8]{inputenc} % Om niet ascii karakters rechtstreeks te kunnen typen</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{float} % Om nieuwe float environments aan te maken. Ook optie H!</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{flafter} % Opdat floats niet zouden voorsteken</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{listings} % Voor het weergeven van letterlijke text en codelistings</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{marvosym} % Om het euro symbool te krijgen</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{eurosym} % Om het euro symbool te krijgen</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{textcomp} % Voor onder andere graden celsius</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{fancyhdr} % Voor fancy headers en footers.</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage{graphics} % Om figuren te verwerken.</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage[a4paper,plainpages=false]{hyperref} % Om hyperlinks te hebben in het pdfdocument.</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\usepackage[usenames,dvipsnames]{xcolor}</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">% Definitie algemene macro's</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\newcommand{\npar}{\par \vspace{0.2ex }}</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\setlength\textheight{9.75in}</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\setlength\textwidth{7in}</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\topmargin -0.5in </span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\headheight 0.0in</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: xx-small;">\oddsidemargin -.25in </span></div>
</div>
<div>
<br /></div>
<div>
<br />
[Update] You can also try the following method, using abiword, but the method above yields better results, in my opinion:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">abiword --to=tex "filename.pdf"</span></div>
t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-12300407742312718702012-06-02T08:12:00.003-07:002012-06-02T08:12:23.353-07:00When entring a room, do it eyes first rather than head...It's a lot safer.t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-281828944847235672012-05-05T02:55:00.001-07:002012-05-05T10:13:02.881-07:00Please don't blame the weather<span class="Apple-style-span" style="font-family: Arial; font-size: 15px; white-space: pre-wrap;"><span class="Apple-style-span" style="color: white;">Please don't blame the weather</span></span><br />
<div style="background-color: transparent;">
<span id="internal-source-marker_0.2308349080849439" style="color: white;"><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">It’s got nothing to do with the weater.</span></span><br />
<span style="color: white;"><span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Blame me and sincerely blame yourself.</span></span><br />
<span style="color: white;"><span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Try waking up in the morning and</span><br /><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">feeling better than the day before.</span></span><br />
<span style="color: white;"><span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Wash off your guilt, get over yourself,</span><br /><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">and stop wasting time persuing shit.</span></span><br />
<span style="color: white;"><span class="Apple-style-span" style="font-family: Arial;"><span class="Apple-style-span" style="font-size: 15px; white-space: pre-wrap;"><br /></span></span><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">Contemplate life’s meaning and</span><br /><span style="background-color: transparent; font-family: Arial; font-size: 15px; font-style: normal; font-variant: normal; text-decoration: none; vertical-align: baseline; white-space: pre-wrap;">the sadness of existence.</span></span></div>t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-74771099513423718722012-03-01T04:33:00.002-08:002015-01-06T20:48:19.891-08:00Keycodes and coffeeshops in the Linux kernelWe are using gpio-keys to configure 2 GPIO's coming from 2 sensors (left and right on our device) as keyboard interrupt lines. <br />
<br />
So I had to choose 2 obscure <a href="http://lxr.free-electrons.com/source/include/linux/input.h#L338">keycodes</a> to map on "proximity meter left" and "proximity meter right"...<br />
<br />
Here are the results:<br />
<br />
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> {</span><br />
<div style="font-size: 13px;">
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> .gpio = INT_PROX_L,</span>
<span style="color: white; font-family: 'Courier New', Courier, monospace;">
</span><br />
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> .code = <b>KEY_COFFEE</b>,</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> .desc = "Proximity Left",</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> },</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> {</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> .gpio = INT_PROX_R,</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> .code = <b>KEY_SHOP</b>,</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> .desc = "Proximity Right",</span></div>
<div>
<span style="color: white; font-family: 'Courier New', Courier, monospace;"> },</span></div>
<div style="color: #222222;">
<br /></div>
<div style="color: #222222; font-family: arial, sans-serif;">
</div>
</div>
These keynames and their order are easy to memorize now, because (since we read from left to right) we know that coffee = left and shop = right :-)<br />
<br />t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-15904055999683419382012-01-08T03:03:00.001-08:002012-01-08T03:15:40.169-08:00rsync and scp autocompletionApparantly, rsync and scp boast tab autocompletion !<br />
<br />
When you have configured passwordless SSH access (by copying over your public key) and you use these tools, tab autocompletion works as expected.<br />
<br />
For example, typing the following on a bash shell:<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">rsync localfile.txt exampleserver:/examp<TAB></span><br />
<br />
will automatically autocomplete the foldername.<br />
In the example's case, it becomes:<br />
<br />
<br />
<span style="font-family: 'Courier New', Courier, monospace;">rsync localfile.txt exampleserver:/examplefolder/</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span style="font-family: inherit;">The same goes for scp, like:</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace;">scp localfile.txt exampleserver:/examp<TAB></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span style="font-family: inherit;">becomes</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace;">rsync localfile.txt exampleserver:/examplefolder</span><br />
<br />
<br />
rsync and scp are able to do this because the passwordless SSH allows them to see what files can be found on the other server without asking for a password.<br />
<br />
On my LAN network, it takes about 1 second to autocomplete, which is perfectly acceptable for me. It certainly beats having to open a seperate SSH session and manually making a lising ;-)t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-39462982441583938872012-01-08T03:01:00.000-08:002012-01-08T03:02:38.195-08:00Super-sleek shell script as a simple touchscreen controller for Linux<div>
<span style="font-family: 'Courier New', Courier, monospace;">#!/bin/sh</span></div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"># Beautifully simple shell script to detect screen touches</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"># I use it to toggle the music player on my FriendlyARM 2440 Mini</span><br />
<span style="font-family: 'Courier New', Courier, monospace;"># but it can be used for any Linux touch screen</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span><br />
<span style="font-family: 'Courier New', Courier, monospace;"># Copyleft 2011 - t-Omicr0n</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"><br /></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">while true; do</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"> head -c 1 /dev/input/event0</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;"> echo "You touched it !"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace;">done &</span></div>
</div>
<div>
<br /></div>t-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0tag:blogger.com,1999:blog-4355918818071282445.post-84784486284263249802012-01-08T02:55:00.000-08:002012-01-29T03:25:04.688-08:00Hunting adviceLet's say you're a hunter. If a deer takes your gun, shoots itself and then straps itself to the roof of your car..... you <i>have</i> to take it home and eat it ! -- Two and a Half Ment-Omicr0nhttp://www.blogger.com/profile/05135319402995104480noreply@blogger.com0