clear
sudo apt=get update && sudo apt-get upgrade
whoami
hostname
ls
ls -l
clear
sudo apt=get update && sudo apt-get upgrade
whoami
hostname
ls
ls -l
vi ~/.bash_profile | |
vi /Users/vinkrish/.bash_profile | |
export JAVA_HOME=$(/usr/libexec/java_home) | |
source ~/.bash_profile | |
echo $JAVA_HOME | |
/usr/local/Cellar/openjdk/17.0.2/libexec/openjdk.jdk/Contents/Home | |
earlier JAVA_HOME: |
LEARN KUBERNETES BASICS: | |
Create a Cluster: | |
minikube version | |
minikube start | |
kubectl version | |
kubectl cluster-info | |
kubectl get nodes |
let findAndOrCondition= (obj) => Object.entries(obj).filter(([key, value]) => key === 'condition' && value === 'and' || value === 'or'); | |
const constructCondition = (conditionString, rule_object) => { | |
if(findAndOrCondition(rule_object).length > 0) { | |
conditionString.val += '(' | |
let rules = rule_object.rules | |
console.log('rules', rules) | |
for(var i=0; i<rules.length; i++) { | |
let rule_obj = rules[i] | |
if(findAndOrCondition(rule_obj).length > 0) { |
from os.path import join, dirname, abspath | |
import xlrd | |
xlrd.xlsx.ensure_elementtree_imported(False, None) | |
xlrd.xlsx.Element_has_iter = True | |
fname = join(dirname(dirname(abspath(__file__))), 'dir_name', 'file_name.xlsx') | |
xl_workbook = xlrd.open_workbook(fname) |
from os.path import join, dirname, abspath | |
import psycopg2 | |
import psycopg2.extras | |
import xlrd | |
xlrd.xlsx.ensure_elementtree_imported(False, None) | |
xlrd.xlsx.Element_has_iter = True | |
fname = join(dirname(dirname(abspath(__file__))), 'dir_name', 'file_name.xlsx') |
Visual Studio Code: | |
Ctrl+' = Toggle Terminal | |
Cmd + P = Go to File | |
Cmd + o = Opens file in finder | |
Cmd + Shift + k = Delete Line | |
Shift + Alt + F = Format with Indentation | |
Shift + Cmd + L = multi-word selection | |
Cmd + Alt + Up/Down = Selects in a column directly up or down from the cursor's position | |
Ctrl + k + 0 = Fold all section | |
Ctrl + k + j = Unfold all section |
Designing Event-Driven Systems book by Ben Stopford contains a lot of useful links to papers, books, documentation and definitions related to event driven design and Kafka. I just extracted them as reference for the future and added some groups to show them better.
You can read the book for free
//return an array of objects according to key, value, or key and value matching | |
function getObjects(obj, key, val) { | |
var objects = []; | |
for (var i in obj) { | |
if (!obj.hasOwnProperty(i)) continue; | |
if (typeof obj[i] == 'object') { | |
objects = objects.concat(getObjects(obj[i], key, val)); | |
} else | |
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not) | |
if (i == key && obj[i] == val || i == key && val == '') { // |