nullrend

INSUFFICIENT DATA FOR MEANINGFUL ANSWER

Tmux Alt/Meta + Arrow keys don’t work on Windows Terminal

Putting this up ‘cos I will forget how to do this at some point in the future.

Say you’re using the following keybindings on tmux:

# switch panes using Alt-arrow without prefix
bind -n M-Left  select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up    select-pane -U
bind -n M-Down  select-pane -D

And they work okay on Windows Bash but they don’t work on Windows Terminal. This is the cause, and this is the solution:

// Add any keybinding overrides to this array.
// To unbind a default keybinding, set the command to "unbound"
"keybindings": [
    { "command": "unbound", "keys": "alt+down" }, 
                  { "command": "unbound", "keys": "alt+left" }, 
                  { "command": "unbound", "keys": "alt+right" }, 
                  { "command": "unbound", "keys": "alt+up" }
]

This will unbind all uses of the Alt key on the terminal itself and pass them on to tmux.

After the sunrise

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
After the sunrise

Wiki.js 2 with Nginx Installation

For the past few months I’ve been using Tiddlywiki as a memory dump but been having some issues. First started with the dreaded XMLHttpRequest error:

Error retrieving skinny tiddler list: XMLHttpRequest error code: 404

Which the available documentation offers no help with and the developers just shrug at. Then it just ate a fucken shotgun shell deep down its throat:

Internal JavaScript Error: TypeError: etag is null

We en’t here for that shit so on we went looking for an alternative that treats markdown as a first-class white citizen in apartheid america. Found wiki.js, which seems to have that, and here we are.

What follows is a guide written after a week of bashing our head against multiple desks because devlopers are morons who don’t know how to write documentation, if they even bother writing any. What is available for wiki.js is fucken laughable or only applies to the 1.x series. Real developers are extinct, by the way.


This is what worked for us on Debian 9. You will have to adapt this for your own OS and hosting configuration. We’re not at fault if the results eat your pet, fuck your significant other, and make your mom call them daddy.

Ingredients

This assumes DNS is already routing properly, outgoing mail works, and you’ve already dealt with your firewall. This setup gets you a wiki.js installation with nginx as a reverse proxy running security.

All commands are executed as root.

Installation

Install what you need

# aptitude install nginx-extras postgresql postgresql-contrib pgcli nodejs certbot python-3-certbot-nginx

Download and extract wiki.js (assuming we’re at /var/www) like the documentation says:

# wget https://github.com/Requarks/wiki/releases/download/2.3.81/wiki-js.tar.gz
# mkdir wiki
# tar xzf wiki-js.tar.gz -C ./wiki
# cd ./wiki
# mv config.sample.yml config.yml

Configuration

Nginx

Edit your configuration file for nginx so it passes everything to the wiki cleanly through nginx. The original configuration was generated by nginxconfig.io and incorporates stuff from the official documentation

As of right now (2020-05-16_14-28) they are valid and working server blocks

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name wiki.domain.invalid;

    # SSL
    ssl_certificate /etc/letsencrypt/live/wiki.domain.invalid/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/wiki.domain.invalid/privkey.pem; #managed by Certbot
    ssl_trusted_certificate /etc/letsencrypt/live/wiki.domain.invalid/chain.pem;

    # security headers
    add_header X-Frame-Options "SAMEORIGIN" always;
    add_header X-XSS-Protection "1; mode=block" always;
    add_header X-Content-Type-Options "nosniff" always;
    add_header Referrer-Policy "no-referrer-when-downgrade" always;
    #add_header Content-Security-Policy "default-src 'self' http: https: data: blob: 'unsafe-inline'" always;
    add_header Strict-Transport-Security "max-age=0" always;

    # . files
    location ~ /\.(?!well-known) {
        deny all;
    }

    # logging
    access_log /var/log/nginx/wiki.domain.invalid.access.log;
    error_log /var/log/nginx/wiki.domain.invalid.error.log warn;

    # reverse proxy
    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version                  1.1;
        #proxy_cache_bypass                  $http_upgrade;
        proxy_set_header Upgrade            $http_upgrade;
        proxy_set_header Connection         "upgrade";
        proxy_set_header Host               $http_host;
        proxy_set_header X-Real-IP          $remote_addr;
        #proxy_set_header X-Forwarded-For    $proxy_add_x_forwarded_for;
        #proxy_set_header X-Forwarded-Proto  $scheme;
        #proxy_set_header X-Forwarded-Host   $host;
        #proxy_set_header X-Forwarded-Port   $server_port;
                proxy_next_upstream error timeout http_502 http_503 http_504;
    }

    # gzip
    gzip on;
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 6;
    gzip_types text/plain text/css text/xml application/json application/javascript application/rss+xml application/atom+xml image/svg+xml;
}

    # HTTP redirect
server {
    listen 80;
    listen [::]:80;

    server_name wiki.domain.invalid;

    # ACME-challenge
    location ^~ /.well-known/acme-challenge/ {
        root /var/www/_letsencrypt;
    }

    location / {
        return 301 https://wiki.domain.invalid$request_uri;
    }

 }

SSL

Using Let's Encrypt SSL certificates:

# certbot

Go through the wizard and it will automatically fix the SSL entries on your server blocks. You could also do this if you know what you’re doing and don’t want certbot to mess around with your files:

# certbot certonly --webroot -d wiki.domain.invalid --email mail@domain.invalid -w /var/www/_letsencrypt -n --agree-to-tos

Nginx Testing

Test and reload your configuration:

# nginx -t
# service nginx reload

Watch out for any errors, as usual. At this point Nginx will be serving files but as wiki.js isn’t setup yet you’ll get HTTP 502 errors if you try to visit the site on a browser. This configuration plays well with other sites being hosted on the same server.

Postgres

Secure your Postgres installation:

# sudo su postgres
$ passwd

Then setup your database. pgcli has smart completions turned on by default and looks pretty.

$ pgcli

> create DATABASE wikijs;
> create USER wikijs_user with ENCRYPTED PASSWORD 'Strong password';
> grant ALL PRIVILEGES on DATABASE wikijs to wikijs_user;
> CREATE EXTENSION pg_trgm;
> exit

$ exit

Wiki.js

Edit config.yml and make the appropriate changes:

  • Port should match what was configured in the nginx https server block (3000)
  • In db section, enter your database credentials
  • Do not enable SSL unless you are not to run this behind a proxy. This might work on a developer workstation but on the public internet you’re asking to get it up the ass, no lube.

Once this is done, start the application and watch for any errors

# node server

At this point you can visit your site and go through the installation wizard.

Configuration

There are a bunch of things the official wiki.js documentation only mentions offhandedly, or that you’ll only find out if you go rooting around in the issues tracker.

Home Page

You can name it anything you want but if you make the path anything other than /home wiki.js will freak out on you and send you on a loop.

File Storage

By default wiki.js will keep all its shit on the DB, which is a fucken stupid bad decision. We like making good decisions so we need to tell wiki.js to keep its shit in the filesystem:

  1. Go to Administration > Storage
  2. Enter the desired absolute path for your stuff, like /var/www/wiki.domain.invalid/wiki-content
  3. Enable the target
  4. Apply the changes

We’re unsure if this means wiki.js will actually use file storage to begin with, but at least you’ll be able to create quick backups of all your stuff. You have backups and you test them, right?

Search Engine

The default search is slow AF, so we’re going to use something better

  1. Go to Administration > Search Engine
  2. Select Database – PostgreSQL
  3. Apply the changes

Finishing thoughts

This thing has potential but it’s got a long way to go before it can look up to MediaWiki. If you find issues with this holler at me on the twitters.

It’s a deep, deep, rabbit hole

In this case the old West Indian world, of which Tennessee lay at the northern fringe. It’s the shatter-zone of the slave diaspora. Circulating currents. We gave Jamaica blues. Jamaica gave us ska. Jamaica gave us dub, we gave back hip-hop. It’s been happening for four hundred years.

Source: That Chop on the Upbeat

More than you thought you’d want to learn about the origins of ska.

Dell Wireless 1703 on Windows Server 2019

Recently at work I had to install this OS (with the Desktop Experience feature set) on a Dell XPS 8700. Windows was able to recognize everything properly and all components but the network adapter would show up in Device Manager. Tried the usual things to fix this:

  • Installing the driver from Dell; it would install but Windows would fail to make use of it.
  • Updating the driver using “Search automatically for updated driver software”. This would fail with Windows complaining about an issue with the INF.
  • Manually pick a driver from the filesystem. It would also fail with an error about the INF.

Looked at the INF file but there wasn’t anything in it that would make Windows Server just up and refuse to install the thing, and given there isn’t that much difference between Windows 10 and Windows Server the issue had to lie elsewhere.

There is one thing that Windows 10 does, however, and that’s automatically start WLAN services, since usually you’d see Windows Server be installed on enterprise hardware or have it connected to the network via Ethernet. Turns out Windows Server does not even install this feature on its own.

To install it:

  1. Click Start button.
  2. Type “Turn features on or off”.
  3. Click Next 4 times (Before you Begin, Installation Type, Server Selection (which defaults to the local server), and Features.
  4. On the Features selection list, scroll down to Wireless LAN Service and select it.
  5. Click Install and wait for the OS to do its thing.
  6. Reboot system. This is required for it all to work.

After the system comes back up the network adapter should be installed and enabled in Device Manager.

Ah, right… in addition to this it turns out the “Dell Update Application” totally does not work under this OS so you have to manually download and install all device drivers; this took me a couple of hours, so mind your clock.

This is most annoying

Riot tells Ars kernel-level system could be removed if vulnerability is detected.

Source: Ring 0 of fire: Does Riot Games’ new anti-cheat measure go too far? | Ars Technica

Given Riot’s labor and cultural practices I’m not holding much hope for them being able to fix issues quickly when (not if) someone breaks their driver and turns it into a rootkit like Sony’s.

Another issue the article does not go into is the fact every major game publisher will develop their own kernel-mode driver or use a 3rd party service (like BattlEye) to do so, leading to issues within the kernel that will be:

  • A pain in the ass to diagnose
  • Hidden from the player
  • Likely will not provide any kind of error message since the developers will be afraid they could be used to break the driver.
  • The risk of collisions between drivers will be increased, with likely both publishers being the cause.

Microsoft can help but there’s only so much they can do before breaking compatibility with previous versions of Windows; Gamers don’t care as much but Microsoft does have to worry about their main customer base (enterprise) who will definitely not like having weird code fuck around with workstation kernels(like this, and what Swift is complaining about is mere user-level applications.

People with time and money will probably want to look at PCI Passthrough to be able to run games in a Windows VM and not have to worry about any of this fuckery. Something goes wrong? Just restore to a previous snapshot of the VM and carry on as usual.

Lines

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
Lines

Emptiness

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
Emptiness

*shrug*

Life hasn’t changed much since the current pandemic started.

I’m still working nights, so I don’t really get to see that many people. I still order pretty much everything for delivery.

The gf is staying with me during almost-quarantine since she was able to get a job in a restaurant (!!!).

Life goes on but I can see how it is changing for everyone around me.

The new normal

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
The new normal

It’s quiet…

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
It's quiet...

Moosey

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
Moosey

Monday night

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
Monday night

This is my “I’m being a shill” moment

I recently discovered Instacart is able to deliver Costco and…

OMFG

GAME CHANGER. STUFF is CHEAP and at VOLUME.

Granted, not Commercial Foodservice Company cheap, but for home use this is fucken ferpect.

  • Got 20 lb Basmati rice for like, 20 bucks.
  • 6 lb of pasta elbows for *checks notes* 6 bucks
  • Eggs are stupid cheap, pick how many you want.
  • Bleach? I got me a lot of bleach.
  • EVOO! A gallon of it is 15 bucks!
  • Canola oil! 6 qt are 10 bucks!

I got some more things to round out the pantry for pasta production but for getting all of this stuff delivered? I can probably order once a month and 80% of my grocery shopping is done right there and then.

Now, they don’t have everything at the store available. They don’t have kosher salt (well they do but it’s the Kirkland brand. I prefer Morton or Diamond). The meat and fish selection is somewhat limited but they got the basics on there. Produce is good but I’d rather mosey down to the neighborhood coop for that.

Again, for me the angle here is the delivery; I bike everywhere and carrying all the stuff on my last order on my bike rack would probably require at least 5 trips, so the 8.99 delivery charge is totally worth it. This isn’t a promoted post (ugh) but there are many use cases for exactly this kind of thing at this volume, which is right in between “let’s pick up groceries on the way home” and “I need to open a sysco/us foods/reinhart account”:

  • People with more than two kids. Kids eat a fucken hell of a lot. You ate a lot when you were a kid, you just don’t remember it.
  • Disabled/sick people.
  • People who literally don’t have the time, like when you’re working 2 full-time jobs. Good luck finding time to cook, much less to buy the groceries.
  • People without cars, like myself.

Anyway, click on this here referral link so I get a fucken discount on my next order and you get cheap groceries. Everyone wins.

Earlier today…

        <a href="https://www.flickr.com/people/nullrend/">nullrend</a> posted a photo:
Earlier today...

And in that moment I was happy

So the coffee grinder that I have is… mine! All mine!

First time in my life I’ve got a coffee grinder for my own use without having to depend on work to be able to grind beans using a quality device. It’s just a “cheap” Baratza Virtuoso I got off Amazon but… again, it’s all mine and no one else’s.

I won’t have to wait for a distracted barista at any of the coffee shops in town to grind the coffee for me. I’ll be able to do a good— nay, a great! cup of french press, or Hario V60 pourover. I’ll be able to do cold press in a good way without having to waste ground beans.

I won’t have to deal with the li’l temperamental pice grinder I’ve been using for years to brew my stuff. I can actually use to grind y’know, spices; at least until I get an actual burr grinder for said spices.

Yesterday I used it for the first time for a couple of cups of french press.

It was perfect.