Skip to content

Instantly share code, notes, and snippets.

View kmplngj's full-sized avatar

Jan Kampling kmplngj

  • Münster, Germany
View GitHub Profile
@kmplngj
kmplngj / README.md
Created June 17, 2024 13:32 — forked from abelcallejo/README.md
Create bootable Linux USB using Mac

Creating bootable Linux USB using Mac

mac

CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.

1. Prepare the .iso file

Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file

2. Convert the .iso file into a .img.dmg

@kmplngj
kmplngj / init.lua
Created January 29, 2024 07:56 — forked from nriley/init.lua
Hammerspoon script for ensuring Sidecar is active when iPad is plugged in (macOS 10.15; see comments for versions up to macOS 13)
hs.loadSpoon('SpoonInstall')
spoon.SpoonInstall.use_syncinstall = true
Install = spoon.SpoonInstall
log = hs.logger.new('init', 5)
-- function debugUI(msg, table)
-- log:d(msg)
-- log:d(hs.inspect(table))
-- end
@kmplngj
kmplngj / 80-mount-usb-to-media-by-label.rules
Created August 17, 2022 06:09 — forked from eklex/80-mount-usb-to-media-by-label.rules
udev rule for Home Assistant OS (hassio) to mount USB drives into the Supervisor Media directory
#
# udev rule
# Mount USB drive to the media directory using the partition name as mount point
#
# Description:
# Created for Home Assistant OS, this rule mounts any USB drives
# into the Hassio media directory (/mnt/data/supervisor/media).
# When a USB drive is connected to the board, the rule creates one directory
# per partition under the media directory. The newly created partition is named
# as the partition name. If the partition does not have a name, then the following
@kmplngj
kmplngj / switch.yaml
Created June 27, 2022 13:13
Home Assistant Switch to start/shutdown VmWare ESXi VM
# needs SSH active on ESXi host
# needs SSH public key from HomeAssistant in ESXi ssh authorized_keys config '/etc/ssh/keys-<username>/authorized_keys' Have a look here: https://kb.vmware.com/s/article/1002866
# get VM ID on ESXi commandline by 'vim-cmd vmsvc/getallvms' You need to set this in the scripts commands where 00 is shown
# needs VMware Tools installed on the VM you want to control
# change in Switch: ESXi ip address, VM ID, switch name and switch friendly name
switch:
# https://www.home-assistant.io/integrations/switch.command_line/
- platform: command_line
@kmplngj
kmplngj / pixoo64.yaml
Last active June 30, 2024 11:05
Home Assistant Configuration to add a Divoom Pixoo 64 as a light. Feel free to help me optimise this.
# Set pixoo_post_address in your secrets.yaml to your Pixoo64 rest api post address
# pixoo_post_address: http://192.168.foo.bar/post
# if you host Pixoo-Rest you could set url in the pixoo_rest_imageurl command
sensor:
- platform: rest
name: pixoo64 Data
resource: !secret pixoo_post_address
method: POST
payload: '{ "Command" : "Channel/GetAllConf" }'
value_template: "OK"
@kmplngj
kmplngj / newscript.sh
Created July 21, 2021 14:21 — forked from aaronNGi/newscript.sh
Boilerplate for new POSIX shell scripts
#!/bin/sh
prog_name=${0##*/}
version=1.0
version_text="Boilerplate for new scripts v$version"
options="h o: q v V"
help_text="Usage: $prog_name [-o <text>] [-hqvV] [<file>]...
Boilerplate for new scripts
@kmplngj
kmplngj / git-commit-template.md
Created March 19, 2021 12:01 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@kmplngj
kmplngj / fish-default-on-osx.sh
Created February 15, 2020 20:03
Setting Fish as your default shell on Mac OS X
$ brew install fish
$ echo "/usr/local/bin/fish" | sudo tee -a /etc/shells
$ chsh -s `which fish`
@kmplngj
kmplngj / ganalytics-with-autotrack-german-legal.html
Created March 14, 2016 09:42
Add Google Analytics and Autotrack with anonymize IP and no Cookie Storage
var root = app.activeDocument;
var result = getStyleByString(root, "Formatgruppe 2:Form\\:atgruppe 1:Zeichen\\:\\:format 1", "characterStyles");
$.bp();
function getStyleByString(root, string, property) {
stringResult = string.match (/^(.*?[^\\]):(.*)$/);
var cStyleName = (stringResult) ? stringResult[1] : string;
cStyleName = cStyleName.replace (/\\:/g, ":");
remainingString = (stringResult) ? stringResult[2] : "";