Skip to content

Instantly share code, notes, and snippets.

# perl memcached.pl
Rate pp fast
pp 21167/s -- -89%
fast 197745/s 834% --
# perl -Ilib -Iblib/arch eg/benchmark.pl
single get =======
Rate redis fast hiredis jet
redis 34841/s -- -56% -68% -71%
fast 80082/s 130% -- -27% -33%
#!/bin/sh
_THREADS=$1
shift
_CPANM_OPTS="--notest --mirror http://ftp.cpan.org/pub/CPAN/ --mirror ${CPAN_MIRROR}"
cpanm --quiet --showdeps $* \
| xargs -n 1 -P $_THREADS cpanm ${_CPANM_OPTS} \
&& cpanm ${_CPANM_OPTS} $*
@knutov
knutov / gist:78b7043ee6ea4f345f6da55670e65582
Created May 23, 2017 21:51
mojolicious async external command execution using Mojo::IOLoop
#!/usr/bin/perl
# $Id: receiver_manage.pl 1977 2010-10-14 09:12:15Z bfg $
# $Date: 2010-10-14 11:12:15 +0200 (Thu, 14 Oct 2010) $
# $Author: bfg $
# $Revision: 1977 $
# $LastChangedRevision: 1977 $
# $LastChangedBy: bfg $
# $LastChangedDate: 2010-10-14 11:12:15 +0200 (Thu, 14 Oct 2010) $
# $URL: https://svn.interseek.com/repositories/admin/misc/cic/receiver_manage.pl $
#!/usr/bin/perl
use Benchmark qw(:all);
use Storable;
use Clone;
use CBOR::XS;
use Data::MessagePack;
use Panda::Lib;
use Sereal;
use Sereal::Dclone;
@knutov
knutov / _service.md
Created May 30, 2016 19:10 — forked from naholyr/_service.md
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
[
{
"keys": ["super+k", "super+c", "super+l"],
"command": "toggle_color_scheme",
"args":{
"options": [
{
"color_scheme": "Packages/User/Flatland Monokai (SL).tmTheme" ,
"theme": "Spacegray.sublime-theme"
},
#!/bin/sh
cd /root/backup || exit
date=`date +%F`
days=10
host=`hostname`
nice rsync -aR --delete --link-dest=$PWD/$host.current --exclude-from=exclude.list \
/etc/apache2 \
#!/usr/bin/perl
use strict;
use warnings;
my $exclude_list_path_static = "/etc/ovznodes_backup_rsync_exclude_list.static";
my $exclude_list_path_dynamic = "/etc/ovznodes_backup_rsync_exclude_list.dynamic";
my $config_file_path = '/etc/ovznodes_backup_config';
# должна объявляться в конфиге
- http://www.coffeepowered.net/2009/06/13/fine-tuning-your-garbage-collector/
- http://snaprails.tumblr.com/post/241746095/rubys-gc-configuration
article’s settings: ("spec spec" took 17-23!sec)
export RUBY_HEAP_MIN_SLOTS=1250000
export RUBY_HEAP_SLOTS_INCREMENT=100000
export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
export RUBY_GC_MALLOC_LIMIT=30000000
export RUBY_HEAP_FREE_MIN=12500
#!/bin/bash
set -e
# Usage:
# rsync_parallel.sh [--parallel=N] [rsync args...]
#
# Options:
# --parallel=N Use N parallel processes for transfer. Defaults to 10.
#
# Notes: