If FreeBSD’s pkg refuses to update because of a wrong OS version, for example because you are in a FreeNAS jail and version mismatch are bound to happen, then you can always try to force the OS version in pkg (which you can find with uname -UK
. Either put OSVERSION={{version}}
in /usr/local/etc/pkg.conf or start it with pkg -o OSVERSION={{version}}
where {{version}}
is the target version, for example 1101001.
Category Archives: Uncategorized
Sshguard, PF and FreeBSD
We recently had a problem with sshguard. Some IP that were blocked were still able to send packets through because the associated states were not killed properly with pfctl -k $ip
. We used an older version until then, so I just did an upgrade to the latest port.
From this point however sshguard did not block anything anymore. In fact it didn’t recognize the correct backend to use to block those IP. Not sure if we always have to specify it manually in the configuration or if there is some kind of broken-autodetect. But you can force the backend inside the configuration file in /usr/local/etc/sshguard.conf
(see /usr/local/etc/sshguard.conf.sample
):
BACKEND="/usr/local/libexec/sshg-fw-pf"
Women In Science
Multi-single line comments
// Anyone who comments like this // reads like the non-K&R type.
No offense but that’s literally the truth.
WHAT.THE.ACTUAL.####
Aside
underlying hypernova
Nothing fits the angriness, rage, and sadness.
Everything just explodes with no before nor after.
All the walls break, little perks in the wind.
A never ending unfolding sound of broken glass,
everlasting high pitched pink pain.
Sure there can’t be more out of hundred millions electron-volts,
sempiternal ill witched red rain.
Is there a prime number whose…
Is there a prime number whose binary representation looks like a giraffe?
like another prime number?
like a prime number of giraffes?
like Squidward Tentacles?
You’ve probably understood the mechanism by now. Converting a binary image into a number, its nearest upper prime generally only differ in the lesser significant bits, hence most of the image pattern stays the same. So finding a prime number whose binary representation looks like a specific image is relatively easy. I say relatively, because in a computer sens it is quite really complex.
I just wrote a program to do just that. It is written in C and uses GMP. It is around 1k SLOC. It could probably have been much shorter, and even less so in another language. But I wanted something that went a little further than just of simple proof of concept.
I must admit, it’s pretty useless. But still there it is. And there is still much room for improvement. So patches are welcome on GitHub.
Союз
Aside
Live from Intel’s HQ
Disable XF86Back/Forward
Real ThinkPad keyboards (not this monstruous ignominy) have directly accessible keys for XF86Back and XF86Forward. That is really problematic with web browsers such as Firefox or Chromium since pressing those keys transparently go back or forward into your history, discarding anything you were typing in the process, including that 3 hours long bug report you were just about to submit. That’s rather annoying, to say the least.
Some other blog post suggest to simply disable them with xmodmap. That is in ~/.xmodmaprc
(or whatever it is you use):
keycode 166 = NoSymbol keycode 167 = NoSymbol
I personally prefer to remap them to Next/Prior keys. Having these near the navigation keys might come up handy:
keycode 166 = Next keycode 167 = Prior
That’s on Linux though, on FreeBSD the keycodes are 233 and 234:
keycode 233 = Next keycode 234 = Prior
Anyway use the xev
command and xmodmap -pke
to find the keycodes and remap them to any other interesting key symbol.
Intel’s big bug
That’s pretty hot fucking big deal.
If you don’t mind my saying so.