Skip to content

Instantly share code, notes, and snippets.

View vadv's full-sized avatar
🏠
Working from home

vadv vadv

🏠
Working from home
  • OZON
  • Moscow
View GitHub Profile
actions :write
attribute :magic_line, :kind_of => String, :default => "# Managed by Chef, dont write below"
attribute :host_file, :kind_of => String, :default => "/etc/hosts", :name_attribute => true
attribute :lines, :kind_of => Array
UPDATE tb_wwan w
SET
n_block = 0
WHERE
w.numb_osb = 1112
AND w.ansch = 47412
AND w.anstt = 20000000;
1 минута запроса:
UPDATE tb_wwan w
SET
n_block = 0
WHERE
w.numb_osb = 1112
AND w.ansch = 47412
AND w.anstt = 20000000;
@vadv
vadv / vanila
Created August 27, 2015 15:16
4 numa nodes (256 CPU smt=8)
32.10% postgres [.] s_lock
7.77% postgres [.] GetSnapshotData
2.64% postgres [.] AllocSetAlloc
1.40% postgres [.] hash_search_with_hash_value
1.37% postgres [.] base_yyparse
1.36% postgres [.] SearchCatCache
1.32% postgres [.] PinBuffer
@vadv
vadv / bufmgr_perf_top
Last active October 8, 2015 13:35
for hackers
машина по cpu утилизирована:
Cpu(s): 71.0%us, 18.3%sy, 0.0%ni, 10.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
[root@localhost src]# uptime
14:39:28 up 7 days, 19:20, 9 users, load average: 106.61, 56.77, 44.59
Samples: 33M of event 'cycles', Event count (approx.): 4079875627752, UID: vadv
4.36% postgres [.] GetSnapshotData
2.88% postgres [.] hash_search_with_hash_value
2.74% postgres [.] _bt_compare
vadv 699 0.0 0.0 210616 7516 pts/1 Sl+ 16:55 0:00 \_ docker run -it --rm -v /usr/bin/qemu-arm-static:/usr/bin/qemu-arm-static -v /home/vadv/build:/data philipz/rpi-raspbian bash
root 32637 0.0 0.2 583236 17952 ? Ssl 16:53 0:02 /usr/bin/docker daemon -H fd://
root 754 0.0 0.1 4141012 9168 pts/4 Ssl 16:55 0:00 \_ /usr/bin/qemu-arm-static /bin/bash
root 32292 0.0 0.0 4141012 7452 pts/4 Sl+ 17:21 0:00 \_ /usr/bin/qemu-arm-static /usr/bin/make -j 5
root 32295 0.0 0.1 4134868 8076 pts/4 Sl+ 17:21 0:00 \_ /usr/bin/qemu-arm-static /usr/bin/make -C src all
root 624 0.0 0.0 4134868 6276 pts/4 Sl+ 17:22 0:00 \_ /usr/bin/qemu-arm-static /usr/bin/make -C backend all
root 690 0.0 0.0 4134868 6192 pts/4 Sl+ 17:22 0:00 \_ /usr/bin/qemu-arm-static /usr/bin/make -C access all
root 4665 0.5 0.0 4134868 6144 pts/4 Sl+ 17:30 0:00 | \_ /usr/bin/qemu-arm-s
@vadv
vadv / build.cmd
Last active January 30, 2024 15:12
Build PostgreSQL for windows
REM BUILD DEPENDS
REM 1. .NET 4.0
REM 2. MICROSOFT SDK 7.1
REM 3. ACTIVE PERL <= 5.14
REM 4. PYTHON 2.7
REM 5. MSYS2
REM 6. 7Z
REM SET POSTGRESQL VERSION
SET PGVER=9.4.4
@vadv
vadv / cmd
Last active October 7, 2015 18:52
psql_windows
C:\Windows\System32>set lc_messages=ru
C:\Windows\System32>"c:\Program Files\PostgreSQL\9.4\bin\psql.exe"
psql: не удалось подключиться к серверу: Connection refused (0x0000274D/10061)
Он действительно работает по адресу "localhost" (::1)
и принимает TCP-соединения (порт 5432)?
не удалось подключиться к серверу: Connection refused (0x0000274D/10061)
Он действительно работает по адресу "localhost" (127.0.0.1)
и принимает TCP-соединения (порт 5432)?
@vadv
vadv / 1.c
Last active October 9, 2015 14:40
#include <stdio.h>
#include "one.h"
int main() {
bool take_action, FatalError, Shutdown, ImmediateShutdown;
take_action = !FatalError && Shutdown != ImmediateShutdown;
printf("take_action: %d\n", take_action);
}
@vadv
vadv / 1c.sql
Last active March 29, 2022 14:05
1c init db: dropdb test; createdb test; psql test -f 1c.sql -v ON_ERROR_STOP=1
SET SESSION default_with_oids = on;
SET client_min_messages=error;
SET lc_messages to 'en_US.UTF-8';
SET enable_mergejoin = off;
show standard_conforming_strings;