Skip to content

Enable Deep Sleep mode on Tuxedo Computers Pulse 15 Gen2

A while ago we bought new Pulse 15 laptops from Tuxedo Computers.

Installed Ubuntu on them, and for a while the sleep mode was nagging me, it does not really work. Today I found time to investigate this issue.

First let's find out which sleep mode is enabled:

cat /sys/power/mem_sleep
[s2idle]

Something is wrong here. Not only can't I set the sleep mode to the desired "deep" mode, the "deep" mode is not even available. That explains why things are not working as expected.

After some research it turns out that this might be a BIOS problem. Prepare to reboot!

After the laptop powers up, press the "Del" key until the BIOS comes up. Then navigate to "Advanced Settings" -> "AMD PBS" -> "S3/Modern Standby Support".

The default is "Modern Standby Enable", but it turns out that this is the culprit. Changing this to "S3 Enable" and then reboot fixes the problem and "deep" now shows up in the available Linux Power States.

Then follow the description in this link, and permamently set the sleep mode to "deep".

cat /sys/power/mem_sleep
s2idle [deep]

 

Obsidian: Paste URL into selection

I have a few community plugins enabled in my Obsidian. One of them is "Paste URL into selection" - and it fits very well into the Markdown workflow. Also what you might know from other tools like Slack.

In Markdown, a link is created using square brackets and round brackets. The description text for the link goes into the square brackets, the URL into the round brackets:

[This is a link to the Obsidian website](https://obsidian.md/)

Now, usually I write the text first, and then later on add the link. Without this plugin, I have to add the square brackets manually, then add the round brackets and insert the link.
With the Paste URL into selection plugin, I copy the link, select the text in Obsidian and press Ctrl+V. The plugin creates the Markdown link automatically.

It's not much, but it's really useful when writing larger texts with many links!

Show me recent notes in my Obsidian Work Vault

In the previous Obsidian blog posting about managing tasks I showed a note which lists all open tasks in my Work vault. This gives me quick access to all open tasks.

In the same way I use another note quite often which shows me recently added and changed files in my Work vault.

 

Continue reading "Show me recent notes in my Obsidian Work Vault"

Show me all open Work tasks in Obsidian

My Obsidian vault is "all-in-one", personally I don't like switching between multiple vaults for work and private stuff, and I organize it in a way to keep things separated in one vault. Multiple templates I'm using automatically generate Tasks in my vault, therefore I need a convenient way to see open work tasks. This blog posting describes the approach I'm using.

In my vault I have a folder "Work", that's where all the work stuff lives, obviously. In this folder is a note named "Open Work Tasks". Here's the note, which is mostly DataView queries.

## Open Work Tasks

```dataview
TABLE WITHOUT ID regexreplace(Tasks.text, "\[.*$", "") AS Task, choice(Tasks.completed, "🟒", "πŸ”΄") AS Status, file.link AS "File"
FROM "Work"
FLATTEN file.tasks AS Tasks
WHERE file.tasks AND !Tasks.completed AND Tasks.text != ""
```

### Grouped list

```dataview
TASK 
FROM "Work"
WHERE !completed AND text != ""
GROUP BY section
```

### Dates for Tasks

[Documentation](https://publish.obsidian.md/tasks/Getting+Started/Dates)

- πŸ“… Due Date
- ⏳ Scheduled Date
- πŸ›« Start Date
- βž• Created Date
- βœ… Done Date

### Tasks with invalid dates

```tasks
(created date is invalid) OR (done date is invalid) OR (due date is invalid) OR (scheduled date is invalid) OR (start date is invalid)
```

Let's go over this in detail:

Open Work Tasks

This DataView lists all open tasks, which have a text. Part of the templates is a "ready-to-go" task without text in the "Decisions" section, but such tasks are not listed here.

The query is limited to the "Work" folder, therefore excluding all other tasks somewhere else in the vault.

This list is flattened, which means that it shows all tasks, not grouped, no matter where in the vault under "Work". That's helpful to see where I still have work to do. At some point I may integrate this into Todoist, but so far it works well for me.

Grouped list

This list shows the same entries as the previous list, but groups the entries by source file. This gives me an idea if I have some "heavy work" open where multiple tasks require my attention for the same issue.

Dates for Tasks

This section is mostly documentation (for me). It helps me to quickly remember how to do all the different date forms the Task plugin can do.

Tasks with invalid dates

This last section is supposed to be empty at all times. It's simply a query which shows all Task entries (this time in the entire vault) which have invalid dates. The kind of mistakes which can happen when adding dates in free text form.

Summary

I try to work on open tasks as soon as possible, which means that I rarely have more than a few tasks open here - in contrary to my todo list in Todoist, which is quite large, but managed in a different way.

The two DataView queries provide me all the information I need to quickly find all remaining open Work tasks.

Image

Photo by Glenn Carstens-Peters on Unsplash

Daily Notes in Obsidian

Obsidian is a note-taking software and knowledge base software, where the notes/files are written in Markdown. For quite a while I'm using it in my daily work.

One of the cool features it has is named "Daily Notes". As the name implies, there is a new note generated for every day. For me, this is used for writing down notes which do not deserve their own note. But also this is rather heavily used to share all kind of content from my mobile devides into the daily note in the first place. Content doesn't have to stay there, in fact most of it is either handled one way or another, or is moved to a different place. But it is a very nice collection point in the first place.

By default they are created in the main folder of the Obsidian vault - over time, these are hundreds of files, and no real structure. Which deserves to organize the Daily Notes in a better way.

 

Continue reading "Daily Notes in Obsidian"

KeepingYouAwake on Mac OS X

On my Mac, one of the annoying "features" is when the Mac screensaver comes on, the device eventually goes to sleep, and it disconnects the network. Which in turn timeouts services like Slack or Google, because these services keep a network connection open at all times. When waking up the device, I often have to login again into all the services, even though the device is just sitting in my working room on the desk all day and night. Very annoying.
I suppose it's one of these things where Apple thinks they know better how users want their device to behave.

KeepingYouAwake is a nice little tool which prevents all of this.

When it is running and activated, it prevents the Mac from going to sleep. Which in turn never deactivates the network. And never timeouts the online services.

What's not to love about it?

Picture made by Anton Atanasov

Extract better GPS coordinates from images using exiftool

Sometimes I have to extract Exif information from images, mostly the GPS coordinates. The coordinates coming raw from the images are not very helpful. Let's look at a picture I took today:

Bowl of ice cream

darktable shows the following coordinates:

latitude: N 52Β° 40,198'
longitude: E 013Β° 16,852'
elevation: 93,90 m above sea level

Now that is not very helpful, because neither OpenStreetMap nor Google recognize this format out of the box:

N 52Β° 40,198' E 013Β° 16,852'

Coordinates not working in OpenStreetMap

Coordinates not working in Google

Bummer. And I don't have the time or energy to fix that every time I need the coordinates. Luckily exiftool can output the coordinates in different formats, which is super helpful. For my use cases I choose the Degrees.MinutesSeconds format, also named "Decimal degrees", or DD. This format shows latitude and longitude geographic coordinates as decimal fractions of a degree.

exiftool -time:all -location:all -G -a -s -c "%.6f"

The explanation for the options used here:

  • -G: Print group name for each tag
  • -a: Allow duplicate tags to be extracted
  • -s: Short output format
  • -v: Print verbose messages
  • -q: Quiet processing
  • -c "%.6f": Set format for GPS coordinates

Using these settings, I get the following coordinates:

[Composite] Β  Β  GPSAltitude Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  : 93.9 m Above Sea Level
[Composite] Β  Β  GPSLatitude Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  : 52.669959 N
[Composite] Β  Β  GPSLongitude Β  Β  Β  Β  Β  Β  Β  Β  Β  Β : 13.280862 E
[Composite] Β  Β  GPSPosition Β  Β  Β  Β  Β  Β  Β  Β  Β  Β  : 52.669959 N, 13.280862 E

Which sure enough brings me right to the ice cream place "Il Pistacchio" in Hohen Neuendorf, which I visited earlier today.

Il Pistacchio on OpenStreetMap

Watch for changed files in SyncThing

For syncing files between my devices I'm using SyncThing. This tool is reliable, available on Linux, Android, Mac and iOS. And it encrypts the communication.


But sometimes I want to know when files in certain directories have changed - as example in my Obsidian vault. This allows me to post-process the files.

Some of the use cases I have in Obsidian:

  • Resolve links in Daily Notes: when I share a URL from my RSS reader or from other sources into Obsidian, the URL sometimes is just a link to a URL shortener. I then later need to resolve the link - or let a script do it right away for known shortlinks, and update the daily note.
  • Remove tracking information from URLs: many shared links include campaign and tracking information, and this can be removed straight away.
  • Extract content from certain Toots: I follow a couple interesting accounts on Mastodon, and when I share the Toot link into Obsidian, the script extracts the Toot content and adds it, along with the original link, to a pre-defined note.
  • Extract links from Toots: many news websites include a link (sometimes again with tracking information) in their Toots. When I share such a Toot into Obsidian, a script picks up the link, extract the target link and updates the daily note.

All of this is not very complicated, and a couple of lines in Python do the job. The main parts for the script are:

  • extract the API key from the SyncThing configuration
  • Open a connection to the local SyncThing instance
  • Watch for certain events

 

Continue reading "Watch for changed files in SyncThing"

fwupdmgr: /usr/libexec/fwupd/efi/fwupdx64.efi and /usr/libexec/fwupd/efi/fwupdx64.efi.signed cannot be found

From time to time our laptops receive firmware updates, by using the Linux Vendor Firmware Service (short: fwupd). This worked fine for a long time, until it didn't. One day I was facing the following error message:

root@laptop:/root# fwupdmgr update

╔══════════════════════════════════════════════════════════════════════════════╗
β•‘ Upgrade Embedded Controller from 0.1.23 to 0.1.25?                           β•‘
╠══════════════════════════════════════════════════════════════════════════════╣
β•‘                                                                              β•‘
β•‘ ...                                                                          β•‘
β•‘                                                                              β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Perform operation? [Y|n]: 
Downloading…             [***************************************]
Decompressing…           [***************************************]
Authenticating…          [***************************************]
Waiting…                 [***************************************]
Waiting…                 [***************************************]
/usr/libexec/fwupd/efi/fwupdx64.efi and /usr/libexec/fwupd/efi/fwupdx64.efi.signed cannot be found

During the first few occasions I basically ignored the error message, and attributed it to a glitch in a software package. Maybe a later update will fix this.

But this never happened, so I looked into the issue.

Ubuntu split the 1.6.x version of fwupd into separate packages, and does not install the packages fwupd-signed and fwupd-unsigned to deal with EFI binaries.

apt-get install -y fwupd-signed fwupd-unsigned

Now everything is working again:

root@laptop:/root# fwupdmgr update
╔══════════════════════════════════════════════════════════════════════════════╗
β•‘ Upgrade Embedded Controller from 0.1.23 to 0.1.25?                           β•‘
╠══════════════════════════════════════════════════════════════════════════════╣
β•‘                                                                              β•‘
β•‘ ...                                                                          β•‘
β•‘                                                                              β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Perform operation? [Y|n]: 
Downloading…             [***************************************]
Downloading…             [***************************************]
Decompressing…           [***************************************]
Authenticating…          [***************************************]
Waiting…                 [***************************************]
Writing…                 [***************************************]
Waiting…                 [***************************************]
Successfully installed firmware
Do not turn off your computer or remove the AC adapter while the update is in progress.
Waiting…                 [***************************************]

Voila! Also updated the playbook which installs the laptops, to include the two new packages.

Dynamic content in static websites in Hugo

With people moving away from Twitter, mostly to Mastodon, discovering the new accounts became a problem.

For people in the PostgreSQL community I created a website which lists different social media accounts. This website is part of the "PostgreSQL Person of the Week" interview project, however the data source is dynamic, and stored in a different repository. This allows me to keep the repository for the website private, but publish the data for the social media links - this data is public anyway. The interview repository is private, because who wants to see upcoming interviews anyway? ;-)

The interview website is made with Hugo, a static website generator. Normally Hugo looks for content, templates, and other data in the current directory - my private repository.

As part of compiling the website, Hugo can fetch external data, either in JSON or CSV format. This is using the getJSON() and the getCSV() functions, which can be used in Shortcodes, as example.

 

Continue reading "Dynamic content in static websites in Hugo"

Fix LXC network issues in Ubuntu 22.04

Ran into a curios problem while updating the GitHub Actions Workflow for a project:

Run sudo lxc exec test-container --env DEBIAN_FRONTEND=noninteractive -- apt-get -y install -y openssh-client openssh-server openssh-sftp-server
Reading package lists...
Building dependency tree...
Reading state information...
openssh-client is already the newest version (1:8.9p1-3).
The following additional packages will be installed:
  libpsl5 libwrap0 ncurses-term publicsuffix python3-distro ssh-import-id wget
Suggested packages:
  molly-guard monkeysphere ssh-askpass ufw
The following NEW packages will be installed:
  libpsl5 libwrap0 ncurses-term openssh-server openssh-sftp-server
  publicsuffix python3-distro ssh-import-id wget
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 1371 kB of archives.
After this operation, 7679 kB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 openssh-sftp-server amd64 1:8.9p1-3

...

Ign:9 http://archive.ubuntu.com/ubuntu jammy/main amd64 ssh-import-id all 5.11-0ubuntu1
Err:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 openssh-sftp-server amd64 1:8.9p1-3
  Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable) Could not connect to archive.ubuntu.com:80 (185.125.190.39), connection timed out Could not connect to archive.ubuntu.com:80 (185.125.190.36), connection timed out Could not connect to archive.ubuntu.com:80 (91.189.91.39), connection timed out

...

E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/ssh-import-id/ssh-import-id_5.11-0ubuntu1_all.deb  Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::19). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2620:2d:4000:1::16). - connect (101: Network is unreachable) Cannot initiate the connection to archive.ubuntu.com:80 (2001:67c:1562::18). - connect (101: Network is unreachable)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Error: Process completed with exit code 100.

For the tests, I'm spinning up a LXC container on the Runner, and then try to install software in it. This specific Runner is using Ubuntu 22.04 (new), and the network connection to archive.ubuntu.com is failing. Another Runner in the same workflow, using Ubuntu 20.04, is working fine. 20.04 was the old test setup, 22.04 is the new one. No other changes. But why is it suddenly failing?

 

Continue reading "Fix LXC network issues in Ubuntu 22.04"

GitHub Actions: Node.js 12 actions are deprecated

If you use GitHub Actions to run Workflows and tests, you might have spotted this warning recently:

Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2

This warning means that GitHub will deprecate a certain action, which checks out the repository into the runner. This is going on since early 2022 and by summer 2023 they plan to upgrade all actions to v16.

 

Continue reading "GitHub Actions: Node.js 12 actions are deprecated"

GitHub Actions: The `set-output` command is deprecated and will be disabled soon

If you use GitHub Actions to run Workflows and tests, you might have spotted this warning recently:

The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

This warning means that GitHub will deprecate a certain syntax which populates variables, and disables it by end of May 2023.

 

Continue reading "GitHub Actions: The `set-output` command is deprecated and will be disabled soon"

Install Firefox PPA version over Snap version

It was time to update my laptop, and I already knew that the update will bring Snap, and installs the Snap Firefox version. Along with many known problems. Previously the laptop was on 20.04 LTS, but this version is about to loose support.

I ran through the upgrade, and then added an Ansible Playbook to handle the Firefox installation, remove the Snap version and install the PPA version. Most of my laptop configuration is handled using Ansible Playbooks.

 

 

Continue reading "Install Firefox PPA version over Snap version"

Using fail2ban to block unfriendly web requests

Every time I peek into the webserver logfiles, I find quite a few 404 requests trying to figure out if certain exploits exist on this server. Now I get that these are automated attempts, and the number of requests coming from one IP show that they try several different exploits and path names. Nevertheless I thought that I don’t need this in my log, and on my webserver. fail2ban for the rescue.

 

Continue reading "Using fail2ban to block unfriendly web requests"