Blogposts tagged englishf.zz.dehttps://f.zz.de/tags/english/f.zz.deikiwiki2021-05-28T11:08:00ZMikrotik CRS326 dead after powercyclehttps://f.zz.de/posts/202105281306.mikrotik_crs326_dead_after_powercycle/Florian Lohoff2021-05-28T11:08:00Z2021-05-28T11:06:05Z
<p>It now happened 2 times in the last 2 Weeks that after a Powercycle
the Mikrotik CRS326 was bricked after a powercycle. No link
on any port, serial dead. After "factory reset" it came up
like a charm with "Boot configuration CRC error" - WTF?</p>
<pre><code>RouterBOOT backup booter 6.45.9
CRS326-24S+2Q+
CPU frequency: 650 MHz
Memory speed: 300 MHz
Memory size: 64 MiB
Storage size: 16 MiB
Boot configuration CRC error, applying defaults
writing settings to flash... OK
Press any key within 2 seconds to enter setup..
loading kernel...
</code></pre>
23 year old Bug found in LWP::Useragenthttps://f.zz.de/posts/202011121341.23_year_old_bug_found_in_lwp_useragent/Florian Lohoff2020-11-12T12:51:09Z2020-11-12T12:41:56Z
<p>Finding a decade old bug in some piece of Software which is used in millions of projects
is not an every day event and i was astonished nobody really found this.</p>
<p>I was trying to implement HTTP Digest auth based on AnyEvent::HTTP which is an
asynchronous event framework. So i had a look at how LWP::Useragent (Now libwww-perl)
handles this.</p>
<p>And i found this piece of code. I was not able to find the corresponding RFC
for the <strong>message-digest</strong> request parameter but it turned out, its broken anyway.</p>
<p>So this code supposedly calculated some kind of MD5 on the full PUT/POST request
body. But it turns out there is a <strong>md5->reset</strong> just before exporting the
md5 message digest. So the md5 object returns the null md5 digest as the internal
state gets resetted.</p>
<p>This code wastes some cpu cycles and cache hits for generating a complicated
md5 hash on the request body, and then drops it to present a null md5.</p>
<pre><code> 63 if($request->method =~ /^(?:POST|PUT)$/) {
64 $md5->add($request->content);
65 my $content = $md5->hexdigest;
66 $md5->reset;
67 $md5->add(join(":", @digest[0..1], $content));
68 $md5->reset;
69 $resp{"message-digest"} = $md5->hexdigest;
70 push(@order, "message-digest");
71 }
</code></pre>
<p>I had a quick look at the <a href="https://github.com/libwww-perl/libwww-perl">git repository for LWP::Useragent</a> which
shows that the line has been there since the first import which
was in 1997.</p>
<pre><code>98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 63) if($request->method =~ /^(?:POST|PUT)$/) {
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 64) $md5->add($request->content);
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 65) my $content = $md5->hexdigest;
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 66) $md5->reset;
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 67) $md5->add(join(":", @digest[0..1], $content));
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 68) $md5->reset;
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 69) $resp{"message-digest"} = $md5->hexdigest;
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 70) push(@order, "message-digest");
98c2a2729 (Gisle Aas 1997-12-01 19:12:06 +0000 71) }
</code></pre>
<p>I guess the whole code for PUT/POST handling can be removed as the <strong>message-digest</strong> is not mentioned
in the default Digest Auth RFCs, nor has it ever contained a valid value.</p>
<p>Here is the Debian bugreport <a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=974572">#974572</a></p>
icinga2 check schedulerhttps://f.zz.de/posts/201705191209.icinga2_check_scheduler/Florian Lohoff2017-05-19T10:30:28Z2017-05-19T10:09:37Z
<p>For me icinga2 has been a pain in the ass as of its release. My
primary problem with icinga1 was the inflexibility of defining
dependeny. A host could not depend on a service which imho is broken.
The host connected to a switch depends on the switch, and on the
vlan/bridge on the switch. So i would like to construct/define a
dependency on the vlan check. Icinga1 could not do this, as does
icinga2.</p>
<p>Now - one needs to do the transition on day or the other so i did.
The next issue came up. Icinga2 does not include the embedded perl
interepreter anymore. This means you'll be fighting against a 10 fold
increase in check runtime. The reasoning here is that this could
not be made stable. I wonder why Apache is able to this but not the
Icinga2 devs. So i rewrote my most performance sensitive checks from
Perl to c++.</p>
<p>Lately i am having trouble because on my larger network devices i am
seeing flapping interfaces. That means - from time to time (multiple
times a day) a bulk of interfaces goes into the "Unknown" state which
means my check could not get an SNMP response from the Device.</p>
<p>This came up when i migrated the Icinga2 instance from a virtual machine
to bare metal. I could not explain the symptom and started debugging
on a firewall which had been installed inbetween the host and the network.</p>
<p>No luck so far.</p>
<p>Today then i had another look because my collectd/influx/grafana host
monitoring showed network traffic more like a heart beat. Every hour
exporting the configuration was a beat which swung out into an "null
line" e.g. an average.</p>
<p>After investigating a bit more i found that reloading the icinga2
config would erradicate the check scheduling queue which caused
icinga2 to do a recalculation which made the check scheduling very
much spikey in the <code>check_interval</code> interval.</p>
<p>It seems the Icinga2 (in my case 2.6.3) check scheduler does a
very bad job in averaging out the check executions over their
<code>check_interval</code>.</p>
<p>This is a graph i created using some shell and gnuplot vodoo.
The event at 9:36:44 is the config generation issueing an
<code>service icinga2 reload</code> which causes icinga2 to not issue/schedule
checks for nearly a minute.</p>
<p><a href="https://f.zz.de/media/201705191209.icinga2_check_scheduler.icinga2-2.6.3-scheduler-20170519-917-952.png"><img src="https://f.zz.de/posts/201705191209.icinga2_check_scheduler/640x-201705191209.icinga2_check_scheduler.icinga2-2.6.3-scheduler-20170519-917-952.png" width="640" height="480" class="img" /></a></p>
systemd wtfhttps://f.zz.de/posts/201509201706.systemd_wtf/Florian Lohoff2015-09-20T15:13:27Z2015-09-20T15:06:13Z
<p>You need to know this. Today i set up a new notebook and i like
having a local DNS cache running. So i installed <code>pdnsd</code> and
naturally wanted it to be started so i issued a <code>/etc/init.d/pdnsd start</code>.</p>
<p>The log said - "disabled in /etc/default/pdnsd" so i edited that file
to say "START_DAEMON=yes".</p>
<p>Then i tried <code>/etc/init.d/pdnsd start</code> again but nothing happened. No log
entry - not a running <code>pdnsd</code>.</p>
<p>The explanation is - Even though starting of the daemon failed you need to
tell systemd to actually stop it. So a <code>/etc/init.d/pdnsd stop</code> and start
solved it.</p>
<p>What the f***?</p>
nagios map view - another rant for todayhttps://f.zz.de/posts/201112192254.nagios_map_view_-_another_rant_for_today/2013-04-09T08:11:26Z2011-12-19T21:54:28Z
<p>How hard can it be to design some configuration language to not only define parents, but peers, child, siblings, equivalents etc. Only defining parents is simply not enough to define a network - at least when moving the nagios polling to a different position in the overall network topology the whole definition of your dependencys collapses. It a nagios centric view which is simply broken by design.</p>
android mail apphttps://f.zz.de/posts/201112192250.android_mail_app/2013-04-09T08:11:26Z2011-12-19T21:50:59Z
<p>Its so braindead - since ages the android mail app refuses to show pgp/gpg signed mails - It always says the mail is still on the server. How hard can it be in 2011 to simply ignore detached signatures? Fed up with it and installed k9mail which is also much nicer than the HTC 2.3.6 mail version with the huge overview in the folder view.</p>
require valid-user != require ldap-userhttps://f.zz.de/posts/201112192232.require_valid-user__require_ldap-user/2013-04-09T08:11:26Z2011-12-19T21:32:03Z
<p>Apache authnz_ldap is soo braindead - It offers a require ldap-user which essentially expects a userlist afterwards. It is not necessary to enter one which essentially renders the whole authentications void because there is no user which could possibly satisfy the authentication request. If you'll accept ANY user in the ldap use "require valid-user". "require ldap-user" fails with an obscure ldap protocol error because there is no list of usernames the authnz module passes to the ldap. Hard to debug - hard to find. Broken software. Usability broken by design.</p>
Open Source no more.https://f.zz.de/posts/201110201717.open_source_no_more./2013-04-09T08:11:26Z2011-10-20T15:17:12Z
<p>I guess Google needs to get this fixed ASAP. Android is no more Open Source - Somehow one could have accepted Honycomb to not be open sourced but now once again Google does not live up to its promises.</p>
<p>Now guess whos evil?</p>
<p><a href="http://groups.google.com/group/android-building/browse_thread/thread/ade6fcd847fbb3fb?pli=1%20">http://groups.google.com/group/android-building/browse_thread/thread/ade6fcd847fbb3fb?pli=1</a></p>
debian mipsel buildd problemshttps://f.zz.de/posts/201005042106.debian_mipsel_buildd_problems/2013-04-09T08:11:26Z2010-05-04T19:06:33Z
<p>Now the mystery has been solved. The crashed on the mipsel buildd rem were caused by a broken fan. Replaced and working through the package backlog.<a href="https://f.zz.de/media/201005042106.debian_mipsel_buildd_problems.rem-luefter.jpg"><img src="https://f.zz.de/media/201005042106.debian_mipsel_buildd_problems.rem-luefter.jpg" width="320" height="428" class="img" /></a></p>
CFE Failhttps://f.zz.de/posts/201004042220.cfe_fail/2013-04-09T08:11:26Z2010-04-04T20:20:01Z
<p>One of the Debian/Mipsel buildds had some problems with rebooting so i thought upgrading CFE,the onboard firmware, would be a good idea. It wasn't:</p>
<p>CFE 1.0.40</p>
<blockquote><p>CFE> boot ide0.0:<br/>
Loader:raw Filesys:raw Dev:ide0.0 File: Options:(null)<br/>
Loading: ........... 130048 bytes read<br/>
Entry at 0x0000000020000000<br/>
Starting program at 0x0000000020000000<br/>
SiByte Loader, version 2.4.2</p></blockquote>
<p>CFE 1.4.2 Current</p>
<blockquote><p>CFE> boot ide0.0:<br/>
Loader:raw Filesys:raw Dev:ide0.0 File: Options:(null)<br/>
Loading: Drive status: 51 error 04<br/>
Identify Success<br/>
Could not load ide0.0:: Boot program checksum is invalid</p></blockquote>
<p>So Broadcom decided it would be a good idea to change someting with the bootloader checksum and be strict about it - not just warn - Big #FAIL i'd say ...</p>
New Year, New Key, New e-mail addresshttps://f.zz.de/posts/201001011017.new_year_new_key_new_e-mail_address/2013-04-09T08:11:26Z2010-01-01T09:17:25Z
<p>I was thinking of switching key and email adress for a while and probably 1st of January is not the worst time to actually do it:</p>
<blockquote><p>gpg --fingerprint CB09F22F<br/>
pub 4096R/CB09F22F 2010-01-01<br/>
Key fingerprint = 75BF 68EE 879B 5F6A 5AA5 0FCA 90DD 4120 CB09 F22F<br/>
uid Florian Lohoff <a href="mailto:f@zz.de">f@zz.de</a><br/>
sub 4096R/761E0A69 2010-01-01</p></blockquote>
<p>Its already signed with my DSA and RSA key and uploaded to the keyservers.</p>
Dreambox 8000 / mediaplayerhttps://f.zz.de/posts/200912142058.dreambox_8000__mediaplayer/2013-04-09T08:11:26Z2009-12-14T19:58:40Z
<p>I like my Dreambox 8000 a lot - But regarding the price its unacceptable that it wont play any DIVX/Xvid beyond PAL e.g. 720x576. So whenever you have half way acceptable resolution for your FullHD Display the Dreambox wont play it.</p>
<p>You can guess what my little 2 1/2 Year old thinks about the new TV / Receiver when there is no way to watch his Shaun the Sheep episodes ...</p>
<p>Nevertheless - i am now recoding to mpeg2 16:9 - The DM8000 will play at least that:</p>
<blockquote><p>mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -vf harddup -srate 48000 -af lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=mp2:abitrate=256:aspect=16/9 -ofps 25 -o $outfile $infile</p></blockquote>
"temphttps://f.zz.de/posts/200911221820.temp_files_named_l_are_harmful/2013-04-09T08:11:26Z2009-11-22T17:20:10Z
<p>flo@t1:~$ crontab l<br/>
flo@t1:~$ crontab -l</p>
<p>Where is my crontab?</p>
Philips and OpenSourcehttps://f.zz.de/posts/200911102252.philips_and_opensource/2013-04-09T08:11:26Z2009-11-10T21:52:39Z
<p>Thinking about a new TV i was looking at the new Philips Ambilight Series - In the Manual of the new 46PFL9704 you'll find a page like this:</p>
<p><a href="https://f.zz.de/media/200911102252.philips_and_opensource.zero-opensourcelicense.jpg"><img src="https://f.zz.de/posts/200911102252.philips_and_opensource/640x-200911102252.philips_and_opensource.zero-opensourcelicense.jpg" width="640" height="454" class="img" /></a></p>
<p>Rumours say Philips is using a Linux with all the stuff neded to play AVI/H.264 etc ... So - where is at least the GPL and a dozend other licenses - And where is the source (which has lately been removed from the website i was told).</p>
roaming and printinghttps://f.zz.de/posts/200911011104.roaming_and_printing/2013-04-09T08:11:26Z2009-11-01T10:04:23Z
<p>I always wanted my laptop to automatically detect my network location and set some configs for the location. One of the problematic areas was printing. I have a print server everywhere and probably a default printer - but i dont want to select the right print server everytime i move subnet etc ... So i cam up with this solution which is based on network-manager (yeah i know - bad software) and cups (client only - no server e.g. cupsys)</p>
<p>/etc/NetworkManager/dispatcher.d/02printer</p>
<p>`</p>
<h1>!/bin/sh</h1>
<p>IFACE="$1"<br/>
ADDRESS=$DHCP4_IP_ADDRESS</p>
<p>remove_printerconf() {<br/>
rm -f /etc/cups/client.conf<br/>
}</p>
<p>detect_location() {<br/>
place=""</p>
<p>case "$ADDRESS" in<br/>
195.71.4.<em>|195.71.5.</em>)<br/>
place="work"<br/>
;;<br/>
193.189.251.*)<br/>
place="home"<br/>
;;<br/>
esac</p>
<p>/usr/bin/logger -p daemon.info -t location Found location to be ${place} for ip adress ${ADDRESS}</p>
<p>rm -f /etc/cups/client.conf</p>
<p>if [ -f /etc/cups/client.conf.${place} ]; then<br/>
/usr/bin/logger -p daemon.info -t location Setting new printer config<br/>
ln -s /etc/cups/client.conf.${place} /etc/cups/client.conf<br/>
fi<br/>
}</p>
<p>case "$2" in<br/>
up)<br/>
detect_location<br/>
;;<br/>
down)<br/>
remove_printerconf<br/>
;;<br/>
esac<br/>
`</p>
<p>So basically - whenever a new interface comes up i check for its ip address and have it set a symlink for /etc/cups/client.conf - The only problem left is with network-managers bad habit of connecting the wireless additionally to the wired network - so i have both networks connected and they'll come up one<br/>
after the other ...</p>
Spamstats updatehttps://f.zz.de/posts/200909081011.spamstats_update/2013-04-09T08:11:26Z2009-09-08T08:11:16Z
<p>I am collecting all my spam mails since 2003 - thats a lot in total but allows some interesting stats on the spam i get:<br/>
<a href="https://f.zz.de/media/200909081011.spamstats_update.spamstats-2003-20090908.png"><img src="https://f.zz.de/posts/200909081011.spamstats_update/640x-200909081011.spamstats_update.spamstats-2003-20090908.png" width="640" height="480" class="img" /></a></p>
<p>Thats spam per day so begin of 2009 i got around 2300 spammails per day and we are down to a much more acceptable level.</p>
<p>I also have mails predating 2003 but i would need to sort them from the legitimate mail which would be a pain .... Probably i could use bogofilter to do that automatically ....</p>
Father - the 2nd https://f.zz.de/posts/200907241157.father_-_the_2nd_/2013-04-09T08:11:26Z2009-07-24T09:57:48Z
<p>It was a little silent the last days and weeks. I got father the 2nd time on 28th of June - A little Girl named Rhea ... So Henri now has a sister.</p>
<p><a href="https://f.zz.de/media/200907241157.father_-_the_2nd_.rhea-5580.jpg"><img src="https://f.zz.de/posts/200907241157.father_-_the_2nd_/640x-200907241157.father_-_the_2nd_.rhea-5580.jpg" width="639" height="426" class="img" /></a></p>
sane and scanner buttonshttps://f.zz.de/posts/200904090942.sane_and_scanner_buttons/2013-04-09T08:11:26Z2009-04-09T07:42:00Z
<p>After starting to make my home a paperless by introducing a Document Management System i wondered how to use the buttons on my document scanner (fujitsu fi-4120C). After looking around people seemed to have written some software using the libsane backend to poll the buttons. One to name is <a href="http://jice.free.fr/KScannerButtons/">kscannerbuttons</a>. They all did not fit my needs as i wanted a command line version. Also the fujisto does "only" have 2 buttons (scan and send to) but it has the notation of a function with a 7 segment display which does not trigger a function itself, but may be used to address the function to issue on pressing one of the other 2 buttons. So i started to write my own little scanbtn which regularly polls the buttons, debounces the changes, only notifies a secondary script which contains the policy on change etc. To get the source try:</p>
<p>git clone git://hydra.gt.owl.de/scanbtn.git</p>
arcboot update for Siemens Nixdorf RM serieshttps://f.zz.de/posts/200812181123.arcboot_update_for_siemens_nixdorf_rm_series/2013-04-09T08:11:26Z2008-12-18T10:23:13Z
<p>After a successful weekend in Essen in the Linux Hotel i finally made the patches against arcboot a little more shiny and send them off to Guido for integration into arcboot upstream. Now arcboot boots on IP22 IP32 and SNI RM series - most likely all RM200 and RM400. A git tree with all changes can be found here:</p>
<p><strong>git clone git://hydra.gt.owl.de/arcboot.git</strong></p>
udev and the option umts 3G card #2https://f.zz.de/posts/200811202107.udev_and_the_option_umts_3g_card_2/2013-04-09T08:11:26Z2008-11-20T20:07:26Z
<p>After some days of usage you find udev is ever more complicated to deal with than you initially thought. The inability to check for sysfs attributes more than one parent device away makes it difficult for my usage - so i made it 3 rules to set an appropriate symlink:</p>
<blockquote><p>SUBSYSTEMS=="usb", ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="6000", \<br/>
ATTRS{product}=="Fusion UMTS GPRS WLAN", ENV{fusiongt}="yes"<br/>
SUBSYSTEMS=="usb", DRIVERS=="option", ATTRS{bInterfaceNumber}=="00", \<br/>
ENV{fusiongt}=="yes", ENV{fusiongt_primary}="yes"<br/>
SUBSYSTEMS=="tty", ENV{fusiongt_primary}=="yes", SYMLINK+="modem"</p></blockquote>
<p>The first sets a environment variable if this run is on a Fusion Globetrotter Card. The second one only triggers on the first serial on the Fusion GT Card. And the last sets the symlink for the tty ...</p>
text/html painhttps://f.zz.de/posts/200811201626.texthtml_pain/2013-04-09T08:11:26Z2008-11-20T15:26:35Z
<p>A couple weeks ago i was fed up with all the unreadable html stuff and put a</p>
<blockquote><p>auto_view text/html</p></blockquote>
<p>into my <strong>.muttrc</strong>. This at least showed all html as painless as possible. Now i found that<br/>
it also preferred to show me the html instead of the text/plain on multipart mails. The solution is to set the<br/>
multipart/alternative order.</p>
<blockquote><p>alternative_order text/plain text text/enriched text/html application/postscript image/*</p></blockquote>
udev and the option umts 3G cardhttps://f.zz.de/posts/200811181833.udev_and_the_option_umts_3g_card/2013-04-09T08:11:26Z2008-11-18T17:33:02Z
<p>How i hate to debug udev - i did it a couple of times and everytime i hate do to it again. I wanted udev to create a modem symlink in case i plug in my 3G Option UMTS Card. The problem is the Card has an OHCI USB Host Controller presenting 3 usb-serial devices. Only the first one can be used to connect - Ignoring the fact that all three run through udev create a random symlink on any device whatever comes first. Here is how i solved this:</p>
<blockquote><p>SYSFS{idVendor}=="0af0", SYSFS{idProduct}=="6000", PHYSDEVPATH="<em>:1.0/ttyUSB</em>", SYMLINK+="modem"</p></blockquote>
<p>the PHYSDEVPATH makes shure i am only attaching the modem symlink to the device :1.0 on the new OHCI bus. As i also match <br/>
vendor and product of the Option card this will only create a symlink on the first port of the option card.</p>
cups notifier - another overengineered featurehttps://f.zz.de/posts/200810251106.cups_notifier_-_another_overengineered_feature/2013-04-09T08:11:26Z2008-10-25T09:06:30Z
<p>I bought a usb power-bar to switch individual devices on an off. We have a central laserjet printer at home which i wanted to turn on automatically after somebody prints and turn off after some time. Using the SIS PM tools is straight forward and turns on/off the printer fine with the power-bar. Now - when do you turn the printer on? The easy stuff would have been a cronjob counting the jobs in the queue. One would have needed to run this every minute or something to get a quick result. I didnt like that approach and found the cups notifier. The notifier may run your programm whenever something happens on the cups server e.g. a job gets created. The problem is - The information you get passed is binary bullshit and fully unsuitable for scripting. I was very close to drop the notifiers when i encountered the <strong>testnotify</strong> notifier. Its for debugging only and its sole purpose is to decode the binary bullshit. Some shell scripts later everything was done:</p>
<blockquote><p>`</p>
<h1>!/bin/sh</h1></blockquote>
<p>TESTNOTIFY=/usr/lib/cups/notifier/testnotify<br/>
POWERFILE=/var/cache/cups/printerpoweron<br/>
TMP=<code>tempfile</code><br/>
PRINTERPOWERON="sudo /usr/local/bin/sispmctl -o 4"</p>
<h1>In:</h1>
<h1>DEBUG: notify-subscribed-event (keyword): "printer-state-changed"</h1>
<h1>Out:</h1>
<h1>notify-subscribed-event: printer-state-changed</h1>
<h1></h1>
<p>${TESTNOTIFY} \<br/>
testnotify://nowait 2>&1 |\<br/>
sed -ne '/^DEBUG: / { s/^DEBUG: <em>*//; s/ ([^)]</em>):/:/; /: "/ { s/: "/: /; s/"$//; }; p;}' >${TMP}</p>
<p>event=<code>sed -ne '/notify-subscribed-event:/ { s/^.*: **//; p; }' <${TMP}</code></p>
<p>case ${event} in<br/>
job-created)<br/>
date >>${POWERFILE}<br/>
${PRINTERPOWERON}<br/>
;;<br/>
esac<br/>
exit 0<br/>
`</p>
<p>Now the same for poweroff - We want to only poweroff if there were no new print jobs within a certain amount of time and no printjob in the queue left ...</p>
<blockquote><p>`</p>
<h1>!/bin/sh</h1></blockquote>
<p>POWERFILE=/var/cache/cups/printerpoweron<br/>
PRINTERPOWEROFF="/usr/local/bin/sispmctl -f 4"<br/>
POWEROFFDELAY=300</p>
<h1>Is the printer turned on?</h1>
<p>[ -e ${POWERFILE} ] || exit 0</p>
<h1>Is there something still in the queue?</h1>
<p>[ $((<code>lpq | wc -l</code> - 2)) -eq 0 ] || exit 0</p>
<h1>Poweroff delay</h1>
<p>age=$((<code>date "+%s"</code> - <code>find ${POWERFILE} -printf "%C@"</code>))</p>
<p>if [ ${age} -gt ${POWEROFFDELAY} ]; then<br/>
${PRINTERPOWEROFF} >/dev/null 2>&1<br/>
rm ${POWERFILE}<br/>
fi<br/>
`</p>
<p>Have a look at the power-bar which is really nice - Reichelt has them as <strong>Gembird SIS-PM Silver Shield</strong> and Pearl as <strong>revolt "Intelli-Plug"</strong>. The linux software is on sourceforge <a href="http://sispmctl.sf.net">http://sispmctl.sf.net</a></p>
HP J9141A #1https://f.zz.de/posts/200809131613.hp_j9141a_1/2013-04-09T08:11:26Z2008-09-13T14:13:32Z
<p>Its a while ago since i hacked on that machine but it fell into my hands today and i thought of reflashing it into the original state as my OpenWRT trys did not succeed (atheros driver in the openwrt repository does not support that chip).</p>
<p>Here is the Serial Pinout of the J9141A Access Point for the curious:</p>
<blockquote><p>PIN 1 GND<br/>
PIN 2 TX (UART 1)<br/>
PIN 3 RX (UART 1)<br/>
PIN 4 GND<br/>
PIN 5 TX (UART 2)<br/>
PIN 6 RX (UART 2)</p></blockquote>
<p>But be careful - its 5v TTL not normal serial so build a converter before frying your AP.</p>
HP J9141A config restorehttps://f.zz.de/posts/200809101046.hp_j9141a_config_restore/2013-04-09T08:11:26Z2008-09-10T08:46:49Z
<p>The HP J9141A is a 802.11a/b/g Access point with Power-over-Ethernet. It runs an OpenWRT native to which HP up to now did not release the source. I mailed them - no answer. Now i tried restoring a config on one of those beasts and guess what? It fails - there is no way to restore the config from linux - you need a windows. HP tried to very clever and parses the config backups filename in javascript and trys to detect whether its linux or windows:</p>
<p><code>
var win_file_name=filestr.substr(filestr.lastIndexOf("\\\\\")+1);
var unix_file_name=filestr.substr(filestr.lastIndexOf("/")+1);
if(win_file_name == filestr && unix_file_name != filestr)
file_name=unix_file_name;
else if( win_file_name != filestr && unix_file_name == filestr)
file_name=win_file_name;
else
{
alert(invalid_filename);
return false;
}
</code></p>
<p>Now i hacked around and did it with curl as neither firefox 3 nor epiphany was getting around this. Dont try to be clever when you have no clue ...</p>
<p><code>curl -u admin:password http://192.168.1.14/cgi-bin/upg_restore.cgi?/reboot_wait.html -F "filename=@AP1.cfg;restore=Restore"</code></p>
Dependencieshttps://f.zz.de/posts/200709121826.dependencies/2013-04-09T08:11:26Z2007-09-12T16:26:22Z
<p>Whats the point in having dependencies when they are not used or maintained? With Debian/Sid you can install an MP3 player which cant play mp3's ... <a href="http://bugs.debian.org/418773">amarok: claims that xine cannot play mp3</a>. Another bad example is pulseaudio - Why on earth cant i open padevchooser until i will install avahi which pulseaudio does not depend on. Seperating packages is a good thing but this makes them basically unusable. I switched to rhythmbox because of the whole amarok mess.</p>
<p>Debian - This is something Ubuntu solves a lot better.</p>
Broken Software distributed in Botnetshttps://f.zz.de/posts/200709011413.broken_software_distributed_in_botnets/2013-04-09T08:11:26Z2007-09-01T12:13:32Z
<p>Lately there is a lot of discussion about Spam armys sucking up SMTP connections on mailexchangers by violating the SMTP protocol. Postfix talks about connection lost in "CONNECT" phase. Just as a hint on how bad the situation is - On a system of mine i typically get ~2200 Mails/Minute with ~300 connections. When the Botnet started misbehaving the amount of mail went down to ~400/Minute which was due to the SMTPd count limit reached. I now decreased the smtp_timeout from 300 to 60 which brought the original performance back.</p>
<p>Its interesting to see Botnets having the same QA problems as Microsoft with its WGA servers. Coincident ?</p>
partitioning toolshttps://f.zz.de/posts/200708122251.partitioning_tools/2013-04-09T08:11:26Z2007-08-12T20:51:43Z
<p>This hackmeeting we successfully wrote a bootloader and mechanism for the SNI RM series. As a matter of fact all known partitioning tools are basically broken and multiple aspects. SGI or SNI partitions must start on a cylinder boundary and as those must even have the size which is a multiple of the cylinder. fdisk fails to create a volhdr which is a multiple of a cylinder. It does though create partitions which start on cylinder boundarys. It still ignores the real geometry of the disk and instead relys on the kernel and its HDIO_GETGEOM capability which basically gives back a DOS stripped view on the world which no one really shares (except the WinDOS world). And by trying around fdisk showed another really nasty bug: <a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=437483">not beeing able to create a second partition</a>.On the other hand parted is even worse. It fails to create any partition on a cylinder boundary. Everything is garbled to hell.</p>
<p>The problem is not existand on SGI as they decided to ignore the Cylinder/Head/Sector world and instead go the LBA aka Sector number way which is much easier. SNI instead used the same volume header format as SGI but were "very clever" by writing a second partition table to the very end of every disk. The problem is that the MipsPROM uses those SNI specific partition tables and not the volhdr ones. We now must ensure that those partition tables match which is impossible when those f*** tools decide to ignore the constrain of cylinder boundaries (which is valid for SGI too)</p>
cross gcc/binutils for mips-linuxhttps://f.zz.de/posts/200708102146.cross_gccbinutils_for_mips-linux/2013-04-09T08:11:26Z2007-08-10T19:46:13Z
<p>As every hackmeeting starts with building a cross toolchain - and every year the gcc people changed the way it works. Now some documentation:</p>
<blockquote><p>../gcc-4.1-4.1.2/src/configure --prefix=/usr/local --target=mips-linux --disable-multilib --disable-nls --disable-shared --disable-threads --enable-languages=c</p></blockquote>
<p>make all-gcc<br/>
make install-gcc</p>
Vintage Computing https://f.zz.de/posts/200705292153.vintage_computing_/2013-04-09T08:11:26Z2007-05-29T19:53:06Z
<p>I was cleaning my room and found two machines i just kept because i needed to make a backup before dismantling. I powered the first up and found i needed an AT (not PS/2) Keyboard and i still had loads of them. The machine came up and greeted me. The filesystem was on a 250MByte SCSI Disk connected via an Adaptec AHA1542. It hadnt been checked for 1255 Days. It had last been powered up on 29th Sep 2004 and the .forward in my own homedirectory was dated 15 June 1999. lspci showed 3 PCI Devices, none of them beeing an extension card. /proc/cpuinfo told me i was using an Authentic AMD K5. The second showed an SCSI disk on an AHA2940 Wide Bus which was reported as not ready. After hitting the disk with a screwdriver i heard it spin up. After booting it had massive problems detecting the PCI devices in there so i decided to just dismantle and not care about the backup any longer.</p>
<p>All this hardware felt very familiar and i would now declare myself an Oldtimer.</p>