Skip to content

Instantly share code, notes, and snippets.

View pimlie's full-sized avatar

Pim pimlie

  • NL
View GitHub Profile
@pimlie
pimlie / zigbee2mqtt-update-local-device-images.sh
Last active May 8, 2025 16:21
Zigbee2MQTT allows users to cache device images locally, but does this by downloading images for your currently configured files. This is half annoying as you have to remember to manually localise the device images after adding a new device, but it also allows Koenk/Github/Microsoft to track what zigbee devices users have running locally. This s…
#!/usr/bin/env bash
# Url from: https://github.com/nurikk/zigbee2mqtt-frontend/blob/dev/src/components/device-image/index.tsx
device_image_url="https://www.zigbee2mqtt.io/images/devices/"
# Zip file containing full repo https://github.com/Koenkk/zigbee2mqtt.io
zigbee2mqttio_url="https://github.com/Koenkk/zigbee2mqtt.io/archive/refs/heads/master.zip"
# Path to download above zip file to, relative from data folder
repo_zip_path="master.zip"
set -e
@pimlie
pimlie / howto-dell-service-menu.md
Last active April 14, 2024 08:18
Service menu on Dell monitors with just a joystick and power button

How to get to the service menu on a newer Dell monitor with just a joystick & power button

For example to check how many hours the monitor has been on?

⚠️ Changing settings in the service menu of a Dell monitor could void your warranty. Only proceed if you know what you are doing and are willing to take that risk

  1. Connect the monitor with either a hdmi or display-port input source (usb-c won't work, at least not for me)
  2. Make sure monitor is turned off
  3. Press & hold enter using the joystick (enter is just the center of the joystick)
  4. Double click on the power button (while holding enter down with the joystick)
@pimlie
pimlie / nuxt-proxy-hooks.js
Created April 25, 2020 12:53
nuxt-proxy-hooks.js
window.process = { client: true, server: false }
// definition of hooks that exists
nuxtHooks = {}
function addHook(n, h) {
nuxtHooks[n] = nuxtHooks[n] || []
nuxtHooks[n].push(h)
}
@pimlie
pimlie / monorepo-pkgs-md.js
Created September 26, 2019 08:51
Generate markdown for monorepo package sizes and dependencies (see eg https://github.com/nuxt/nuxt.js/wiki/Dependencies)
#!/usr/bin/env node
const fs = require('fs')
const path = require('path')
const https = require('https')
const repoPath = 'nuxt/nuxt.js'
const pkgNamespace = '@nuxt'
const branches = [
{
@pimlie
pimlie / b.sh
Created February 18, 2019 17:19
List component tag occurences in your project (eg to optimize bootstrap-vue components)
#!/usr/bin/env bash
extPattern="*.vue"
tagPattern="<b-[a-zA-Z\\\-]+"
srcFiles=($(find . -iname "$extPattern" ! -path '*node_modules*' ! -path '*.nuxt*' | sort))
components=()
for file in ${srcFiles[@]}; do
components+=($(cat "$file" | awk '{split($0, a, "'$tagPattern'", sep); for (k in sep) print substr(sep[k], 2) }' | sort -u));
/**
* Merge this in your nuxt.config.js or copy to examples/hello-world
* yarn build
* yarn start
* open index in browser (dont click About)
* edit and change pages/about.vue
* yarn build && yarn start
* click About in browser
* => page reloads
*/
@pimlie
pimlie / amdgpu-pro-17.50-patch-for-4.14.patch
Last active December 27, 2017 17:49
Patch to run amdgpu-pro 17.50 on a v4.14 Ubuntu mainline kernel ** not perfect, runs but crashes on drm_object_property_(g|s)et_value **
diff --git a/amd/amdgpu/amdgpu_drv.c b/amd/amdgpu/amdgpu_drv.c
index e55a293..64f9090 100644
--- a/amd/amdgpu/amdgpu_drv.c
+++ b/amd/amdgpu/amdgpu_drv.c
@@ -826,7 +826,9 @@ static struct drm_driver kms_driver = {
.open = amdgpu_driver_open_kms,
.postclose = amdgpu_driver_postclose_kms,
.lastclose = amdgpu_driver_lastclose_kms,
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
.set_busid = drm_pci_set_busid,
#!/usr/bin/env bash
img=$1
blocksize=15
img_width=300
img_height=300
w_steps=$(( img_width / blocksize ))
<?php
namespace App\Forms\Fields;
use Kris\LaravelFormBuilder\Fields\SelectType;
class Mapping extends SelectType
{
protected function getTemplate()
{
return 'fields.mapping';
@pimlie
pimlie / amdgpu-pro-16.50-patch-for-4.9.patch
Last active August 1, 2017 08:35
Patch to run amdgpu-pro 16.50 on a v4.9 Ubuntu mainline kernel
diff --git a/amd/amdgpu/amdgpu_acp.c b/amd/amdgpu/amdgpu_acp.c
index 252edba..892d60f 100644
--- a/amd/amdgpu/amdgpu_acp.c
+++ b/amd/amdgpu/amdgpu_acp.c
@@ -421,29 +421,6 @@ static int acp_suspend(void *handle)
static int acp_resume(void *handle)
{
- int i, ret;
- struct acp_pm_domain *apd;