Skip to content

Instantly share code, notes, and snippets.

@zahedshareef
zahedshareef / tutorial.md
Created August 26, 2023 10:36 — forked from Makeshift/tutorial.md
Tutorial for automatically syncing an Obsidian vault with Git on an Android device

How to sync Obsidian with Git on Android

Limitations

  • If Termux is closed in the background by Android, the cron service will stop updating your repository and you must open Termux again. Refer to instructions for your device model to disable the killing of certain background applications.
  • This may negatively affect your devices battery life. I'm not entirely sure yet.

Setup

Setting up the agent SDK:


var agent = new Builder()
	.SetEnvironment(environment)
	.SetSandbox(init.Sandbox)
	.SetService(init.ServiceName)
	.SetServiceProvider(init.ServiceProviderName)
	.Build();
@zahedshareef
zahedshareef / EncryptedEnrollmentRequest.cs
Last active April 28, 2021 16:23
Sample Og Stack Client Enrollment API in .NET Core
public class EncryptedEnrollmentRequest
{
public string EncryptedData { get; set; }
public string EncryptedKey { get; set; }
public string PublicKeyFingerprint { get; set; }
public string HashingAlgorithm { get; set; }
}
@zahedshareef
zahedshareef / docker-compose.yml
Created March 17, 2021 11:02 — forked from rmoff/docker-compose.yml
Docker-Compose for Kafka and Zookeeper with internal and external listeners
---
version: '2'
services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
public static class RelativeTime
{
/// <summary>
/// Returns a humanized string indicating how long ago something
/// happened, eg "3 days ago". For future dates, returns when this
/// DateTime will occur from DateTime.UtcNow.
/// </summary>
public static string ToRelativeTime(this DateTime dt)
{
var utcNow = DateTime.UtcNow;
@zahedshareef
zahedshareef / CertCheck.cs
Created February 9, 2020 08:23
Check for Certificate Expiration
using System;
using System.Net;
using System.Net.Security;
using System.Security.Cryptography.X509Certificates;
using Xunit;
namespace CertCheck
{
public class ProductionServerCertificates
{
@zahedshareef
zahedshareef / The Technical Interview Cheat Sheet.md
Created August 26, 2018 13:50 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@zahedshareef
zahedshareef / service-checklist.md
Last active May 27, 2020 12:18 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?