Skip to content

Instantly share code, notes, and snippets.

View labmonkey's full-sized avatar

Paweł Derehajło labmonkey

  • Zurich, Switzerland
View GitHub Profile
@labmonkey
labmonkey / Vagrantfile
Last active March 20, 2016 17:06
The scotchbox Vagrantfile with added xdebug. Tested and working with PHPStorm.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
@labmonkey
labmonkey / pre-commit.sh
Created January 25, 2016 12:39
Git hook that increments Wordpress plugin and theme version automatically based on number of commits!
#!/bin/bash
#
## DESCRIPTION
# Git hook that increments Wordpress plugin and theme version
# automatically based on number of commits!
#
## INSTALLATION
# In order to install put this file in git root and run this command:
#
# ln -s -f ../../pre-commit.sh .git/hooks/pre-commit
@labmonkey
labmonkey / after.sh
Last active March 19, 2017 14:52
Laravel after.sh file which enables xdebug properly (tested in PhpStorm)
#!/bin/sh
# If you would like to do some extra provisioning you may
# add any commands you wish to this file and they will
# be run after the Homestead machine is provisioned.
# might be /etc/php/7.0/fpm/conf.d/20-xdebug.ini depending of homestead verison
FILE=/etc/php/7.1/fpm/conf.d/20-xdebug.ini
sudo chmod 777 "$FILE"
@labmonkey
labmonkey / Sidebar.css
Created October 12, 2022 16:27
Sidebery (Firefox Extension) TreeStyleTab Sidebar Style/CSS
#root {
--tabs-height: 25px !important;
--tabs-font: message-box !important;
--tabs-fg: ButtonText !important;
--tabs-activated-fg: ButtonText !important;
--tabs-fg-hover: ButtonText !important;
--tabs-activated-bg: none !important;
--tabs-bg-hover: none !important;
--tabs-bg-active: none !important;
@labmonkey
labmonkey / Readme.md
Last active May 13, 2026 23:18
Sony Bravia Android TV -> Turn screen ON/OFF using ADB

Sony Bravia Android TV -> Turn screen ON/OFF using ADB

TLDR

By using this method https://gist.github.com/Ademking/e9141c8336de77c3ea1c390dc666bfaa I've recorded which button is the "PICTURE_OFF" on my remote that simply turns off the screen on Bravia TV and then triggered this from command line.

Story

I could not find any programmatic way to turn off the display of Sony Bravia TV that I could for example script in Home Assistant.

I was thinking that maybe somewhere there is an Android "Activity" which would trigger this via ssh but did not find any. In the end you can turn off Sony Bravia from the "Action Menu" that you can find in your remote (I think this menu is editable so maybe you have to add there this command but mine was there out of the box).

@labmonkey
labmonkey / Readme.md
Last active May 2, 2024 11:35
Script to manage Windows Taskbar Pinned Icons and Shortcuts

This script is a collection of methods that allow you to programatically manage your Windows taskbar icons.

The main purpose of this is to help the people who are using corporate laptops where the IT is forcefully managing the pinned icons. In my case I get the default pinned icons every time I reboot my laptop which is annoying.

There are many ways to run this script but I am using the only one that was not blocked on PC by IT which is to run Win+R and type there shell:startup. In the directory that just opened you can place the script or a Shortcut to it and then it will execute on every startup (might be delayed a bit depending on hoe many apps ru nat startup).

You can also see that I keep the script runing continuously in the background because in my case the IT is updating taskbar every 100 minutes so now I revert to my setup everr minute if needed.

@labmonkey
labmonkey / Readme.md
Last active May 3, 2024 11:00
My Dual Monitor and Dual PC/Laptop setup. Easy KVM alternative via scripts

Summary

This Guide describes how to have a KVM like solution but cheaper and maybe just good enough for you.

What hardware you need

  1. This works between any Windows machines. I have 1 Windows PC and 1 Windows Laptop.
  2. I am using 2 Monitors where both support at least 2 input sources and they also support DDC/CI (One has 1xDP + 1xHDMI and other 1xDP + 2xHDMI)
  3. I have a PCI-E graphics card in my PC that has multiple outputs. I bought a 4xUSB switch that supports 2 sources and a USB-C -> 2xDP adapter for laptop (as it had only 1 HDMI slot). It is way cheaper to have the devices separate because for some reason KVM devices that support high refresh rate monitors and/or 4K are very expensive while adapters are cheap.

In the end you have 2 deviced connected to both monitors simultaneously (as both monitors have at least 2 inputs, each for each device) and for the keybord, mouse etc. you use a separate USB switch (mine has a physical button but you ca

@labmonkey
labmonkey / Readme.md
Last active June 9, 2025 16:43
OpenVPN client connect and disconnect notification to Discord (working on AsusWRT)

Discord notification for OpenVPN Client connect and Disconnect + GeoIP lookup

  • simple: easy to understand code, just a text notification
  • advanced: discord embeds with fields + GeoIP country and city lookup
@labmonkey
labmonkey / Readme.md
Last active March 27, 2026 19:09
Philips Hue Lights - Scenes and Color Palettes

Philips Hue Lights - Scenes and Color Palettes

The following is a dump of all the Scenes and colors used by default Scenes in Philips Hue mobile app. I had 10 lights so each of the scenes is showing values for each of them. Normally a Scene has up to 6 color variants but I've decided to just list them all as it is. If you need unique values then it is easy to convert it.

It is useful if you want to use the scenes in your application with lights that are not Philips hue or if you don't have the Gateway to setup scenes and read the data etc.

I have included an .csv file which can be easily converted to anything and scenes.yaml file that can be imported as part of Home Assistant yaml configuration.

All of the lights have dummy names such as light.hue_1 up to light.hue_10 making it easier to replace the names with your own lights when importing to any other application.