Skip to content

Instantly share code, notes, and snippets.

View gtirloni's full-sized avatar

Giovanni Tirloni gtirloni

View GitHub Profile
@gtirloni
gtirloni / chrome_disable_signin_prompt.md
Created September 7, 2024 20:28
chrome: disable sign-in prompts

When you visit sites like reddit.com, they may show a native popup in Chrome asking you to login with your Google account(s).

To disable that, go to chrome://settings/content/federatedIdentityApi and click on Block sign-in prompts from identity services.

@gtirloni
gtirloni / wezterm.lua
Last active June 22, 2024 19:02
wezterm like tilix
local wezterm = require 'wezterm'
local config = wezterm.config_builder()
-- broken
config.enable_wayland = false;
config.initial_cols = 220
config.initial_rows = 60
config.color_scheme = 'Thayer Bright (Gogh)'
@gtirloni
gtirloni / chrome_wayland.md
Created February 13, 2024 15:14
Fedora 39 + Chrome 121 + Wayland

Chrome + Wayland

After switching to Wayland (with an Intel iGPU on Fedora 39), I started experiencing extreme lag in Chrome.

Here is a workaround:

  1. Go to chrome://flags
  2. Search for "ozone" or "wayland"
  3. Set "Preferred Ozone platform" to "auto"
  4. Relaunch
@gtirloni
gtirloni / nuvoton.md
Last active January 31, 2024 14:00
lm_sensors and Nuvoton chips

lm_sensors and Nuvoton chips

My ASUS B760M motherboard and many others have a Nuvoton Super I/O chip used for controlling fans, monitoring temperature and other tasks.

Some of the temperature readings that the chip provides are not connected to any physical sensors. This caused bad readings, like reported by lm_sensors here:

$ sensors nct6798-*
nct6798-isa-0290
Adapter: ISA adapter
@gtirloni
gtirloni / README.md
Last active August 30, 2023 19:14
Flexible per-alert silences in Grafana

Flexible per-alert silences in Grafana

Overview

Certain expected behaviors in the infrastructure can cause alerts to fire unnecessarily, generating noise and contributing to alert fatigue.

For example, database backups can increase the number of disk operations beyond what is expected during business hours but they don't cause issues that require human actions because they usually run outside business hours.

If these events happen on specific time periods, they can be ignored programmatically.

@gtirloni
gtirloni / README.md
Last active August 17, 2023 12:45
Google Chrome work profiles on Linux

Work profile with Google Chrome on Linux (GNOME)

The goal is to open a different profile for work-related URLs opened anywhere on the desktop.

Install Steps

  1. Copy default-browser.sh to $HOME/bin (or somewhere else in your PATH)
  2. Copy default-browser.desktop to $HOME/.local/share/applications
  3. Update $HOME/.config/mimeapps.list with proper values (or create file from scratch)
  4. Go to Settings > Default Applications and configure "Default Browser" for Web
@gtirloni
gtirloni / git-blame-ignore.md
Last active July 20, 2023 13:23
git-blame ignore major formatting commits

git-blame shows what revision and author last modified each line of a file.

$ echo "this is a test" > test.txt
$ git add test.txt
$ git commit -m "first commit"
$ git blame test.txt
^d12054e (John Doe 2023-07-20 10:08:32 -0300 1) this is a test
@gtirloni
gtirloni / mount-ec2-snapshot-same-server.md
Created June 13, 2023 12:05
mount-ec2-snapshot-same-server
  1. Locate the snapshot in EC2 > Snapshots
  2. Actions > Create volume from snapshot
  3. Locate the new volume in EC2 > Volumes
  4. Actions > Attach volume
  5. Confirm volume is attached to instance (ls -l /dev/nvme1*)
  6. Confirm volume has same UUID as the root disk (blkid)
  7. Change volume UUID to avoid conflicts (uuidgen && xfs_admin -U GENERATED_UUID_HERE /dev/nvme1n1p1)
  8. Confirm UUID was changed (blkdid)
  9. Mount filesystem (mount -t xfs /dev/nvme1n1p1 /mnt)
@gtirloni
gtirloni / jupyter-lab.service
Last active May 6, 2023 14:18
Start Jupyter-lab automatically
[Unit]
Description=JupyterLab
After=network-online.target
Wants=network-online.target
[Service]
ExecStart=/usr/bin/jupyter lab --no-browser
Restart=on-failure
RestartSec=7
RestartPreventExitStatus=3
@gtirloni
gtirloni / wireplumber.md
Last active November 11, 2024 23:04
How to disable audio devices with Pipewire

Find your devices

$ pactl list short

Create the Wireplumber rule to disable the device

$ mkdir -p $HOME/.config/wireplumber/main.lua.d