Diary

Welcome! :-)

This is both a wiki (a website editable by all) and a blog (an online diary about the stuff Alex Schroeder reads and does). If you’re a friend or relative, you might be interested in reading Life instead of this page. If you’ve come here from an RPG blog, you might want to head over to RPG. There are other similar categories to be found on the SiteMap.

Für Rollenspieler gibt es ebenfalls eine eigene RSP Kategorie.

2017-10-23 Facedetect

Ok, so facedetect is failing me. When I ran fgallery I got this error:

  File "/Users/alex/bin/facedetect", line 140, in face_detect
    flags = cv2.cv.CV_HAAR_DO_CANNY_PRUNING
AttributeError: 'module' object has no attribute 'cv'

Based on an answer on StackExchange, I installed the latest facedetect from GitHub.

Now I get a different error:

facedetect: error: cannot load HAAR_FRONTALFACE_ALT2 from /usr/share/opencv/haarcascades/haarcascade_frontalface_alt2.xml

This directory is wrong: my opencv stuff got installed in /usr/local/opt/opencv@3 by Homebrew. I should be using the --data-dir option but I opted to change line 37 in facedetect instead. DATA_DIR should point to the directory containing haarcascades:

DATA_DIR = '/usr/local/opt/opencv@3/share/OpenCV/'

Tags:

Add Comment

2017-10-22 Show All Feeds

This is the bookmarklet from dekstop which is based on the bookmarklet from the Google Reader days. The good part is that this is not an extension you need to install in your browser, it’s a little piece of Javascript that’s easily checked. It doesn’t load stuff from remote sites, either. Perfect!

Feel free to copy and paste from here into the URL of a bookmark:

javascript:function%20txt(str){return%20document.createTextNode(str)}function%20tag(n,c){var%20e=document.createElement(n);e.style.fontFamily='Arial,sans-serif';e.style.color='#000';if(c)e.appendChild(c);return%20e}function%20p(c){return%20tag('p',c)}function%20a(href,desc){e=tag('a',txt(desc));e.href=href;e.style.color='#00c';e.style.textDecoration='underline';return%20e}var%20el=tag('div');el.style.zIndex=100000;el.style.position='absolute';el.style.padding='20px';el.style.top='10px';el.style.left='10px';el.style.backgroundColor='#ffffcc';el.style.border='1px%20solid%20#333333';el.style.textAlign='left';var%20ul=tag('ul');var%20found=false;var%20links=document.getElementsByTagName('link');for(var%20i=0,link;link=links[i];i++){var%20type=link.getAttribute('type');var%20rel=link.getAttribute('rel');if(type&&(type=='application/rss+xml'||type=='application/atom+xml')&&rel&&rel=='alternate'){var%20href=link.getAttribute('href');if(!href.match(/^http/)){var%20path=(href.match(/^\//))?%20'/'%20:%20location.pathname;href='http://'+location.hostname+path+href;}var%20title=link.getAttribute('title');ul.appendChild(tag('li',a(href,((title)%20?%20title+'%20-%20'%20:%20'')+href)));found=true;}}if(found){el.appendChild(p(txt('The%20current%20page%20links%20to%20these%20feeds:')));el.appendChild(ul);}else{el.appendChild(p(txt('The%20current%20page%20does%20not%20link%20to%20any%20feeds.')));}var%20close=a('#','Close');close.onclick=function(){el.style.display='none';return%20false;};el.appendChild(p(close));function%20addFeedBox(){document.body.appendChild(el);y=window.scroll(0,0);}void(z=addFeedBox());

Tags:

Add Comment

2017-10-22 Mastodon and Bitlbee

OK, so you want to test the Mastodon implementation for Bitlbee like I do after a long break?

Well, let’s say you did a ./configure --debug=1 --asan=1 --msn=0 --jabber=0 --oscar=0 --twitter=0 && make in your directory and stuff crashes immediately. You want to debug. How does that work on macOS?

You try using gdb, and use the BITLBEE_DEBUG environment variable to have HTTP headers printed as you go:

alex@Megabombus:~/src/bitlbee (kensanata/develop %=)$ BITLBEE_DEBUG=1 gdb --args ~/src/bitlbee/bitlbee -D -n -F -v -d /Users/alex/.bitlbee -c /Users/alex/.bitlbee/bitlbee.conf
GNU gdb (GDB) 8.0.1
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin16.7.0".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /Users/alex/src/bitlbee/bitlbee...done.
.gdbinit:1: Error in sourced command file:
Disabling randomization of debuggee's virtual address space is unsupported on
this platform.
(gdb) run
Starting program: /Users/alex/Source/bitlbee/bitlbee 
Unable to find Mach task port for process-id 43768: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

OK, so the randomisation error is due to a line in .gdbinit and you can ignore it. You may also delete the file.

If you have used plugins such as bitlbee-facebook or bitlbee-discord, now would be a good time to delete them from /usr/local/lib/bitlbee until your issues are resolved.

You can’t ignore the part about codesigning, though. Luckily, the answer is simple:

alex@Megabombus:~/src/bitlbee (kensanata/develop %=)$ ls -l /usr/local/bin/gdb
lrwxr-xr-x 1 alex admin 27 Oct 22 09:46 /usr/local/bin/gdb -> ../Cellar/gdb/8.0.1/bin/gdb
alex@Megabombus:~/src/bitlbee (kensanata/develop %=)$ codesign -fs gdb-cert /usr/local/bin/gdb
alex@Megabombus:~/src/bitlbee (kensanata/develop %=)$ codesign -fs gdb-cert /usr/local/bin/../Cellar/gdb/8.0.1/bin/gdb
/usr/local/bin/../Cellar/gdb/8.0.1/bin/gdb: replacing existing signature

You will have to provide your username and password, twice.

Now, when you issue the run command, you will have to provide your username and password, again, but now it works:

(gdb) run
Starting program: Starting program: /Users/alex/Source/bitlbee/bitlbee -D -n -F -v -d /Users/alex/.bitlbee -c /Users/alex/.bitlbee/bitlbee.conf
[New Thread 0x1403 of process 43950]
warning: unhandled dyld version (15)
Warning: Warning: Couldn't write PID to `/var/run/bitlbee.pid'

You should now be able to connect to your local server (in my case, megabombus.local) using an IRC client.

And you’ll probably get an error like the following:

ASAN:DEADLYSIGNAL
=================================================================
==48642==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000b8f0 (pc 0x0001000ccf00 bp 0x7fff5fbfdaf0 sp 0x7fff5fbfda50 T0)
==48642==The signal is caused by a READ memory access.
    #0 0x1000cceff in mastodon_http_timeline (bitlbee:x86_64+0x1000cceff)
    #1 0x1000c2fc9 in mastodon_http_hashtag_timeline (bitlbee:x86_64+0x1000c2fc9)
    #2 0x100078b80 in http_incoming_data (bitlbee:x86_64+0x100078b80)
    #3 0x100074587 in gaim_io_invoke (bitlbee:x86_64+0x100074587)
    #4 0x100251e63 in g_main_context_dispatch (libglib-2.0.0.dylib:x86_64+0x2ce63)
    #5 0x100252161 in g_main_context_iterate (libglib-2.0.0.dylib:x86_64+0x2d161)
    #6 0x1002523b6 in g_main_loop_run (libglib-2.0.0.dylib:x86_64+0x2d3b6)
    #7 0x1000742af in b_main_run (bitlbee:x86_64+0x1000742af)
    #8 0x100069e7f in main unix.c:182
    #9 0x7fffe946e234 in start (libdyld.dylib:x86_64+0x5234)

And now you know where to look. Well, more or less. You need to convert that address to a line number:

(gdb) info line *0x1000cceff
Line 1054 of "mastodon_lib.c" starts at address 0x1000ccebc <mastodon_http_timeline+28>
   and ends at 0x1000ccf07 <mastodon_http_timeline+103>.

Strangely enough, setting a breakpoint does not help. Hit C-c to break, b mastodon_http_timeline to set a breakpoint, c to continue, and try again – and you run into the same error without reaching a GDB prompt. This also happens if you run without ASAN. I’m not sure what the problem is, but in this situation you’re basically back to print statements and the like. Uagh!

Oh, and Mastodon 2.0 changed all their ids from integers to string in their API and so everything is broken.

Tags:

Comments on 2017-10-22 Mastodon and Bitlbee

Also, I’m working on my branch, kensanata/develop. I have the remote upstream configured. So when I’m done and I have committed, I fetch from upstream, rebase onto upstream/develop, and force push that.

Later, when I’m ready to upgrade my Pull Request, I switch to my master branch. And then what? To be answered. :)

– Alex 2017-10-23 05:17 UTC


Looks like my PR is not going to get merged. It’s a big chunk of code and tricky to review thoroughly, unfortunately. :(

– Alex 2017-10-23 14:53 UTC

Add Comment

2017-10-22 Debian and HTTPS

I installed apt-transport-https and changed all the links in /etc/apt/sources.list and I got a bunch of these: `server certificate verification failed. CAfile: etcssl/certs/ca-certificates.crt CRLfile: none`

Huh? But it’s true. Visiting https://security.debian.org/dists/jessie/updates/contrib/binary-amd64/Packages gives me a warning. I have the ca-certificates package installed, so I guess either this is a man-in-the-middle attack, or the certificates for the Debian HTTPS sites are not packaged with ca-certificates, both of which are not good.

I fiddled with the hostnames and changed ftp.debian.org to ftp.ch.debian.org and now I get a different message: W: Failed to fetch https://ftp.ch.debian.org/debian/dists/jessie/main/binary-amd64/Packages SSL: certificate subject name (plattenberg.ethz.ch) does not match target host name ’ftp.ch.debian.org’

This makes sense. I changed the hostnames in sources.list to plattenberg.ethz.ch and that worked, partly. The security.debian.org still doesn’t work.

When I checked plattenberg itself, though, they say: “If you prefer to access this Debian mirror via HTTPS, please replace https://ftp.ch.debian.org/ by https://debian.ethz.ch/ in your sources.list file.” OK, then!

# ftp.ch.debian.org -> plattenberg.ethz.ch
deb https://debian.ethz.ch/debian jessie main contrib non-free
deb https://debian.ethz.ch/debian jessie-updates main contrib non-free
deb http://security.debian.org jessie/updates main contrib non-free

And it also has an “Unofficial Mirror of the Debian Security APT repository”. And: “Use at your own risk!” I guess not. So the above mix of HTTPS and HTTP is going to be it. Hmmmm.

Add Comment

2017-10-22 Admin Returns from Holidays

So, I’m back from a long trip. What is there to do?

  1. Run a backup. More…
  2. Check Munin and Monit for issues on the servers. More…
  3. Run sudo apt-get update and sudo apt-get upgrade on the server. More…
  4. Run brew update and brew upgrade on the laptop.

Add Comment

2017-10-20 Australians

Our trip is ending. All the remains is the long flight home. Here’s what I learned about the Australians:

  1. They aren’t kidding about char grilled stuff—they really like their stuff burned! Yuck!
  2. They are very polite and upbeat. Everything is fantastic and beautiful, everybody is a honey and a darling.
  3. They really like their pork belly. I didn’t know people still ate that. In Switzerland it’s all entrecôte or sausages instead of bacon and pork belly.
  4. Outside of Sydney, all the portions where humongous, made for people thrice my weight

Tags:

Comments on 2017-10-20 Australians

Now that I’m back in Switzerland I tealized that they also don’t ring their church bells all the time like they do here in Switzerland.

– Alex 2017-10-21 17:03 UTC

Add Comment

2017-10-15 Online Again

I was sitting in a very nice hotel on Lord Howe Island and wondering why my iPhone no longer connects to my homepage, alexschroeder.ch, where as all my other sites seem to be fine, eg. oddmuse.org loads just fine. I’m getting an error saying the connection is not private and that the certificate is wrong.

How is this possible? Apparently my site is being served with a different certificate? Where’s my Let’s Encrypt certificate? Both sites are hosted on the same machine, using the same Apache, the same config. Is this a man-in-the-middle attack by a “security” solution? But why doesn’t it affect any other site?

Image 1 for 2017-10-15 Online Again Image 2 for 2017-10-15 Online Again

I checked Qualis SSL Report and it still gives me a grade A. Thus it must be the hotel firewall, or a secret agency attacking the cable between Australia and Switzerland? 🤔

Other sites with a “ch” ending were not affected so it really looked targeted!

The thing I’m not doing is public key pinning, if I remember correctly.

Another thing I have noted: iMessage and WhatsApp are both refusing to send messages or are forever “connecting...” which makes me think that they are seeing spoofed certificates as well where as the Google+ app and Instagram app are still working as intended (either because they are not being spoofed or because they don’t check).

Back on the mainland, everything works again as intended. How strange.

Tags:

Add Comment

2017-10-10 Learning Japanese, Again

I don’t feel like reading Fantasy books or the newspapers while I’m traveling in Australia. And thus I’ve started practicing with the Kanji Teacher by Chris Rusche and the free PDF Japanese Grammar Guide by Tae Kim (2012), and the Anki App... Help! :)

This time I don’t want to spend time programming apps to learn Japanese instead of learning Japanese. I did this many years ago when I wrote Kanji Dictionary.

Tags:

Comments on 2017-10-10 Learning Japanese, Again

Platform choice? I’ve gotten the most mileage with the iOS app Human Japanese (and the Intermediate follow up).

– Kristopher Browne 2017-10-10 15:57 UTC


Thank you for the recommendation. We will see how far I get with what I have and I’ll keep this in mind. The previews in the App Store look pretty good, though.

– Alex 2017-10-10 23:48 UTC


Wenn Du Idee fuer Kanji Teacher hast: bitte sehr gerne melden, bin gerade an Version 9... Sollte lieber lernen, ja! ٩(

Und: Japan, Fruehling 2018, vielleicht? Oder 2019?

– Chris 2017-10-12 19:51 UTC

Add Comment

2017-09-13 Japanese

Every now and then I get the urge to start learning Japanese again—or Chinese.

Recently I saw Nate Cull talk about Chinese characters on Mastodon. He was looking at CC-CEDICT ( see dictionary) and CJK-DECOMP.

EDICT was the one I used ages ago, for Japanese.

Tags:

Add Comment

2017-09-08 The Wake

Still reading The Wake. I just read a review and another review.

This tale of the Norman conquest, told from the point of view of an English man, in an invented language that is readable but looks a bit like Old English, the “shadow tongue”, this tale makes me uneasy for all the nationalis it invokes, a kind of new-pagan ecofascism, too much Blut & Boden for my liking. As a perpetual foreigner, I question every mentioning of the “true” nationals, the “original” people, their “special” relationship with the land. If we learned anything from history, it should be that even if the first monkey that climbed down from tree and walked, even if that first human had stayed right there on that first piece of land, and their descendants had stayed there as well, making them the most original of the most true natives forever—I still don’t believe in a special relationship that cannot be gained in a few years of living somewhere, in a special property inherited from parents to children, in any sense of “belonging”. There are the things we do, the things we say, but the special connection to the land, a special property of the blood, this is one of the ingredients of fascism. Remember the essay on Urfascism. When you don’t have anything, when you can’t do anything, when you don’t know anything, at least you were born in a country and therefore it must be all to you. Fuck this.

Discussion on G+.

Tags:

Add Comment

More...

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit this page if you need to fix typos. You can subscribe to updates by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.

Referrers: The City of Iron Diary Face Gallery Gothridge Manor