Skip to content

Instantly share code, notes, and snippets.

View mrqwer88's full-sized avatar

Sergei Mamonov mrqwer88

  • https://fastvps.ee/
View GitHub Profile
@mrqwer88
mrqwer88 / cl_clean.yaml
Last active May 17, 2020 17:52
clean old partitions in clickhouse
databases:
- logs: 7
- vms: 9
- statistics: 20
connect_line: '127.0.0.1'
log_file: 'cl_clean_partitions.log'
@mrqwer88
mrqwer88 / ksm.sysconfig
Created October 3, 2017 14:50
ksmctl from rhel ksm packages with added default params support
# The maximum number of unswappable kernel pages
# which may be allocated by ksm (0 for unlimited)
# If unset, defaults to half of total memory
# KSM_MAX_KERNEL_PAGES=
# KSM_SLEEP_MSECS=20
# KSM_PAGES_TO_SCAN=100
# KSM_MERGE_ACROSS_NODES=1
# KSM_MAX_PAGE_SHARING=256
# KSM_USE_ZERO_PAGES=0
@mrqwer88
mrqwer88 / buddyinfo.pl
Created April 25, 2017 10:34
Script for parse /proc/buddyinfo
#!/usr/bin/perl
use strict;
use warnings;
my $page_size = `getconf PAGE_SIZE 2>&1`;
if ( $? ) {
die "Cannot get page_size with error - $page_size\n";
}
[Unit]
Description=go-carbon server daemon
After=network.target
Requires=network.target
[Service]
User=_graphite
PIDFile=/run/gocarbon.pid
ExecStart=/usr/local/bin/go-carbon --config /usr/local/etc/carbon.conf --daemon -pidfile /run/gocarbon.pid
package main
import "fmt"
import "sort"
import "strings"
import (
"code.google.com/p/getopt"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
@mrqwer88
mrqwer88 / gist:33ad4043a7ac297de218
Created February 13, 2015 10:47
strace.docker.start.564
strace -ff -s 1024 -p 564
Process 564 attached with 8 threads
[pid 731] futex(0xc2082049f0, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 570] restart_syscall(<... resuming interrupted call ...> <unfinished ...>
[pid 569] epoll_wait(6, <unfinished ...>
[pid 568] futex(0xc2080772f0, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 567] futex(0x110b360, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 566] futex(0xc2080769f0, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 565] futex(0x110b6d8, FUTEX_WAIT, 0, NULL <unfinished ...>
[pid 564] futex(0x110c630, FUTEX_WAIT, 0, NULL <unfinished ...>
@mrqwer88
mrqwer88 / strace.docker.1078
Created February 12, 2015 21:07
strace docker demon when it try start start container on 2.6.32-042stab105.4 in container
[root@dedic /]# ps aux | grep docker
root 1078 0.0 0.1 371924 7756 ? Ssl 13:50 0:00 /usr/bin/docker -d --selinux-enabled -s vfs -b eth0
root 4476 0.0 0.0 9000 824 pts/1 S+ 16:00 0:00 grep --color=auto docker
[root@dedic /]# strace -s 1024 -p 1078
Process 1078 attached
futex(0x110c630, FUTEX_WAIT, 0, NULL^CProcess 1078 detached
<detached ...>
[root@dedic /]# strace -ff -s 1024 -p 1078
Process 1078 attached with 7 threads
[pid 1083] futex(0xc208079770, FUTEX_WAIT, 0, NULL <unfinished ...>