I hate doing SEO but I feel I have to… My github repositories have been wiped from Google search. Until recently (not exactly sure when because I rarely search for them…) my github projects were showing up in the top of Google’s search results when using close enough search words.
E.g. searching for “kate gpg plugin” would show both my blogpost and the github project as one of the very first search results. Same when searching for “qtetramesher“. Funnily enough this is still the case when searching using DuckDuckGo, Bing or Yahoo.
Both projects have received significant updates recently but apparently some of my recent updates must have offended Google and there is no way to know why. Even a very specific search for
site:github.com/dennis2society/kate-gpg-plugin or site:github.com/dennis2society/qtetramesher
shows no result at all indicating that the repo is not even indexed.
The repos are public
To the best of my knowledge there is no offending content in the repos that could violate any policies
Checking both the repo pages and the binary releases on VirusTotal show that everything is clean
I have asked the Google community with no replies yet. A similar question appears here.
To me it looks like either my repositories have been removed deliberately (for whatever reason) or there is a bug in Google search…
I have recently worked with the PcapPlusPlus library to analyze timestamps from PCAP ethernet captures. And I have fucked up majorly the Unix timestamp to string conversion. This post is meant to 1. remind me of my failure… 2. remember how to do it right the next time
Unix timestamps represent time elapsed since 00:00:00 UTC on Thursday, 1 January 1970, mostly in seconds, in case of .pcap(ng) files with an additional fractional nanoseconds part. The following timestamp represents Mon Jul 15 2024 17:48:40 GMT+0000 and almost a second full of nanoseconds (the fractional part):
1721065720.968918119
In my C++ program I wanted to export stuff as CSV including a row of Unix timestamps. PcapPlusPlus allows getting the timestamp from a parsed packet read from a pcap(ng) file like this:
Converting this to string seems to be straight forward using a std::stringstream. The crucial part is that the nanoseconds part can start with one or more zeros such as this:
1721065721.008918119
The fractional part represents 0.008918119 seconds. This must be 9 digits long!
Parsing the fractional part of this with a std::stringstream will strip the leading zeros which reduces the length of the nanoseconds fractional part: The fractional part must preserve the 9 digits because 0.8918119 s is much bigger than 0.008918119 s.
To properly parse the fractional part (e.g. to plot it) it must be ensured that the leading zeros also go into the string written into the CSV:
Replaced old trimesh2 C library with Assimp library
New mesh formats available for import
Fixed surface normal generation (damn.. the old one was so slow… )
libQGLViewer is now included in the repository
Failed experiments
quartettetrastuffing is very unstable on meshes more complex than primitives…
There is now a preliminary but currently deactivated option to use Tetgen tetrahedralization which is disabled, too, because of random errors on Linux… :/
This is another reminder to myself in case I ever have to re-setup the mail system. Fingers crossed that this doesn’t happen any time soon! But if it happens this post will hopefully spare me another few weeks of searching outdated discussion board and mailing list posts until finally reading the proper documentation… :/
I am running a Debian 11 VPS with postfix, dovecot and (daemonized) spamassassin. Only recently had I discovered that spamassassin’s bayes filtering and autolearn functionality was not working properly for multiple reasons:
By default the bayes database lives in /root/.spamassassin which is … suboptimal.
The bayes database needs to be trained with at least 200 spam+ham mails to be used at all .
In my setup not only the system user debian-spamd would access the bayes DB, but also the dovecot/vmail user would attempt to access it when regular mail users would manually move a missed spam mail from their inbox to the Junk folder.
Fortunately, each step was easier to solve than I’d like to admit:
Searching the web reveals that /root/.spamassassin is a very unfortunate place for the bayes database because most likely the daemonized spamassassin is not able to write there. This appears to be a common problem as I have found this issue quite often during my “research”.
1.2 There already exists a dedicated user to run spamd: debian-spamd, but for some reason it is not used by default. This can be fixed in /etc/default/spamassassin by appending “-u debian-spamd” to the OPTIONS line. After restarting spamassassin it should now run as the correct user.
“Luckily” one of my mail users had a large number of spam mails in his Junk folder which were correctly classified and moved there by the default non-bayesian spamassassin rules, and could be used to train the >200 required spam mails for the bayes filter: https://spamassassin.apache.org/full/3.0.x/dist/doc/sa-learn.html The same was done for the ham mails.
This was the tricky part: After moving the bayes_path and setting up spamassassin to run as the correct user, the /var/lib/spamassassin folder had these permissions: 4,0K drwxrwxr-x 8 debian-spamd debian-spamd 4,0K Jun 11 12:57 spamassassin
This was good enough to have mails recognized as “ham” by the now running bayes filter to be auto-learned as such. However there was another player in the field that would try to update the bayes database: dovecot/vmail. I had set up an IMAPSieve for dovecot which is supposed to automatically “sa-learn –spam/ham [mail]” when being moved manually from either Inbox to Junk or vice versa: https://doc.dovecot.org/configuration_manual/howto/antispam_with_sieve/ While spamd itself is allowed write to /var/lib/spamassassin thanks to the updated permissions (1.1), the dovecot sieve could not. Turns out the sieve invoked on a manual move runs as user “vmail”, resulting in error messages in the dovecot log that the sieve execution has failed. Searching the web again showed many suboptimal solutions, including recursively setting the permissions for /var/lib/spamassassin to 777… That’s not what I want. Instead: 3.1 Add user vmail to the mail group (if it isn’t already) 3.2 Change ownership of /var/lib/spamassassin to debian-spamd:mail 3.3 Change ownership of /var/lib/spamassassin/bayes_* to debian-spamd:mail 3.4 Change permissions on /var/lib/spamassassin to 775/770 3.5 Change permissions on /var/lib/spamassassin/bayes_* to 664/660 3.6 Bonus: If you have enabled the spamassassin CRON job in /etc/default/spamassassin: Change permissions on /var/lib/spamassassin/sa-update-keys to 700 to avoid warnings about unsafe permissions. Your /var/lib/spamassassin folder contents should now look like this: > ls -l /var/lib/ […] 4,0K drwxrwxr-x 8 debian-spamd mail 4,0K Jun 11 12:57 spamassassin […] > ls -l /var/lib/spamassassin […] 356K -rw-rw-r-- 1 debian-spamd mail 360K Jun 11 12:57 bayes_db_seen 7,6M -rw-rw-r-- 1 debian-spamd mail 10M Jun 11 12:57 bayes_db_toks 4,0K drwx------ 3 debian-spamd debian-spamd 4,0K Jun 9 00:33 sa-update-keys
For me this allows spamd itself to learn ham from legitimate mails. It also allows the bayes DB to be updated when manually moving missed spam mails from Inbox to Junk using the dovecot sieve.
OpenCV’s TextureFlow example screenshot (C++ variant)
Since version 2.4.3 OpenCV has a nice example for generating a texture flow image from an input image. This generates a grid-like distributed edge-gradient image from the input. Unfortunately this example is in Python with no C++ translation available. A while ago I have made an attempt to translate this to C++. The result is not 100% identical to the Python variant, but close enough:
This is a Qt-based program for Windows and Linux to generate tetrahedral meshes for finite element simulation from various surface mesh formats. It also offers a fast and easy-to-use mesh viewer based on QGLViewer and allows basic mesh manipulations (currently only scaling is possible). Two different methods for tetrahedralization are possible: Delaunay Triangulation and Johnathan Shewchuk’s Isosurface Stuffing algorithm.