<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>hardwarefetish.com</title>
	<atom:link href="http://hardwarefetish.com/feed" rel="self" type="application/rss+xml" />
	<link>http://hardwarefetish.com</link>
	<description></description>
	<lastBuildDate>Sun, 01 Mar 2026 02:19:37 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9.4</generator>
	<item>
		<title>Adobe Reader ] 21208 update breaks Acrobat Reader on Windows 7 &#8211; Fix</title>
		<link>http://hardwarefetish.com/912-adobe-reader-21208-update-breaks-acrobat-reader-on-windows-7-fix</link>
		<comments>http://hardwarefetish.com/912-adobe-reader-21208-update-breaks-acrobat-reader-on-windows-7-fix#comments</comments>
		<pubDate>Sat, 21 Feb 2026 15:22:27 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=912</guid>
		<description><![CDATA[It seems that Adobe rolled out an automatic update that breaks Adobe Reader on Windows 7 with the error message&#160;“This program couldn’t launch because the object api-ms-win-core-winrt-l1-1-0.dll is missing”. So someone didn&#8217;t verify the application before rolling out an update and breaking thousands of installations. Looks like abd QC for me. Interestingly, if you download [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>It seems that Adobe rolled out an automatic update that breaks Adobe Reader on Windows 7 with the error message&nbsp;“This program couldn’t launch because the object api-ms-win-core-winrt-l1-1-0.dll is missing”.</p>
<p>So someone didn&#8217;t verify the application before rolling out an update and breaking thousands of installations. Looks like abd QC for me. Interestingly, if you download Adobe Reader from the official page and Select Windows 7 as an OS, it still offers you the broken version to download instead of a working one and it also seems, even though the error has already been&nbsp;<a href="https://community.adobe.com/questions-12/reader-win7-21208-update-breaks-acrobat-reader-won-t-start-missing-dll-1550183">reported</a>, Adobe still continues rolling out the broken update giving me a flood of calls by users whose Adobe Read installation suddenly gets broken. Thank you, Adobe! &gt;:-(&nbsp;</p>
<p><del>As this error is so common and the broken update still is getting rolled out, I made a little batch script in order to fix it to save work. Here are the instructions on how to get it working again:</del></p>
<ol>
<li><del>Uninstall broken Adobe Reader from Control Panel</del></li>
<li><del>Download&nbsp;<a href="https://ardownload3.adobe.com/pub/adobe/reader/win/AcrobatDC/2500121111/AcroRdrDC2500121111_de_DE.exe">AcroRdrDC2500121111_de_DE.exe</a>&nbsp;fpr German or&nbsp;<a href="https://ardownload3.adobe.com/pub/adobe/reader/win/AcrobatDC/2500121111/AcroRdrDC2500121111_en_US.exe">AcroRdrDC2500121111_en_US.exe</a> for English</del><br />
<del> A list of available download sources can be found <a href="https://it-blogger.net/adobe-reader-offline-installer-fuer-windows-und-macos/">here</a>.</del></li>
<li><del>After installing the older working version, disable all update-mechanisms and also remove the&nbsp;RdrCEF.exe and&nbsp;AdobeCollabsync.exe bloat that doesn&#8217;t work on Windows 7 anyways and also eats up huge amounts of memory in the background for nothing.</del><br />
<del> I made a batch script (with help of AI to save myself time) that automates the process, download <a href="http://dose.0wnz.at/scripts/disable_adobe_update.cmd">this script</a>&nbsp;(right click &#8211; save as&#8230;) and execute is as an Administrator. You may want to read its contents first if you do not trust it. For this you can open it with notepad.</del></li>
<li><del>Launch Adobe Reader, should work again</del></li>
</ol>
<p><del>Here is what the script does:</del></p>
<ol>
<li><del>Disable and stop the Adobe updater service</del></li>
<li><del>Delete the Adobe Updater Task that runs peridodically</del></li>
<li><del>Set a policy to disable updtes in Adobe Reader</del></li>
<li><del>Remove the bloatware by renaming the executables so that they don&#8217;t get found and also rename updater executables so that they won&#8217;t accidentally launch.</del></li>
</ol>
<p><del>In case you reinstall the Adobe Reader, the bloatware and updater will get reenabled again.</del></p>
<p><del>Hope this helps.</del></p>
<p><strong>Update, 22.02.2026</strong></p>
<p>It seems that all these steps are <strong>still not sufficient</strong> to prevent Adove from updating, *grrr*<br />
So updater host also needs to be blocked via hosts-file. Have a look at the comments section for a host list.</p>
<p>Alternatively, it seems that it is enough to add a WinRT stub file for the missing .dll to c:\windows\syswow64 in order to make the latest Adobe version work again. Just download x86 32bit version from <a href="https://www.dllme.com/dll/files/api-ms-win-core-winrt-l1-1-0/versions">here</a>. This hint was given in the original <a href="https://community.adobe.com/questions-12/reader-win7-21208-update-breaks-acrobat-reader-won-t-start-missing-dll-1550183?postid=7503777#post7503777">complaint thread</a> and even though the affected functions in that DLL do not do anything and just reurn 0, it seems to work, possibly the WinRT that gets initialized there is not really used in Adobe Reader.<br />
The specific file I downloaded is <a href="https://www.dllme.com/dll/files/api-ms-win-core-winrt-l1-1-0/000833daa98325efd7a8ce7b5bae608d">this one</a> from the orange &#8220;Start download&#8221; button.</p>
<p>However, be aware that when solving it this way, you may need to execute my batch file after every update again to disable all the bloatware (CollabSync and RdrCEF) that comes with every update, as it just eats up your memory and slows down your machine.</p>
<p><strong>Update, 01.03.2026</strong></p>
<p>As people seem to be concerned about the stub DLL from the dllme.com site: I was concerned too and thus I checked the DLLs with a disassembler first before using them and posted my results <a href="https://community.adobe.com/questions-12/reader-win7-21208-update-breaks-acrobat-reader-won-t-start-missing-dll-1550183?postid=7504369#post7504369">here</a>. They are really just DLLs that contain NULL-Stubs fo the exported WinRT-functions, so no malware included.<br />
You can check them with your favourite disassembler yourself.<br />
The correct file is named&nbsp;api-ms-win-core-winrt-l1-1-0.dll and has 13.192 bytes, so that you can compare.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/912-adobe-reader-21208-update-breaks-acrobat-reader-on-windows-7-fix/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Fixing a Zyxel GS1200-8HP Switch</title>
		<link>http://hardwarefetish.com/906-fixing-a-zyxel-gs1200-8hp-switch</link>
		<comments>http://hardwarefetish.com/906-fixing-a-zyxel-gs1200-8hp-switch#respond</comments>
		<pubDate>Wed, 27 Aug 2025 22:47:13 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=906</guid>
		<description><![CDATA[I recently got a Zyxel GS1200-8HP switch that seemed to be stuck in a bootloop. It was located in a room that wasn&#8217;t heated during winter time and therefore there might be condensed water issues or whatever. But I was interested if I could fix the bootloop. So I opened up the device and found [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I recently got a Zyxel GS1200-8HP switch that seemed to be stuck in a bootloop. It was located in a room that wasn&#8217;t heated during winter time and therefore there might be condensed water issues or whatever. But I was interested if I could fix the bootloop.<br />
So I opened up the device and found a 4 pin connector.<br />
I followed its traces and came up with the following 3.3V FTDI serial interface pinout:</p>
<pre>&nbsp;
Board&nbsp; &nbsp; &nbsp;FTDI Adapter
+WJ1+ 
|GND|     -
|TXD|     RXD
|RXD|     TXD
|GND|     GND
+---+</pre>
<p>Here is a picture showing the orientation:</p>
<p><a href="http://hardwarefetish.com/wp-content/uploads/2025/08/zyxel.jpg"><img class="alignnone size-medium wp-image-907" src="http://hardwarefetish.com/wp-content/uploads/2025/08/zyxel-300x146.jpg" alt="" width="300" height="146" srcset="http://hardwarefetish.com/wp-content/uploads/2025/08/zyxel-300x146.jpg 300w, http://hardwarefetish.com/wp-content/uploads/2025/08/zyxel-768x373.jpg 768w, http://hardwarefetish.com/wp-content/uploads/2025/08/zyxel-1024x498.jpg 1024w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>Now afterwards I needed the correct baudrate to communicate with the device which is: 38400 baud, 8 data bits, 1 stop bit, no parity<br />
When connecting a terminal program to it, it showed me the following:</p>
<pre>-------------- GS608A Firmware -------------
------ Press "f" into firmware update ------
------- Press other key into boot up -------

== MAC Calculate Correct
== Boot Up After 3s
== Boot Up After 2s
== Boot Up After 1s
----------------GS608A Start------------------

CMD&gt; Pressed 6s !!!</pre>
<p>So it seems that the REST-Switch triggered. Out of curiousity, I pressed &#8220;f&#8221; for firmware update. I suggest you to not do it,because it immediately starts <strong>erasing</strong> the firmware and then asks for the new one:</p>
<pre>== Upgrade GS608A App Now
== Erase Bank(0) ~ Bank(30)

</pre>
<p>Luckily, I was able to find out <a href="https://community.zyxel.com/en/discussion/4804/gs1200-hp-firmware-corrupted">how to reflash it</a></p>
<p>Basically you need to do an XMODEM Transfer, i.e. via <a href="https://teratermproject.github.io/index-en.html">Tera Term</a> program with 1K Blocksize activated (check the checkbox in the file open dialog).</p>
<p>Now I first suspected the RESET-button, but the button was OK. It is basically just a simple circuit that drives the Line LO that is usually tied high via a standard debouncing circuit:<br />
<img src="https://www.kampis-elektroecke.de/wp-content/uploads/2020/06/VHDL_Debounce2.png"></p>
<p>When measuing, I measured that it was always LO, so maybe the capacitor became faulty and tied the line to GND or whatever.<br />
I measured that the RESET line was connected to P3.3 or the&nbsp;<a href="https://images.chipyun.com/pdf/C703561_DE7318878EEE9D50F8DFB56B72DFAF1E.pdf">IP210W CPU</a>.</p>
<p>So instead of messing around with electronics, I took the easiest approach and simpy patched the firmware to ignore Reset. In the firmware, there is:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="asm"><pre class="de1">ROM<span class="sy1">:</span>1A8B1 <span class="kw1">jnb</span> P3<span class="sy1">.</span>3<span class="sy1">,</span> code_A8B7 <span class="co1">; Port 3</span>
ROM<span class="sy1">:</span>1A8B4 ljmp ROM_1A944</pre></div></div></div></div></div></div></div>


<p>jnb means &#8220;Jump if port is not set&#8221;, so I NOPed out the Jump and replaced 30 B3 03 with 00 00 00 and reflashed the firmware. And really, the reset loop went away and the switch didn&#8217;t restart all the time anymore.</p>
<p>When testing the switch, I found out that the upper non-PoE port group (5-8) was faulty, the link light of port 8 stays lit all the time. I guess that the PHY dricing this port group got damaged. But the PoE Ports 1-4 work fine without issues, so at least I have a working 4-Port PoE-Switch now and don&#8217;t have to spend money on a PoE switch and it was a very easy fix.</p>
<p>Let&#8217;s see how long it keeps working.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/906-fixing-a-zyxel-gs1200-8hp-switch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Booting a HP ML310e Server with a broken fan that refuses to boot</title>
		<link>http://hardwarefetish.com/902-booting-a-hp-ml310e-server-with-a-broken-fan-that-refuses-to-boot</link>
		<comments>http://hardwarefetish.com/902-booting-a-hp-ml310e-server-with-a-broken-fan-that-refuses-to-boot#respond</comments>
		<pubDate>Sun, 15 Jun 2025 16:11:59 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=902</guid>
		<description><![CDATA[I recently got a HP ML310e Server machine that refused to boot with a &#8220;Fan 2 error, not sufficient&#8221;. However the temperatures were normal and the fan was spinning at max level. Now in such a case, the system refuses to even enter BIOS and shuts down immediately during POST. Unfortunately, on this machien the [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I recently got a HP ML310e Server machine that refused to boot with a &#8220;Fan 2 error, not sufficient&#8221;.<br />
However the temperatures were normal and the fan was spinning at max level.</p>
<p>Now in such a case, the system refuses to even enter BIOS and shuts down immediately during POST. Unfortunately, on this machien the iLO was also disabled and there was no way to enable the iLO without booting the system to a point where the iLO can be configured.<br />
Resetting via Dip switch 6 als odidn&#8217;t help in this case, as system always shut down before BIOS boot prompt.</p>
<p>So I read about the fan pinout which can be seen <a href="https://www.reddit.com/media?url=https%3A%2F%2Fi.redd.it%2Fqvnc7klynz711.png">here</a>:</p>
<pre>1 VCC, 2 N/C, 3 Speed Control, 4 Rotation detect, 5 GND loop, 6 GND</pre>
<p>The cable layout also confirmed this wiring:</p>
<pre class="bbCodeCode" dir="ltr" data-xf-init="code-block" data-lang=""><code>4.1.6 Fan Connector Pinout and Wiring Colors
Table 1 Connector Pinout
Pin Function Wire Color
1 GND Black
2 12 V Yellow
3 Sense Green
4 Control Blue</code></pre>
<p>Some <a href="https://www.reddit.com/r/HomeServer/comments/8w4ncc/my_attempt_at_creating_a_circuit_that_enables_4/">posts</a> stated, that shorting pins 4-6 would trick the server into booting which would make sense. But what to do about the non-standard connector? I didn&#8217;t want to cut the existing fan, just get the system to boot and I didn&#8217;t have a matching connector?&nbsp;<br />
I decided to just use a metal paper clip, as it fits perfectly into the connector to short the pins:</p>
<p>&nbsp;</p>
<p><a href="http://hardwarefetish.com/wp-content/uploads/2025/06/Luefteranschluss.jpg"><img class="alignnone size-medium wp-image-903" src="http://hardwarefetish.com/wp-content/uploads/2025/06/Luefteranschluss-300x223.jpg" alt="" width="300" height="223" srcset="http://hardwarefetish.com/wp-content/uploads/2025/06/Luefteranschluss-300x223.jpg 300w, http://hardwarefetish.com/wp-content/uploads/2025/06/Luefteranschluss-768x571.jpg 768w, http://hardwarefetish.com/wp-content/uploads/2025/06/Luefteranschluss-1024x762.jpg 1024w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>I used a toothpick to stabilize the paper clip to have enough pressure on the pins and tadaaa: The server booted successfully and I was able to enable the iLO console!</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/902-booting-a-hp-ml310e-server-with-a-broken-fan-that-refuses-to-boot/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Repairing a damaged Windows NT4 registry hive</title>
		<link>http://hardwarefetish.com/898-repairing-a-damaged-windows-nt4-registry-hive</link>
		<comments>http://hardwarefetish.com/898-repairing-a-damaged-windows-nt4-registry-hive#respond</comments>
		<pubDate>Mon, 24 Mar 2025 22:42:59 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=898</guid>
		<description><![CDATA[I was shown a defective HKEY_LOCAL_MACHINE\System registry hive of a Windows NT 4.0 system today (resides in \WINNT\SYSTEM32\CONFIG\SYSTEM ). In order to get NT4 running again, it had to be repaired. No need to reinstall NT4. In order to repair it, I did the following: 1) Loading the SYSTEM file in Windows XP Regedt32 via [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I was shown a defective HKEY_LOCAL_MACHINE\System registry hive of a Windows NT 4.0 system today (resides in \WINNT\SYSTEM32\CONFIG\SYSTEM ). In order to get NT4 running again, it had to be repaired.<br />
No need to reinstall NT4. In order to repair it, I did the following:<br />
1) Loading the SYSTEM file in Windows XP Regedt32 via File/Load Hive (&#8220;Datei/Struktur laden&#8230;&#8221;). It told me that it was damaged and reparied some damaged pwars before plugging it in.<br />
2) Exporting the hive to a new file via File/Export&#8230; (Datei/Exportieren&#8230;) by using the Save as type: Registry Hive Files (*.*)  (&#8220;Registrierungsstrukturdaten (*.*)&#8221;) and saving it to a new file<br />
3) Just replacing \WINNT\SYSTEM32\CONFIG\SYSTEM with the newly created hive file.</p>
<p>Worked like a charm, NT4 booted again.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/898-repairing-a-damaged-windows-nt4-registry-hive/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RasPi4 with touch screen as living room media center with TV/Beamer autoswitch</title>
		<link>http://hardwarefetish.com/884-raspi4-with-touch-screen-as-living-room-media-center-with-tv-beamer-autoswitch</link>
		<comments>http://hardwarefetish.com/884-raspi4-with-touch-screen-as-living-room-media-center-with-tv-beamer-autoswitch#respond</comments>
		<pubDate>Wed, 13 Sep 2023 09:44:45 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=884</guid>
		<description><![CDATA[I recently got a RasPi4 with official 7&#8243; touch screen in a case and wanted to make this my living-room media control center. I attached a video beamer to its HDMI port (would also work for a TV set) and installed KODI. My goal was to automatically restart Kodi and execute it on the video [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I recently got a RasPi4 with official 7&#8243; touch screen in a case and wanted to<br />
make this my living-room media control center. I attached a video beamer to its<br />
HDMI port (would also work for a TV set) and installed <a href="https://kodi.tv/">KODI</a>.<br />
My goal was to automatically restart Kodi and execute it on the video projector<br />
screen, as soon as I turn on the device and restart it on the internal touch<br />
screen when the device gets turned off again.<br />
This way I can use the internal touch screen to i.e. listen to Internet Radio<br />
or other live streams using the RasPi conveniently and also use it as a video<br />
entertainment center when turning on the beamer.<br />
This turned out to be not as easy as I initially thought it would be.</p>
<p>First of all, RaspiOS nowadays ships with the KMS/DRM video stack per default.<br />
This is good for hardware accelleration and has a few other advantages, but is<br />
bad for compatibility with the internal 7&#8243; touchscreen display and KODI.<br />
Here are the problems that I encountered:</p>
<ol>
<li>Current RaspiOS is based on debian Bullseye and only ships with KODI 19.<br />
However, KODI 19 is missing a feature where its KMS backend can detect<br />
multiple attached Screens (so in my case: Internal DSI-1 display and<br />
external HDMI-1 display). So do most of the specialised Mediacenter<br />
distributions like LibreELEC.<br />
The first version that ships with KODI 20 is based on Debian Bookworm.<br />
So RasPi needs to be updated to Debian Bookworm for KODI 20.</li>
<li>KODI 20 supports the detection of multiple screens (only can use one<br />
of them at the same time, but that&#8217;s not a problem for me yet), but<br />
it doesn&#8217;t support screen rotation in its KMS backend and doesn&#8217;t<br />
obey the console rotation settings. This was a problem in my case, as<br />
the screen got mounted upside-down in the case and due to the way the<br />
case was designed, this also couldn&#8217;t be changed physically.<br />
There is very few documentation about the KMS-DRM stack regarding rotation,<br />
so I had to spend a huge amount of time into reading about the workings<br />
of the KMS/DRM graphics stack, as most docuemntation just refers to X,<br />
which isn&#8217;t used by KODI on RasPi (and shouldn&#8217;t be because of lack<br />
in hardware accelleration).</li>
<li>The <a href="https://github.com/Pulse-Eight/libcec">libcec</a> library, that also<br />
gets used by KODI internally for i.e. using the remote control of an<br />
attached HDMI-device and other stuff, demands exclusive access to the<br />
CEC interface, therefore I cannot monitor the CEC power status via<br />
another libcec-Based daemon like<br />
<a href="https://github.com/matthewbauer/libcec-daemon">libcec-daemon</a><br />
concurrently.</li>
<li>The FMKS-driver (vc4-fkms-v3d) supports rotation of the screen via<br />
firmware, but doesn&#8217;t seem to detect HDMI properly (with attached<br />
device in standby) and also doesn&#8217;t offer<br />
<a href="https://docs.kernel.org/driver-api/media/cec-core.html">CEC kernel support</a>.<br />
Therefore it is also unusable for my project.</li>
</ol>
<p>So, how to solve all of these problems?</p>
<ol>
<li>Easy, just upgrade the OS to bookworm and we have a working KODI 20.</li>
<li>Unfortunately, there didn&#8217;t seem to be a solution for KODI at the<br />
time of writing. It just doesn&#8217;t have a setting for screen rotation<br />
and the KMS-DRM requires the application driving the video screen to<br />
set rotation itself. The Raspi-Docs just know about on how to let X<br />
rotate the screen which isn&#8217;t what we need.<br />
Therefore the only solution to this is to recompile kodi with a<br />
hardcoded rotation for the internal DSI-1 port.<br />
I made a little patch for Kodi and recompiled it for Debian bookworm<br />
and documented everything in <a href="https://github.com/xbmc/xbmc/issues/23622">this</a><br />
Github-Issue. It also documents on how to rotate the touch screen.<br />
If you have the &#8220;brilliant&#8221; idea to rotate the screen from another<br />
application by setting the rotation property of the active screen locked<br />
by Kodi, like I did, I must disappoint you: You get &#8220;access denied&#8221;<br />
in this case, so you have to bite the bullet and recompile kodi.<br />
Altough I already provide a Debian package for it on the linked issue,<br />
you can take the patch from there and recompile Kodi yourself, if you<br />
want.<br />
Approximately, this is something like:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">   apt <span class="kw2">install</span> build-essential devscripts
   apt <span class="kw3">source</span> kodi
   apt build-dep kodi
   <span class="co0"># Apply patch here</span>
   <span class="kw3">export</span> <span class="re2">DEB_BUILD_OPTIONS</span>=<span class="st0">&quot;lang=en-US ccache nocheck&quot;</span>
   <span class="kw3">export</span> <span class="re2">EMAIL</span>=<span class="st_h">'leecher@dose.0wnz.at'</span>
   <span class="kw2">dch</span> <span class="re5">-n</span>
   debuild <span class="re5">-us</span> <span class="re5">-uc</span> <span class="re5">-nc</span></pre></div></div></div></div></div></div></div>


</li>
<li>As libcec-daemon wasn&#8217;t usable for me due to mentioned reasons, I<br />
wrote a little application to monitor the CEC0 port myself for changes<br />
in power status and then execute a shell-script that restarts KODI<br />
on change. The program is available in <a href="https://github.com/leecher1337/cecpowmon">this github repo</a>.</li>
</ol>
<p>So in order to make the same installation as I did, here is a step-by-step<br />
guide:</p>
<ol>
<li style="list-style-type: none;">
<ol>
<li>Install RapiOS Bookworm<br />
At the time of writing, Debian Bookworm wasn&#8217;t available as ready-made<br />
distribution for the RasPi 4, so I had to install RaspiOS Bullseye and<br />
then upgrade it.<br />
If RaspOS based on Debian Bookworm or later is already available when you are<br />
reading this, just install it with the RasPi Imager and you are good to go.<br />
I selected the following<br />
* Raspberry Pi OS (other)<br />
* Raspberry Pi OS Lite (32-bit)Then, upgrade the newly-installed system(as root):</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">apt update
apt upgrade <span class="re5">--without-new-pkgs</span>
<span class="kw2">sed</span> <span class="re5">-i</span> <span class="st_h">'s/bullseye/bookworm/g'</span> <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list
<span class="kw2">sed</span> <span class="re5">-i</span> <span class="st_h">'s/bullseye/bookworm/g'</span> <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list.d<span class="sy0">/*</span>
apt update
apt full-upgrade
reboot</pre></div></div></div></div></div></div></div>


</li>
<li>Install KODI (as root)


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1">apt <span class="kw2">install</span> kodi socat</pre></div></div></div></div></div></div></div>


<p>2a) If your screen is swapped, install special 180° rotated version of KODI<br />
(as root)</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw2">wget</span> https:<span class="sy0">//</span>github.com<span class="sy0">/</span>xbmc<span class="sy0">/</span>xbmc<span class="sy0">/</span>files<span class="sy0">/</span><span class="nu0">12452936</span><span class="sy0">/</span>kodi-bin_20.0<span class="sy0">%</span>2Bdfsg-<span class="nu0">2.1</span>_armhf.zip
<span class="kw2">unzip</span> kodi-bin_20.0+dfsg-<span class="nu0">2.1</span>_armhf.zip
<span class="kw2">rm</span> kodi-bin_20.0+dfsg-<span class="nu0">2.1</span>_armhf.zip
<span class="kw2">dpkg</span> <span class="re5">-i</span> kodi-bin_20.0+dfsg-<span class="nu0">2.1</span>_armhf.deb
<span class="kw2">sed</span> <span class="re5">-i</span> <span class="st0">&quot;s/kodi-bin (&lt;&lt; 2:20.0+dfsg-2.1~), //g&quot;</span> <span class="sy0">/</span>var<span class="sy0">/</span>lib<span class="sy0">/</span>dpkg<span class="sy0">/</span>status
<span class="kw2">vi</span> <span class="sy0">/</span>boot<span class="sy0">/</span>cmdline.txt
<span class="co0">#add at the end of the first line:</span>
  <span class="re2">video</span>=DSI-<span class="nu0">1</span>:800x480M,<span class="re2">rotate</span>=<span class="nu0">180</span>
<span class="kw3">echo</span> <span class="st_h">'ACTION==&quot;add|change&quot;, KERNEL==&quot;event[0-9]*&quot;, ENV{LIBINPUT_CALIBRATION_MATRIX}=&quot;-1 0 1 0 -1 1&quot;'</span> <span class="sy0">&gt;/</span>etc<span class="sy0">/</span>udev<span class="sy0">/</span>rules.d<span class="sy0">/</span><span class="nu0">90</span>-libinput-rotate.rules</pre></div></div></div></div></div></div></div>


</li>
<li>Install cec-powmon and necessary scripts (as normal user)<br />
Ensure that you are running as normal user and not as root!</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw3">cd</span> ~
<span class="kw2">wget</span> https:<span class="sy0">//</span>github.com<span class="sy0">/</span>leecher1337<span class="sy0">/</span>cecpowmon<span class="sy0">/</span>archive<span class="sy0">/</span>refs<span class="sy0">/</span>heads<span class="sy0">/</span>main.zip
<span class="kw2">unzip</span> main.zip
<span class="kw2">rm</span> main.zip
<span class="kw2">mv</span> cecpowmon-main cecpowmon
<span class="kw3">cd</span> cecpowmon
<span class="kw2">make</span>
<span class="kw2">vi</span> restart_kodi.sh</pre></div></div></div></div></div></div></div>




<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="co0">#!/bin/sh</span>
<span class="kw3">echo</span> <span class="st_h">'{&quot;jsonrpc&quot;:&quot;2.0&quot;,&quot;method&quot;:&quot;Application.Quit&quot;,&quot;id&quot;:1}'</span> <span class="sy0">|</span> socat <span class="re5">-t</span> <span class="nu0">1</span> - TCP-CONNECT:localhost:<span class="nu0">9090</span></pre></div></div></div></div></div></div></div>




<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw2">chmod</span> <span class="nu0">755</span> restart_kodi.sh
<span class="kw2">vi</span> start_kodi.sh</pre></div></div></div></div></div></div></div>




<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="co0">#!/bin/sh</span>
<span class="co0"># Configure CEC for first use</span>
cec-ctl <span class="re5">-d</span> <span class="nu0">0</span> <span class="re5">--tv</span> <span class="re5">-S</span>
&nbsp;
<span class="co0"># Wait for HDMI status</span>
<span class="kw1">while</span> :
<span class="kw1">do</span>
    <span class="re2">STATUS</span>=<span class="sy0">`</span>cec-ctl <span class="re5">--give-device-power-status</span> <span class="re5">--to</span> <span class="nu0">0</span><span class="sy0">`</span>
    <span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$STATUS</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> <span class="st0">&quot;pwr-state&quot;</span> <span class="sy0">&gt;/</span>dev<span class="sy0">/</span>null
    <span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re4">$?</span> <span class="re5">-eq</span> <span class="nu0">0</span> <span class="br0">&#93;</span>; <span class="kw1">then</span>
      <span class="kw3">break</span>
    <span class="kw1">fi</span>
    <span class="kw2">sleep</span> <span class="nu0">2</span>
<span class="kw1">done</span>
<span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$STATUS</span>&quot;</span> <span class="sy0">|</span> <span class="kw2">grep</span> pwr-state <span class="sy0">|</span> <span class="kw2">grep</span> <span class="st0">&quot;on&quot;</span>.
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="re4">$?</span> <span class="re5">-eq</span> <span class="nu0">0</span> <span class="br0">&#93;</span>; then.
    <span class="re2">OUTPUT</span>=HDMI-A-<span class="nu0">1</span>
    <span class="re2">SKIN</span>=skin.estuary
else.
    <span class="re2">OUTPUT</span>=DSI-<span class="nu0">1</span>
    <span class="re2">SKIN</span>=skin.estouchy
<span class="kw1">fi</span>
<span class="kw3">echo</span> <span class="st0">&quot;<span class="es2">$OUTPUT</span><span class="es2">$SKIN</span>&quot;</span> <span class="sy0">&gt;</span>~<span class="sy0">/</span>.kodi<span class="sy0">/</span>userdata<span class="sy0">/</span>advancedsettings.xml
<span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span>kodi <span class="re5">--standalone</span></pre></div></div></div></div></div></div></div>




<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw2">chmod</span> <span class="nu0">755</span> start_kodi.sh
<span class="kw2">mkdir</span> <span class="re5">-p</span> ~<span class="sy0">/</span>.kodi<span class="sy0">/</span>userdata<span class="sy0">/</span>
<span class="kw2">sudo</span> <span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>systemd<span class="sy0">/</span>system<span class="sy0">/</span>kodi.service</pre></div></div></div></div></div></div></div>


<pre>[Unit]
Description=Kodi Media Center
After=remote-fs.target network-online.target
Wants=network-online.target

[Service]
User=[username]
Type = simple
ExecStart=/home/[username]/cecpowmon/start_kodi.sh
ExecStop=/bin/kill -TERM $MAINPID
TimeoutStopSec=5
Restart=always
RestartSec=2
StartLimitInterval=0
LimitNOFILE=16384
SyslogIdentifier = kodi

# lowering memory fragmentation
# https://linux.die.net/man/3/mallopt
# https://github.com/xbmc/xbmc/pull/11620
  Environment=MALLOC_MMAP_THRESHOLD_=131072

# Workaround for high CPU load with nvidia GFX
  Environment=__GL_YIELD=USLEEP

[Install]
WantedBy= multi-user.target
</pre>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="re2">USER</span>=<span class="sy0">`</span><span class="kw2">whoami</span><span class="sy0">`</span> <span class="kw2">sudo</span> <span class="kw2">sed</span> <span class="re5">-i</span> <span class="st0">&quot;s/\[username\]/<span class="es2">$USER</span>/g&quot;</span> <span class="sy0">/</span>etc<span class="sy0">/</span>systemd<span class="sy0">/</span>system<span class="sy0">/</span>kodi.service
<span class="kw2">sudo</span> <span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>systemd<span class="sy0">/</span>system<span class="sy0">/</span>cecpowmon.service</pre></div></div></div></div></div></div></div>


<pre>[Unit]
Description=HDMI CEC Monitor
After=kodi.service
Requires=multi-user.target
Wants=network-online.target

[Service]
ExecStart=/home/[username]/cecpowmon/cecpowmon /home/[username]/cecpowmon/restart_kodi.sh
ExecStop=/bin/kill -TERM $MAINPID
TimeoutStopSec=5
Restart=always
RestartSec=2
StartLimitInterval=0
LimitNOFILE=16384

[Install]
WantedBy=default.target
</pre>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="re2">USER</span>=<span class="sy0">`</span><span class="kw2">whoami</span><span class="sy0">`</span> <span class="kw2">sudo</span> <span class="kw2">sed</span> <span class="re5">-i</span> <span class="st0">&quot;s/\[username\]/<span class="es2">$USER</span>/g&quot;</span> <span class="sy0">/</span>etc<span class="sy0">/</span>systemd<span class="sy0">/</span>system<span class="sy0">/</span>cecpowmon.service
<span class="kw2">sudo</span> systemctl <span class="kw3">enable</span> cecpowmon
<span class="kw2">sudo</span> systemctl <span class="kw3">enable</span> kodi
<span class="kw2">sudo</span> systemctl daemon-reload
<span class="kw2">sudo</span> reboot</pre></div></div></div></div></div></div></div>


</li>
</ol>
</li>
</ol>
<p>Now you should be greeted with KODI on one of the screens depending on<br />
which you have turned on.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/884-raspi4-with-touch-screen-as-living-room-media-center-with-tv-beamer-autoswitch/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Advokat mit MS SQL Server als CID-Quelle in FreePBX einbinden</title>
		<link>http://hardwarefetish.com/879-advokat-mit-ms-sql-server-als-cid-quelle-in-freepbx-einbinden</link>
		<comments>http://hardwarefetish.com/879-advokat-mit-ms-sql-server-als-cid-quelle-in-freepbx-einbinden#respond</comments>
		<pubDate>Mon, 11 Sep 2023 21:10:07 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=879</guid>
		<description><![CDATA[Ich habe bereits in einem frühere Artikel dargelegt, wie man in die FreePBX Telefonanlage eine Called ID Suche für das in Österreich populäre Anwaltskanzleipaket Advokat einbindet. Damals basierte das Paket noch auf einer MS-Access Datenbank, mitterweile ist überall der MS SQL Server vorgeschrieben. Das bietet den großen Vorteil, dass man nun nicht mehr wie damals [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Ich habe bereits in einem <a href="http://hardwarefetish.com/725-advokat-als-cid-quelle-in-freepbx-einbinden">frühere Artikel</a> dargelegt, wie man in die <a href="https://www.freepbx.org/">FreePBX</a> Telefonanlage eine Called ID Suche für das in Österreich populäre Anwaltskanzleipaket <a href="http://www.advokat.at">Advokat</a> einbindet.<br />
Damals basierte das Paket noch auf einer MS-Access Datenbank, mitterweile ist überall der MS SQL Server vorgeschrieben.<br />
Das bietet den großen Vorteil, dass man nun nicht mehr wie damals die Liste aller Adressen mühsam händisch durchparsen kann (aufgrund des sehr limitierten SQL-Syntax zur Abfrage von MDB-Datenbanken), sondern die DB direkt schnell inklusive Nummern-Normalisierung abfragen kann.<br />
Dies hat den weiteren Vorteil, dass man Asterisk das Abfrageergebnis nicht mehr zwischenspeichern lassen muss (Caching auf Yes in den CID-Einstellungen der FreePBX), was zu dem unschönen Effekt geführt hat, dass die cidname Records in der astdb im Asterisk immer mit einem Leerwert gespeichert wurden, wenn kein Abfrageergebnis vorhanden war, was wiederum zur Folge hatte, dass ein spätere Eintrag der Nummer in der Advokat-Datenbank nicht mehr dazu führte, dass der Namen richtig aufgelöst wird, sondern dieser immer leer bleibt.</p>
<p>Hier also nun die aktualisierte Anleitung:</p>
<p>Zuerst müssen einmal, wenn noch nicht vorhanden, unixodb und die php-Module dafür installiert werden.<br />
php-odbc wird hier als Meta-Paket angegeben, je nach Debian-Release kann es sein, dass man für die Preepbx ein eigenes Paket mit einer kompatiblen PHP-Version installiert hat, demnach wäre der Modulname dann z.B. php7.4-odbc.<br />
Für die Installation der mssql-tools wird auf die <a href="http://hardwarefetish.com/874-installing-ms-sql-server-2019-on-devuan-daedalus-debian-12-bookworm">jeweiligen Tutorials</a> zur MS SQL Server Installation in diesem Blog verwiesen.</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw2">apt-get install</span> unixodbc php-odbc mssql-tools</pre></div></div></div></div></div></div></div>


<p>Die Advokat-Datenquelle dann dem UnixODBC mitteilen. Es wird davon ausgegangen, dass durch die Installation des MS SQL Servers oder zumindest dessen Client Tools schon ein entsprechender Eintrag in /etc/odbcinst.ini angelegt wurde.<br />
Für den Treibernamen ist also ggf die odbcinst.ini zu konsultieren, sollte der hier angegebene nicht passen.<br />
vi /etc/odbc.ini</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="br0">&#91;</span>Advokat<span class="br0">&#93;</span>
Description = Advokat
Driver = ODBC Driver <span class="nu0">17</span> <span class="kw1">for</span> SQL Server
Server = localhost
Port = <span class="nu0">1433</span>
Database = Advokat_DATEN</pre></div></div></div></div></div></div></div>


<p>Nun benötigen wir noch ein kleines PHP-Script, welches die Nummern<br />
normalisiert, damit diese mit der eingehenden Nummer auf der Telefonanlage<br />
verglichen werden können.<br />
Die Normalisierung der Nummer muss man sich entsprechend der Anlagenparameter<br />
anpassen, da diese wohl je nach Provider in unterschiedlicher Form kommt.<br />
Das Script z.B. in den root der FreePBX-Installation kopieren oder an einen<br />
Ort, wo es das CIDLookup Script finden kann.<br />
Zugangsdaten für den Server entsprechend im script anpassen:</p>
<p>tel.php:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw3">define</span><span class="br0">&#40;</span><span class="st_h">'DSN_ADVOKAT'</span><span class="sy0">,</span> <span class="st_h">'Advokat'</span><span class="br0">&#41;</span><span class="sy0">;</span>
&nbsp;
<span class="kw2">function</span> GetName<span class="br0">&#40;</span><span class="re0">$odbc</span><span class="sy0">,</span> <span class="re0">$NNr</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
&nbsp;
    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$result</span> <span class="sy0">=</span> <span class="kw3">odbc_exec</span><span class="br0">&#40;</span><span class="re0">$odbc</span><span class="sy0">,</span> <span class="st_h">'select Titel, Vorname, Name1 from Namen Where NNr='</span><span class="sy0">.</span><span class="re0">$NNr</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">if</span> <span class="br0">&#40;</span><span class="kw3">odbc_fetch_row</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
        <span class="br0">&#123;</span>
            <span class="re0">$titel</span> <span class="sy0">=</span> <span class="kw3">odbc_result</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="sy0">,</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">;</span>
            <span class="re0">$ret</span><span class="sy0">=</span><span class="br0">&#40;</span><span class="re0">$titel</span>?<span class="re0">$titel</span><span class="sy0">.</span><span class="st_h">' '</span><span class="sy0">:</span><span class="st_h">''</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="kw3">odbc_result</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="sy0">,</span><span class="nu0">2</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="st_h">' '</span><span class="sy0">.</span><span class="kw3">odbc_result</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="sy0">,</span><span class="nu0">3</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="br0">&#125;</span>
        <span class="kw3">odbc_free_result</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
    <span class="kw1">return</span> <span class="re0">$ret</span><span class="sy0">;</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="re0">$nr</span> <span class="sy0">=</span> <span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st_h">'nr'</span><span class="br0">&#93;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="kw3">is_numeric</span><span class="br0">&#40;</span><span class="re0">$nr</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="kw3">exit</span><span class="sy0">;</span>
<span class="re0">$where</span> <span class="sy0">=</span> <span class="st0">&quot;WHERE phone='<span class="es4">$nr</span>'&quot;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$nr</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st_h">'0'</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$nr</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st_h">'0'</span><span class="br0">&#41;</span> <span class="re0">$where</span><span class="sy0">.=</span><span class="st0">&quot; or phone='&quot;</span><span class="sy0">.</span><span class="kw3">substr</span><span class="br0">&#40;</span><span class="re0">$nr</span><span class="sy0">,</span> <span class="nu0">2</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="st0">&quot;' &quot;</span><span class="sy0">;</span>
<span class="kw1">else</span> <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$nr</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">==</span><span class="st_h">'0'</span> <span class="sy0">&amp;&amp;</span> <span class="re0">$nr</span><span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span><span class="sy0">!=</span><span class="st_h">'0'</span><span class="br0">&#41;</span> <span class="re0">$where</span><span class="sy0">.=</span><span class="st0">&quot; or phone='43&quot;</span><span class="sy0">.</span><span class="kw3">substr</span><span class="br0">&#40;</span><span class="re0">$nr</span><span class="sy0">,</span> <span class="nu0">1</span><span class="br0">&#41;</span><span class="sy0">.</span><span class="st0">&quot;' &quot;</span><span class="sy0">;</span>
&nbsp;
<span class="re0">$found</span><span class="sy0">=</span><span class="kw4">false</span><span class="sy0">;</span>
<span class="re0">$odbc</span> <span class="sy0">=</span> <span class="kw3">odbc_connect</span><span class="br0">&#40;</span>DSN_ADVOKAT<span class="sy0">,</span> <span class="st_h">'sa'</span><span class="sy0">,</span> <span class="st_h">'superuserpassword'</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$result</span> <span class="sy0">=</span> <span class="kw3">odbc_exec</span><span class="br0">&#40;</span><span class="re0">$odbc</span><span class="sy0">,</span> <span class="st0">&quot;with t as (select NNr, REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(CONCAT(Vorwahl, Telefon),' ',''),'(',''),')',''),'-',''),'?',''),'+','') phone from Telefon Where Art='Telefon' or Art='Handy') select NNr, phone from t <span class="es4">$where</span>&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span class="kw1">while</span> <span class="br0">&#40;</span><span class="kw3">odbc_fetch_row</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">echo</span> GetName<span class="br0">&#40;</span><span class="re0">$odbc</span><span class="sy0">,</span> <span class="kw3">odbc_result</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="sy0">,</span><span class="nu0">1</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="sy0">;</span>
        <span class="re0">$found</span><span class="sy0">=</span><span class="kw4">true</span><span class="sy0">;</span>
        <span class="kw1">break</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
    <span class="kw3">odbc_free_result</span><span class="br0">&#40;</span><span class="re0">$result</span><span class="br0">&#41;</span><span class="sy0">;</span>
<span class="br0">&#125;</span> <span class="kw1">else</span> <span class="kw1">echo</span> <span class="st0">&quot;fail odbc&quot;</span><span class="sy0">;</span>
&nbsp;
<span class="kw3">odbc_close</span><span class="br0">&#40;</span><span class="re0">$odbc</span><span class="br0">&#41;</span><span class="sy0">;</span></pre></div></div></div></div></div></div></div>


<p>Wenn man möchte, kann man auch noch einen Lookup in der lokalen SOGO-Installation anhängen, wenn man einen derartigen Server betreibt und die Views aus dem <a href="http://hardwarefetish.com/727-cidlookup-in-freepbx-on-sogo">zugehörigen Artikel</a> angelegt hat (DB User und Passwort enstprechend anpassen):</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="php"><pre class="de1"><span class="kw1">if</span> <span class="br0">&#40;</span><span class="sy0">!</span><span class="re0">$found</span><span class="br0">&#41;</span>
<span class="br0">&#123;</span>
    <span class="co1">// Alternativ kann man noch im SOGO-Adressbuch nachschaun</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$conn</span><span class="sy0">=</span><span class="kw3">mysqli_connect</span><span class="br0">&#40;</span><span class="st0">&quot;localhost&quot;</span><span class="sy0">,</span><span class="st0">&quot;sogo&quot;</span><span class="sy0">,</span><span class="st0">&quot;sogopasswd&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
    <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$seldb</span><span class="sy0">=</span><span class="kw3">mysqli_select_db</span><span class="br0">&#40;</span><span class="re0">$conn</span><span class="sy0">,</span> <span class="st0">&quot;sogo&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
        <span class="kw1">if</span> <span class="br0">&#40;</span><span class="re0">$retrive</span><span class="sy0">=</span><span class="kw3">mysqli_query</span><span class="br0">&#40;</span><span class="re0">$conn</span><span class="sy0">,</span> <span class="st0">&quot;select c_cn from phoneno_f <span class="es4">$where</span>&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
        <span class="br0">&#123;</span>
            <span class="kw1">if</span><span class="br0">&#40;</span><span class="re0">$r</span><span class="sy0">=</span><span class="kw3">mysqli_fetch_row</span><span class="br0">&#40;</span><span class="re0">$retrive</span><span class="br0">&#41;</span><span class="br0">&#41;</span>
            <span class="br0">&#123;</span>
                <span class="kw1">echo</span> <span class="re0">$r</span><span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="sy0">;</span>
            <span class="br0">&#125;</span>
        <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
    <span class="kw3">mysqli_close</span><span class="br0">&#40;</span><span class="re0">$conn</span><span class="br0">&#41;</span><span class="sy0">;</span>
    <span class="br0">&#125;</span>
<span class="br0">&#125;</span></pre></div></div></div></div></div></div></div>


<p>Danach müssen wir nur noch eine neue Quelle im CIDLookup definieren.</p>
<p>Source type: HTTP<br />
Host: localhost<br />
Port: 80 oder wo immer der Webserver läuft<br />
Path: /tel.php<br />
Query: nr=[NUMBER]</p>
<p>Cachen nicht aktivieren. Das sollte es gewesen sein.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/879-advokat-mit-ms-sql-server-als-cid-quelle-in-freepbx-einbinden/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing MS SQL Server 2019 on Devuan Daedalus (~Debian 12/bookworm)</title>
		<link>http://hardwarefetish.com/874-installing-ms-sql-server-2019-on-devuan-daedalus-debian-12-bookworm</link>
		<comments>http://hardwarefetish.com/874-installing-ms-sql-server-2019-on-devuan-daedalus-debian-12-bookworm#comments</comments>
		<pubDate>Mon, 04 Sep 2023 16:53:17 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=874</guid>
		<description><![CDATA[As this systemd plague has also caught Debian, I&#8217;m mostly using Devuan for new servers now to have the normal SYSV-Init system I&#8217;m used to. I already wrote an article on how to install MS SQL Server 2017 on Debian Jessie. Now here is a little Tutorial on how to install it on lates Devuan [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>As this systemd plague has also caught Debian, I&#8217;m mostly using Devuan for new servers now to have the normal SYSV-Init system I&#8217;m used to.<br />
I already wrote an article on how to install MS SQL Server 2017 on Debian Jessie. Now here is a little Tutorial on how to install it on lates Devuan Beowulf:</p>
<p>I assume you are root and fixed the annoying Debian 10 su bug with:</p>
<pre>echo "ALWAYS_SET_PATH yes" &gt;/etc/default/su</pre>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw2">apt-get install</span> gnupg
<span class="kw2">wget</span> <span class="re5">-qO-</span> https:<span class="sy0">//</span>packages.microsoft.com<span class="sy0">/</span>keys<span class="sy0">/</span>microsoft.asc <span class="sy0">|</span> <span class="kw2">apt-key add</span> -
<span class="kw2">wget</span> https:<span class="sy0">//</span>packages.microsoft.com<span class="sy0">/</span>config<span class="sy0">/</span>debian<span class="sy0">/</span><span class="nu0">12</span><span class="sy0">/</span>packages-microsoft-prod.deb
<span class="kw2">dpkg</span> <span class="re5">-i</span> packages-microsoft-prod.deb
<span class="kw2">wget</span> <span class="re5">-qO-</span> https:<span class="sy0">//</span>packages.microsoft.com<span class="sy0">/</span>config<span class="sy0">/</span>ubuntu<span class="sy0">/</span><span class="nu0">20.04</span><span class="sy0">/</span>mssql-server-<span class="nu0">2019</span>.list <span class="sy0">|</span> <span class="kw2">tee</span> <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list.d<span class="sy0">/</span>mssql-server.list
<span class="kw2">wget</span> <span class="re5">-qO-</span> https:<span class="sy0">//</span>packages.microsoft.com<span class="sy0">/</span>config<span class="sy0">/</span>debian<span class="sy0">/</span><span class="nu0">11</span><span class="sy0">/</span>prod.list <span class="sy0">|</span> <span class="kw2">tee</span> <span class="sy0">/</span>etc<span class="sy0">/</span>apt<span class="sy0">/</span>sources.list.d<span class="sy0">/</span>mssql-client.list
apt update
<span class="kw2">wget</span> http:<span class="sy0">//</span>ftp.uk.debian.org<span class="sy0">/</span>debian<span class="sy0">/</span>pool<span class="sy0">/</span>main<span class="sy0">/</span>o<span class="sy0">/</span>openldap<span class="sy0">/</span>libldap-<span class="nu0">2.4</span>-<span class="nu0">2</span>_2.4.57+dfsg-<span class="nu0">3</span>+deb11u1_amd64.deb
<span class="kw2">dpkg</span> <span class="re5">-i</span> libldap-<span class="nu0">2.4</span>-<span class="nu0">2</span>_2.4.57+dfsg-<span class="nu0">3</span>+deb11u1_amd64.deb
<span class="kw2">wget</span> http:<span class="sy0">//</span>security.ubuntu.com<span class="sy0">/</span>ubuntu<span class="sy0">/</span>pool<span class="sy0">/</span>main<span class="sy0">/</span>o<span class="sy0">/</span>openssl<span class="sy0">/</span>libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb
<span class="kw2">dpkg</span> <span class="re5">-i</span> libssl1.1_1.1.1-1ubuntu2.1~18.04.23_amd64.deb
<span class="kw2">apt-get install</span> mssql-server
<span class="co0"># Ignore error about failed systemctl start after setup</span>
<span class="kw2">ln</span> <span class="re5">-s</span> <span class="sy0">/</span>usr<span class="sy0">/</span>lib<span class="sy0">/</span>x86_64-linux-gnu<span class="sy0">/</span>libssl.so.1.1 <span class="sy0">/</span>opt<span class="sy0">/</span>mssql<span class="sy0">/</span>lib<span class="sy0">/</span>libssl.so
<span class="kw2">vi</span> <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mssql-server</pre></div></div></div></div></div></div></div>


<p># Insert script from <a href="http://hardwarefetish.com/781-ms-sql-server-2017-upstart-script">http://hardwarefetish.com/781-ms-sql-server-2017-upstart-script</a></p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="kw2">chmod</span> +x <span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mssql-server
update-rc.d mssql-server defaults
<span class="sy0">/</span>opt<span class="sy0">/</span>mssql<span class="sy0">/</span>bin<span class="sy0">/</span>mssql-conf  setup
<span class="sy0">/</span>etc<span class="sy0">/</span>init.d<span class="sy0">/</span>mssql-server start
<span class="kw2">apt-get install</span> mssql-tools unixodbc</pre></div></div></div></div></div></div></div>


<p>As can be seen, older libldap and libssl-versions are needed so that it runs.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/874-installing-ms-sql-server-2019-on-devuan-daedalus-debian-12-bookworm/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Removing E (DiskError) flag on system drive of a Synology NAS</title>
		<link>http://hardwarefetish.com/867-removing-e-diskerror-flag-on-system-drive-of-a-synology-nas</link>
		<comments>http://hardwarefetish.com/867-removing-e-diskerror-flag-on-system-drive-of-a-synology-nas#respond</comments>
		<pubDate>Mon, 13 Mar 2023 22:42:58 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=867</guid>
		<description><![CDATA[Recently, I came across the following problem: A user of a Synology DiskStation wanted upgrade the disk drives to bigger ones. So he tried to do everything correctly: First, he identified the list of possible disk drives officially supported for his Disk Station and bought the appropriate hard disk. Then removed one disk drive (drive [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Recently, I came across the following problem: A user of a <a href="https://www.synology.com">Synology DiskStation</a> wanted upgrade the disk drives to bigger ones. So he tried to do everything correctly:<br />
First, he identified the list of possible disk drives officially supported for his Disk Station and bought the appropriate hard disk.<br />
Then removed one disk drive (drive 2) in the bay and exchanged it with one of the newly bought disks and tols the NAS to repair the volume in order to sync system and data to the new drive.<br />
And here is, where the problems started: The data RAID fortunately synced fine to the second drive, but the System RAID did not sync and left him with a faulty system volume.</p>
<p>This is where I came into play. A quick check via commandline revealed the following status:</p>
<pre>sh-4.3# cat /proc/mdstat
Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5] 
[raid4]
md2 : active raid1 sda5[2] sdb5[1]
1948779648 blocks super 1.2 [2/2] [UU]

md1 : active raid1 sda2[0] sdb2[1]
2097088 blocks [2/2] [UU]

md0 : active raid1 sdb1[1](E)
2490176 blocks [2/1] [_E]</pre>
<p>Now my first thought was: Status E? I&#8217;m used to Linux Software RAID, but I never saw such a RAID status code. Checked documentation, no mention if it either. It&#8217;s not &#8220;F&#8221; for faulty, it&#8217;s &#8220;E&#8221;.<br />
After digging around in Google I finally figured out that this is a proprietary status code from Synology RAIDs not implemented in official Linux kernel.</p>
<p>Now how to find out more about it? I found an article on <a href="https://serverfault.com/questions/495392/remove-faulty-state-in-raid-1">how to reset the &#8220;Faulty&#8221; flag</a> on an existing array disk, but it didn&#8217;t sound very safe given the fact that I didn&#8217;t know the original RAID parameters of the RAID.&nbsp;<br />
Now the first thing to do when working with such volumes obviously is to make a copy and work only with the copied drive to have the original drive secured in case something goes wrong. So I dug out another good spare drive of the same size from my collection and copied the existing drive to it sector per sector with dd.</p>
<p>During copying, it turned out there was a bad block (fortunately only one!) on the original drive within the system partition, so that was the reason why the drive&#8217;s state went to &#8220;E&#8221;, which seems to indicate &#8220;Disk error&#8221;. ddrescue to the rescue! It skipped the bad sector and I had a working copy of the drive to mess around with. I later checked the location of the bad sector and there were sectors with 00s around it, so I guess that there was nothing important on that bad sector anyway.</p>
<p>Now how to reset this damn E flag? First, I needed to identify the Superblock of the RAID volume that went bed. So obviously, just examine it with</p>
<pre>mdadm --examine /dev/sdb1</pre>
<p>right? BOOM:</p>
<pre>mdadm: No md superblock detected on /dev/sdb1.</pre>
<p>Where the heck is it? After much googling around, I <a href="https://blog.milla-online.de/how-to-access-your-data-if-your-synology-has-broken-but-the-disks-still-working">found a hint</a>, that the Superblock has swapped endianness and was in fact version 0.9 as opposed to the data partition which has a version 1.2 superblock:</p>
<pre># mdadm --examine /dev/sdb1 -e 0
mdadm: No super block found on /dev/sdb1 (Expected magic a92b4efc, got fc4e2ba9)</pre>
<p>Now the author of the article changed byte endianness to use the RAID on a PC, but my intention was to just remove the E flag and not mess around with the partition style. By looking at the mdadm source code, I found out that there already was a parameter to obey the different endianness of the superblock, the parameter to be specified is: &#8220;-e 0.9&#8221;&nbsp;</p>
<p>So I finally was able to dump the superblock of the disk with:</p>
<pre># ./mdadm.synology --examine /dev/sdb1 -e 0.9
/dev/sdb1:
 Magic : a92b4efc
 Version : 0.90.00
 UUID : 5b116fc2:267b242b:3017a5a8:c86610be
 Creation Time : Sat Jan 1 00:00:02 2000
 Raid Level : raid1
 Used Dev Size : 2490176 (2.37 GiB 2.55 GB)
 Array Size : 2490176 (2.37 GiB 2.55 GB)
 Raid Devices : 2
 Total Devices : 1
Preferred Minor : 0

Update Time : Wed Mar 8 16:25:39 2023
 State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
 Spare Devices : 0
 Checksum : c15399ef - correct
 Events : 12649239


 Number Major Minor RaidDevice State
this 1 8 17 1 active sync /dev/sdb1

0 0 0 0 0 removed
 1 1 8 17 1 active sync /dev/sdb1
</pre>
<p>When looking at the output, the array component seemed to be in a perfectly fine condition, no sign of the failure indication from Synology. So I checked the available open source of the <a href="https://sourceforge.net/projects/dsgpl/">Synology Linux kernel</a> for this disk error flag. Turns out that it can be found in&nbsp;md_p.h header file:</p>
<pre>#ifdef MY_ABC_HERE
#define MD_DISK_ERROR 6 
#endif</pre>
<p>Fortunately, Synology marked all their changes to the Stock Linux kernel with the #define MY_ABC_HERE, so specific code paths are easy to spot in the source.<br />
Next, I had to identify the location of the flag in the superblock to confirm my findings. I hexdumped the superblock of the affected device. The 0.90 superblock is of struct&nbsp;mdp_superblock_s, which -according to&nbsp;md_p.h has the following structure:</p>
<pre>typedef struct mdp_superblock_s {
 /*
 * Constant generic information
 */
 __u32 md_magic; /* 0 MD identifier */
 __u32 major_version; /* 1 major version to which the set conforms */
 __u32 minor_version; /* 2 minor version ... */
 __u32 patch_version; /* 3 patchlevel version ... */
...
 /*
 * Disks information
 */
 mdp_disk_t disks[MD_SB_DISKS];

/*
 * Reserved
 */
 __u32 reserved[MD_SB_RESERVED_WORDS];

/*
 * Active descriptor
 */
 mdp_disk_t this_disk;

} mdp_super_t;


typedef struct mdp_device_descriptor_s {
 __u32 number; /* 0 Device number in the entire set */
 __u32 major; /* 1 Device major number */
 __u32 minor; /* 2 Device minor number */
 __u32 raid_disk; /* 3 The role of the device in the raid set */
 __u32 state; /* 4 Operational state */
 __u32 reserved[MD_SB_DESCRIPTOR_WORDS - 5];
} mdp_disk_t;</pre>
<p>So the state of the individual disks is in the state field of the mdp_disk_t structure. Let&#8217;s check the dump and interpret it:</p>
<pre>mdp_super_t:
------------
 0000 A9 2B 4E FC 00 00 00 00 00 00 00 5A 00 00 00 00
 0010 00 00 00 00 5B 11 6F C2 38 6D 43 82 00 00 00 01
 0020 00 25 FF 40 00 00 00 01 00 00 00 02 00 00 00 00
 0030 00 00 00 00 26 7B 24 2B 30 17 A5 A8 C8 66 10 BE
 0040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0070 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0080 64 08 B7 03 00 00 00 01 00 00 00 01 00 00 00 01
 0090 00 00 00 00 00 00 00 00 C1 53 9A 6F 00 00 00 00
 00A0 00 C1 03 17 00 00 00 00 00 C1 03 17 FF FF FF FF
 00B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 00F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0100 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0140 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0150 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0160 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0170 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0190 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 01A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 01B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 01C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 01D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 01E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 01F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0210 00 00 00 08 00 00 00 00 00 00 00 00 00 00 00 00
 0220 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0230 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0240 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0250 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0260 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

mdp_disk_t disks[MD_SB_DISKS];
 0280 00 00 00 01 00 00 00 08 00 00 00 11 00 00 00 01
 0290 <strong>00 00 00 46 </strong>00 00 00 00 00 00 00 00 00 00 00 00
 02A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 02F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0300 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0310 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0320 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0330 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0350 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0360 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0370 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0380 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 03F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0440 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0450 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0460 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0470 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0480 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0490 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 04A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 04B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 04C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 04D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 04E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 04F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0500 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0510 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0520 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0530 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0540 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0550 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0560 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0570 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0580 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0590 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 05A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 05B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 05C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 05D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 05E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 05F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0600 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0610 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0620 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0630 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0640 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0650 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0660 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0670 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0680 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0690 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 06A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 06B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 06C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 06D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 06E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 06F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0700 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0710 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0720 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0730 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0740 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0750 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0760 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0770 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0780 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0790 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 07A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 07B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 07C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 07D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 07E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 07F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0800 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0810 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0820 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0830 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0840 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0850 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0860 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0870 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0880 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0890 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 08A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 08B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 08C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 08D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 08E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 08F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0900 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0910 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0920 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0930 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0940 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0950 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0960 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0970 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0980 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0990 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 09A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 09B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 09C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 09D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 09E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 09F0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0A90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0AA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0AB0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0AC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0AD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0AE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0AF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0B90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0BA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0BB0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0BC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0BD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0BE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0BF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0C90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0CA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0CB0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0CC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0CD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0CE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0CF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0D90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0DA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0DB0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0DC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0DD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0DE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0DF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E80 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0E90 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0EA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0EB0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0EC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0ED0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0EE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0EF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F10 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F30 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F50 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F60 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0F70 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

mdp_disk_t this_disk;
 0F80 00 00 00 01 00 00 00 08 00 00 00 11 00 00 00 01
 0F90 <strong>00 00 00 46 </strong>00 00 00 00 00 00 00 00 00 00 00 00
 0FA0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0FB0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0FC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0FD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0FE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
 0FF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</pre>
<p>I marked the significant fields in the dump. It can be seen that the state flag is 0x46 (that is 1000110b) which indicates:&nbsp;</p>
<pre>#define MD_DISK_FAULTY 0 
#define <strong>MD_DISK_ACTIVE</strong> 1 
#define <strong>MD_DISK_SYNC</strong> 2 
#define MD_DISK_REMOVED 3 
#define MD_DISK_CLUSTER_ADD 4 
#define MD_DISK_CANDIDATE 5
#define <strong>MD_DISK_ERROR</strong> 6 

#define MD_DISK_WRITEMOSTLY 9 
#define MD_DISK_JOURNAL 18</pre>
<p>Bingo, there it is, MD_DISK_ERROR! So I was temtped to just remove the flag with a Hex editor, but beware: There is a checksum for the superblock header! So what&#8217;s the easiest thing to do?<br />
First, check if <a href="https://archive.synology.com/download/ToolChain/Synology%20NAS%20GPL%20Source/7.0-41890">Synology&#8217;s mdadm fork</a> contained functions to maybe already clear the error flag. There must be a custom implementation, because it is able to display the E flag.<br />
Turns out, there is no such function, so I had to extend the mdadm source code to introduce such a feature.</p>
<p>So, in short, I forked mdadm and implemented it, it can be downlaoded <a href="https://github.com/leecher1337/mdadm/tree/synology">here</a>&nbsp;together with a description on how to use it, so read the <a href="https://github.com/leecher1337/mdadm/blob/synology/README.md">README</a> there for a continuation of this story.</p>
<p>In short, I cleared the errorflag of the partition with my patched mdadm:</p>
<pre>./mdadm.synology --misc --no-diskerr /dev/sdb1 -e 0.9</pre>
<p>and put the disk back in the Synology, booted up, repaired system partition and got back a running system without having to reinstall the Synology DSM Software and its settings.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/867-removing-e-diskerror-flag-on-system-drive-of-a-synology-nas/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing BoundsChecker 8 on Windows 7 x64</title>
		<link>http://hardwarefetish.com/861-installing-boundschecker-on-windows-7-x64</link>
		<comments>http://hardwarefetish.com/861-installing-boundschecker-on-windows-7-x64#respond</comments>
		<pubDate>Sun, 08 Jan 2023 20:31:17 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=861</guid>
		<description><![CDATA[I had real pain installing DevParther Studio Professional Edition&#160; for its BoundsChecker 8 component under Windows 7 64 bit. MSI installations fortunately can be debugged with msiexec /i "Compuware DevPartner Studio Professional Edition.msi" /lvx log2.txt Searching for &#8216;1603&#8217; in log file helps finding the error location. First of all, after installing the .NET Framework 1.1, [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I had real pain installing DevParther Studio Professional Edition&nbsp;<br />
for its BoundsChecker 8 component under Windows 7 64 bit.</p>
<p>MSI installations fortunately can be debugged with</p>
<p><code>msiexec /i "Compuware DevPartner Studio Professional Edition.msi" /lvx log2.txt</code></p>
<p>Searching for &#8216;1603&#8217; in log file helps finding the error location.</p>
<p>First of all, after installing the .NET Framework 1.1, it refues<br />
to isntall saying that Boundchecker was already installed, which was<br />
not true.<br />
Turns out, that it checks for</p>
<p><code>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\NuMega\BoundsChecker</code></p>
<p>key, which has been set during .NET Framework installation to<br />
mark that it had been installed.<br />
But that in turn makes further setup atempts impossible.<br />
So first problem was resolved by deleting above mentioned key.</p>
<p>Next, it went further, but rolled back during writing registry keys.<br />
According to the log, it had problems overwriting a CLSID key<br />
of MSXML3 parser:</p>
<p><code>MSI (s) (54!A8) [20:17:50:008]: Creating MSIHANDLE (12522) of type 790531 for thread 2984<br />
Finding the key CLSID\{2933BF90-7B36-11d2-B20E-00C04F983E60}\SideBySide; the result is: 5<br />
MSI (s) (54!A8) [20:17:50:009]: Closing MSIHANDLE (12522) of type 790531 for thread 2984<br />
MSI (s) (54!A8) [20:17:50:009]: Creating MSIHANDLE (12523) of type 790531 for thread 2984<br />
AddRefcountMsxml returns the code 5</code></p>
<p>So,next, I had to change the owner of the following Registry key<br />
(which is owned by TrustedInstaller) to Administrators group and then<br />
allow full access to everyone for this key:</p>
<p><code>HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{2933BF90-7B36-11D2-B20E-00C04F983E60}</code></p>
<p>Next, it went a bit further but stopped at:</p>
<p><code>MSI (s) (54!50) [20:48:20:465]: Creating MSIHANDLE (15175) of type 790531 for thread 4176<br />
PerformTypeLib Name: 'msxml3.dll' LibDir: 'C:\Windows\SysWOW64\' HelpDir: 'C:\Windows\SysWOW64\'<br />
MSI (s) (54!50) [20:48:20:466]: Closing MSIHANDLE (15175) of type 790531 for thread 4176<br />
MSI (s) (54!50) [20:48:20:468]: Creating MSIHANDLE (15176) of type 790531 for thread 4176<br />
PerformTypeLib failed with error code 11 and function code 0x8002801C.</code></p>
<p>Error code 0x8002801C is TYPE_E_REGISTRYACCESS<br />
Fired up Process Monitor and checked where there is access denied<br />
for msiexec.exe furing installation. Turned out to be:</p>
<p><code>MsiExec.exe 2588 RegCreateKey HKCR\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\3.0\HELPDIR ACCESS DENIED Desired Access: Maximum Allowed</code></p>
<p>So I did the same Permission adjustment for the key<br />
<code>HKCR\TypeLib\{F5078F18-C551-11D3-89B9-0000F81FE221}\3.0</code><br />
in the registry so allo everyone to access it.</p>
<p>Finally, installation finished properly. However I wasn&#8217;t very happy with it on Win 7 anyway, as the dpinject64.sys driver that gets installes crashes the system and makes it stuck. Maybe it can be fixed, but I then gave up on it. Seems that a new version is needed.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/861-installing-boundschecker-on-windows-7-x64/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Collabora Office on Devuan Beowulf</title>
		<link>http://hardwarefetish.com/856-installing-collabora-office-on-devuan-beowulf</link>
		<comments>http://hardwarefetish.com/856-installing-collabora-office-on-devuan-beowulf#respond</comments>
		<pubDate>Tue, 25 Oct 2022 15:39:28 +0000</pubDate>
		<dc:creator><![CDATA[dose]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hardwarefetish.com/?p=856</guid>
		<description><![CDATA[Unfortunately, the Package coolwsd from Collabora for Debian 10 relies on systemd. And most recent loolwsd is now coolwsd for Collabora online (office suite to use with nextcloud). So here is a short how-to how to set it up on Devuan Beowulf: Setup repo: apt install gnupg apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D echo "deb [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>Unfortunately, the Package coolwsd from Collabora for Debian 10 relies on systemd. And most recent loolwsd is now coolwsd for Collabora online (office suite to use with nextcloud).<br />
So here is a short how-to how to set it up on Devuan Beowulf:</p>
<p>Setup repo:<br />
<code><br />
apt install gnupg apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 0C54D189F4BA284D<br />
echo "deb https://www.collaboraoffice.com/repos/CollaboraOnline/CODE-debian10 ./" &gt;/etc/apt/sources.list.d/collabora.list<br />
apt update<br />
</code></p>
<p>Install cooldwsd without systemd:<br />
<code><br />
apt-get download coolwsd code-brand<br />
dpkg -i --ignore-depends=systemd coolwsd_22.05.7.2-1_amd64.deb<br />
</code></p>
<p>I actually did it this way, as I was unaware of &#8211;ignore-depends option, but I leave it in here for reference in case it doesn&#8217;t work with ignore-depends option:<br />
<code><br />
dpkg --force-all -i coolwsd_22.05.7.2-1_amd64.deb<br />
</code></p>
<p>Then remove systemd dependency to fix package cache:<br />
<code><br />
vi /var/lib/dpkg/status<br />
</code><br />
Remove &#8220;systemd&#8221; from &#8220;coolwsd&#8221; package in dependency list so that your apt isn&#8217;t damaged anymore.</p>
<p>When you installed with &#8211;force-all, install missing dependencies:<br />
<code><br />
apt install expat collaboraofficebasis-calc collaboraofficebasis-core collaboraofficebasis-graphicfilter collaboraofficebasis-images collaboraofficebasis-impress collaboraofficebasis-ooofonts collaboraofficebasis-writer collaboraoffice collaboraoffice-ure collaboraofficebasis-en-us collaboraofficebasis-draw collaboraofficebasis-extension-pdf-import collaboraofficebasis-ooolinguistic collaboraofficebasis-math code-brand<br />
</code></p>
<p>Create logfile dir:<br />
<code><br />
mkdir /var/log/coolwsd<br />
chown cool:cool /var/log/coolwsd<br />
</code></p>
<p>Configure coolwsd:<br />
<code><br />
vi /etc/coolwsd/coolwsd.xml<br />
ssl/enable -&gt; false<br />
ssl/termination -&gt; true<br />
net/listen -&gt; loopback<br />
file -&gt; enable=true<br />
file/patch -&gt; /var/log/coolwsd/coolwsd.log<br />
trace_event/path -&gt; /var/log/coolwsd/coolwsd.trace.json<br />
net/proto -&gt; IPv4<br />
storage/ssl/as_scheme -&gt; false<br />
net/<br />
&lt;host desc="External IP of server"&gt;123\.123\.123\.123&lt;/host&gt;</code></p>
<p>&nbsp;</p>
<p>Create init.d script /etc/init.d/coolwsd</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="bash"><pre class="de1"><span class="co0">#!/bin/sh</span>
<span class="co0">### BEGIN INIT INFO</span>
<span class="co0"># Provides:          coolwsd</span>
<span class="co0"># Required-Start:    $local_fs $remote_fs $network $syslog $named</span>
<span class="co0"># Required-Stop:     $local_fs $remote_fs $network $syslog $named</span>
<span class="co0"># Default-Start:     2 3 4 5</span>
<span class="co0"># Default-Stop:      0 1 6</span>
<span class="co0"># Short-Description: libreoffice</span>
<span class="co0"># Description:       LibreOffice Online WebSocket server</span>
<span class="co0">#                    This script will start the libreoffice server</span>
<span class="co0">### END INIT INFO</span>
&nbsp;
<span class="co0"># run update-rc.d for create K S file in /etc/init.d/*</span>
&nbsp;
&nbsp;
<span class="re2">DESC</span>=<span class="st0">&quot;LibreOffice Online WebSocket server&quot;</span>
<span class="re2">NAME</span>=coolwsd
<span class="re2">USER</span>=cool
<span class="re2">DAEMON</span>=<span class="sy0">/</span>usr<span class="sy0">/</span>bin<span class="sy0">/</span><span class="re1">$NAME</span>
<span class="re2">PIDFILE</span>=<span class="sy0">/</span>var<span class="sy0">/</span>run<span class="sy0">/</span><span class="re1">$NAME</span>.pid
<span class="re2">PARAM</span>=<span class="st0">&quot;&quot;</span>
<span class="re2">PARAM</span>=<span class="st0">&quot;<span class="es2">$PARAM</span> --version&quot;</span>
<span class="re2">PARAM</span>=<span class="st0">&quot;<span class="es2">$PARAM</span> --disable-ssl&quot;</span>
<span class="re2">PARAM</span>=<span class="st0">&quot;<span class="es2">$PARAM</span> --o:sys_template_path=/opt/cool/systemplate&quot;</span>
<span class="re2">PARAM</span>=<span class="st0">&quot;<span class="es2">$PARAM</span> --o:child_root_path=/opt/cool/child-roots&quot;</span>
<span class="re2">PARAM</span>=<span class="st0">&quot;<span class="es2">$PARAM</span> --o:file_server_root_path=/usr/share/coolwsd&quot;</span>
<span class="re2">PARAM</span>=<span class="st0">&quot;<span class="es2">$PARAM</span> --o:logging.file[@enable]=true&quot;</span>
&nbsp;
<span class="kw3">test</span> <span class="re5">-x</span> <span class="re1">$DAEMON</span> <span class="sy0">||</span> <span class="kw3">exit</span> <span class="nu0">0</span>
&nbsp;
&nbsp;
. <span class="sy0">/</span>lib<span class="sy0">/</span>lsb<span class="sy0">/</span>init-functions
&nbsp;
&nbsp;
<span class="kw1">if</span> <span class="br0">&#91;</span> <span class="st0">&quot;<span class="es4">$(id -u)</span>&quot;</span> <span class="sy0">!</span>= <span class="st0">&quot;0&quot;</span> <span class="br0">&#93;</span>
<span class="kw1">then</span>
  log_failure_msg <span class="st0">&quot;You must be root to start, stop or restart cool&quot;</span>
  <span class="kw3">exit</span> <span class="nu0">1</span>
<span class="kw1">fi</span>
&nbsp;
&nbsp;
do_status <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
     log_daemon_msg <span class="st0">&quot;<span class="es2">$DESC</span>&quot;</span> <span class="st0">&quot;<span class="es2">$name</span>&quot;</span>
     start-stop-daemon <span class="re5">--status</span> <span class="re5">--verbose</span> <span class="re5">--pidfile</span> <span class="re1">$PIDFILE</span>
     log_end_msg <span class="re4">$?</span>
     <span class="kw3">return</span> <span class="re4">$?</span>
<span class="br0">&#125;</span>
&nbsp;
do_start <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  log_daemon_msg <span class="st0">&quot;Starting <span class="es2">$DESC</span>&quot;</span> <span class="st0">&quot;<span class="es2">$name</span>&quot;</span>
  start-stop-daemon <span class="re5">--start</span> <span class="re5">--verbose</span> <span class="re5">--pidfile</span> <span class="re1">$PIDFILE</span> <span class="re5">--make-pidfile</span> <span class="re5">--chuid</span> <span class="re1">$USER</span> <span class="re5">--background</span> <span class="re5">--exec</span> <span class="re1">$DAEMON</span> <span class="re5">--</span> <span class="re1">$PARAM</span>
  log_end_msg <span class="re4">$?</span>
  <span class="kw3">return</span> <span class="re4">$?</span>
<span class="br0">&#125;</span>
&nbsp;
do_stop <span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span>
  log_daemon_msg <span class="st0">&quot;Stopping <span class="es2">$DESC</span>&quot;</span> <span class="st0">&quot;<span class="es2">$name</span>&quot;</span>
  start-stop-daemon <span class="re5">--stop</span> <span class="re5">--verbose</span> <span class="re5">--pidfile</span> <span class="re1">$PIDFILE</span> <span class="re5">--remove-pidfile</span>
  log_end_msg <span class="re4">$?</span>
  <span class="kw3">return</span> <span class="re4">$?</span>
<span class="br0">&#125;</span>
&nbsp;
<span class="kw1">case</span> <span class="st0">&quot;$1&quot;</span> <span class="kw1">in</span>
  status<span class="br0">&#41;</span>
     do_status <span class="sy0">||</span> <span class="kw3">exit</span> <span class="nu0">1</span>
     <span class="sy0">;;</span>
  start<span class="br0">&#41;</span>
     do_start <span class="sy0">||</span> <span class="kw3">exit</span> <span class="nu0">1</span>
     <span class="sy0">;;</span>
  stop<span class="br0">&#41;</span>
     do_stop <span class="sy0">||</span> <span class="kw3">exit</span> <span class="nu0">1</span>
     <span class="sy0">;;</span>
  force-reload<span class="sy0">|</span>restart<span class="br0">&#41;</span>
     do_stop <span class="sy0">&amp;</span>amp;<span class="sy0">&amp;</span>amp; <span class="kw2">sleep</span> <span class="nu0">3</span>
     do_start <span class="sy0">||</span> <span class="kw3">exit</span> <span class="nu0">1</span>
     <span class="sy0">;;</span>
  <span class="sy0">*</span><span class="br0">&#41;</span>
&nbsp;
     <span class="kw3">echo</span> <span class="st0">&quot;Usage: /etc/init.d/lool {start|stop|restart|force-reload|status}&quot;</span>
     <span class="kw3">exit</span> <span class="nu0">1</span>
<span class="kw1">esac</span>
&nbsp;
<span class="kw3">exit</span> <span class="nu0">0</span></pre></div></div></div></div></div></div></div>


<p>Install with: <code>update-rc.d coolwsd defaults</code></p>
<p>Now setup apache virtualhost to collabora.yourdomain.com:</p>
<p><code><br />
cp /etc/apache2/sites-available/000-default.conf /etc/apache2/sites-available/collabora.conf<br />
vi /etc/apache2/sites-available/collabora.conf<br />
</code><br />
Uncomment &amp; set the ServerName directive.</p>
<p>Install SSL certificate:<br />
<code><br />
a2ensite collabora<br />
/etc/init.d/apache2 reload<br />
certbot --apache -d collabora.yourdomain.com<br />
a2enmod proxy proxy_wstunnel proxy_http<br />
</code></p>
<p>Add configuration options for coolwsd:<br />
<code>vi /etc/apache2/sites-enabled/collabora-le-ssl.conf</code>:</p>


<div class="wp-geshi-highlight-wrap5"><div class="wp-geshi-highlight-wrap4"><div class="wp-geshi-highlight-wrap3"><div class="wp-geshi-highlight-wrap2"><div class="wp-geshi-highlight-wrap"><div class="wp-geshi-highlight"><div class="apache"><pre class="de1"><span class="co1"># Encoded slashes need to be allowed</span>
<span class="kw1">AllowEncodedSlashes</span> NoDecode
&nbsp;
<span class="co1"># Container uses a unique non-signed certificate</span>
<span class="kw1">SSLProxyEngine</span> <span class="kw2">Off</span>
<span class="kw1">SSLProxyVerify</span> <span class="kw2">None</span>
SSLProxyCheckPeerCN <span class="kw2">Off</span>
SSLProxyCheckPeerName <span class="kw2">Off</span>
&nbsp;
<span class="co1"># keep the host</span>
<span class="kw1">ProxyPreserveHost</span> <span class="kw2">On</span>
&nbsp;
<span class="co1"># static html, js, images, etc. served from coolwsd</span>
<span class="co1"># browser is the client part of LibreOffice Online</span>
<span class="kw1">ProxyPass</span> /browser http://127.0.0.1:<span class="nu0">9980</span>/browser retry=<span class="nu0">0</span>
<span class="kw1">ProxyPassReverse</span> /browser http://127.0.0.1:<span class="nu0">9980</span>/browser
&nbsp;
<span class="co1"># WOPI discovery URL</span>
<span class="kw1">ProxyPass</span> /hosting/discovery http://127.0.0.1:<span class="nu0">9980</span>/hosting/discovery retry=<span class="nu0">0</span>
<span class="kw1">ProxyPassReverse</span> /hosting/discovery http://127.0.0.1:<span class="nu0">9980</span>/hosting/discovery
&nbsp;
<span class="co1"># Main websocket</span>
<span class="kw1">ProxyPassMatch</span> <span class="st0">&quot;/cool/(.*)/ws$&quot;</span> ws://127.0.0.1:<span class="nu0">9980</span>/cool/$1/ws nocanon
&nbsp;
<span class="co1"># Admin Console websocket</span>
<span class="kw1">ProxyPass</span> /cool/adminws ws://127.0.0.1:<span class="nu0">9980</span>/cool/adminws
&nbsp;
<span class="co1"># Download as, Fullscreen presentation and Image upload operations</span>
<span class="kw1">ProxyPass</span> /cool http://127.0.0.1:<span class="nu0">9980</span>/cool
<span class="kw1">ProxyPassReverse</span> /cool http://127.0.0.1:<span class="nu0">9980</span>/cool
&nbsp;
<span class="co1"># Endpoint with information about availability of various features</span>
<span class="kw1">ProxyPass</span> /hosting/capabilities http://127.0.0.1:<span class="nu0">9980</span>/hosting/capabilities retry=<span class="nu0">0</span>
<span class="kw1">ProxyPassReverse</span> /hosting/capabilities http://127.0.0.1:<span class="nu0">9980</span>/hosting/capabilities</pre></div></div></div></div></div></div></div>


<p>Start collabora and reload apache and it should work:</p>
<p><code><br />
/etc/init.d/apache2 reload<br />
/etc/init.d/coolwsd start<br />
</code></p>
<p>Hope that helps to use collabora without this dreaded systemd cr*p.</p>
]]></content:encoded>
			<wfw:commentRss>http://hardwarefetish.com/856-installing-collabora-office-on-devuan-beowulf/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
