Skip to content

Instantly share code, notes, and snippets.

@debsahu
debsahu / esphome_dotmatrix_display.yaml
Last active November 9, 2023 17:04
ESPHome config for connected ESP8266 to MAX7219 Dot-Matrix Display to show useful information from HomeAssistant
esphome:
name: veneer_display
platform: ESP8266
board: d1_mini
wifi:
networks:
- ssid: !secret esphome_wifi_ssid1
password: !secret esphome_wifi_pass1
# - ssid: !secret esphome_wifi_ssid2

Synergy between Linux and Mac Os X

sharing a mouse and keyboard between two computers

A quick writeup for a working setup (Linux is Server, Mac is Client)

synergy.conf:

section: screens
    linux:
 mac:
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@dglaude
dglaude / 1st_readme.txt
Last active January 6, 2024 14:14
Home Assistant Rainbow Loop with Ikea Tradfri RGB light
Please find below the various piece of code that together control my RGB light to loop in Rainbow.
Every two seconds, it change from one colour to another based on the value of the second.
So it compute 30 differents RGB value in a "circle", all with the same Saturation and Brightness both forced to 1.0
The transition from one colour to another is done in one seconds.
The name of my Tradfri RGB light bulb is "light.couleur"
A link to my video on Twitter:
https://twitter.com/DavidGlaude/status/1059596285991366657
@jebarjonet
jebarjonet / codeToFlag.js
Last active February 6, 2023 15:57
Transforms a country code (ISO 3166-1 alpha-2) into corresponding flag emoji
import { toUpper } from 'lodash'
export const codeToFlag = (code: string): string =>
String.fromCodePoint(
...toUpper(code)
.split('')
.map(c => 127397 + c.charCodeAt(0)),
)
// codeToFlag('fr') => 🇫🇷
@totti2
totti2 / SSRPARI_Snapserver_Snapclient_RPi3.md
Last active July 27, 2023 08:41
Synchronous multi-room sound casting of Bluetooth, Airplay, Line-In and Spotitfy

Synchronous multi-room sound casting of Bluetooth, Airplay, Line-In and Spotitfy

ALL CREDITS TO @badaix AND @BaReinhard

This will setup a raspberry-pi-3 as a snapcast-server and snapcast-client.
Possible music sources for the snapserver-component: Bluetooth, Airplay, Spotify, Line-In (more to come eg. RTP)
Music sinks (snapclients): usb soundcard connected to my stereo, another Pi

To Do:

  • Energy saving by disabling onboard bluetooth, wifi and soundcard

CEC-Detection

Want to control a TV over HDMI-CEC via a remote RasPi? Include the following as a switch:

platform: command_line
switches:
    tv_power:
      command_on: "ssh pi@<ip_address> -i /home/homeassistant/.homeassistant/id_homeassistant 'echo on 0 | cec-client -s -d 1'"
 command_off: "ssh pi@ -i /home/homeassistant/.homeassistant/id_homeassistant 'echo standby 0 | cec-client -s -d 1'"
@marcan
marcan / linux.sh
Last active December 1, 2023 15:18
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@carlessanagustin
carlessanagustin / Nginx_Cheat_Sheet.md
Last active April 18, 2024 20:18
Nginx Cheat Sheet
@tilap
tilap / install.sh
Created January 29, 2016 08:23
Share your git hooks in a project: basic script to install them all
#!/bin/bash
# Basic script to set custom project hook and share it with other developpers
# original script from http://stackoverflow.com/questions/3462955/putting-git-hooks-into-repository/3464399#3464399
#
# cd [path-of-the-script]
# . install.sh
#
# Folders usecase
# /.git