Attaching a Nextcloud account to Nautilus via WebDAV in Ubuntu 16.04

  1. Go to your Nextcloud account security settings using a browser. Create a new app password.
  2. Open Nautilus and select Connect to Server from the left sidebar.
  3. Enter
    davs://YOUR-DOMAIN.TLD/PATH/remote.php/dav/files/YOUR-USERNAME/

    substituting YOUR-DOMAIN.TLD/PATH and YOUR-USERNAME as needed. If your server is not using https, substitute davs:// with dav://. (Also, shame on you.)

  4. Enter your username and app password (created at step 1, above) when prompted.

How to delete unwanted dav mount from Nautilus sidebar (Places) in Ubuntu 16.04

I had previously linked a Nextcloud account somehow (possibly through Online Accounts in Gnome’s Control Center) so that it was present in Nautilus, and there was no GUI means to remove it.

What I did to finally make it go away was to first open Seahorse and the Login keyring therein, and delete all keys related to the account. I then deleted ~/.config/goa-1.0/accounts.conf.

My accounts.conf only had the unwanted account in it, so you need to edit it instead of deleting it if yours has other accounts that you wish to preserve.

Deleting the keys (in Seahorse) may not be necessary, but didn’t hurt either.

Only every other boot succeeds with Ubuntu 18.04 on Thinkpad X60 (with every other boot in between ending in blank screen)

(Just helping Google out here.)

This seemingly weird issue of cold boot and every other boot thereafter failing (with successful boots in between) is mediated by Grub’s recordfail functionality: after a failed boot, the next boot is forced into linux_gfx_mode=text (see /boot/grub/grub.cfg), which then results in a successful boot.

The core issue is the failing boot, which in the case of Thinkpad X60 is probably LP #1724639 (although the report and comments are all over the place, making the report pretty useless).

To work around it, add GRUB_GFXPAYLOAD_LINUX=text to /etc/default/grub and run sudo update-grub.

This forces Grub to always boot in text mode, which is less pretty ofc, but at least it doesn’t hang.

Xorg ServerLayout identifier

From the “Serverflags” (note the miscapitalisation) Section in man Xorg.conf:

Option DefaultServerLayout layout-id
This specifies the default ServerLayout section to use in the absence of the -layout command line option.

From man Xorg: “By default the first Layout section is used.”

The table of Contents lists no “Layout” section, only ServerLayout (and, again, inconsistently titles it “Serverlayout”).

Make of this crap what you will.

Kotiboksi Bewan iBox A5100 (Arcadyan ARV4510EPW-A-LF-L3, valkoinen antenni) langattomaksi sillaksi OpenWrt 18.06.2:lla

Tässä on lähtötilanteena, että Kotiboksissa on jo OpenWrt 18.06.2, eli sen asennusohjeita joudut tarvittaessa etsimään muualta. Lisäksi oletuksena on, saatavilla on jo toinen reititin (alempana “gateway-reititin”) tarjoamassa langatonta yhteyttä lähiverkkoon (ja Internetiin). Tarvitset sen IP-osoitteen. Lisäksi tarvit tietokoneen (alempana “PC”), jossa on ssh-asiaksohjelma ja ethernet-liitin, sekä ethernet-kaapelin.

Teen tässä Kotiboksin neljännestä LAN-portista (WAN-portti) erillisen hallintaportin, jotta PC:n ja Kotiboksin IP-osoiteasetuksia ei tarvitsisi mulkata yhteyden säilymisen takia. Lisäetuna on, että sen jälkeen asetuksia on vähän vaikeampi saada niin solmuun, että niiden täysnollaus ja kokonaan alusta aloittaminen on tarpeen.

(Sovelsin tämän reseptin Karl Stenerudin Relayd Wireless Bridge in OpenWRT -ohjeista.)

Alkutoimet

  1. Palauta Kotiboksi (OpenWrt:n) tehdasasetuksille.
  2. Irrota PC muista verkoista (huom.: myös langattomista).
  3. Kytke ethernet-kaapeli Kotiboksin LAN1-portin ja PC:n välille.
  4. Avaa PC:n selaimella http://192.168.1.1/ ja kirjaudu pääkäyttäjänä (root, salasana on tyhjä).
  5. System > Administration: aseta pääkäyttäjälle salasana.
  6. Save & Apply
  7. System > System: aseta aikavyöhyke ja valitse Sync with browser.
  8. Aseta mieluisa Hostname.
  9. Save & Apply

Langattoman yhteyden luonti

  1. Network > Wireless: SSID “OpenWRT”: Edit
  2. Advanced Settings: valitse Country Code -valikosta FI
  3. Wireless Security: Encryption: WPA2-PSK, syötä hyvä salausavain
  4. Save & Apply
  5. Network > Wireless: SSID “OpenWRT”: Enable
  6. Valitse radio0:n Scan.
  7. Kytkeydy gateway-reitittimen langattomaan verkkoon (Join Network).
  8. Syötä verkon salasana.
  9. Submit
  10. Operating frequency / Channel: auto
  11. Mode: Client (huom.: pelkkä “client”, ei siis WDS Client)
  12. Save & Apply
  13. Network > Diagnostics: varmista, että ping toimii.

Hallintaportin (etherwan) luonti

  1. Network > Switch: Add
  2. Ota VLAN 1:n LAN 4 -portti (joka on untagged) pois päältä (off) ja luo uusi VLAN (nro 2) seuraavasti:
    VLAN ID CPU (eth0) LAN 1 LAN 2 LAN 3 LAN 4
    1 tagged untagged untagged untagged off
    2 tagged off off off untagged
  3. Save & Apply
  4. Network > Interfaces: Add new interface
  5. nimeksi etherwan
  6. Protocol: Static address
  7. Cover the following interface: Switch VLAN: "eth0.2" (eli edellä luotu VLAN 2)
  8. Submit
  9. Setup DHCP server
  10. IPv4 address: 192.168.100.1
  11. IPv4 netmask: 255.255.255.0
  12. Advanced Settings: Override MAC address: 00:11:22:33:44:56
  13. Save & Apply

Relayd:n (ja nettilediajurin) asennus

  1. Ota PC:n ssh-asiakasohjelmalla yhteys Kotiboksiin:
    $ ssh root@192.168.1.1
  2. # vi /etc/opkg/distfeeds.conf
  3. Kommentoi pois openwrt_telephony-rivi (viimeinen) (lisäämällä # sen edelle). Tallenna ja poistu.
  4. root@OpenWrt:~# opkg update
  5. root@OpenWrt:~# opkg install luci-proto-relay kmod-ledtrig-netdev
  6. root@OpenWrt:~# exit

LAN-verkon osoitteenmuutos

  1. Irrota ethernet-kaapeli Kotiboksin LAN-portista ja odota että PC:n ethernet-portti hiljenee (unohtaa vanhan IP-osoitteensa).
  2. Kytke ethernet-kaapeli Kotiboksin WAN-porttiin (LAN4).
  3. Avaa PC:n selaimella http://192.168.100.1/ ja kirjaudu sivulle pääkäyttäjänä.
  4. Network > Interfaces: valitse LAN muokattavaksi (Edit).
  5. Vaihda IPv4 address -arvoksi 192.168.2.1
  6. Aseta IPv4 gateway -arvoksi gateway-reitittimen IP-osoite (useimmiten 192.168.1.1).
  7. Valitse Disable DHCP for this interface.
  8. Save & Apply

Siltaus

  1. Network > Interfaces: Add new interface.
  2. Anna liitännän nimeksi stabridge.
  3. Protocol of the new interface: Relay bridge
  4. Submit
  5. Local IPv4 address -arvoksi gateway-reitittimen osoite (sama kuin LAN-verkon IPv4 gateway -arvo) edellä).
  6. Relay between networks: lan ja wwan
  7. Save & Apply

Palomuurivyöhykkeiden päivitys

  1. Network > Firewall: poista kaikki vyöhykkeet.
  2. Add
  3. Anna vyöhykkeen nimeksi bridgezone.
  4. Aseta Input, Output ja Forward accept-tilaan.
  5. Covered networks: lan ja wwan
  6. Save & Apply

Viimeistely

  1. Irrota ethernet-kaapeli Kotiboksin wan-portista ja odota että PC:n ethernet-portti hiljenee (unohtaa vanhan IP-osoitteensa).
  2. Kytke ethernet-kaapeli Kotiboksin LAN1-porttiin.
  3. Testaile PC:llä, että kaikki toimii niin kuin lopulta pitäisi.
  4. Sammuta Kotiboksi ja käynnistä se sitten uudestaan. Varmista, että kaikki toimii edelleen.
  5. Irrota ethernet-kaapeli Kotiboksin lan-portista ja odota että PC:n ethernet-portti hiljenee (unohtaa vanhan IP-osoitteensa).
  6. Jos PC:ssä on langaton verkko, yhdistä Kotiboksin langattomaan ja varmista, että kaikki toimii senkin kautta niin kuin pitää. Irrota PC lopuksi taas Kotiboksin langattomasta (ja muistakin verkoista).
  7. Kytke ethernet-kaapeli Kotiboksin wan-porttiin (LAN4).
  8. Avaa PC:n selaimella http://192.168.100.1/ ja kirjaudu sivulle pääkäyttäjänä.
  9. System > LED Configuration: virittele LEDit mieluisiksi.

How to detach the green latch (P1-595349) used in some HP SFF computers’ slim optical drives

I’m talking about this:

HP DS-8A8SH locking mechanism

Now, forget about that weird screw head looking thing, it’s there just to guide the thing in place when they’re installing it, and to keep it from sliding off when in place.

The whole part is actually just kept in place by a small piece of adhesive in the middle. So there’s no need for a screwdriver at all here, as you can just carefully pry the damn thing off:

HP P1-595349 detached

Change keyboard layout when booting Ubuntu 18.04 live cd/USB in UEFI

I’m selecting the Finnish locale and keyboard layout here, YMMV.

  1. With the Try Ubuntu option selected, hit ‘e’ to enter the boot parameter editor
  2. Go to the end of the line with linux kernel boot parameters (they perhaps end with quiet splash --) and add these parameters: locale=fi_FI console-setup/layoutcode=fi (so that, if the previous example holds, it now ends with quiet splash -- locale=fi_FI console-setup/layoutcode=fi)
  3. Hit Ctrl-x to boot

Apache 2.4: Require (allow) either (mod_auth_basic) valid-user or a specific query string

Prerequisities:

  • Apache 2.4
  • you have set up your htpasswd file in /path/to/.htpasswd
  • the alternative, secret query parameter for access is secret_access_parameter

To make it work, add these lines to the appropriate section of your Apache vhost configuration:

Require all denied
<RequireAny>
  Require valid-user
  Require expr "%{QUERY_STRING} =~ /secret_access_parameter/"
</RequireAny>
AuthType Basic
AuthName "Authorization required"
AuthUserFile /path/to/.htpasswd