Skip to content

Instantly share code, notes, and snippets.

@JamesBondsky
JamesBondsky / Tutorial.md
Created February 9, 2024 16:58 — forked from dockerlead/Tutorial.md
Wireguard on CentOS 7/8

Set Up Your Own WireGuard VPN Server on CentOS

This tutorial is going to show you how to set up your own WireGuard VPN server on CentOS. WireGuard is made specifically for the Linux kernel. It runs inside the Linux kernel and allows you to create fast, modern, and secure VPN tunnel. TL;DR

Prerequisites

This tutorial assumes that the VPN server and VPN client are both running CentOS operating system.

Step 1: Install WireGuard on CentOS Server and Desktop

Log into your CentOS server, then run the following commands to install WireGuard.

# CentOS 8
  1. Install ipset:
apt-get install ipset
  1. Create new ipset:
ipset create tor iphash
@JamesBondsky
JamesBondsky / torblock.sh
Created May 23, 2023 22:05 — forked from ansmirnov/torblock.sh
iptables: Блокировка входящего TOR-трафика
#!/bin/bash
# Block Tor Exit nodes
IPTABLES_TARGET="DROP"
IPTABLES_CHAINNAME="TOR"
EXTERNAL_IP="xx.xx.xx.xx"
if ! iptables -L TOR -n >/dev/null 2>&1 ; then
/sbin/iptables -N TOR >/dev/null 2>&1
/sbin/iptables -A INPUT -p tcp -j TOR 2>&1
fi
@JamesBondsky
JamesBondsky / readme.md
Created April 19, 2023 21:06 — forked from MaxwellRU/readme.md
Название раздела и элемента в хлебных крошках, вместо SEO поля. Bitrix

Не забываем подключать файл в шаблоне хлебных крошек.

Для этого в самом начале шаблона, сразу после подключения пролога, добавляем строчку:

include_once 'result_modifier.php';
@JamesBondsky
JamesBondsky / Fixer.js
Created April 11, 2023 23:26 — forked from artemsites/Fixer.js
Фиксация блоков при прокрутке | Block fixing when scrolling
/**
* @version 3.5 - 21.02.2023
* @author Artem Kuznecov
* @email artem@web-ascent.ru
* @website https://web-ascent.ru
* @source https://snippets.cacher.io/snippet/79e169f9ca705c345531
* @source https://gist.github.com/artemijeka/130fd58f6859999faafcea60de686262
* @param {String|Node} obj.target | Блок который фиксируем
* @param {Boolean} obj.fixAtTop | Зафиксировать везде начиная с верха сайта
* @param {Boolean} obj.fixAfter | Зафиксировать после ухода этого блока за верх экрана
@JamesBondsky
JamesBondsky / bitrix_custom_discount_rules.php
Created March 6, 2023 14:08 — forked from dmitryburov/bitrix_custom_discount_rules.php
Интеграция через событие (OnCondSaleControlBuildList) кастомных условий для каталога или корзины 1С-Битрикс(>16.x). Результат - http://prntscr.com/mnpcop
<?php
namespace Burov\Handlers;
use Bitrix\Main\Loader;
use Bitrix\Sale\Location;
use Bitrix\Main\GroupTable;
/**
@JamesBondsky
JamesBondsky / class.php
Created November 21, 2022 22:31 — forked from pgooood/class.php
Примеры исходного кода к статье https://pgooood.medium.com/174ac881a93a
<?php
use Bitrix\Main\Engine\Contract\Controllerable;
class ajaxTest extends \CBitrixComponent implements Controllerable {
function executeComponent(){
$this->arResult = [
'COMPONENT_ID' => $this->componentId()
,'SCRIPT_PATH' => $_SERVER['SCRIPT_NAME']
];
<?php
global $DBType;
CModule::AddAutoloadClasses(
'crm',
array(
'CAllCrmLead' => 'classes/general/crm_lead.php',
'CCrmLead' => 'classes/'.$DBType.'/crm_lead.php',
'CCrmLeadWS' => 'classes/general/ws_lead.php',