Calculate XLOG entries distance between master and replica with:
on master:
> select pg_xlogfile_name(pg_current_xlog_flush_location()), pg_current_xlog_insert_location(), pg_current_xlog_location();
on slave:
local fn = vim.fn | |
local api = vim.api | |
local executable = function(e) | |
return fn.executable(e) > 0 | |
end | |
local opts_info = vim.api.nvim_get_all_options_info() | |
local opt = setmetatable( | |
{}, { |
/* | |
* Copyright (c) 2020 Andrew G Morgan <morgan@kernel.org> | |
* | |
* This program exploit demonstrates why libcap alone in a | |
* multithreaded C/C++ program is inherently vulnerable to privilege | |
* escalation. | |
* | |
* The code also serves as a demonstration of how linking with libpsx | |
* can eliminate this vulnerability by maintaining a process wide | |
* common security state. |
// $ clang -lcap -Wall -O2 ./setuidgid.c | |
#include <getopt.h> | |
#include <stdio.h> | |
#include <sys/types.h> | |
#include <pwd.h> | |
#include <grp.h> | |
#include <stdlib.h> | |
#include <stdbool.h> | |
#include <errno.h> |
#define _MULTI_THREADED | |
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <stdlib.h> | |
#include <cstring> | |
#define SQLOK(line) do { \ |
https://stackoverflow.com/questions/7272558/can-we-define-a-new-data-type-in-a-gdb-session | |
// sample.c | |
#include "sample.h" | |
struct sample foo; | |
gcc -g -c sample.c | |
(gdb) add-symbol-file sample.o 0 | |
add symbol table from file "sample.o" at |
#define _MULTI_THREADED | |
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
#include <stdlib.h> | |
int print_row_cb(void *NotUsed, int argc, char **argv, char **azColName) { | |
NotUsed = 0; |
#define _MULTI_THREADED | |
#include <sqlite3.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <pthread.h> | |
int callback(void *, int, char **, char **); | |
void check(const char *str, int err); | |
void *threadfunc(void *parm); |
Calculate XLOG entries distance between master and replica with:
on master:
> select pg_xlogfile_name(pg_current_xlog_flush_location()), pg_current_xlog_insert_location(), pg_current_xlog_location();
on slave:
$stdin.sync = true; | |
$stdout.sync = true; | |
$a = true | |
def handle(id, sig) | |
puts id.to_s + " got " + sig.to_s + " at " + Process.pid.to_s | |
$a = false | |
end |
#define _GNU_SOURCE /* See feature_test_macros(7) */ | |
#include <sched.h> | |
#include <sys/syscall.h> /* Definition of SYS_* constants */ | |
#include <unistd.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <errno.h> | |
#include <string.h> | |
#include <sys/wait.h> | |
#include <time.h> |