- Updated on May 29 to accommodate etcd container not having
/bin/sh
available anymore.
curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
#!/bin/bash | |
modprobe -r psmouse && modprobe psmouse |
[Unit] | |
Description=Restart trackpad after suspend | |
After=basic.target suspend.target hibernate.target | |
[Service] | |
User=root | |
Environment=DISPLAY=:0 | |
ExecStart=/usr/bin/restart-trackpad | |
[Install] |
Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font
To setup native Linux, see this gist
const util = require('util'); | |
const WebSocket = require('ws'); | |
const vehicle_id = ''; // as returned by the /vehicles api call | |
const auth_token = ''; // tokens as used in the REST API | |
const stream_columns = [ | |
'speed', | |
'odometer', | |
'soc', |
See Keycloak Documentation for more details.
// 1. Open the browser developper console on the network tab | |
// 2. Start the video | |
// 3. In the dev tab, locate the load of the "master.json" file, copy its full URL | |
// 4. Run: node vimeo-downloader.js "<URL>" | |
// 5. Combine the m4v and m4a files with mkvmerge | |
const fs = require('fs'); | |
const url = require('url'); | |
const https = require('https'); |
# In CPython implementation of Python 3.6, dictionary keeps the insertion order. | |
# From Python 3.7, this will become a language feature. | |
# In order to sort a dictionary by key including nested dictionary inside, we can do: | |
def sort_dict(item: dict): | |
""" | |
Sort nested dict | |
Example: | |
Input: {'a': 1, 'c': 3, 'b': {'b2': 2, 'b1': 1}} | |
Output: {'a': 1, 'b': {'b1': 1, 'b2': 2}, 'c': 3} |
# Gnome 3 - based on https://blog.samalik.com/make-your-gnome-title-bars-smaller/ | |
.header-bar.default-decoration { | |
padding-top: 3px; | |
padding-bottom: 3px; | |
font-size: 0.8em; | |
} | |
.header-bar.default-decoration .button.titlebutton { | |
padding: 0px; | |
} |
#/bin/bash | |
TOKEN='put your token here. Get a new from https://api.slack.com/docs/oauth-test-tokens' | |
dbus-monitor --session type='signal',interface='com.canonical.Unity.Session' | while true | |
do | |
read x | |
if echo "$x" | grep -q Locked; then | |
echo "set yourself away at $(date)" | |
curl -X GET -H "Cache-Control: no-cache" "https://slack.com/api/users.setPresence?token=$TOKEN&presence=away" |