Skip to content

Instantly share code, notes, and snippets.

@lesovsky
lesovsky / postgresql-13.md
Created August 11, 2021 11:38
PostgreSQL 13

PostgreSQL 13

Major features:

  • Оптимизация хранения и производительности за счет дедупликации в B-tree индексах.
  • Улучшение производительности запросов с использованием агрегатов или работающих с партицонированными таблицами.
  • Улучшенное планирование запросов с использованием расширенной статистики.
  • Параллельное вакуумирование индексов.
  • Инкрементальная сортировка.
@checco
checco / postgres-owner-grants.sql
Last active June 14, 2023 15:19
How to change OWNER for DATABASE, SCHEMA or TABLE on AWS RDS PostgreSQL. An how to REASSIGN owner for all objects on AWS RDS PostgreSQL
--
-- Change database owner
--
ALTER DATABASE "db_name" OWNER TO user;
--
-- List schemas
--

Summary

Опиши в 3-4 предложениях что происходило и почему. Это информативное представление о факапе с высоты птичьего полета, оно должно быть понятно любому человеку без контекста.

Ущерб

Качественная оценка Какая функциональность не работала, насколько долго, у кого. Была ли потеря или порча данных. Выбери поле справа.

Количественная оценка

@abhirockzz
abhirockzz / create-redis-cluster.sh
Created August 31, 2018 11:51
Use redis-cli to create a Redis Cluster on Docker (with Redis 5.0)
#------------ bootstrap the cluster nodes --------------------
start_cmd='redis-server --port 6379 --cluster-enabled yes --cluster-config-file nodes.conf --cluster-node-timeout 5000 --appendonly yes'
redis_image='redis:5.0-rc'
network_name='redis_cluster_net'
docker network create $network_name
echo $network_name " created"
#---------- create the cluster ------------------------
@djraw
djraw / convert-jks-to-pem.txt
Created March 3, 2018 17:04
Export private key from a Java Keytool keystore to pem
Use Java keytool to convert from JKS to P12...
Export from keytool's proprietary format (called "JKS") to standardized format PKCS #12:
keytool -importkeystore -srckeystore keystore.jks -destkeystore keystore.p12 -deststoretype PKCS12 -srcalias <jkskeyalias> -deststorepass <password> -destkeypass <password>
...then use openssl to export from P12 to PEM
Export certificate using openssl:
@monodot
monodot / ssl-testing.md
Last active April 21, 2022 13:00
Using openssl to test an SSL connection with a CA file, pulled out from a Java keystore

Java, do you trust me? 🤔

Using openssl to test an SSL connection to google.com, using a CA file that's been pulled out from a Java keystore. For those days when you want to verify that you've got the right certificate in the store:

  1. Download the Equifax root certificate (which is the root CA for Google)
  2. Import the certificate into a new Java keystore
  3. Export the certificate back out again
  4. Convert the certificate to PEM
  5. Use openssl to test an SSL connection to Google with that cert
@wesm
wesm / parquet-benchmark-20170210.py
Created February 10, 2017 18:07
Parquet multithreaded benchmarks
import gc
import os
import time
import numpy as np
import pandas as pd
from pyarrow.compat import guid
import pyarrow as pa
import pyarrow.parquet as pq
import snappy
@houtianze
houtianze / sysv.init.script.to.systemd.unit.file.md
Last active May 8, 2024 18:15
Convert SysV Init scripts to Systemd Unit File

Let's say you have a SysV Init Script named foo

  1. Copy the file to /etc/init.d/foo

  2. Enable the SysV service: chkconfig --add foo

  3. Enable the SysV service: chkconfig foo on

  4. Start the service: service foo start. After this, systemd-sysv-generator will generate this file /run/systemd/generator.late/foo.service, copy this file to /etc/systemd/system by running: cp /run/systemd/generator.late/foo.service /etc/systemd/system/foo.service

  5. Edit /etc/systemd/system/foo.service by running systemctl edit foo.service, add in the following line to foo.servie (this makes the service installable)

[Install]

@dreikanter
dreikanter / encrypt_openssl.md
Last active June 20, 2024 10:15 — forked from crazybyte/encrypt_openssl.txt
File encryption using OpenSSL

Symmetic encryption

For symmetic encryption, you can use the following:

To encrypt:

openssl aes-256-cbc -salt -a -e -in plaintext.txt -out encrypted.txt

To decrypt:

@zhujunsan
zhujunsan / Using Github Deploy Key.md
Last active June 4, 2024 10:08
Using Github Deploy Key

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key