Revisiting Hugo Themes :heart:

I started using Hugo in 2019 and have stuck with the same theme for my blog for the most of that time… until now.

I ended up on Blowfish mostly because the flexibility of layouts and feature set was exactly what I was looking for in a theme.

Hugo Learnings

I also learned some things about Hugo content organization, changing Site params in frontmatter and a directory based config approach (compared to a single file).

I wanted to see some percentages of how much time certain things take out of my week. This obviously does not reflect the reality and to be honest I doubt it really comes close, but I found it to be an interesting exercise.

Script Output

------------------------
Time Map:
------------------------
[29.8%] work           : {'working': 40, 'commuting': 10}
[40.5%] health         : {'sleep': 35, 'showers': 3.5, 'gym': 3, 'meditating': 3.5, 'cleaning_cooking': 7, 'eating': 7, 'pooping': 7, 'laundry': 2}
[16.7%] digital_entertainment: {'gaming': 7, 'watching_videos': 21}
[10.4%] learning_studying: {'reading': 7, 'learning_japanese': 3.5, 'coding_proj': 7}
------------------------
Time Used:
------------------------
[97.3] % used
[2.7] % left
------------------------

used hrs 163.5 / 168

The Script

#!/usr/bin/env python3

# this is a very simplified, rough estimate of time as there is much more
# variation and drift in these things, however the things that do not change
# for me are work, sleep (I don't usually get a full 8 hours :/)

# i know there are lots of ways to log time spent on various things and that would
# take a lot of the guess work out of these things. something to consider in the future

hrs_in_week = 24 * 7                # 168 hours in a week - that's not ever going to change

# this is a map of groups of things that i dedicate my time to
# the (++) or (--) parentheses at the end of the comments indicate what i want to spend more or less time on

hours_map = {
    "work": {
        "working": 8 * 5,           # currently working a 9-5 schedule. this is not very cash money (--)
        "commuting": 2 * 5,         # an hour each way to work in the car. this does not spark joy (--)
    },
    "health": {
        "sleep": 5 * 7,             # ideally getting 8 hours of sleep (more often 4-6 is the case). I should get more sleep (++)
        "showers": .5 * 7,          # i take short showers (G)
        "gym": 1 * 3,               # if I don't skip leg day (++)
        "meditating": .5 * 7,       # like to spend an hour or two meditating throughout the day (++)
        "cleaning_cooking": 1 * 7,  # easily could be more/less (++)
        "eating": 1 * 7,            # could me more or less (G)
        "pooping": 1 * 7,           # also could be more or less (G)
        "laundry": 2                # pretty much 2 hours for washing/drying/folding/putting-away clothes for the week (G)
    },
    "digital_entertainment": {
        "gaming": 1 * 7,            # usually don't even play 7 hours of games these days :< (++)
        "watching_videos": 3 * 7,   # usually watch more on YT or streaming. includes social media (--) (unless classic movies)
    },
    "learning_studying": {
        "reading": 1 * 7,           # reading more would be nice (++)
        "learning_japanese": .5 * 7,# would like to spend an hour learning a new language (++)
        "coding_proj": 1 * 7        # would also like to do more of this (++)
    },
}


total_hours_used = 0
total_used_percentage = 0

print("------------------------")
print("Time Map:")
print("------------------------")

for k, v in hours_map.items():
    hrs_sum = sum(v.values())
    total_hours_used += hrs_sum
    percentage = (hrs_sum / hrs_in_week) * 100
    total_used_percentage += percentage
    print(f"[{percentage:.1f}%] {k : <15}: {v} ")

print("------------------------")

print("Time Used:")
print("------------------------")
print(f"[{total_used_percentage:.1f}] % used")
print(f"[{100 - total_used_percentage:.1f}] % left")
print("------------------------")
print()
print("used hrs", total_hours_used, "/", hrs_in_week)
print()

You can take this, modify it to what you spend time on and see what you can change around.

Zsh Git Prompt

- 1 min read

My ZSH Git Prompt

zsh is a great interactive prompt, however it can be a little tough to find solutions that do not rely on plugins or plugin managers like oh-my-zsh.

If you are looking for a portable zsh function for getting git status in your zsh prompt, here is what I am using currently (adapted from my bash git prompt):

https://github.com/lemonase/dotfiles/blob/master/config/zsh/.zshrc#L225-L247

This function gets the git status and branch - greps out a few keywords that I’m interested in and prints out some characters accordingly.

What have I done?

So I thought I would give a little update on what’s new with my setup - specifically my mobile setup.

Well, here’s the news - I bought a new M1 MacBook Air (2020) about 2 or 3 weeks ago. It is the lowest spec version too - so 8GB of RAM, 256GB SSD and all the hype.

This is also my first Apple computer - my first Mac - so that’s pretty neat. The ARM processor is also a big reason I wanted to get one of these things.

Samba is one of the go-to protocols for sharing files over a network.

It is builtin to Windows, but needs to be installed and configured on other OSes like Linux and macOS.

Thankfully the process is not too difficult.

Installing on Rasbian

Run the following command on your Pi to install a samba server and client onto your Pi.

sudo apt update && sudo apt install samba samba-common-bin smbclient cifs-utils

Checking the smb server

To check the status of your smb server, use:

Parts of a “minimal” vimrc

What makes a minimal vimrc?

My opinion of a “minimal” vimrc might be different from yours, but for me, it means

  1. Not using external plugins
  2. < ~100 lines
  3. Reducing vi related pain-points

So here’s what I do:

Source default settings

While this may not be necessary most of the time, it is still worth it to check that it has been sourced IME. It is a small fine to pay for ensuring you have the defaults you deserve.

These are some thoughts about my personal experience with learning a new programming environment like shell scripting (but this applies to almost any new environment). This is mainly based off mistakes and pitfalls I’ve fallen into in the past, so this post will be pretty cathartic, but perhaps it could be help someone out there.

5 Tips

  1. Don’t try to memorize every command, every API, every function, etc. Learn enough to become functional in the environment. Build something and move on.
  2. Think twice about what you’re trying to accomplish before considering tools.
  3. Have a structured process for getting help and use it frequently.
  4. Realize that commands/interfaces have different design goals and that’s OK!
  5. Know when a command/library/framework doesn’t mesh with the problem you’re trying to solve.

Let me elaborate on these points a little bit.

I recently learned about a project called spicetify that allows you to customize the theme of your Spotify client and I thought I would share.

Installing it is a few commands on all platforms and people have already made tons of themes and extensions.

Example

This is what my Spotify looks like with the “Spicy” theme:

theme_pic

Configuration

Customizations are stored in a config file located at:

  • Windows: %USERPROFILE%\.spicetify\config.ini
  • Linux: ~/.config/spicetify/config.ini
  • MacOS: ~/spicetify_data/config.ini

Themes

To get themes, you can clone the community themes repo and copy them to these directories

I’ve been trying to get used to PowerShell for a little while now and while it is difficult to adjust coming from other shells, there are some modules I have installed that make it much less of a pain.

Modules are really core to what makes PowerShell extensible and you can read more about them here but they work similar to other OOP languages and just like other interpreted scripting languages, loading too many modules will slow down performance.

Windows Package Managers

Using Linux has spoiled me when it comes to easily installing software. The fact that there is a default package manager for every distro can be taken for granted sometimes. There are lots of open source, community driven package managers for proprietary systems as well.

Mac users boast homebrew, as their de facto package manager, but what about Windows? Well I’ll tell you – Windows has had a few package managers over the years.