Skip to content

Instantly share code, notes, and snippets.

View alexclear's full-sized avatar
💭
Trapped in a Vim session

Alex Chistyakov alexclear

💭
Trapped in a Vim session
View GitHub Profile
@alexclear
alexclear / gist:3162059
Created July 23, 2012 05:20
A patch from https://bugzilla.kernel.org/show_bug.cgi?id=30702 adapted to 2.6.32-042stab057.1-el6-openvz
diff -u -r .//arch/alpha/include/asm/pgalloc.h ../linux-2.6.32/arch/alpha/include/asm/pgalloc.h
--- .//arch/alpha/include/asm/pgalloc.h 2009-12-03 06:51:21.000000000 +0300
+++ ../linux-2.6.32/arch/alpha/include/asm/pgalloc.h 2012-07-22 21:06:48.000000000 +0400
@@ -38,10 +38,15 @@
}
static inline pmd_t *
+__pmd_alloc_one(struct mm_struct *mm, unsigned long address, gfp_t gfp_mask)
+{
+ return (pmd_t *)__get_free_page(gfp_mask | __GFP_ZERO);
@alexclear
alexclear / tsung-filter.pl
Created March 24, 2013 15:42
Tsung recorded sessions filtering script
#!/usr/bin/perl
use strict;
use warnings;
print "Processing ${ARGV[0]}, filtering domain ${ARGV[1]}\n";
open INPUT, ${ARGV[0]} or die $!;
open OUTPUT, ">${ARGV[0]}.filtered.xml" or die $!;
my $skip = 0;
while (my $line = <INPUT>) {
@alexclear
alexclear / gist:5761520
Created June 11, 2013 22:59
sysbench results for my SanDisk Ultra Plus SDSSDHP-128G-G25
[root@cellar sb]# sysbench --test=fileio --file-total-size=18G --file-test-mode=rndrw --max-time=300 --max-requests=0 run
sysbench 0.4.12: multi-threaded system evaluation benchmark
Running the test with following options:
Number of threads: 1
Extra file open flags: 0
128 files, 144Mb each
18Gb total file size
Block size 16Kb
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
@alexclear
alexclear / thin
Created June 25, 2014 21:23
Хук для LVM thin provisioned volumes (/etc/initramfs-tools/hooks/thin)
#!/bin/sh
. /usr/share/initramfs-tools/hook-functions
PREREQ=""
prereqs()
{
echo "$PREREQ"
}
@alexclear
alexclear / gist:43116658971c6e727098
Created July 10, 2014 06:34
ElasticSearch and Graphite proxied by nginx
server {
listen {{ grafana_ext_ip }}:{{ grafana_http_port }}; ## listen for ipv4; this line is default and implied
#listen [::]:80 default ipv6only=on; ## listen for ipv6
root /usr/share/nginx/www/grafana/src;
index index.html index.htm;
auth_basic "Restricted";
auth_basic_user_file htpasswd.grafana;
@alexclear
alexclear / gist:3130cef0284c217962a8
Created February 13, 2015 21:46
BTRFS restoration
root@hypervisor02 ~ mount -o ro,recovery /dev/sdc3 /mnt
mount: wrong fs type, bad option, bad superblock on /dev/sdc3,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so.
root@hypervisor02 ~
@alexclear
alexclear / gist:b291787701026e28910f
Last active August 29, 2015 14:16
LeoFS node recovery issue(?)
When I start "recover node <storage_node_name>" message of type QUEUE_ID_RECOVERY_NODE seems to be
blocking processing of other messages (mainly, QUEUE_ID_PER_OBJECT ones).
I tried to visualize message processing using StatsD:
http://ns2.1888.spb.ru/2015-02-24-024731_1366x768_scrot.png
A graph at the lower right corner depicts calls to
handle_call({consume, ?QUEUE_ID_RECOVERY_NODE, MessageBin}).
It is my understanding that recover_node_callback(Node) should generate a lot
of QUEUE_TYPE_PER_OBJECT messages synchronously for a single QUEUE_ID_RECOVERY_NODE
message but the graph shows that QUEUE_ID_RECOVERY_NODE messages are constantly processed.
@alexclear
alexclear / gist:dc18b2c5599c091dc095
Created March 13, 2015 11:27
Количество метрик в Graphite
root@fe5 ~ find /opt/graphite/storage/whisper -name "*.wsp" | wc -l
18398
root@fe5 ~
export https_proxy="https://student:[email protected]:8080/"
export http_proxy="https://student:[email protected]:8080/"
cd /home/student
sudo apt-get update
sudo apt-get install git
git clone https://github.com/alexclear/nginx.git
sudo apt-get install libpcre3-dev zlib1g-dev
cd /home/student/nginx
./auto/configure
make