Skip to content

Instantly share code, notes, and snippets.

View kvaps's full-sized avatar
🔳
This mess is mine!

Andrei Kvapil kvaps

🔳
This mess is mine!
View GitHub Profile

#Ceph benchmark

I have three nodes running with Proxmox hypervisor and ceph cluster in the 10G network.

Regarding ceph, each node have:

  • 2 PCI SSD drive in ssd pool (128GB each)
  • 3 SAS HDD drive in hdd pool (6TB each)

ceph osd tree

  • Linux VM
  • VirtIO driver
  • raid5+lvm drive
# mount /dev/vdb /btrfs/
# mount /dev/vdc /ext4/
# mount /dev/vdd /xfs/
# cd /btrfs/
# dd if=/dev/zero of=./test bs=4k count=1000000 conv=fdatasync
icecast=play.artradio.su:8000 #радио-сервер IceCast
mountpoint="/mp3_192" #имя точки монтирования
#получаем статистику с сервера
req=$(curl http://$icecast/status2.xsl -s)
#ищем точку монтирования в статистике
if [[ "$req" != *"$mountpoint"* ]];
then
echo $(date +"%y-%m-%d %T") "Watchdog: Stream not fond. Rebooting server..."
@kvaps
kvaps / le-renew-webroot
Created December 23, 2015 13:01 — forked from thisismitch/le-renew-webroot
Let's Encrypt Auto-Renewal using the Webroot Plugin (Nginx)
#!/bin/bash
web_service='nginx'
config_file="/usr/local/etc/le-renew-webroot.ini"
le_path='/opt/letsencrypt'
exp_limit=30;
if [ ! -f $config_file ]; then
echo "[ERROR] config file does not exist: $config_file"
LIST: https://raw.githubusercontent.com/zapret-info/z-i/master/dump.csv
URL: cat dump.csv|iconv -f cp1251 -t utf8|tr ' |' ' '|tr ' ' ','|tr ';' ' '|awk '{print $3}'|grep http|tr ',' '~'|sed 's/~~~/ /'|tr ' ' '\n'|sort -u
IP: cat dump.csv|iconv -f cp1251 -t utf8|tr ' |' ' '|tr ' ' ','|tr ';' ' '|awk '{print $1}'|sed 's/,,,/=/g'|tr '=' '\n'|sort -u|sed '/Updated:/d'
DOMAIN: cat dump.csv|iconv -f cp1251 -t utf8|tr ' |' ' '|tr ' ' ','|tr ';' ' '|awk '{print $2}'|sort -u
UPDATE: cat dump.csv|iconv -f cp1251 -t utf8|grep "Updated:"
@kvaps
kvaps / .profile
Last active January 25, 2016 13:57
if [ -z $OLD_HOME ]; then
export OLD_HOME=$HOME
export HOME=/tmp/$USER
mkdir -p $HOME
find $OLD_HOME -type f -exec sh -c '
path=`echo "$@" | sed "s|$OLD_HOME||g"`
mkdir -p `dirname ${HOME}${path}`
ln -s ${OLD_HOME}${path} ${HOME}${path}' _ {} \;
fi
# Password for Encription Certificate
$secret = "MyPassw0rd"
Get-ChildItem cert:\currentuser\my | Out-String -Width 512 | Out-File "$Env:USERPROFILE\Documents\info.txt"
# Copying Certificate to My Document
Get-ChildItem cert:\currentuser\my |
# Where-Object { $_.HasPrivateKey -and $_.PrivateKey.CspKeyContainerInfo.Exportable } |
Foreach-Object { [system.IO.file]::WriteAllBytes( "$Env:USERPROFILE\Documents\$($_.thumbprint).pfx" , ($_.Export('PFX', $secret )) ) }
#include <GuiListView.au3>
#include <Array.au3>
$CryptoPro = 'rundll32.exe shell32.dll,Control_RunDLL "C:\Program Files\Crypto Pro\CSP\cpconfig.cpl"'
$hCryptoPro = ''
$tCryptoProTab1 = ''
$tCryptoProTab2 = ''
$tCryptoProTab3 = ''
$hCertsInPrivContainer = ''
$tCertsInPrivContainerStep1 = ''
@kvaps
kvaps / rspamd-lists.md
Last active May 6, 2024 05:13
Howto create local whitelists and blacklists for Rspamd

Local whitelists and blacklists for Rspamd

  • cd /etc/rspamd
  • create rspamd.conf.local
  • create lists:
touch local_bl_from.map.inc local_bl_ip.map.inc local_bl_rcpt.map.inc \
local_wl_from.map.inc local_wl_ip.map.inc local_wl_rcpt.map.inc
  • change permissions:
@kvaps
kvaps / _GoPro_shrink_video_with_ffmpeg.md
Last active December 5, 2023 18:55
Скрипты для сжатия видео с GoPro и ковертирования RAW в JPG

Как сжать GoPro видео с помощью ffmpeg (инструкуция для windows)

Расскажу как круто можно ужимать видео с гопрошки без потери качества.

Видео как правило жмется очень хорошо, мне удавалось сжимать ролики до 70% безо всяких на то проблем.

Для windows-пользователей приложу инструкцию, linux-пользователи и так разберутся, все скрипты приведены ниже.

Установка