Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cezarypiatek's full-sized avatar
🎹
Coding

Cezary Piątek cezarypiatek

🎹
Coding
View GitHub Profile
@cezarypiatek
cezarypiatek / gist:3a605492f49883c05afd604b0d4e4772
Created September 17, 2023 09:04
ZeroMQ deployment on K8s
https://cloud.google.com/kubernetes-engine/docs/tutorials/deploying-memcached-on-kubernetes-engine
https://github.com/kubernetes/kubernetes/issues/92639
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#stable-network-id
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/
https://kubernetes.io/docs/concepts/services-networking/service/#headless-services
@cezarypiatek
cezarypiatek / AdbCommands
Created August 17, 2023 17:47 — forked from Pulimet/AdbCommands
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
# Disable apps
adb.exe shell 'pm list packages -f' |% {$($_ -split "=") | Select-Object -Last 1} | ogv -OutputMode Multiple |% {adb shell pm disable-user --user 0 $_}
# Enable aps
adb.exe shell 'pm list packages -f' |% {$($_ -split "=") | Select-Object -Last 1} | ogv -OutputMode Multiple |% {adb shell pm enable $_}
# Uninstall apps
adb.exe shell 'pm list packages -f' |% {$($_ -split "=") | Select-Object -Last 1} | ogv -OutputMode Multiple |% {adb shell pm uninstall -k --user 0 $_}
# Install module for winget
Install-Package Microsoft.WinGet.Client
# Show All installed package and uninstall selected
Get-WinGetPackage | Out-GridView -OutputMode Multiple | Uninstall-WinGetPackage
@cezarypiatek
cezarypiatek / README.md
Created May 9, 2023 20:56 — forked from manuelbl/README.md
ESP32 as Bluetooth Keyboard

ESP32 as Bluetooth Keyboard

With its built-in Bluetooth capabilities, the ESP32 can act as a Bluetooth keyboard. The below code is a minimal example of how to achieve it. It will generate the key strokes for a message whenever a button attached to the ESP32 is pressed.

For the example setup, a momentary button should be connected to pin 2 and to ground. Pin 2 will be configured as an input with pull-up.

In order to receive the message, add the ESP32 as a Bluetooth keyboard of your computer or mobile phone:

  1. Go to your computers/phones settings
  2. Ensure Bluetooth is turned on
param (
[Parameter(Mandatory=$true)]
[string]$apiKey,
[Parameter(Mandatory=$true)]
[string]$issueKey,
[Parameter(Mandatory=$true)]
[string]$timeSpent,
$a.ResourceDictionary.ChildNodes |? {$_.Key -match "Shortcut|Description"} |% {@{Type= $_.Key; Value= $_.'#text'; Id = $_.Key -replace '/Default/PatternsAndTemplates/LiveTemplates/Template/=(\w+)/(Description|Shortcut)/@EntryValue','$1'} } | Group-Object -Property Id |% { New-Object PSObject -Property @{ Shortcut = $_.Group[0].Value; Description = $_.Group[1].Value}} | Sort-Object -Property Shortcut | ogv
@cezarypiatek
cezarypiatek / SetVersion.xml
Last active February 15, 2022 07:22
Setting version for VisualStudio extensions based on the Version msbuild parameter
<Project>
<Target Name="GenerateAssemblyInfo" BeforeTargets="BeforeBuild">
<PropertyGroup>
<AssemblyInfoFileLines><![CDATA[
[assembly: System.Reflection.AssemblyFileVersionAttribute("$(Version)")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("$(Version)")]
[assembly: System.Reflection.AssemblyVersionAttribute("$(Version)")]
]]></AssemblyInfoFileLines>
</PropertyGroup>
<WriteLinesToFile Lines="$(AssemblyInfoFileLines)" File="$(IntermediateOutputPath)\AssemblyInfo.g.cs" Overwrite="true" />
//***************************************************************************
//
// Copyright (c) Microsoft Corporation. All rights reserved.
// This code is licensed under the Visual Studio SDK license terms.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//***************************************************************************
SCENARIO: should activate regular license for vs2019
STEP 1: Register purchase for VS2019
STEP 2: Activate the license
STEP 3: Verify that license activated properly