Always Pushing Tags

Tagging is nice but I always forget to push the darn things. And yes, I am one of those guys that push all local tags - so what? We’re all kinky in our ways.

There are many ways you can ensure you push tags with your regular push but my favorite is just editing .gitconfig. In the [remote "origin"] section I just add the following two lines:

push = +refs/heads/*:refs/heads/*
push = +refs/tags/*:refs/tags/*

Now each push will come with a bit of extra.

Automatic Backlight Per Power Source

I love the feature when Windows sets different backlight level depending whether I am plugged in or on battery. I really fits how I use my laptop. But then one day that feature seemingly disappeared. Cause seemed to be a Windows Update and to fix it I would essentially need to restore my old driver.

Well, either that or this small utility. Once installed, it will run a service in the background tracking your power source and backlight level. Whatever level you last set on battery will be used whenever you unplug and whatever you set while plugged in will be used when your AC adapter is connected. Essentially, the same behavior as what once came by default.

While this will never be a full application as I doubt there will ever be enough interested people, download is available at GitHub.


PS: For Linux version check Backlight Tracer.

Editing Scanner Profile

Changing default scanner under Windows is possible but requires manually editing XML files.

Well, this utility at least removes that step. While knowledge of scanner profiles is necessary, one can now do it using application and without messing with XML files directly.

While this will never be a full application as I doubt there will ever be enough interested people, download is available at GitHub.

APIs Are a Fair Use

It took just 10 years but we finally know for sure: copying API is a fair use.

There’s a really detailed analysis of Supreme’s court decision at TechDirt for those wanting details.

Despite result matching what I believe is right and better for industry, it’s really heartbreaking it took 10 years and millions in lawyers to clean this up.

Wait For Mountpoint

I have quite a few scripts running on my home server and they love writing on disk. They love it so much that, after reboot, they don’t necessarily wait for mount points to appear - they just start writing. Unfortunately, such eagerness also means that my other scripts mounting ZFS might find directory already in use and give up.

What I needed was a way to check if mount point is already there before starting with write. The easiest approach for me was using mountpoint command.

TEST_PATH=/test/directory
while(true); do  # wait for mount point
    mountpoint "$TEST_PATH" >/dev/null
    if [[ $? != 0 ]]; then
        sleep 1
        continue
    fi
    break
done

Script fragment above will check if given directory has something mounted and, if not, wait for 1 more second. Once test succeeds, it will break out of the infinite loop and proceed with whatever follows.

Easy enough.