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 / Vagrantfile
Created April 5, 2019 06:09 — forked from ironcladlou/Vagrantfile
OpenShift 4.0 Installer on macOS
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "generic/fedora28"
config.vm.network "public_network"
config.vm.synced_folder ".", "/vagrant", type: "nfs"
config.vm.provider "vmware_desktop" do |v|
v.ssh_info_public = true
v.vmx["numvcpus"] = "2"
@anjannath
anjannath / tmux.md
Created October 21, 2019 05:55 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@anjannath
anjannath / bullshit.js
Created October 24, 2019 13:27 — forked from raydog/bullshit.js
Bullshit as a Service
var E_PREFIX_RATE = 0.25;
// All of our word lists:
var _word_lists = {
verb : [
"implement", "utilize", "integrate", "streamline", "optimize", "evolve", "transform", "embrace",
"enable", "orchestrate", "leverage", "reinvent", "aggregate", "architect", "enhance", "incentivize",
"morph", "empower", "envisioneer", "monetize", "harness", "facilitate", "seize", "disintermediate",
import urllib2
import json
def rpc_call(url, method, args):
data = json.dumps({
'id': 1,
'method': method,
'params': [args]
}).encode()

CRC has a daemon, which can be used to do some basic CRC operations, to start the daemon run crc daemon or with debug logging crc daemon --log-level debug In case of macOS and Windows, crc setup --enable-experimental-features will start the daemon but it'll also start the tray.

The daemon when started, listens on a Unix socket at $CRC_HOME/crc.sock, (~/.crc/crc.sock in linux and macOS) for commands/requests.. After connecting to the socket, it accepts commands as a JSON.

It understands a subset of the crc CLI commands:

CLI commands Daemon api Response
@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:

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 / 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]
@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 / 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