Skip to content

Instantly share code, notes, and snippets.

Avatar

Lari Hotari lhotari

  • DataStax
  • Espoo, Finland
  • 20:39 (UTC +03:00)
  • Twitter @lhotari
View GitHub Profile
@lhotari
lhotari / configure_grub_for_dell_7480.sh
Created October 25, 2019 03:26
Ubuntu 18.04 Linux kernel settings for Dell Latitude 7480
View configure_grub_for_dell_7480.sh
#!/bin/bash
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 - https://bugs.archlinux.org/task/55629
# intel_idle.max_cstate=4
@lhotari
lhotari / jira_spam_cleaner.groovy
Created July 29, 2014 04:04
Jira Groovy Script for cleaning comment spam from a certain user
View jira_spam_cleaner.groovy
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.IssueManager
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.comments.Comment
import com.atlassian.jira.issue.comments.CommentManager
import com.atlassian.jira.issue.search.SearchException
import com.atlassian.jira.bc.issue.search.SearchService
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.jira.user.ApplicationUser
@lhotari
lhotari / debug_github_actions.md
Last active September 29, 2022 09:52
GitHub Actions debugging tip: connect to the running build with ssh
View debug_github_actions.md

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
 with:
@lhotari
lhotari / ubuntu_install.sh
Last active July 4, 2022 15:45
Ubuntu install
View ubuntu_install.sh
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 https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
@lhotari
lhotari / clean_microk8s_registry.sh
Created April 21, 2021 04:02 — forked from Kevinrob/clean.md
Clean up microk8s registry
View clean_microk8s_registry.sh
#!/bin/bash
registry=localhost:32000
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 \
View lari@hotari.net.gpg
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGBRm5gBEADoGdMtbyvaBJXG1xEX6138mT5UNsBKbKIoR7ivuIoXjhoGIiHm
1Ow9yw+8blL7tVaJLQzwmBg/1fJTfuLb4OUqSEEGL7sHssDoMLTfRD8K0owlJpW/
baiI9tM2KyIHhkUxbnBg+wzX5zeoTW6WCZWOAUfXgzfHAEscWLGc9mb15aZppkK2
TvDgBiLXKfgjUr7znSdWwWOh8Wzs1aMijLzg86Q+1hKsR7F1ZSqIELa8KUWcW0Wi
bqq4UD5xka7DZTIRzPkLfAdyAaIFauGiq2DyswNJFBGRul8RjZGnOxadZPmJB2iB
ukBZQGGVirNBVRSOKELSmbS3+zQnopyic0/dZS4/caE9YMgfLnv8AQAfFbzn8gzK
2KdLheH8F5FLekMCx70mtIDCI9L7nI2OUJk0YGjQkpqnGjI8j4OI3XPyLO1aQeyH
lce1xEsoZOx6fBVtO275Fo0kKKZJ6ToAbXSijc1o1iSszV4saeGXE+G8PbOOK40W
@lhotari
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.
View smx8fancontrol
#!/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
#
# http://www.apache.org/licenses/LICENSE-2.0
@lhotari
lhotari / add_modes_to_screen.sh
Created May 24, 2013 13:16
script for adding standard modes to beamer for presenting on linux
View add_modes_to_screen.sh
#!/bin/bash
# script for adding standard modes to beamer for presenting on linux
# use xrandr to find out screen name of external output port
# xrandr is in x11-xserver-utils package on debian/ubuntu
SCREENNAME=$1
if [ -z "$SCREENNAME" ]; then
SCREENNAME=VGA-0
fi
function addmode() {
xrandr --newmode `cvt $1 $2 |grep Modeline | sed -e 's/^Modeline //' | sed -e 's/\"//g'`
View install_hwe_kernel_to_ubuntu16.04.sh
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
View disable_indexing_and_backups_for_build_dirs.sh
#!/bin/bash
# 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 com.apple.metadata:com_apple_backup_excludeItem com.apple.backupd "{}" \;