recycledspace.com my laboratory experiment served hot by Benoit Beauchamp

linux tag

Using obsidian-remote

Recently, I discovered a new way to use obsidian in a VNC session and it has been a game changer for me. I know, I know, you might be thinking, “Why would I want to do that?” Well, let me tell you, the answer is simple - because it’s awesome!

Let me give you a little background on how I stumbled upon this amazing discovery. As a #homelab enthusiast, I am always looking for ways to optimize my workflow and make things easier for myself. One of my latest projects was to sync my obsidian vault to a headless server. For those of you who are not familiar, a headless server is a computer without a monitor, keyboard, or mouse, and is usually controlled remotely.

Now, I am currently using Synology for my homelab and I didn’t want to rely on another computer to sync my obsidian vault with it. That’s when the idea struck me - why not run obsidian in a VNC session on my Synology? And let me tell you, it was a brilliant idea.

For those who are not familiar, VNC (Virtual Network Computing) is a graphical desktop sharing system that allows you to remotely control another computer. And the best part is, I could connect to my Synology over the web through Tailscale, making it even more convenient. If you don’t know what Tailscale is, oh boy, you are in for a treat. You can go check it out. I give you permission. ;-)

So, I did a little research and came across the obsidian-remote repo on GitHub. I made a few modifications to the files and voila, I was able to run obsidian in a VNC session on my Synology. It was like a dream come true for me. Now, I can access my obsidian vault from anywhere, anytime, without having to rely on another computer.

I am sure some of you might be wondering, “But how does this benefit me?” Well, let me tell you, the possibilities are endless. Whether you are a student, a writer, a researcher, or just someone who loves to organize their thoughts, obsidian in a VNC session can make your life so much easier. You can access your vault from any device, as long as you have an internet connection. No more worrying about forgetting important notes or files on a different computer. Obsidian Sync also provides version history for a year, allowing you to revert to previous versions of notes at any time. I should mention that I am not exposing any ports on the internet. Everything is through Tailscale. I’m using their free tier as a solo #homelab enthusiast.

Enough of the chit-chat, here is what I did. I modified a few files from the obsidian-remote repo.

git clone https://github.com/sytone/obsidian-remote

I changed the Dockerfile.

FROM ghcr.io/linuxserver/baseimage-kasmvnc:debianbookworm

# Update and install extra packages.
RUN echo "**** install packages ****" && \
    apt-get update && \
    apt-get install -y --no-install-recommends curl libgtk-3-0 libnotify4 libatspi2.0-0 libsecret-1-0 libnss3 desktop-file-utils fonts-noto-color-emoji git ssh-askpass && \
    apt-get autoclean && rm -rf /var/lib/apt/lists/* /var/tmp/* /tmp/*

# Set version label
ARG OBSIDIAN_VERSION=1.5.11

# Download and install Obsidian
RUN echo "**** download obsidian ****" && \
    curl --location --output obsidian.deb "https://github.com/obsidianmd/obsidian-releases/releases/download/v${OBSIDIAN_VERSION}/obsidian_${OBSIDIAN_VERSION}_amd64.deb" && \
    dpkg -i obsidian.deb

# Environment variables
ENV CUSTOM_PORT="8083" \
    CUSTOM_HTTPS_PORT="8443" \
    CUSTOM_USER="" \
    PASSWORD="" \
    SUBFOLDER="" \
    TITLE="Obsidian v${OBSIDIAN_VERSION}" \
    FM_HOME="/vaults"

# Add local files
COPY root/ /
EXPOSE 8083 8443
VOLUME ["/config","/vaults"]

# Define a healthcheck
HEALTHCHECK CMD curl --fail http://localhost:8083/ || exit 1

I also changed a few files in the /root directory to remove sudo in the menu.xml and autostart file. You might want to check your config folder in your docker-compose.yml to see it stuck. I did this a couple times. I remove one line in the startwm.sh that started a script called pulseaudio. I don’t need that so I didn’t really care. I could probably connect the audio to a machine but that’s not my use case.

I proceed to build it with the usual docker build . -t obsidian-remote. After building the container, I modified the docker-compose.yml to suit my need and came up with this one.

services:
  obsidian:
#    image: 'ghcr.io/sytone/obsidian-remote:latest'
    image: obsidian-remote:latest
    container_name: obsidian-remote
    restart: unless-stopped
    healthcheck:
      test: curl -f http://localhost:8080/ || exit 1
    ports:
      - 8083:8083
      - 8443:8443
    volumes:
      - /my/homes/vault:/vaults
      - ./config:/config
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Montreal
      - DOCKER_MODS=linuxserver/mods:universal-git
      - CUSTOM_PORT=8083
      - CUSTOM_HTTPS_PORT=8443
      - CUSTOM_USER=
      - PASSWORD=
      - SUBFOLDER

Everything seems to be working. I sync my vault to my Synology using Obsidian sync which I pay for. Pretty happy to be able to do this.

Find me on @benoitb@mas.to mastodon if you have any questions.

Fixing Crackling Sound Issue with AlsaMixer

To fix the crackling sound issue with muting and unmuting the sound, you can follow these steps:

  1. Open the terminal and enter the command alsamixer to launch the AlsaMixer interface.
  2. Use the F6 key to select the default sound card.
  3. Use the arrow keys to navigate to the S/PDIF option.
  4. Press the ‘M’ key to mute the S/PDIF option.
  5. Press the ‘M’ key again to unmute the S/PDIF option.

By muting and unmuting the S/PDIF option, you can potentially resolve the crackling sound issue. This method has worked for some users who experienced similar problems.

If you are using a dock with a keyboard, mouse, and external monitor attached, this solution might work for you as well. Give it a try and let me know how it goes!

Please note that these instructions are specific to AlsaMixer and may not apply to other sound control applications.

I hope this helps!

Reload udev rules without rebooting

A simple way to reload udev rules and trigger the new rules all wrap into a oneliner.

$ udevadm control --reload-rules && udevadm trigger

Using Linux Tools To Send To DayOne App

Ive started getting back into journaling with DayOne recently. The reason why I like using DayOne is supper simple. It’s a great interface. The sync features is great. It works with IFTTT. It great with photo journaling. It has a bunch of workflow goodness on the iOS platform using workflow.app and launch center pro. The problem I do have is that I spend quite a bit of time using my Debian box. I hope my information is secured in the clouds within DayOne biosphere. In short I love being able to use the app on my iOS devices. One thing that was bothering me a bit was that I wanted to be able to use it on my computer which like I said its running Debian. I stumbled awhile ago jrnl. Its a great way to keep a journal using the command line which is where I like to live. I wanted to send my journal entries to DayOne from jrnl which is super easy. On this computer I also setup mutt with my gmail account. The glue between jrnl and DayOne is ifttt.com. I have a recipe that when I send an email to trigger@recipe.ifttt.com it forwards it to my DayOne journal. The recipe in question is this one applets.

$ jrnl “Hey look, im using the command line to send to DayOne” $ jrnl -n 1 | mutt -s “command line awesomeness” trigger@recipe.ifttt.com

How cool is that? Maybe I can also send my DayOne entry to jrnl.