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 / 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"
}
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket = /var/run/mysqld/mysqld.sock
nice = 0
[mysqld]
user = mysql
@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
@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: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);