Skip to content

Instantly share code, notes, and snippets.

View stalkerg's full-sized avatar
🎯
Focusing

Yury Zhuravlev stalkerg

🎯
Focusing
View GitHub Profile
@stalkerg
stalkerg / Perimeter-CLA.md
Last active October 11, 2021 13:45
Perimeter-CLA.md

Perimeter Contributor License Agreement

Individual Agreement

Individual Contributor License Agreement ("Agreement")

Thank you for your interest in the Perimeter project (“Project”). The Project is managed by the KD Vision, a Russian Private limited company, headquartered in Kaliningrad, Russia (the “Company”). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must have a Contributor License Agreement ("CLA") on file that has been agreed to by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Company, the Project and its users; it does not change your rights to use your own Contributions for any other purpose. By clicking “Sign in to Github to agree” and following the steps to sign in to Github, you acknowledge that you have read, understand and agree to be bound by this Agreement and comply with the KD Vision Company’s Code of Con

@stalkerg
stalkerg / Vangers-CLA.md
Last active March 10, 2020 09:40
Vangers CLA

Vangers Contributor License Agreement

Individual Agreement

Individual Contributor License Agreement ("Agreement")

Thank you for your interest in the Vangers project (“Project”). The Project is managed by the KranX Productions, a Russian Private limited company, headquartered in Kaliningrad, Russia (the “Company”). In order to clarify the intellectual property license granted with Contributions from any person or entity, the Company must have a Contributor License Agreement ("CLA") on file that has been agreed to by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of the Company, the Project and its users; it does not change your rights to use your own Contributions for any other purpose. By clicking “Sign in to Github to agree” and following the steps to sign in to Github, you acknowledge that you have read, understand and agree to be bound by this Agreement and comply with the KranX Company’s Code of Con

@stalkerg
stalkerg / SparkLine.html
Created August 6, 2018 06:53
Svelte Simple SparkLine Component
<svg viewBox="0 0 {maxWidth} {maxHeight}"
style="width: {width}; height: {height};vertical-align: middle;margin-top: {marginTop};"
preserveAspectRatio="none">
{#each data as value, index}
<path stroke="{ (value/maxHeight) * 100 > 80 ? colorDanger : color}"
stroke-width="{strokeWidth}"
d="M{(strokeWidth + 2) * index + strokeWidth/2} 100 V{ maxHeight - (value/maxHeight) * 100 }"
/>
{/each}
</svg>
@stalkerg
stalkerg / Clipboard.html
Last active January 20, 2022 08:52
Svelte component for copy to clipboard.
<script>
import { tick } from 'svelte';
let valueCopy = null;
export let value = null;
let areaDom;
async function copy() {
valueCopy = value;
await tick();
@stalkerg
stalkerg / cmake_10_v2.patch
Last active October 9, 2017 23:22
cmake_10_v2
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000000..795f34db48
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,1429 @@
+cmake_minimum_required(VERSION 2.8.4)
+
+project(Postgres C)
+
@stalkerg
stalkerg / ptrack_100_v7.patch
Last active November 17, 2016 11:46
ptrack patch v7 for Postgres 10
--- src/backend/access/heap/Makefile
+++ src/backend/access/heap/Makefile
@@ -12,6 +12,6 @@ subdir = src/backend/access/heap
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o
+OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o ptrack.o
include $(top_srcdir)/src/backend/common.mk
@stalkerg
stalkerg / ptrack_95_v3.patch
Created September 1, 2016 10:29
ptrack patch v3 for Postgres 9.5 stable
diff --git a/src/backend/access/heap/Makefile b/src/backend/access/heap/Makefile
index b83d496..788c55c 100644
--- a/src/backend/access/heap/Makefile
+++ b/src/backend/access/heap/Makefile
@@ -12,6 +12,6 @@ subdir = src/backend/access/heap
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o
+OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o ptrack.o
@stalkerg
stalkerg / ptrack_v2.patch
Created May 31, 2016 16:53
ptrack patch for Postgres 9.5 stable
diff --git a/src/backend/access/heap/Makefile b/src/backend/access/heap/Makefile
index b83d496..788c55c 100644
--- a/src/backend/access/heap/Makefile
+++ b/src/backend/access/heap/Makefile
@@ -12,6 +12,6 @@ subdir = src/backend/access/heap
top_builddir = ../../../..
include $(top_builddir)/src/Makefile.global
-OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o
+OBJS = heapam.o hio.o pruneheap.o rewriteheap.o syncscan.o tuptoaster.o visibilitymap.o ptrack.o
import tornado.ioloop
import tornado.web
import json
class MainHandler(tornado.web.RequestHandler):
def get(self, type_r=None):
format_answer = self.get_argument("format", "json")
# bla bla request to postgres
if format_answer == "sql":
self.write(my_sql_answer)
@stalkerg
stalkerg / ptrack_backup_todo.md
Last active May 31, 2016 17:05
Truly Incremental backup for Postgres

Description

First, I will talk about the current state of affairs. We have a several approaches:

  1. Scan all db files and compare page LSN (barman, pg_rman). If you have big db it is not your choice.

  2. Scan archive WAL files (current pg_arman). If you have high load it is not oyur choice too. (Big databases rarely living without high load.)

  3. Pages are tracked using bitmap during runtime, so the needed ones can be easily dumped. (Oracle and my ptrack (patches for postgres and pg_arman)) It's really your choice.