Skip to content

Instantly share code, notes, and snippets.

View EelisRouvinen's full-sized avatar

Eelis Rouvinen EelisRouvinen

View GitHub Profile
@EelisRouvinen
EelisRouvinen / gist:7582f44de50873f75cd04fd47b5be2c8
Last active September 17, 2024 15:49
initiallize docker on a debian server playbook
- name: initiallize docker on a debian server
hosts: # define hosts here
remote_user: root
vars_prompt:
- name: admin_passwd
prompt: Enter admin_passwd
private: true
confirm: true
tasks:
@EelisRouvinen
EelisRouvinen / gist:2f1454dcbfe2a90b6617247e5e74d91a
Created July 5, 2024 03:59
setting up rootless docker to run on a privileged port and start containers with os
sudo setcap cap_net_bind_service=ep $(which rootlesskit)
systemctl --user enable docker
sudo loginctl enable-linger $(whoami)
@EelisRouvinen
EelisRouvinen / delete-artifacts.sh
Last active June 3, 2024 14:34
delete all workflow artifacts
#!/bin/bash
# get artifacts from github api and parse json with jq
artifacts=$(gh api -H "Accept: application/vnd.github+json" "/repos/$1/$2/actions/artifacts" | jq -c '.artifacts')
function delete() {
# iterate artifact array
echo "$artifacts" | jq -c '.[]' | while read artifact; do
# get id
artifactId=$(echo "$artifact" | jq -c -r '.id')
# get name
@EelisRouvinen
EelisRouvinen / pocketchip_debian10.md
Last active June 6, 2023 20:29 — forked from luzhuomi/pocketchip_debian10.md
A tutorial to upgrade NXT pocket C.H.I.P to Debian Buster

Pocket Chip Debian 10 Upgrade Guide

The purpose of this tutorial is to walk through the required steps to upgrade NXT chip (or pocketchip) from debian jessie to debian buster.

If you would like to start your Chip from scratch, follow the steps in the Preparation section.

Preparation (Optional)

A linux host machine, recommended Ubuntu 18.04. However I managed to do it with 20.04 with some changes to the Flash.sh script.

@EelisRouvinen
EelisRouvinen / 20auto-upgrades
Last active July 4, 2024 11:33
/etc/apt/apt.conf.d/20auto-upgrades
APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "7";
APT::Periodic::Unattended-Upgrade "1";
@EelisRouvinen
EelisRouvinen / set-ouput.sh
Last active January 27, 2023 15:42
serial output selection for aten vs481A
#!/bin/bash
stty -F /dev/ttyUSB0 19200 cs8 -parenb cstopb
echo -ne "\r" > /dev/ttyUSB0; echo -ne "sw i0$1 o01" > /dev/ttyUSB0; echo -ne "\r" > /dev/ttyUSB0
# manual page 15 https://assets.aten.com/product/manual/vs481a_um_w_2021-01-13.pdf
New-Alias -Name vim -Value nvim
Import-Module PSReadLine
Set-PSReadlineOption -EditMode Emacs
@EelisRouvinen
EelisRouvinen / gist:8904474611b8e58ad3a831ac0290c11f
Created July 2, 2020 08:47
remove old kernels when boot is full
sudo dpkg --list 'linux-image*'|awk '{ if ($1=="ii") print $2}'|grep -v `uname -r` | sed 's/linux-image//' | sed 's/generic//' | while read -r line; do [[ ( "$line" != "-" ) && ( "$line" != *"extra"* ) ]] && sudo rm /boot/*$line*; done
@EelisRouvinen
EelisRouvinen / 10-slimblade.conf
Created May 6, 2020 16:16
kensington slimblade conf ubuntu 18.04
Section "InputClass"
Identifier "Kensington Slimblade Trackball"
MatchProduct "Kensington Slimblade Trackball"
MatchIsPointer "on"
MatchDevicePath "/dev/input/event*"
Driver "libinput"
Option "ButtonMapping" "1 8 2 4 5 6 7 3 2"
Option "ScrollButton" "8"
Option "ScrollMethod" "button"
Option "MiddleEmulation" "on"