Skip to content

Instantly share code, notes, and snippets.

@kernusr
kernusr / check_ssl_connection.php
Created October 13, 2021 10:59
Проверяет, есть ли проблема с SSL и дохлым DST ROOT CA X3 в Joomla
<?php
$ch = curl_init();
$options[CURLOPT_HTTPGET] = true;
$options[CURLOPT_NOBODY] = false;
$options[CURLOPT_CAINFO] = __DIR__ . '/libraries/src/Http/Transport/cacert.pem';
$options[CURLOPT_URL] = 'https://webmasterskaya.xyz';
$options[CURLOPT_HEADER] = true;
$options[CURLOPT_RETURNTRANSFER] = true;
@kernusr
kernusr / BaseTagsTranslations.php
Created April 15, 2021 22:24
Человекопонятные названия атрибутов
<?php
abstract class BaseTagsTranslations implements TagsTranslationsInterface{
static function getTagTranslation(string $key): string
{
switch ($key):
case 'UnstructuredName':
case 'UN':
return 'Неструктурированное имя';
case 'C':
@b2z
b2z / default.php
Last active July 28, 2020 13:23
Override to correctly set the heading tags for a content article. If there is no page heading then the article title gets H1 tag. If there is a page heading then the article title gets H2 tag.
<?php
/**
* @package Joomla.Site
* @subpackage com_content
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@kernusr
kernusr / createMenuItem.php
Last active July 5, 2019 07:59
Programmatically add menu item in Joomla!
<?php
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\MVC\Model\BaseDatabaseModel;
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Table\Table;
protected function addMenuItem($data){
$app = Factory::getApplication();
@b2z
b2z / site.sh
Last active November 25, 2018 18:50
Virtual host script for apache2 on Ubuntu
#!/bin/bash
# Author: Ivlev E
# Modified by voland
# Modified by Dmitry Rekun
echo -n "Enter host name: "
read newHost
newPath="/var/www/$newHost"
@2E0PGS
2E0PGS / gigabyte-usb3-fix.md
Last active September 29, 2024 12:10
GIGABYTE GA-970A-DS3 USB3 fix for Ubuntu x64

Ok so for anyone with "GIGABYTE GA-970A-DS3" I have done alot of testing and research. The best config I found to get USB3 working is this:

Edit Grub config:

sudo nano /etc/default/grub

Edit the line that looks like this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"