Skip to content

Instantly share code, notes, and snippets.

Pavel Odintsov pavel-odintsov

Block or report user

Report or block pavel-odintsov

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 gist:10009745
package main
import (
"bufio"
"compress/gzip"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
@pavel-odintsov
pavel-odintsov / gist:11140995
Last active Aug 29, 2015
Code for checking direct io ability for FS
View gist:11140995
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <string.h>
@pavel-odintsov
pavel-odintsov / gist:305482e2cdfddf5bbdf6
Last active Aug 29, 2015
/etc/init.d/vz parallels startup
View gist:305482e2cdfddf5bbdf6
#!/bin/sh
# pavel.odintsov@gmail.com
. /usr/libexec/vzctl/scripts/initd-functions
VZCTL="/usr/sbin/vzctl"
# Get CT list which we need start
velist=`vzlist -aH -octid,onboot | awk '$2 == "yes" {print $1}'`
View gist:e4a3cd655f51fa7f99b8
#!/usr/bin/perl
use warnings;
use strict;
my $command = $ARGV[0] || '';
open my $log, ">>", '/var/log/bind_speedup.log';
print {$log} "command: $command @ARGV\n";
View gist:7813f50ee2f8dc1ef467
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-4.0.44/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-4.0.44
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
View gist:386956e25f886ba214fe
# And the passenger performance tuning settings:
PassengerHighPerformance On
# Set this to about 1.5 times the number of CPU cores in your master:
PassengerMaxPoolSize 12
# Recycle master processes after they service 1000 requests
PassengerMaxRequests 1000
# Stop processes if they sit idle for 10 minutes
PassengerPoolIdleTime 600
Listen 8140
@pavel-odintsov
pavel-odintsov / 0001-Fixes-from-Dropbox.patch
Created Jun 11, 2014
Diff between dropbox librsync and original librsync because DropBox do not contribute changes back
View 0001-Fixes-from-Dropbox.patch
From 30a169954dc0c1e337e34cedb49817eae9d4e074 Mon Sep 17 00:00:00 2001
From: Pavel Odintsov <odintsov@fastvps.ru>
Date: Wed, 11 Jun 2014 18:04:51 +0400
Subject: [PATCH] Fixes from Dropbox
---
buf.c | 69 +++++++++++++++++++++++++++++++++---------------------------
buf.h | 2 +-
delta.c | 25 ++++++++++-----------
fileutil.h | 2 -
View gist:62f372c882c83d85ed17
#include <pfring.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
// this code compiles correctly with this command: gcc test_pf_ring.c -lpfring -lpcap -lnuma -lrt
int main() {
@pavel-odintsov
pavel-odintsov / cat_page_cache_safe.go
Created Jun 19, 2014
Tool like cat but without poisoning page cache with O_DIRECT
View cat_page_cache_safe.go
package main
import "github.com/ncw/directio"
import "os"
import "log"
import "io"
// Author: pavel.odintsov@gmail.com
// Tool like cat but without poisoning page cache with O_DIRECT
@pavel-odintsov
pavel-odintsov / pcs_kcare
Created Jun 25, 2014
kcare on Parallels Cloud Server PCS
View pcs_kcare
[5564163.777187] kcare: registered device with node 10:54
[5564164.960694] kcare: allocated 95568 bytes for patch at ffffc90040f07000
[5564164.960747] kcare: verifying patch...
[5564164.960748] kcare: verified successfully
[5564164.960750] kcare: allocating memory in module space...
[5564164.960835] kcare: allocated 95568 bytes at ffffffffa0544000
[5564164.960852] kcare: 935 relocations to fixup...
[5564164.960869] kcare: fixed 935 relocations
[5564164.960872] kcare: jumping to ffffffffa054a8f0
[5564164.960877] kpatch: starting at ffffffffa0544000 (Linux version 2.6.32-042stab088.4 (root@rh6-build-x64) (gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC) ) #1 SMP Thu Apr 3 17:41:05 MSK 2014, ts 1403632506)...
You can’t perform that action at this time.