Skip to content

Instantly share code, notes, and snippets.

Ivan sitano

Block or report user

Report or block sitano

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View core.test_log-1e9c94.1000.59d5e7d3e5814aea95d6242827f744ba.1228.1565024511000000
(gdb) info threads
Id Target Id Frame
* 1 Thread 0x7fea543f9700 (LWP 1244) 0x00007fea65765755 in raise () from /usr/lib/libc.so.6
2 Thread 0x7fe986a78700 (LWP 1350) 0x00007fea65927415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
3 Thread 0x7fe94cff1700 (LWP 1378) 0x00007fea65927415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
4 Thread 0x7fe947dfe700 (LWP 1383) 0x00007fea65927415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
5 Thread 0x7fe94d673700 (LWP 1376) 0x00007fea65927415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
6 Thread 0x7fe94797d700 (LWP 1384) 0x00007fea65927415 in pthread_cond_wait@@GLIBC_2.3.2 () from /usr/lib/libpthread.so.0
7 Thread 0x7fe9eebfe700 (LWP 1287) 0x00007fea6588cca3 in __memmove_avx_unaligned_erms () from /usr/lib/libc.so.6
8 Thread 0x7fe9ee3fd700 (LWP 1289) 0x00007fea6588cca3 in __memmove_avx_unaligned_erms () from /usr/lib/libc.s
@sitano
sitano / strict_schedules_examples.md
Last active Jul 18, 2019
strict schedules examples
View strict_schedules_examples.md

In Strict schedule, if the write operation of a transaction precedes a conflicting operation (Read or Write operation) of another transaction then the commit or abort operation of such transaction should also precede the conflicting operation of other transaction.

Example A

Ta	Tb
-----   -----
R(X)	
        R(X)
W(X)	
@sitano
sitano / to_adrian.md
Created Jun 26, 2019
About a DSG and depedency edges in Generalized Isolation Level Definitions
View to_adrian.md

Hi, Adrian!

Hope you are doing well! I also hope this is the right email of yours.

I am writing to you about your article https://blog.acolyer.org/2016/02/25/generalized-isolation-level-definitions/ . I've tried to write a comment on the site, but WordPress does not show up it.

Reading an article, the phrases:

A transaction T1 depends on T2 if there is a path in the graph from T1 to T2. It directly depends on T2 if there is an edge from T1 to T2...

@sitano
sitano / for_keys_go_issue2.go
Created Mar 15, 2018
env GOSSAFUNC=keys go build for_keys_go_issue2.go
View for_keys_go_issue2.go
package main
import "fmt"
type S struct {
b [8]byte
}
func keys(m map[S]struct{}) [][]byte {
var z [][]byte
View for_key_issues1.go
package main
import "fmt"
type S struct {
b [8]byte
}
func main() {
mmap := map[S]struct{}{
@sitano
sitano / overthewire_wargames_behemoth.md
Created Mar 13, 2018
overthewire_wargames_behemoth
View overthewire_wargames_behemoth.md

Level 0

ssh behemoth0@behemoth.labs.overthewire.org -p 2221

password: eatmyshorts flag: aesebootiv hint: password is protected by the xor func memfrob from <string.h>

memfrob - frobnicate (encrypt) a memory area

@sitano
sitano / realloc.c
Last active Nov 5, 2017
undefined behavior with realloc
View realloc.c
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
int* p = (int *)malloc(sizeof(int));
int* q = (int *)realloc(p, sizeof(int));
*p = 1;
*q = 2;
if (p == q)
@sitano
sitano / brackets_split.go
Created Oct 19, 2017
parallel brackets sequence verification
View brackets_split.go
package main
import "fmt"
type res struct {
s []byte
l int
r int
}
@sitano
sitano / rds-pgsql-replica-lag.md
Last active Jun 8, 2017
how to measure amazon rds postgresql replica lag
View rds-pgsql-replica-lag.md

What to do when replica creation fails stopping streaming, trying to recover WAL from the archive

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:

@sitano
sitano / read-only.sql
Created Jun 8, 2017
PostgreSQL create read only user
View read-only.sql
-- Create a group
CREATE ROLE readonly WITH LOGIN;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readonly;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readonly;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readonly;
You can’t perform that action at this time.