Skip to content

Instantly share code, notes, and snippets.

@YogSottot
YogSottot / README.md
Created May 26, 2023 08:31 — forked from Isa3v/README.md
CSS inline body | Minification HTML (Bitrix)

CSS inline body | Minification HTML (Bitrix)

Выводим css стили в тело и сжимаем html в 1 строку, удаляем css комментарии

(исправляя относительные пути изображений)

Добавляем в init.php и радуемся (или нет) как гугл прибаляет 10-15 балов

@YogSottot
YogSottot / pve_API2Subs_sed.sh
Created March 4, 2023 08:54 — forked from ngadmini/pve_API2Subs_sed.sh
remove naged subscription message on proxmox 7.x-x
#!/usr/bin/env bash
# TAGS
# /usr/local/bin/pve-API2Subs_sed.sh
# https://gist.github.com/ngadmini/7f9df377999cc78c1b58e361d5425ac4#file-pve_api2subs-sh
# AUTHOR
# [email protected]
# https://github.com/ngadmini
# https://gist.github.com/ngadmini
# VERSION
# v10.2
@YogSottot
YogSottot / pipewire.md
Created December 22, 2022 09:58 — forked from the-spyke/pipewire.md
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Unfortunately, aptX and AAC are not enabled because of patents and other technical reasons. However, looks like aptX will be available in coming 22.10 release. If you need these codecs in 22.04 you may use this PPA from @aglasgall which is based on universe, but rebuilds pipewire with

Usage

curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/autossh@host1 | \
  sudo tee /etc/default/autossh@example
curl -sSL https://gist.githubusercontent.com/ttimasdf/ef739670ac5d627981c5695adf4c8f98/raw/[email protected] | \
  sudo tee /etc/systemd/system/[email protected]

sudo useradd -g nogroup -s /bin/false -m tunnel
sudo -u tunnel mkdir -p ~tunnel/.ssh # and copy your private key here
@YogSottot
YogSottot / PVE-HP-ssacli-smart-storage-admin.md
Created June 3, 2022 06:03 — forked from mrpeardotnet/PVE-HP-ssacli-smart-storage-admin.md
HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

HP Smart Storage Admin CLI (ssacli) installation and usage on Proxmox PVE (6.x)

Why use HP Smart Storage Admin CLI?

You can use ssacli (smart storage administrator command line interface) tool to manage any of supported HP Smart Array Controllers in your Proxmox host without need to reboot your server to access Smart Storage Administrator in BIOS. That means no host downtime when managing your storage.

CLI is not as convenient as GUI interface provided by BIOS or desktop utilities, but still allows you to fully manage your controller, physical disks and logical drives on the fly with no Proxmox host downtime.

ssacli replaces older hpssacli, but shares the same syntax and adds support for newer servers and controllers.

Installation

@YogSottot
YogSottot / Howto convert a PFX to a seperate .key & .crt file.md
Created January 18, 2021 09:28 — forked from junxy/Howto convert a PFX to a seperate .key & .crt file.md
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX

source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/

openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]

What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.

Now let’s extract the certificate:

openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]

@YogSottot
YogSottot / gist:ed011f7f65d6d95848dc2e83c908cfae
Last active December 19, 2020 14:39 — forked from splacento-incomm/gist:a2895551d36f66b3e715286ae232767a
Find all system files in mysql db FTS issue
magento2 db server was crashing and we had to investigate why.
Long story short: it ran out of space. 220GB ssd with 0 bytes free.
Mysql folder size 70GB while db itself is somewhere near 300MB.
So most of space was used by:
FTS_0000000000274d82_000000000031bd04_INDEX_1.ibd
FTS_0000000000274d82_000000000031bd04_INDEX_2.ibd
FTS_0000000000274d82_000000000031bd04_INDEX_3.ibd
FTS_0000000000274d82_000000000031bd04_INDEX_4.ibd
FTS_0000000000274d82_000000000031bd04_INDEX_5.ibd
FTS_0000000000274d82_000000000031bd04_INDEX_6.ibd
@YogSottot
YogSottot / P12toPEM.txt
Last active February 12, 2020 12:24 — forked from shahdhiren/P12toPEM.txt
Convert P12 file for Push Notification to PEM format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@YogSottot
YogSottot / init.php
Last active November 1, 2019 12:42 — forked from muxx/init.php
pinba configure in Bitrix
<?php
include __DIR__ . '/pinba_configure.php';
@YogSottot
YogSottot / linuxprivchecker.py
Created August 30, 2018 14:57 — forked from YazooSecurity/linuxprivchecker.py
linuxprivchecker.py -- a Linux Privilege Escalation Check Script
#!/usr/env python
###############################################################################################################
## [Title]: linuxprivchecker.py -- a Linux Privilege Escalation Check Script
## [Author]: Mike Czumak (T_v3rn1x) -- @SecuritySift
##-------------------------------------------------------------------------------------------------------------
## [Details]:
## This script is intended to be executed locally on a Linux box to enumerate basic system info and
## search for common privilege escalation vectors such as world writable files, misconfigurations, clear-text
## passwords and applicable exploits.