Skip to content

Instantly share code, notes, and snippets.

View inadarei's full-sized avatar

Irakli Nadareishvili inadarei

View GitHub Profile
@inadarei
inadarei / python-dev-2022.md
Created November 4, 2022 01:39
Python DevEnv in 2022
> echo "Here we go"
import java.util.*;
class MovieDashboard {
public static void main(String[] args) {
System.out.println("Getting movies...");
MovieLister mv = new MovieLister();
Movie[] toWatch = mv.moviesDirectedBy("Quentin Tarantino");
System.out.println (Arrays.toString(toWatch));
}
}
@inadarei
inadarei / ipaddressclasses.md
Last active December 28, 2020 17:43
IP Address Classes, CIDRs and Network Masks

Network Classes

IP Addresses identify both a network as well as host on a network. Depending on the class of a network, certain amount of bits in the IP (32 bits overall) are allocated for network adressing and the rest is for: adressing the host on the network.

  1. Class A: first octet is network, last three: host
  2. Class B: first two octets are for network, last two: host
  3. Class C: first three octets are for network, only last octet is for host.

Furthermore, looking at the IP itself, you can tell which class of IP it is, using the following rules:

@inadarei
inadarei / minikube-sierra.md
Last active October 20, 2020 01:57
Minikube Setup: Docker for Mac / Sierra

Prerequisite: latest Docker for Mac on MacOS Sierra

$ brew update
$ brew install --HEAD xhyve
$ brew install docker-machine-driver-xhyve
$ sudo chown root:wheel $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve
$ sudo chmod u+s $(brew --prefix)/opt/docker-machine-driver-xhyve/bin/docker-machine-driver-xhyve

$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.18.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# Atom Editor's Must-Have Plugins
- AsciiDoc Preview
- hard-wrap
- Hey Pane
- Wordcount
@inadarei
inadarei / gotools.md
Last active July 1, 2020 12:21
Go Essential Tools and Libraries
@inadarei
inadarei / python3-on-macos.md
Last active May 15, 2020 12:17
Setting up Python3 Environment on MacOS High Sierra+ and/or Ubuntu

Installing Python 3.x and Pip3 on Mac

# Install Homebrew itself
> brew install python3
> python -V
Python 2.7.10
> python3 -V
Python 3.7.0
# Eureka!
@inadarei
inadarei / base64.js
Created January 6, 2013 04:11
base64 encode/decode in Node.js
var url = "http://cdn1.giltcdn.com/images/share/uploads/0000/0001/7250/172502872/420x560.jpg";
var encoded = new Buffer(url).toString('base64');
var decoded = new Buffer(encoded, 'base64').toString('ascii')
console.log(encoded);
console.log(decoded);
@inadarei
inadarei / nodedaemon.sh
Created June 24, 2011 18:40
Daemonize Node.js
#!/bin/bash
## Node.js App Launcher
## Usage: ./nodedaemon.sh /home/apps/projectname/app.js
## Baesed on: http://pastebin.com/wNJNkbjg
# name=`basename $1` # For when/if we want to use scriptname
name=`dirname $1 | xargs -0 basename` # When/if we want to use last folder name as project name
cd `dirname $1`
@inadarei
inadarei / statevscapability.md
Last active April 18, 2019 21:54
state vs capability thinking

State-oriented thinking

  1. Find me users whose names are "john"
  2. Retrieve current state of that user, for each user. Start loop:
  3. Is their name still "john"?
  4. Update the state of the user object so their name is now "johnnie"
  5. Clean-up loop

Capabilities-oriented exchange