Skip to content

Instantly share code, notes, and snippets.

View HoLengZai's full-sized avatar
💭
In The Cloud

HoLengZai

💭
In The Cloud
View GitHub Profile
@EverythingSmartHome
EverythingSmartHome / esp32-voice.yaml
Last active April 18, 2024 18:53
ESP32 & ESPHome Voice Assistant
esphome:
name: esp32-mic-speaker
friendly_name: esp32-mic-speaker
on_boot:
- priority: -100
then:
- wait_until: api.connected
- delay: 1s
- if:
condition:
@jay0lee
jay0lee / popimap.sh
Last active August 30, 2021 18:54
Shell script that can do OAuth, domain-wide delegation or password based IMAP/POP/SMTP authentication
#!/bin/bash
#
# This script should be run from Linux and uses basic tools like grep, awk, date and openssl.
# You need to populate the client_id and client_secret variables below
# with your own GCP project values. Sample command lines:
#
# Use 3-legged IMAP OAuth (default):
# bash popimap.sh --email myaccount@example.com --protocol imap
#
# Use a service account and domain-wide delegation:
@allene
allene / python-azure-blob-storage-download.py
Last active August 1, 2021 19:25 — forked from brijrajsingh/python-azure-blob-storage-download.py
Downloadin an Azure Storage Blob Container with complex path of folders and sub folders
import os
from azure.storage.blob import BlobServiceClient,ContainerClient, BlobClient
import datetime
# Assuming your Azure connection string environment variable set.
# If not, create BlobServiceClient using trl & credentials.
#Example: https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobserviceclient
connection_string = os.getenv("AZURE_STORAGE_CONNECTION_STRING")
@joerodgers
joerodgers / Get-KeyVaultSecret.ps1
Last active August 4, 2022 08:27
Example using REST and PowerShell to retrieve a secret from Azure Key Vault via AAD Service Principal credential
function Get-AccessToken
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true,ParameterSetName='Resource')]
[Parameter(Mandatory=$true,ParameterSetName='Scope')]
[string]$ClientId,
[Parameter(Mandatory=$true,ParameterSetName='Resource')]
@carlolars
carlolars / .wsl-git.md
Last active February 4, 2024 07:21
HOWTO: Use WSL and its Git in a mixed development environment

How to setup a development environment where Git from WSL integrates with native Windows applications, using the Windows home folder as the WSL home and using Git from WSL for all tools.

Note if using Git for Windows, or any tool on the Windows side that does not use Git from WSL then there will likely be problems with file permissions if using those files from inside WSL.

Tools

These are the tools I use:

  • git (wsl) - Command line git from within WSL.
  • Fork (windows) - Git GUI (must be used with wslgit)
  • wslgit - Makes git from WSL available for Windows applications. Important! Follow the installation instructions and do (at least) the first optional step and then the Usage in Fork instructions.
param
(
[Parameter(Mandatory = $true)]
[string]$pat,
[Parameter(Mandatory = $true)]
[string]$instance,
[Parameter(Mandatory = $true)]