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 / 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:

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
import urllib2
import json
def rpc_call(url, method, args):
data = json.dumps({
'id': 1,
'method': method,
'params': [args]
}).encode()
@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",
@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 / 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 / irc.md
Created February 22, 2019 08:02 — forked from xero/irc.md
irc cheat sheet

#IRC Reference

Not intended as a guide for newbies, more like a "cheat sheet" for the somewhat experienced IRC user, especially one who wields some power over a channel.

##The Basics

  • /join #channel
    • Joins the specified channel.
  • /part #channel
    • Leaves the specified channel.
#!/usr/bin/env bash
vol_list=$(sudo virsh vol-list --pool default | grep test1 | awk '{print $1}')
for vol in $vol_list
do
sudo virsh vol-delete $vol --pool default
done
sudo virsh net-destroy test1
sudo virsh net-undefine test1