Skip to content

Instantly share code, notes, and snippets.

View anjannath's full-sized avatar
🏴‍☠️

Anjan Nath anjannath

🏴‍☠️
  • Red Hat
  • Earth
View GitHub Profile
@anjannath
anjannath / p2p_block_transmit_test.py
Created February 27, 2022 18:19
chaincode academy Bitcoin exercise
#!/usr/bin/env python3
# Copyright (c) 2017-2021 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Block transmit test
This is based on the example_test.py file, here the test tries
to generate a block in node1 send it to node2 and verify that
they received the block
"""
@anjannath
anjannath / crcd-client.go
Created February 14, 2022 09:40
quickly test the crc daemon api on window via namedpipe
package main
import (
"context"
"fmt"
"io/ioutil"
"net"
"net/http"
"os"
"time"
-----BEGIN PGP PUBLIC KEY BLOCK-----
mQINBGHTFp0BEADJMgfiJcxUMgajcNBSXZgWZEiiO/5IVDXjfinwyGe7Fx16uQsE
SYBZTcvn68ZZgKCoFVScsHCEf6lmHwwTW0pXqpVsmcT0ht15jtxDMxTBKQtCT2su
vEzBIH2pNK99vdlIjEMVR9hpYpCHV/MQyuHKib/m7WjW6gtHFjm2IVFCCeqAVXAj
V1HOQD5FBNcQyK+uTyvqqMUdzvPlJqdCxNqLMmeY18AcrpkQyyEWLwym0Yq6qxF0
CKDWeYuBycEIqA9qXD3jWDJBR/cYBFFEakCaa87u3rC3o8TAm+aoV/QJn0/+lRoL
u2WApH8zj8Z64W/sM2ITaAYeLImkArJyruahaitUEYryJg6zImP39K3d9ZyDvsZi
yojBvrNF3AiO8KShPTY6geGgN0oxwDre7ajORfeYe4BWW7yRN/Tlz/hF6gHl+K/M
L0DtT5iiv8TU3kedXsxSaI8djw6X8igYWUftBxGex3VORQGb8evauyIr8wjstbNI
@anjannath
anjannath / README.md
Created December 1, 2021 05:31 — forked from gbraad/README.md
  • slides
    • outline
      • intro
      • problem definition
      • how did you solve it how did you do it
        • swift -> react
          • it is complicated
            • HTML
  • JS (es6)
@anjannath
anjannath / readme.md
Created September 15, 2021 15:49 — forked from guillaumerose/readme.md
Microshift with podman machine

5 minutes to OpenShift on a Mac with podman machine and microshift.

Steps:

  1. brew install podman
  2. podman machine init
  3. podman machine start
  4. podman machine ssh

(in the ssh session)

@anjannath
anjannath / node_description
Last active August 27, 2020 11:11
OKD Stats
Name: crc-w6m86-master-0
Roles: master,worker
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/arch=amd64
kubernetes.io/hostname=crc-w6m86-master-0
kubernetes.io/os=linux
node-role.kubernetes.io/master=
node-role.kubernetes.io/worker=
node.openshift.io/os_id=fedora
@anjannath
anjannath / crc_client.js
Created July 10, 2020 06:42
Javascript to talk to crc daemon
const net = require('net');
const homedir = require('os').homedir();
const path = require('path');
const SOCKET_PATH = path.join(homedir, ".crc", "crc.sock");
function sendCommand(command, args) {
if (command === "") {
console.log("Command is required!!")
return
@anjannath
anjannath / daemonCleanup.ps1
Created July 9, 2020 06:14
PS Scripts for setup and cleanup of crc system tray on windows
$tempDir = $args[0]
$startUpFolder = "$Env:USERPROFILE\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"
function RemoveUserFromServiceLogon
{
# security template to modify SeServiceLogonRight
$securityTemplate = @"
[Unicode]
Unicode=yes
[Version]

Windows

Todo:

  1. Design config UI
  2. Use daemon config api to modify crc configuration
  3. Create a progress window and animate icon
  4. Prompt user for pull secret bundle if not configured

In progress:

  1. Reduce the number of UAC prompts during setup
@anjannath
anjannath / git-compressing-and-deltas.md
Created May 30, 2020 18:19 — forked from matthewmccullough/git-compressing-and-deltas.md
Git, Compression, and Deltas - An explanation

Git Compression of Blobs and Packfiles.

Many users of Git are curious about the lack of delta compression at the object (blob) level when commits are first written. This efficiency is saved until the pack file is written. Loose objects are written in compressed, but non-delta format at the time of each commit.

A simple run though of a commit sequence with only the smallest change to the image (in uncompressed TIFF format to amplify the observable behavior) aids the understanding of this deferred and different approach efficiency.

The command sequence:

Create the repo: