Skip to content

Instantly share code, notes, and snippets.

View mustakimali's full-sized avatar

Mohammad Mustakim Ali mustakimali

View GitHub Profile
mustakimali / zed-keymap.json
Last active June 6, 2024 20:17
Zed keymap similar to VSCode for linux/windows
"context": "Editor",
"bindings": {
"ctrl-t": "project_symbols::Toggle",
"ctrl-shift-t": "file_finder::Toggle",
"ctrl-p": "command_palette::Toggle",
"alt-g alt-g": "editor::GoToDefinition",
"alt-f alt-f": "editor::FindAllReferences",
"alt-g alt-i": "editor::GoToImplementationSplit",
mustakimali /
Last active November 21, 2023 12:20
OpenSSL/JWE Cheatsheets

Some Useful Aliases

alias openssl-genkeys="openssl genrsa -out opensslgenkeys-private-key.pem 2048 \
                && openssl rsa -in opensslgenkeys-private-key.pem -out opensslgenkeys-public-key.pem -outform PEM -pubout \
                && openssl req -key opensslgenkeys-private-key.pem -new -x509 -days 3650 -out opensslgenkeys-crt.crt \
                && openssl pkcs12 -in opensslgenkeys-crt.crt -inkey opensslgenkeys-private-key.pem -export -out opensslgenkeys-pfx.pfx \
                && openssl pkcs12 -in opensslgenkeys-crt.crt -export -out opensslgenkeys-public-key.pfx -nokeys \
                && cat opensslgenkeys-pfx.pfx | base64 -w 0 > opensslgenkeys-pfx.pfx-b64 \
                && cat opensslgenkeys-public-key.pfx | base64 -w 0 > opensslgenkeys-public-key.pfx-b64 \
                && cat opensslgenkeys-private-key.pem \
mustakimali /
Last active September 1, 2021 18:21
bash file to update .net core daily build, to be used using `dn-pre`. ASSUMES: you already have ~/bin folder and included in the PATH
set -eu
rm -rf ~/bin/dotnet-daily || true
mkdir ~/bin/dotnet-daily || true
wget -P ~/bin/dotnet-daily/
chmod +x ~/bin/dotnet-daily/
~/bin/dotnet-daily/ -c main -v latest --install-dir ~/bin/dotnet-daily
#wget -P ~/bin/dotnet-daily/
c.Listen(IPEndPoint.Parse("", l =>
l.Protocols = HttpProtocols.Http2;
l.UseHttps(config =>
config.ServerCertificate = new X509Certificate2(Convert.FromBase64String("PFX-BASE64", "PASSWORD");
services.AddGrpcClient<DemoService.DemoServiceClient>(c =>
c.BaseAddress = new Uri("http://localhost:5000");
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Grpc.Net.Client;
using GrpcDotNetDemoPackage;
namespace Client
class Program
using System.Net;
using System.Threading.Tasks;
using Google.Protobuf.WellKnownTypes;
using Grpc.Core;
using GrpcDotNetDemoPackage;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Server.Kestrel.Core;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
<Project Sdk="Microsoft.NET.Sdk.Web">
<PackageReference Include="Grpc.AspNetCore.Server" Version="0.1.22-pre2" />
<Project Sdk="Microsoft.NET.Sdk">
<PackageReference Include="Grpc.Core" Version="1.22.0" />
<PackageReference Include="Grpc.Tools" Version="1.22.0-pre1" />
<PackageReference Include="Google.Protobuf" Version="3.9.0-rc1" />
syntax = "proto3";
import "google/protobuf/empty.proto";
package GrpcDotNetDemoPackage;
service DemoService {
rpc SayHello(HelloRequest) returns (HelloResponse);
rpc SayHelloToNobody(google.protobuf.Empty) returns (HelloResponse);