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 / SigningAssembly.md
Last active January 28, 2024 16:37
Signing assembly
  1. Generate SNK file (you need to run console as admin)
& "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe" -k ./MyKeys.snk
  1. Converting SNK file to base64 text file using PowerShell
@cezarypiatek
cezarypiatek / Example.cs
Last active October 22, 2023 16:33
Example provider for Swashbuckle
services.AddSwaggerGen(c =>
{
c.UseExampleFilter(e =>
{
e.DefineExample<AuthenticationController>(con => con.Login(new LoginCredentials
{
Login = "cezarypiatek",
Password = "secret"
}));
@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
# 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 $_}
@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
# 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,
@cezarypiatek
cezarypiatek / .editorconfig
Last active February 14, 2023 21:48
This snippet set severity level to error for different rules related to the reference nullability
[*.cs]
# CS8603: Possible null reference return.
dotnet_diagnostic.CS8603.severity = error
# CS8604: Possible null reference argument.
dotnet_diagnostic.CS8604.severity = error
# CS8606: Possible null reference assignment to iteration variable
dotnet_diagnostic.CS8606.severity = error
# CS8600: Converting null literal or possible null value to non-nullable type.
dotnet_diagnostic.CS8600.severity = error
# CS8602: Dereference of a possibly null reference.
$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