chungn

Ps

Muterr - global microphone mute button for MacOS

Introducing Muterr – your opensource MacOS sidekick for seamless input audio mute!

banner

Introducing

Tired of mic mishaps on your Mac? Say hello to Muterr, where muting is made easy and laughter is part of the package

Ever found yourself inadvertently serenading your virtual meeting?

Muterr’s got your back with a topbar mic mute button, so you can silence the unexpected solo performances in a click.

Muterr not only solves problems but adds a touch of humor to your Mac life.

SSH key management with small bash script function

Managing SSH keys for secure access to Git repositories can be a daunting task, especially if you work on multiple accounts hosted on a same platform like Gitlab or Github.

How to use?

If that’s your case, this script maybe for you, just paste it to your ~/.bashrc or ~/.zshrc. I didn’t test with fish tho.

Then running git-change to select one SSH for your git project.

function git-change() {
  if [ $ZSH_VERSION ]; then
    setopt sh_word_split
  fi
  IFS=$'\n' keys=$(ls -1 ~/.ssh/id_rsa ~/.ssh/*/id_rsa ~/.ssh/id_rsa_* 2> /dev/null)

  select item in $keys
  do
    echo "export GIT_SSH_COMMAND=\"ssh -i $item -o IdentitiesOnly=yes\""
    export GIT_SSH_COMMAND="ssh -i $item -o IdentitiesOnly=yes"
    break
  done
}

How it works?

  • This small script list available SSH keys by searching for files named “id_rsa” in ~/.ssh, as well as its subdirectories.
  • By default, script searches with this command: ls -1 ~/.ssh/id_rsa ~/.ssh/*/id_rsa ~/.ssh/id_rsa_*, feel free to customize it for your use case.
  • After you select the script, git-change function sets the GIT_SSH_COMMAND environment variable with the appropriate SSH command, including the chosen SSH key.

Happy coding (⌐□_□)

Database Comparison (PostgreSQL and SQLite)

When considering the choice between PostgreSQL and SQLite for my project, several factors come into play.

1. The Database System/Engine

SQLite

Initially, my project utilized SQLite, which presented some distinct advantages:

  • Fast Integration: SQLite allowed for swift integration into my project.
  • Easy Backups: Backing up the database was a breeze, simply involving copying the file from the server to my local machine.

However, it also had its drawbacks:

  • Concurrency Issues: I encountered difficulties when multiple operations like crawling, administrative viewing, and uploading occurred simultaneously.
  • Schema Alterations: Modifying column types or names was cumbersome, often requiring me to drop the database and start from scratch.
  • Database Maintenance: After pruning data, the “vacuum” command was necessary to reduce the file size, which could be a manual task.

PostgreSQL

In response to the limitations of SQLite, I made the switch to PostgreSQL, which addressed these issues effectively. Here are some notes on PostgreSQL:

Streamlining Multiple PHP Projects with Apache Virtual Hosts

As a PHP developer, I often find myself working on multiple projects, each requiring a different PHP version. In the past, setting up each project involved creating a new Apache (or Nginx) configuration file and adding an entry to my /etc/hosts file. While this process isn’t overly complex, I’ve always been on the lookout for ways to optimize it. After some exploration and experimentation, I’ve found a solution that eliminates the need for separate configurations for each project.