Skip to content

Instantly share code, notes, and snippets.

View Jeket's full-sized avatar

Jeket Jeket

View GitHub Profile
@Jeket
Jeket / dockerToLocalhost.md
Created October 25, 2021 17:15 — forked from zmts/dockerToLocalhost.md
Get access to localhost database from docker container

Get access to localhost database from docker container

  • Run containerized application on 0.0.0.0 address
  • Use host.docker.internal as database hostname
@Jeket
Jeket / imageSize.md
Created October 25, 2021 17:15 — forked from zmts/imageSize.md
Get image width and height with JavaScript

Get image width and height with JavaScript

function imageSize (image) {
  return new Promise((resolve, reject) => {
    try {
      const fileReader = new FileReader()

      fileReader.onload = () => {
 const img = new Image()
@Jeket
Jeket / pg_jsonb_push.md
Created October 25, 2021 17:16 — forked from zmts/pg_jsonb_push.md
Insert(push) object to nested array. JSONB PostgreSQL

Insert(push) object to nested array. JSONB PostgreSQL

// posts table

| id | content          |
|----|------------------|
| 40 | jsonb data       |
@Jeket
Jeket / ssh_cert.md
Created October 25, 2021 17:16 — forked from zmts/ssh_cert.md
ssh cert to remote server access

SSH cert to remote server access

Generate ssh certificate with unique filename. Stroring keys in separate files will help make backup without not related keys.

➜ cd /Users/alex/.ssh
➜ ssh-keygen -t rsa -b 4096 -f myproject_test -C "myproject comment"
Generating public/private rsa key pair.
@Jeket
Jeket / debian_do.md
Created October 25, 2021 17:17 — forked from zmts/debian_do.md
Первичная настойка Debian Linux/Разворачиваем серверную инфраструктуру на Digital ocean

Первичная настойка Debian Linux/Разворачиваем серверную инфраструктуру на Digital ocean

Для проектов среднего и небольшого размера не всегда оправданно использовать AWS/Kubernetes подобную технологию. Для проектов нуждающихся в нескольких серверах отлично подходит Digital ocean. Который к тому же предоставляет средства вертикального скейлинга(увеличение производительной мощности уже существующих серверов).

SSH cертификат

Создаем сертификат под которым будем логинится на сервера нашего проекта (на локальной машине)

ssh-keygen -t rsa -b 4096 -f /Users/alex/.ssh/myproject_test -C "myproject comment"

Не забываем сделать его бекап