Max's Blog

Exploring Technology

Why would anyone in their right mind us vim? I asked myself this question 543 times in the last 3 years. To my own surprise, I found myself wanting to use vim. The justification being that you can write code without using a mouse.

Jumpstart Neovim
https://github.com/ur4ltz/kickstart.nvim

There is a program called Howdy, which is like Windows Hello. It uses face data as authentication.
Howdy Github Repository

howdy logo

If you own a Logitech Brio or other camera with Windows Hello compatibility, Howdy will work perfectly for you.
Howdy is better than windows hello though. It has a serious advantage while you are running it in linux; any time you would need to type in your password, howdy will verify with your camera. You won’t have to type your password in for any authentication on your linux machine even on command line!

Sunshine is a desktop streaming client for linux that offers efficient, low latency PC streaming, for free.
Download Sunshine onto your linux machine (the host)
Sunshine Github
Download moonlight onto whatever device you streaming on (the client)
Moonlight Homepage

I have spent a considerable amount of time looking for something that would replace Parsec when I switched to linux. A number of posts spoke about NoMachine, TightVNC and a number of other VNC clients. None of them were sufficient for what I wanted; low latency, high refresh rate, unlimited access to my PC.

Sunshine checks all the boxes. It uses an implementation of Nvidia’s GameStream service. Its really fast and reliable. Better yet, you don’t need to install Nvidia’s crappy GeForce experience if you are doing this on a windows machine, you can also use Sunshine.

If you want to use sunshine outside of your local network, turn on Upnp in your router so that sunshine can set up all the required ports.

Checkout the sunshine docs for installation instructions -> https://docs.lizardbyte.dev/projects/sunshine/en/latest/about/installation.html

Start Running
cd downloads
./sunshine.AppImage –install && ./sunshine.AppImage

Once its set up, you can configure options in a browser. Visit:
https://localhost:47990/

Additional fun stuff:
Moodlight supports wake on lan WOL. This is a feature on motherboards that allows the computer to boot up or wake from sleep.
Go into your bios and make sure its turned on. You can tell your eithernet controller is running during sleep if you sleep your computer but you can still see the orange light blinking on your eithernet port.
If you setup moonlight to work outside your network, you can also setup Wake on Lan, to wake up your computer if you are out of the house.
Port Forward UDP 7-9 to the Sunshine host. Now you can wake your computer from anywhere in the world.

To kill all instances of an application us the command killall

It can be tedious to find all the processes you are trying to kill based on process id. There is a cool little command that can do the work for you, killall.

You can kill all instances of a misbehaving program:

$sudo killall discord

Or you can kill using wild cards:

$sudo killall node*

If you want to check what you will kill you can use the command:

$ps aux | grep node*

If an image is being displayed on a website and for some reason that asset disappears, you can catch that error and display a placeholder image with a little inline js.

Here is an example:

<img src="/marketing/importantImage.png"
    onerror=" this.onerror = null; this.src='/marketing/backupimage.png';"
/>

This will help prevent image 404’s on the site if someone decides to go and delete a bunch of images. Since is just a little js snippet, you can change the class, report the error or even remove the element entirely.

You can setup nginx to point subdomains at specific ports.

Set up your a records

set up nginx

1
2
3
4
5
6
server {
server_name blog.maxg.cc www.blog.maxg.cc;
listen 80;
root /data/blog/folder;
index index.html;
}

upload successful

OK THEN

If your server has a .env file, it may be necessary to parse those variables into a bash script. This can be accomplished by using the ‘source’ command.

A .env file is an important part of any application set up because it allows you to separate credentials of the app into different environments and pulls them out of the git repository.

Contents of a .env file may look like this:
DB_USERNAME=root
DB_PASSWORD=S0S3CUR3!

How to pull .env variables into a bash script:

Make sure to start with the right shebang at the top of your file.

#!/bin/bash

Pull in .env variables

source ~/.env

Then reference those variables in your script

echo “$DB_USERNAME”

As we fumble around life, doing little projects we end up learning little things and forgetting a lot of things.

My hope is that someone will google a strange problem and find the strange solution here. I wish to add to the global human corpus of knowledge in a small way.

I also hope to document things I will forget.

If you don’t find anything you enjoy, why don’t you go somewhere else? Its not like I’m monetizing this blog. Your patronage means nothing to me. Hope you have a great day.

0%