Skip to content

Instantly share code, notes, and snippets.

View marliotto's full-sized avatar

Vitaly Gridasov marliotto

  • Russia, Krasnodar
View GitHub Profile
create table table_text
(
message text
);
create table table_varchar
(
message varchar(64)
);
drop table if exists states_raw;
drop table if exists final_states_by_month;
drop table if exists final_states_by_month_mv;
CREATE TABLE states_raw(d date, uid UInt64, s String) ENGINE = Null;
CREATE TABLE final_states_by_month(d date, uid UInt64, a_state AggregateFunction(groupArray, String))
ENGINE = AggregatingMergeTree PARTITION BY toYYYYMM(d) ORDER BY (uid);
CREATE MATERIALIZED VIEW final_states_by_month_mv TO final_states_by_month AS
SELECT d, uid, groupArrayState(s) a_state FROM states_raw GROUP BY d, uid;
@marliotto
marliotto / sysctl.conf
Created June 9, 2018 12:14 — forked from AysadKozanoglu/sysctl.conf
high secure & perfornce debian sysctl.conf setting - debian sysctl yüksek güven ve performans ayarlari
# Kernel sysctl configuration file for Linux
# Version 1.11 - 2015-07-07
# Aysad Kozanoglu Aysad K.
# This file should be saved as /etc/sysctl.conf and can be activated using the command:
# sysctl -e -p /etc/sysctl.conf
#
# For binary values, 0 is disabled, 1 is enabled. See sysctl(8) and sysctl.conf(5) for more details.
#
# Tested with: Ubuntu 14.04 LTS kernel version 3.13
version: '3.1'
services:
wordpress:
image: wordpress
ports:
- 8080:80
environment:
WORDPRESS_DB_PASSWORD: example
GET /test-de-1.ogg HTTP/1.1
Host: tazik.sytes.net
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
User-Agent: Mozilla/5.0 (Linux; Android 5.1.1; Nexus 4 Build/LMY48T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.81 Mobile Safari/537.36
Accept: */*
Referer: http://tazik.sytes.net/app_dev.php/cabinet/feedback/
Accept-Encoding: gzip, deflate, sdch
Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4

###Важно! Необходимо перед установкой данного кода, удалить наш старый код

<!-- подключаем загрузчик -->
<script async src="http://show.octobird.com/ob.js"></script>

<!-- первый рекламный блок: 320x50, без адалта -->
<div class="octobird-block" 
    data-site-id="3510" 

Для отображения собственной рекламы, при отсутствии рекламы из octobird, добавляется параметр passback с собственным обработчиком.

<div class="octobird-block"></div>

<script type="text/javascript">
    var _ob = {
        sid: YOUR_SITE_ID,
        passback: function () {
            //ЗДЕСЬ РЕАЛИЗУЕТСЯ ВАША ЛОГИКА, КОТОРАЯ ВЫПОЛНЯЕТСЯ ПРИ ОТСУТСТВИИ РЕКЛАМЫ В OCTOBIRD 
 console.log('Octobird does not have any ads');
{
"allimps": 0,
"at": 2,
"cur": ["USD"],
"device": {
"ip": "87.225.114.245",
"ua": "Mozilla/5.0 (Linux; Android 5.1.1; Nexus 4 Build/LMY47V) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.93 Mobile Safari/537.36"
},
"id": "1334090C423DA0CB6C2ACAE3575C6000-1446553981.198",
"imp": [{