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 / 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" {
@styk-tv
styk-tv / ADExport.ps1
Created June 28, 2019 11:05
Export AD Groups with Members as CSV
#// Start of script
#// Get year and month for csv export file
$DateTime = Get-Date -f "yyyy-MM"
#// Set CSV file name
$CSVFile = "C:\AD_Groups"+$DateTime+".csv"
#// Create emy array for CSV data
$CSVOutput = @()
@styk-tv
styk-tv / git-status-recursive
Created September 7, 2018 19:41 — forked from dbu/git-status-recursive
recursive git status
#!/usr/bin/php
<?php
$repos = array();
exec('find -type d -name .git | sed -e "s/\.git//"', $repos);
foreach ($repos as $repo) {
$status = shell_exec("cd $repo && git status");
if (false == strpos($status, 'nothing to commit (working directory clean)')) {
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n";
}
}