Skip to content

Instantly share code, notes, and snippets.

View soflane's full-sized avatar

Sofiane A. soflane

View GitHub Profile
@benjaminrau
benjaminrau / Readme.md
Last active March 12, 2024 09:15
Home Assistant (HASS) with Homekit, Television Volume Control and Fire TV Stick connected to Sony Bravia

Home Assistant (HASS) with Homekit, Television Volume Control and Fire TV Stick connected to Sony Bravia

Basically it integrates and older Sony Bravia TV with Fire TV Stick on HDMI via Home Assistant in Apple Homekit with Siri Voice Control for Volume, Mute and Turning TV on and off.

Features of my setup

  • Voice control for television on, off, mute, set volume, play, pause
  • Control for television on, off, mute, set volume and input (which app to start) in Home app
  • Turn on TV light scene when TV starts playing
  • iOS Remote Widget inputs are forwarded to media player & Android TV

Used Integrations

@codebytes
codebytes / DevMachineSetup.ps1
Last active April 8, 2024 17:25
DevMachineSetup
#Install WinGet
#Based on this gist: https://gist.github.com/crutkas/6c2096eae387e544bd05cde246f23901
$hasPackageManager = Get-AppPackage -name 'Microsoft.DesktopAppInstaller'
if (!$hasPackageManager -or [version]$hasPackageManager.Version -lt [version]"1.10.0.0") {
"Installing winget Dependencies"
Add-AppxPackage -Path 'https://aka.ms/Microsoft.VCLibs.x64.14.00.Desktop.appx'
$releases_url = 'https://api.github.com/repos/microsoft/winget-cli/releases/latest'
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
@sajidmohammed88
sajidmohammed88 / DI WPF-C#.md
Last active April 13, 2024 20:40
Dependency injection in WPF project with .net core

Dependency injection in WPF project with .net core

Delete StartupUri="MainWindow.xaml" from App.xaml
Install packages :
Microsoft.Extensions.Configuration.Json
Microsoft.Extensions.DependencyInjection
Microsoft.Extensions.Options.ConfigurationExtensions
Add the file appsettings.json in the root of the project to use it for configuration.
@natcl
natcl / docker-compose.yaml
Last active May 21, 2024 04:37
traefik: node-red + mosquitto using letsencrypt
version: "3.3"
services:
traefik:
image: "traefik:v2.2"
container_name: "traefik"
command:
- "--api=true"
- "--api.dashboard=true"
@pedrolamas
pedrolamas / docker-iptables-fix.sh
Created August 18, 2020 19:32
Script to fix Docker iptables on Synology NAS
#!/bin/bash
currentAttempt=0
totalAttempts=10
delay=15
while [ $currentAttempt -lt $totalAttempts ]
do
currentAttempt=$(( $currentAttempt + 1 ))
echo "Attempt $currentAttempt of $totalAttempts..."
@techthoughts2
techthoughts2 / Send-TelegramTextMessage
Last active June 9, 2023 14:37
This PowerShell function will send a Telegram message via the Telegram Bot API. Specify your Bot token and chat ID and send text messages to the specified Telegram chat via PowerShell.
<#
.Synopsis
Sends Telegram text message via Bot API
.DESCRIPTION
Uses Telegram Bot API to send text message to specified Telegram chat. Several options can be specified to adjust message parameters.
.EXAMPLE
$bot = "#########:xxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$chat = "-#########"
Send-TelegramTextMessage -BotToken $bot -ChatID $chat -Message "Hello"
.EXAMPLE
@hjbotha
hjbotha / free_ports.sh
Last active May 26, 2024 01:35
Free ports 80 and 443 on Synology NAS
#! /bin/bash
# NEWLY ADDED BACKUP FUNCTIONALITY IS NOT FULLY TESTED YET, USE WITH CARE, ESPECIALLY DELETION
# Developed for DSM 6 - 7.0.1. Not tested on other versions.
# Steps to install
# Save this script in one of your shares
# Edit it according to your requirements
# Backup /usr/syno/share/nginx/ as follows:
# # cd /usr/syno/share/
# # tar cvf ~/nginx.tar nginx
@halkyon
halkyon / cleanup-win10.ps1
Last active April 28, 2024 16:40
Cleanup Windows 10 Powershell script
##
## Windows 10 cleanup script.
## Remove dodgy tracking settings, unneeded services, all apps, and optional features that come with Windows 10. Make it more like Windows 7.
## NOTE: this was tested on Creators Update (1703) and Fall Creators Update (1709). Some of this may not work as expected on newer versions.
##
## Instructions
## 1. Run this script (under Powershell as Administrator):
## powershell -ExectionPolicy Bypass .\cleanup-win10.ps1
## 2. Let it run through, you may see a few errors, this is normal
## 3. Reboot
@beeman
beeman / remove-all-from-docker.sh
Created November 15, 2016 03:04
Remove all from Docker
# Stop all containers
docker stop `docker ps -qa`
# Remove all containers
docker rm `docker ps -qa`
# Remove all images
docker rmi -f `docker images -qa `
# Remove all volumes
@isc30
isc30 / install.bash
Last active January 27, 2021 10:38
Raspberry Pi Install PHP7 + Nginx + MySQL + PhpMyAdmin (last versions)
#!/bin/bash
# Thanks to https://gist.github.com/Lewiscowles1986/ce14296e3f5222082dbaa088ca1954f7
if [ "$(whoami)" != "root" ]; then
echo "Run script as ROOT please. (sudo !!)"
exit
fi
echo "deb http://mirrordirector.raspbian.org/raspbian/ stretch main contrib non-free rpi" > /etc/apt/sources.list.d/stretch.list
echo "APT::Default-Release \"jessie\";" > /etc/apt/apt.conf.d/99-default-release