Skip to content

Instantly share code, notes, and snippets.

View styk-tv's full-sized avatar

Peter Styk styk-tv

View GitHub Profile
@styk-tv
styk-tv / xrstorage.js
Last active September 4, 2024 16:46
xrstorage.js
const xrstorage = {
storage: {},
save: function(key, value) {
this.storage[key] = value;
console.log(`Saved: ${key} = ${value}`);
},
load: function(key) {
const value = this.storage[key];
@styk-tv
styk-tv / xr-utils.js
Last active August 5, 2024 06:33
xr-utils.js
// xr-utils.js
class XrUtils {
constructor(storage) {
this.storageMock = storage;
}
eventEgress(dataSource) {
return (target, propertyKey, descriptor) => {
const originalMethod = descriptor.value;
@styk-tv
styk-tv / ubu22 openvpn client
Created January 27, 2023 12:40
ubu22 openvpn client
sudo apt install openvpn
sudo apt install network-manager-openvpn-gnome
sudo systemctl restart network-manager
sudo nmcli device status
sudo nmcli networking off
sudo nmcli networking on
@styk-tv
styk-tv / ubu22 visual studio code
Last active January 27, 2023 12:43
ubu22 visual studio code
USING SNAP (on path automatically)
sudo snap install --classic code
USING APT
sudo apt install software-properties-common apt-transport-https wget gpg
wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -D -o root -g root -m 644 packages.microsoft.gpg /etc/apt/keyrings/packages.microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/keyrings/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
@styk-tv
styk-tv / ubu22 docker
Last active January 27, 2023 12:43
ubu22 docker
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update
apt-cache policy docker-ce
sudo apt install docker-ce
sudo systemctl status docker
# RESTART AFTER THIS - LOGOUT OR (su - ${USER}) is temporary
@styk-tv
styk-tv / nvm-node-react-setup.txt
Last active March 18, 2023 08:54
NVM NODE REACT SETUP
-== NVM ==-
REPO: https://github.com/nvm-sh/nvm#install--update-script
INSTALL/UPDATE: wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
LOAD:
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm -v
0.39.3
@styk-tv
styk-tv / ubu22 pyenv
Last active May 12, 2023 14:47 — forked from jmvrbanac/install_pyenv.sh
ubu22 pyenv
#!/bin/bash
sudo apt-get install git python3-pip make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev curl liblzma-dev
sudo pip install virtualenvwrapper
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
git clone https://github.com/yyuu/pyenv-virtualenvwrapper.git ~/.pyenv/plugins/pyenv-virtualenvwrapper
git clone https://github.com/pyenv/pyenv-virtualenv.git ~/.pyenv/plugins/pyenv-virtualenv
@styk-tv
styk-tv / git-describe-semantic.py
Created September 30, 2019 22:57
semantic version from git describe tags (python3)
import sys
import subprocess
proc1 = subprocess.Popen("git describe --tags", stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
out = proc1.communicate()
if proc1.returncode != 0:
sys.stdout.write("fourbars must install from cloned folder. make sure .git folder exists\n")
sys.stdout.write(out[1])
raise SystemExit(32)
@styk-tv
styk-tv / openstack-instance-port.tf
Created September 7, 2019 00:45
openstack create port for instance
resource "openstack_networking_network_v2" "network_1" {
name = "network_1"
}
resource "openstack_networking_subnet_v2" "subnet_1" {
name = "subnet_1"
network_id = "${openstack_networking_network_v2.network_1.id}"
cidr = "192.168.1.0/24"
ip_version = 4
enable_dhcp = true
@styk-tv
styk-tv / tf_os_allowed-address_pairs.txt
Created September 1, 2019 19:13
Terraform Openstack Allowed Address Pairs
locals {
some_list_of_ips = [
"127.0.0.1",
"127.0.0.2",
"127.0.0.3"
]
}
resource "openstack_networking_port_v2" "test-adp" {