Skip to content

Instantly share code, notes, and snippets.

View novokrest's full-sized avatar

Novokreshchenov Konstantin novokrest

View GitHub Profile
@novokrest
novokrest / World’s Simplest Database.md
Created December 15, 2022 19:10 — forked from abdennebi/World’s Simplest Database.md
World’s Simplest Database

#!/bin/bash

db_set () { echo "$1,$2" >> database }

db_get () { grep "^$1," database | sed -e "s/^$1,//" | tail -n 1 }

@novokrest
novokrest / free-database-hosting.md
Created December 13, 2022 13:02 — forked from bmaupin/free-database-hosting.md
Free database hosting
@novokrest
novokrest / vagrant-vmware-tech-preview-apple-m1-pro.md
Created November 19, 2022 20:22 — forked from sbailliez/vagrant-vmware-tech-preview-apple-m1-pro.md
Vagrant and VMWare Tech Preview on Apple M1 Pro

Vagrant and VMWare Tech Preview on Apple M1 Pro

This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated from discussions in hashicorp/vagrant-vmware-desktop#22

Created on: November 1, 2021 Updated on: September 17, 2022

Installing Rosetta

@novokrest
novokrest / postgres-brew.md
Created April 12, 2021 15:34 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@novokrest
novokrest / how-to-remove-postgres
Created May 10, 2020 07:24
How to remove Postgres
# https://www.liquidweb.com/kb/how-to-remove-postgresql/
dpkg -l | grep postgres
sudo apt-get --purge remove pgdg-keyring postgresql-10 postgresql-client-10 postgresql-client-common postgresql-common
@novokrest
novokrest / how-to-install-postgres-on-mac
Created April 11, 2020 12:07
How to install Postgres on Mac OS X
# https://www.codementor.io/@engineerapart/getting-started-with-postgresql-on-mac-osx-are8jcopb
brew install postgresql
pg_ctl -D /usr/local/var/postgres start && brew services start postgresql
# check
postgres -V
psql postgres
-- CREATE ROLE username WITH LOGIN PASSWORD 'quoted password';
@novokrest
novokrest / access_postgresql_with_docker.md
Created April 9, 2020 11:39 — forked from MauricioMoraes/access_postgresql_with_docker.md
Allow Docker Container Access to Host's Postgres Database on linux (ubuntu)

You have to do 2 things in order to allow your container to access your host's postgresql database

  1. Make your postgresql listen to an external ip address
  2. Let this client ip (your docker container) access your postgresql database with a given user

Obs: By "Host" here I mean "the server where docker is running on".

Make your postgresql listen to an external ip address

Find your postgresql.conf (in case you don't know where it is)

$ sudo find / -type f -name postgresql.conf

@novokrest
novokrest / how-to-install-postgres-on-ubuntu
Last active May 10, 2020 13:37
How to install Postgres on Ubuntu
# https://medium.com/coding-blocks/creating-user-database-and-adding-access-on-postgresql-8bfcd2f4a91e
# https://www.digitalocean.com/community/tutorials/how-to-install-and-use-postgresql-on-ubuntu-18-04
# https://www.liquidweb.com/kb/how-to-remove-postgresql/
$ export LANGUAGE="en_US.UTF-8"
$ echo 'LANGUAGE="en_US.UTF-8"' >> /etc/default/locale
$ echo 'LC_ALL="en_US.UTF-8"' >> /etc/default/locale
$ sudo locale-gen en_US en_US.UTF-8
$ sudo dpkg-reconfigure locales
@novokrest
novokrest / how-to-install-oracle-11-on-ubuntu
Last active April 5, 2020 14:28
Installing Java 11 from Oracle tar.gz archive on Ubuntu
# https://kifarunix.com/install-java-11-on-debian-9-8-ubuntu-18-04/
sudo apt install software-properties-common
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
# check
sudo apt-cache policy oracle-java11-installer-local
mkdir -p /var/cache/oracle-jdk11-installer-local
@novokrest
novokrest / bb-clone-repos.py
Created February 2, 2020 18:25
Python script to clone team's repositories from BitBucket
import os
import sys
import argparse
import subprocess
import requests as r
from os import path
from urllib.parse import urlparse
class Creds:
def __init__(self, team_name, auth, ssh_host_alias):