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!

My updated music setup

I've updated how I use part of my music system at home from the previous example here. I took inspiration from the following mopidy issue at GitHub.The big difference in how I've set it up before is that mopidy now use the audio output and send it to a UDP sink with the following tibits.

[audio]
output = tee name=t ! queue ! autoaudiosink t. ! queue ! udpsink host=127.0.0.1 port=5555

I then use socat to make it a fifo so that forked-daapd can stream it wherever I want. Here is the script that I use to launch it during boot.

#!/bin/bash

createFifo() {
fifo='/srv/music/mopidy.fifo' # this is where my forked-daapd will read it
rm $fifo

mkfifo "$fifo"
while :; do socat -d -d -T 1 -u UDP4-LISTEN:5555 OPEN:"$fifo"; done
}

var=`ps -C socat -F | grep [s]ocat | tr -s " " | cut -d " " -f2`
if [ -z "$var" ]; then
 createFifo
fi

Here is the breakdown of what's happening in the previous script. I create a simple bash function to make the fifo and make sure to only run it if no other instance of socat is running. If you have another instance of socat running you probably just need to kill that particular instance if it's not working.

I also created a simple systemd service file to load it up at boot time which I put in /etc/systemd/system/

[Unit]
Description=Startup mopidy udplink to fifo

[Service]
Type=oneshot
ExecStart=/etc/mopidy/startup.sh

[Install]
WantedBy=multi-user.target

5 Things you should know about plant based meat

Plant based meat ain't the fix that I was looking for. It's looking like a processed food alternative to processed meat. In my book, a lost. Lot's more information from Juliette Luini on the website defining those next points.

We’re inundated with talk of plant-based meat, so we’ve teamed up with the True Health Initiative to suss out what we know and, as important, what we don’t regarding how products from Impossible Foods and Beyond Meat influence animal welfare, the environment, and our health.

Here are five takeaways from the talk:

  • Plant-based meats are obviously better for animal rights, but replacing a beef burger with a Beyond burger isn’t going to save the planet from climate change.

  • Vegetables are better for the environment than plant-based meats.

  • Plant-based meats are ultra-processed, but beef has a hefty ingredient list, too.

  • The health impacts of plant-based meat are TBD.

  • If you’re a carnivore, switching from a beef burger to a plant-based burger is a good thing for your health, the health of the planet, as well as animals. But if you are comfortable with plants tasting like plants, just stick to unprocessed vegetables and grains.

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

Tips to fall back asleep in the middle of the night

  • Remain in bed
  • Stay in the dark
  • Block out noise
  • Adjust the temperature (65 degrees)
  • Quiet your mind
  • Think positive

Rethinking Gluten Free

Interesting article about the food system industrialization and how it affects our health. People with gluten intolerance might want to take a look at this since it does makes you wonder what you put into your belly. I have been skipping wheat for our kids for a long time now but Im slowly re-introducing sourdough bread into their diet. They are doing great.

Gluten-free diets simply sidestep deeper problems in our food system, problems that wheat points out to us. As one of the most intensively industrialized crops in the world, wheat is giving us a glimpse of where we’re headed as we continue on this path with other foods. If we ignore these warnings, we’ll soon add other foods to our list of dietary sensitivities. But if we heed them, we have a golden opportunity to address many other pressing problems linked to our food system, including its climate footprint and its devastating impact on rural communities. So instead of ditching wheat, let’s fix the way it’s bred, the way it’s grown, and the way it’s processed.

The wheat you eat in a typical store-bought cookie or hamburger bun is very different from the wheat your great-grandparents ate. Over the course of the twentieth century, wheat was aggressively bred to improve crop yield and loaf volume — the number of loaves of bread industrial processors can squeeze out of each bag of flour by pumping as much air into the dough as quickly as possible.

In the process, the chemical composition and nutrient profile were significantly changed. Medical trials with subjects who alternated between a modern wheat and ancient wheat diet have demonstrated just what a difference these breeding programs have made to our ability to digest this staple grain. While modern wheat has been shown to cause inflammation, ancient wheat actually reduces it, improving outcomes for patients with chronic diseases like diabetes, heart disease, and irritable bowel syndrome.

Follow your bliss

Interesting article by Deepak Chopra about following your "bliss".

Let’s say that you want to follow your bliss as far as it can take you. There are essentially three stages on such a path. Stage 1 is the experience of personal joy, which all of us have known at least once in our lives. These moments touch the lives of people who fall in love or who achieve a triumph or who simply find themselves overjoyed for whatever reason. You grab and hold on to Stage 1 bliss as long as you can, but eventually the moment passes.

A change occurs in Stage 2. Instead of possessing an experience of joy, the joy possesses you. By this I mean that it is more impersonal. In Stage 1, bliss is all for me, the ego-personality. In Stage 2, you rise above personality. The Latin roots of the word “ecstasy” mean “to stand outside.” That’s how Stage 2 bliss feels. You go outside your normal boundaries.

Stage 2 feels light and sometimes out-of-body. Religious awe falls into this category, along with wonder before the beauty of Nature, or its immensity. There can be a sense that time has stopped or that your mind has expanded into a new space that is free, open, untroubled, peaceful, and forever calm. But the essential aspect of Stage 2 bliss is that it possesses you, not the other way around.

Stage 3 is the experience of Stage 2 bliss on a permanent basis, so that it becomes the default state of your awareness. Every person’s mind has a default state already, a set of grooved-in reactions, responses, beliefs, and attitudes that make up their personal story. Stage 1 bliss occurs inside this default setting, while Stage 2 takes a brief vacation from it, and then Stage 3 leaves the old default setting behind completely.

At that point, “Follow your bliss” has accomplished what it was meant to accomplish: liberation. There are many terms for this state, such as enlightenment, waking up, Nirvana, Moksha, or the peace that passes understanding. The important thing is the experience, which begins simply enough, by focusing on the bliss you can create in your life, valuing it, and beginning to experience, usually through meditation or Yoga, a settled sense of the quiet, peaceful mind.

My Restaurant Was the Greatest Show of Excess You’d Ever Seen, and It Almost Killed Me

I'm always interested reading about chefs who are forgoing alcohol as a way of life. Restaurateurs like David McMillan and Fred Morin were well know for being excessive in their food and drinks. Things change and when they do, it usually is for better.

When the chefs of Joe Beef in Montreal gave up alcohol, their whole restaurant changed.

McMillan- I was never falling-down drunk. I was never belligerent. I always got my work done. I was never unkempt. I was always clean, I was always shaved, I always performed at work. I was always kind and gracious in the dining room. But I lived in hell.

The Dark Horse path to happiness

Here is something that I have been interested in lately is more about how we live our daily live, our mindset, over the end product so more about process then outcome. Check this article written by Bradley Stulberg in Outside magazine. Here are my answers to the 3 steps.

Apply a Process of Outcome Mindset to Your Own Life

Reflect on what motivates you. Try to come up with three to five core values or things that matter most to you, the guiding principles in your life.

  1. Health - physical and mental
  2. Family and Friends
  3. Making stuff
  4. Misc. creative output

Think about how you can turn these core values into daily practices. What actions work in service of your core values? How can you adjust your life to ensure you are taking these actions regularly? How can you incorporate these actions into your current routines? How will you measure whether or not you’re taking them?

  1. Exercises and meditation
  2. Taking the time to spend time with family and friends either physically or virtually
  3. Plan stuff, test stuff and do stuff
  4. Fail some stuff

Whenever you find yourself seeking, or wanting a certain outcome out of life, note what you’re doing and then refocus on practicing your core values. “When it comes, happiness is most often caused indirectly,” writes Patten. It’s the result of repeatedly practicing the actions that work in service of your core values, a lifestyle that compounds with consistency and over time.