Skip to content

Instantly share code, notes, and snippets.

@PackeTsar
PackeTsar / byobu-ssh-cheatsheet.md
Last active March 28, 2024 01:36
Byobu (over SSH) Cheat Sheet

Byobu (over SSH) Cheat Sheet

I often find myself using Byobu on a Linux machine when connected to it over SSH. In doing so, I've noticed that many of the documented keyboard shortcuts don't work. This can be due to the native PC's OS intercepting certain keys, or possibly other reasons.

Below is a cheatsheet with Byobu features I have found usually work when run over a SSH connection.

Action Windows + Putty to Ubuntu MacOS + Terminal to Ubuntu
Help menu BASH: byobu-config FN-F1
Create new window CTRL-a c CTRL-a c or FN-F2
@akiya64
akiya64 / .gitlab-ci.yml
Created May 12, 2021 08:23
Backstopjs on GitLab CI and Pages
stages:
- get_reference
- regression_test
- publish
backstopjs_reference:
stage: get_reference
image:
name: backstopjs/backstopjs:latest
entrypoint: [""]
@niro1987
niro1987 / zha_ikea_tradfri_5button_remote_custom.yaml
Last active January 15, 2022 08:56
Home Assistant - Blueprint - ZHA - IKEA TRADFRI - 5 Button Remote - Custom Actions
---
# This automation simulates the use of the IKEA TRADFRI Remote control
# connected through ZHA.
blueprint:
source_url: https://github.com/niro1987/homeassistant-config/blob/main/blueprints/automation/niro1987/zha_ikea_tradfri_5button_remote_custom.yaml
name: ZHA - IKEA TRADFRI - 5 Button Remote - Custom Actions
description: >-
@waako
waako / pre-commit
Created March 6, 2019 14:28 — forked from KeyboardCowboy/pre-commit
Check for Drupal Debugging Statements Before Committing Code
#!/bin/bash
#
# Check for debugging statements before commiting your code.
# Place this file in the .git/hooks directory of your project.
# List of function names to search for in regex format
FUNCTIONS='dpm|kpr|qpr|kint|dd|console\.log'
# If any functions are found as executable, prevent the commit.
DIEONFAIL=true
@lordneon
lordneon / steps.md
Last active April 26, 2024 09:58
UK Light Wiring with Shelly 1

Intro

This is a simple guide on how to automate UK lights with a Shelly 1 by installing the shelly 1 relay into the ceiling pendant which has both permanent live, neutral and a switched live back from the wall switch.

These steps are from my own experience making my lighting "smart" but also user friendly (it works via a wall switch!). This simple guide will go through replacing an a normal ceiling pendant with one with room for a Shelly 1. If you have a ceiling light with a bigger base it's even easier.

Warning Electrical regulations must be followed by law. If you are not a competent person under the regulations do not attempt electrical work. https://www.diydoctor.org.uk/projects/electrical_safety.htm

Wiring Diagram

This diagram has been taken from here and modified to include the Shelly 1. Wiring Diagram

@johnny5th
johnny5th / svg_img_load.js
Created September 19, 2018 19:22
SVG Image Loading
// SVG Masked Images
var masked_images = document.querySelectorAll('.svg-masked-image');
var changeHref = function(path, img_wrapper) {
var image = img_wrapper.querySelector('svg g image');
image.setAttributeNS('http://www.w3.org/1999/xlink', 'xlink:href', path);
};
for(let i = 0; i < masked_images.length; i++) {
let img = masked_images[i].querySelector('img');
@matt-bailey
matt-bailey / github-pages-custom-domain-gandi-dns-records.md
Last active May 6, 2024 21:44
How to set up DNS records on gandi.net to use a custom domain on Github Pages

How to set up DNS records on gandi.net to use a custom domain on Github Pages

You would think it would be easy to find this information, but none of the Github or Gandi documentation is clear so I have recorded the required steps here.

Create the following A records:

@ 1800 IN A 185.199.108.153
@ 1800 IN A 185.199.109.153
@ 1800 IN A 185.199.110.153
@ValdikSS
ValdikSS / huawei-fw-list.txt
Last active April 26, 2024 21:03
Huawei firmware files found on update server
==========================================================================
DO NOT WRITE ANY QUESTIONS IN COMMENTS
==========================================================================
This is not appropriate place for discussions. Keep this list FW-only.
I do NOT have any firmware files apart from published here or on 4pda. Please do not contact me for firmware files requests.
This is a list of files found on Huawei update server by brute-forcing URL parameters.
Some firmware files have changelogs. Just change file name to "changelog.xml" in the end of the URL.
@dehnio
dehnio / README.md
Last active May 28, 2017 17:38
Hourly ON/OFF Week Scheduler Dashboard - DEHN.IO v0.1

This allows users to set up a 24h scheduler for each day of the week in a quick and easy way.

It is a customization of robertsLando Temperature/ON-OFF Week Scheduler UI-Template Node-Red Dashboard, which is a customization of Peter Scargill Thermostat Weekend, so all credits goes to those two.

You should edit the backup & Restore File Nodes to point where you will save the setting and then create the file in that folder.

Fixed the 9 hour bug in the original from robertsLando and translated it to english.

scheduler

{% set image_file_path = content.field_teaser_image[0]['#media'].field_media_image.entity.uri.value %}
{% set image_file_alt = content.field_teaser_image[0]['#media'].field_media_image.0.alt %}
<div class="teaser__image">
{% if node.field_teaser_image_style.value == 'portrait' %}
<a href="{{ url }}">
<img src="{{ image_file_path | image_style('portrait_teaser') }}" alt="{{ image_file_alt }}">
</a>
{% endif %}