Skip to content

Instantly share code, notes, and snippets.

View lhotari's full-sized avatar

Lari Hotari lhotari

View GitHub Profile
lhotari / DefaultKeyBinding.dict
Last active December 11, 2023 13:11 — forked from trusktr/DefaultKeyBinding.dict
My DefaultKeyBinding.dict for Mac OS X
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict
This file remaps the key bindings of a single user on Mac OS X 10.5 to more
closely match default behavior on Windows systems. This makes the Command key
behave like Windows Control key. To use Control instead of Command, either swap
Control and Command in Apple->System Preferences->Keyboard->Modifier Keys...
or replace @ with ^ in this file.
Here is a rough cheatsheet for syntax.
Key Modifiers
lhotari /
Last active September 29, 2022 09:52
GitHub Actions debugging tip: connect to the running build with ssh

GitHub Actions debugging tip: You can connect to the running build with ssh and get a shell within the GitHub Actions runner VM.

The recommended approach is to run the build in a PR in your own fork and make only temporary changes to enable the ssh shell. GitHub Actions runs within your own fork when you open a PR to your own fork. Before opening the PR, it's useful to sync your fork's master branch with origin/master. Please check instructions for "Personal GitHub Actions CI" in the dev mailing list archives.

Here's an example of SSH debugging I have: lhotari/pulsar-helm-chart#1 . I removed all other GitHub Actions workflows and added this action step to the workflow where I wanted to connect with ssh:

      - name: Setup upterm session
        uses: lhotari/action-upterm@v1
lhotari /
Created April 21, 2021 04:02 — forked from Kevinrob/
Clean up microk8s registry
repositories=$(curl ${registry}/v2/_catalog)
for repo in $(echo "${repositories}" | jq -r '.repositories[]'); do
echo $repo
tags=$(curl -sSL "http://${registry}/v2/${repo}/tags/list" | jq -r '.tags[]')
for tag in $tags; do
echo $tag
curl -v -sSL -X DELETE "http://${registry}/v2/${repo}/manifests/$(
curl -sSL -I \
lhotari / smx8fancontrol
Last active December 17, 2020 20:31 — forked from ikus060/smx8fancontrol
Python script to edit the X8DTU-F Registry to control fan speed.
#!/usr/bin/env python3
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
lhotari /
Created October 25, 2019 03:26
Ubuntu 18.04 Linux kernel settings for Dell Latitude 7480
sudo apt-get update
sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04
sudo mkdir /etc/default/grub.d
# adjust i915 related kernel parameters
# references for different settings:
# intel_iommu=igfx_off -
# intel_idle.max_cstate=4
lhotari /
Last active July 4, 2022 15:45
Ubuntu install
apt-get install autojump zsh tig git htop vim wget
apt-get install apt-transport-https ca-certificates curl software-properties-common
apt-get install libgnome-keyring-dev && (cd /usr/share/doc/git/contrib/credential/gnome-keyring && make)
apt-get install indicator-sysmonitor
apt-get install keepass2
curl -fsSL | apt-key add -
add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable"
sudo apt-get install linux-generic-hwe-16.04 linux-image-generic-hwe-16.04 linux-tools-generic-hwe-16.04 linux-image-extra-virtual-hwe-16.04
sudo apt-get install xserver-xorg-hwe-16.04
# Disables Spotlight / mdworker and Time Machine backups for all build and .gradle directories under the working directory.
/usr/bin/find . '(' -name build -or -name .gradle ')' -exec touch "{}/.metadata_never_index" \;
/usr/bin/find . '(' -name build -or -name .gradle ')' -exec xattr -w "{}" \;
// Example of using StAX to split a large XML document and parse a single element using XmlSlurper
import javax.xml.transform.Transformer
import javax.xml.transform.TransformerFactory
import javax.xml.transform.sax.SAXResult
import javax.xml.transform.stax.StAXSource
def url = new URL("")