Skip to content

Instantly share code, notes, and snippets.

http {
map $http_user_agent $limit_bots {
default '';
~*(google|bing|yandex|msnbot) $binary_remote_addr;
}
limit_req_zone $limit_bots zone=bots:10m rate=1r/m;
server {
/*
Works best for background images with set dimensions
Just add a ".pngfix" class to anything you want fixed
or put in some other jQuery selector.
*/
$('.pngfix').each( function() {
$(this).attr('writing-mode', 'tb-rl');
$(this).css('background-image', 'none');
$(this).css( 'filter', 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="path/to/image.png",sizingMethod="scale")');
});
@positiveque
positiveque / README.md
Created October 19, 2017 12:56
Отключаем сбор статистики и http://bitrix.info/bx_stat на всех страницах сайта

В файл /bitrix/.settings_extra.php нужно добавить:

<?php
return array(
	'analytics_counter' => array(
		'value' => array(
			'enabled' => false
		),
 'readonly' =&gt; false,
@positiveque
positiveque / lead_form_utm_params.js
Created March 26, 2019 20:09 — forked from hedleysmith/lead_form_utm_params.js
Store UTM params & referrer UTL as subscriber fields on MailChimp form
// $(document).ready() replacement.
function ready(fn) {
if (document.readyState != 'loading'){
fn();
} else {
document.addEventListener('DOMContentLoaded', fn);
}
}
// Get UTM params from URL to pass to Mailchimp. Store in localStorage so they follow the user around the site.
@positiveque
positiveque / compile_nginx_from_sources.yml
Last active August 28, 2020 10:34 — forked from dkorn/compile_nginx_from_sources.yml
Ansible Playbook compiling NGINX from sources, to include particular modules
---
- name: Compile NGINX from sources
hosts: webserver
vars:
nginx_version: nginx-1.13.4
nginx_tarball_url: "http://nginx.org/download/{{ nginx_version }}.tar.gz"
nginx_install_dir: "/tmp/{{ nginx_version }}"
nginx_sbin_path: "/usr/sbin/nginx"
nginx_conf_path: "/etc/nginx/nginx.conf"
@positiveque
positiveque / pagespeed_nginx_ubuntu.sh
Created July 30, 2020 15:41 — forked from pi0/pagespeed_nginx_ubuntu.sh
Install PageSpeed on Ubuntu Nginx Extras
# Deps
sed -i "s|# deb-src|deb-src|" /etc/apt/sources.list
apt update
export DEPS=" \
build-essential zlib1g-dev libpcre3-dev unzip uuid-dev \
debhelper po-debconf libexpat-dev libgd-dev libgeoip-dev libhiredis-dev \
libluajit-5.1-dev libmhash-dev libpam0g-dev libperl-dev libssl-dev libxslt1-dev quilt"
apt install -y $DEPS
# NXG Pagespeed
@positiveque
positiveque / ssh-proxy.sh
Created July 30, 2020 15:42 — forked from pi0/ssh-proxy.sh
SSH-SSH
ssh -vo ProxyCommand='ssh -W %h:%p root@proxy_host' root@dst_host
Ansible playbook to setup HTTPS using Let's encrypt on nginx.
The Ansible playbook installs everything needed to serve static files from a nginx server over HTTPS.
The server pass A rating on [SSL Labs](https://www.ssllabs.com/).
To use:
1. Install [Ansible](https://www.ansible.com/)
2. Setup an Ubuntu 16.04 server accessible over ssh
3. Create `/etc/ansible/hosts` according to template below and change example.com to your domain
4. Copy the rest of the files to an empty directory (`playbook.yml` in the root of that folder and the rest in the `templates` subfolder)
@positiveque
positiveque / sources.list
Created August 28, 2020 08:44
Ubuntu 20.04 LTS (Focal Fossa) - LEMP stack (nginx mainline, php, mariadb 10.5) - /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse