Skip to content

Instantly share code, notes, and snippets.

View Techmind's full-sized avatar

Bogunov Ilya Techmind

View GitHub Profile
ALTER TABLE actions_0 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_1 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_10 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_100 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_101 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_102 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_103 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_104 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_105 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_106 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_0 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_1 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_10 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_100 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_101 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_102 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_103 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_104 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_105 DROP INDEX `type`, DROP INDEX `param`;
ALTER TABLE actions_106 DROP INDEX `type`, DROP INDEX `param`;
./cli jobs/tools/multi_run --count=8 --code='$db = $factory->getDaemonActionsBackend("riak"); $redis = $factory->getRedis();$file = $factory->getDaemonActionsBackend("file"); while ($id = $redis->popFromList("testList2")) { $actions = $file->getUserActions($id, null, array(), 5000); $actions[0] = array_reverse($actions[0]); $db->writeActions($actions[0], $id);}'
./cli jobs/tools/multi_run --count=8 --code='$db = $factory->getDaemonActionsBackend("db_sharded"); $redis = $factory->getRedis();$file = $factory->getDaemonActionsBackend("file"); while ($id = $redis->popFromList("testList3")) { $actions = $file->getUserActions($id, null, array(), 5000); $actions[0] = array_reverse($actions[0]); $db->writeActions($actions[0], $id);}'
%% -------------------------------------------------------------------
%%
%% basho_bench: Benchmarking Suite
%%
%% Copyright (c) 2009-2010 Basho Techonologies
%%
%% This file is provided to you under the Apache License,
%% Version 2.0 (the "License"); you may not use this file
%% except in compliance with the License. You may obtain
%% a copy of the License at
Key = <<"X">.
@Techmind
Techmind / gist:2761654
Created May 21, 2012 10:12
google-reader-pming
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Techmind: подписки в Google Reader</title>
</head>
<body>
<outline title="pming" text="pming">
<outline text="2PM" title="2PM" type="rss"
xmlUrl="http://feeds.feedburner.com/2pm" htmlUrl="http://2pm.kz"/>
<outline text="a-Jail" title="a-Jail" type="rss"
@Techmind
Techmind / gist:2776250
Created May 23, 2012 16:36
Riak something like merge sort
After we compiled this module on all nodes - http://en.literateprograms.org/Merge_sort_(Erlang)
{ok, Client} = riak:local_client().
Client:put(riak_object:new(<<"sort_test">>, <<"1">> 1)).
Client:put(riak_object:new(<<"sort_test">>, <<"2">> 2)).
Client:put(riak_object:new(<<"sort_test">>, <<"3">> 3)).
Get = fun(G, _, _) -> [riak_object:get_value(G)] end.
Msort = fun(ReduceList, none) -> mergesort:msort_gte(ReduceList) end.
@Techmind
Techmind / gist:3958454
Created October 26, 2012 12:14
demo google play parser
<?php
$content = file_get_contents('https://play.google.com/store');
var_dump(strlen($content));
preg_match_all("~<a href=\"(/store/apps/category/[A-Z_]*)~", $content, $matches);
$cats = array_unique($matches[1]);
FORMAT: 1A
# A
text1
## B [/questions]
### C [GET]
@Techmind
Techmind / gist:4588d35c3d25b9e22a71
Created December 10, 2015 08:05
valgring php-fpm.log with opcache, php-src 60fffd296abce5fc071f3c173c25a2696cf683c6, php-ext-handlersocketi - 9ff510f7010e1961dcd070a6339c0fe1c3bd359f
==8014== Memcheck, a memory error detector
==8014== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==8014== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==8014== Command: /home/vagrant/php7/usr/sbin/php-fpm --nodaemonize --fpm-config /etc/php7/fpm/php-fpm.conf
==8014== Parent PID: 17209
==8014==
==8015== Invalid write of size 4
==8015== at 0x603F5F1: hs_index_object_init (handlersocketi_index.c:751)
==8015== by 0x603F9B3: handlersocketi_create_index (handlersocketi_index.c:794)
==8015== by 0x603B70B: zim_HandlerSocketi_open_index (handlersocketi_class.c:549)