Skip to content

Instantly share code, notes, and snippets.

View mustakimali's full-sized avatar
🦀
.expect("it just works!");

~/mustakim mustakimali

🦀
.expect("it just works!");
View GitHub Profile
@mustakimali
mustakimali / zed-keymap.json
Last active February 11, 2026 14:03
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",
"ctrl-g ctrl-g": "editor::GoToDefinition",
"ctrl-k ctrl-c": "editor::ToggleComments",
"ctrl-/": "vim::Search",
@mustakimali
mustakimali / README.md
Last active July 1, 2025 19:54
mkcd - Make Directory and Change Directory

mkcd - Make Directory and Change Directory

A simple shell utility that creates a directory and immediately changes into it.

What it does

The mkcd function combines mkdir -p and cd into a single command:

  • Creates the specified directory (and any parent directories if needed)
  • Changes into the newly created directory
@mustakimali
mustakimali / Dockerfile
Created January 4, 2025 13:30
Transcribe podcasts using OpenAI's free Whisper language model
FROM ubuntu:latest
WORKDIR /app
# source: https://pypi.org/project/openai-whisper/
RUN apt-get update
RUN apt-get install curl git ffmpeg python3-pip python3.12-venv -y
RUN python3 -m venv .venv
RUN .venv/bin/pip install -U openai-whisper
RUN .venv/bin/pip install --upgrade --no-deps --force-reinstall git+https://github.com/openai/whisper.git
RUN .venv/bin/pip install setuptools-rust
@mustakimali
mustakimali / openssl_jwe_cheatsheets.md
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
mustakimali / goaccess-kubernetes-nginx-ingress.py
Last active February 9, 2022 20:40
Gets logs from nginx-ingress container and generate GoAccess dashboard for each of the services + all combined (Blog: https://mustak.im/server-side-kubernetes-nginx-ingress-log-analysis-using-goaccess/)
#!/usr/bin/python
import os
import subprocess
def process_log_for_svc(svc,out):
print('Processing ' + svc)
os.system("rm -f /storage/goaccess/imported-logs/imported-log.log")
os.system('find /var/log/containers/ | grep nginx-ingress | xargs sudo cat | grep ' + svc + ' >> /storage/goaccess/imported-logs/imported-log.log')
@mustakimali
mustakimali / update-dotnet-daily.sh
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
#!/bin/bash
set -eu
rm -rf ~/bin/dotnet-daily || true
mkdir ~/bin/dotnet-daily || true
wget -P ~/bin/dotnet-daily/ https://dotnet.microsoft.com/download/dotnet/scripts/v1/dotnet-install.sh
chmod +x ~/bin/dotnet-daily/dotnet-install.sh
~/bin/dotnet-daily/dotnet-install.sh -c main -v latest --install-dir ~/bin/dotnet-daily
#wget -P ~/bin/dotnet-daily/ https://aka.ms/dotnet/net6/dev/Sdk/dotnet-sdk-linux-x64.tar.gz
syntax = "proto3";
import "google/protobuf/empty.proto";
package GrpcDotNetDemoPackage;
service DemoService {
rpc SayHello(HelloRequest) returns (HelloResponse);
rpc SayHelloToNobody(google.protobuf.Empty) returns (HelloResponse);
}
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<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" />
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Grpc.AspNetCore.Server" Version="0.1.22-pre2" />
</ItemGroup>
using System;
using System.Net.Http;
using System.Threading.Tasks;
using Grpc.Net.Client;
using GrpcDotNetDemoPackage;
namespace Client
{
class Program
{