This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installation will take about 15 minutes ... | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
Calculating upgrade... Done | |
The following packages were automatically installed and are no longer required: | |
linux-headers-4.15.0-20 linux-headers-4.15.0-20-generic | |
linux-image-4.15.0-20-generic linux-modules-4.15.0-20-generic | |
linux-modules-extra-4.15.0-20-generic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Проверяем количество входных параметров | |
if [ $# -lt 3 ] | |
then | |
echo Something wrong with parameters | |
exit | |
fi | |
x=1 # Счетчик файлов |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function my_scripts_method() { | |
// отменяем зарегистрированный jQuery | |
wp_deregister_script( 'jquery' ); | |
wp_register_script( 'jquery', '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js', false, null, true ); | |
wp_enqueue_script( 'jquery' ); | |
} | |
add_action( 'wp_enqueue_scripts', 'my_scripts_method' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Установка letsencrypt | |
sudo apt install letsencrypt | |
/// Создаем каталог верификации Let’s Encrypt | |
sudo mkdir /var/www/ВАШ.ДОМЕН.РУ/ | |
/// Меняем владельца каталога | |
sudo chown www-data:www-data /var/www/ВАШ.ДОМЕН.РУ/ -R | |
/// Добавлем директиву в ранее созданный файл /etc/nginx/conf.d/rslsync.conf придавая ему такой вид |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Установим nginx | |
sudo apt install nginx | |
// Старт и автозапуск nginx | |
sudo systemctl start nginx | |
sudo systemctl enable nginx | |
// Создаем файл конфигураций | |
sudo nano /etc/nginx/conf.d/rslsync.conf | |
--------------------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// добавляем репозиторий Resilio Sync в список репозиториев сервера | |
echo 'deb http://linux-packages.resilio.com/resilio-sync/deb resilio-sync non-free' | sudo dd of=/etc/apt/sources.list.d/resilio-sync.list | |
// Добавляем публичный ключ | |
wget -qO - https://linux-packages.resilio.com/resilio-sync/key.asc | sudo apt-key add - | |
// Обновляем информацию о пакетах | |
sudo apt update && sudo apt upgrade | |
// Устанавливаем Resilio Sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** Чек бокс politika pupi-boy.ru ****/ | |
// заменить стили (style="color: #555;" и style="width:auto;margin:13px;") на свои | |
// замениить ссылку (https://pupi-boy.ru/politica.html) на свою | |
add_action('comment_form', 'politika'); | |
add_action('comment_post', 'proverka_politika'); | |
function politika($id) { | |
if (!is_user_logged_in()) : | |
print '<p style="color: #555;"><input style="width:auto;margin:13px;" type="checkbox" name="bad_post" value="1" checked /> Согласен с <a href="https://pupi-boy.ru/politica.html">политикой конфиденциальности</a> *</p>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------------------------------------------------------------------------- | |
* Убирает версию из скритов и стилей (jquery.js?ver=1.12.4) | |
* -------------------------------------------------------------------------- */ | |
function _remove_script_version( $src ){ | |
$parts = explode( '?', $src ); | |
return $parts[0]; | |
} | |
//Фильтр для скриптов | |
add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); | |
//Фильтр для стилей |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------------------------------------------------------------------------- | |
* Удаляем вывод стилей и скриптов от модуля Contact Form 7, где он не используется | |
* -------------------------------------------------------------------------- */ | |
// Deregister Contact Form 7 styles | |
add_action( 'wp_print_styles', 'aa_deregister_styles', 100 ); | |
function aa_deregister_styles() { | |
if ( ! is_page( get_theme_mod( "header_contacts") ) ) { | |
wp_deregister_style( 'contact-form-7' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -------------------------------------------------------------------------- | |
* pingback, canonical, meta generator, wlwmanifest, EditURI, shortlink, prev, | |
* next, RSS, feed, profile из заголовков head | |
* -------------------------------------------------------------------------- */ | |
// Удаляем код meta name="generator" | |
remove_action( 'wp_head', 'wp_generator' ); | |
// Удаляем link rel="canonical" // Этот тег лучше выводить с помощью плагина Yoast SEO или All In One SEO Pack | |
remove_action( 'wp_head', 'rel_canonical' ); |
NewerOlder