View openvpn.cfg
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
command[check_ovpn_users]=read -r users max <<< "$(sudo sacli LicUsage | jq -r '.[]' | paste -d ' ' - -)"; [ $(($max-$users)) -lt 5 ] && echo "CRITICAL: OpenVPN users CRITICAL ($users/$max) | 'ovpn_users'=$users;;$max" || echo "OK: OpenVPN users OK ($users/$max) | 'ovpn_users'=$users;;$max" |
View extensions.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
[trunk-checker-dst] | |
exten => _X.,1,ResetCDR | |
same => n,NoCDR | |
same => n,Set(DB(trunk_checker/${EXTEN})=${EPOCH}) | |
same => n(end),Busy(2) | |
[from-trunk-pre] | |
exten => _X.,1,Set(DIALED_NUM=${EXTEN}) | |
same => n,Goto(cont,1) | |
exten => _+X.,1,Set(DIALED_NUM=${EXTEN}) |
View check_systemd_units.sh
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 | |
# Source http://lzone.de/blog/Nagios+Check+for+Systemd+Failed+Units | |
# Nagios return codes | |
STATE_OK=0 | |
STATE_WARNING=1 | |
STATE_CRITICAL=2 | |
STATE_UNKNOWN=3 | |
if [ -f /bin/systemctl ]; then |
View test_disk.sh
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/sh | |
run(){ | |
name="$1" | |
shift | |
( | |
set -x | |
# defailt parameters | |
fio -name="$name" -filename=$disk -output-format=json -ioengine=libaio -direct=1 -randrepeat=0 "$@" > results/$disk_dashed-$name.json | |
) |
View move_attachments.php.patch
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
--- mantisbt-1.3.20/admin/move_attachments.php.orig 2019-09-26 19:42:19.000000000 +0300 | |
+++ mantisbt-1.3.20/admin/move_attachments.php 2020-09-08 15:43:06.000000000 +0300 | |
@@ -175,8 +175,13 @@ | |
# Process projects list | |
foreach( $p_projects as $t_project ) { | |
+ | |
+ $start = 0; | |
+ while ($start <= 1500) { | |
+ error_log($start); |
View replicate_bucket.py
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
#!/usr/bin/env python | |
# | |
# The script requires that the OCI CLI be installed | |
# | |
# | |
# Edit these values to configure the script | |
# | |
oci_cli_profile_name = 'DEFAULT' |
View ad_backup.bat
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
@echo off | |
rem -- put this script into the task scheduler and redirect output to a log file: | |
rem -- c:\utils\ad_backup.bat > c:\utils\ad_backup.log 2>&1 | |
rem -- path to remote storage | |
set SHARE=\\filer-1\sysstates | |
rem -- what to backup | |
set PATH2BACKUP=c:\utils C:\Windows\System32\dns\backup |
View freeradius_users_csv_to_xml.pl
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
#!/usr/bin/perl | |
# | |
# Script takes pfSense configuration file (1st argument), strips out all freeradius users | |
# and replaces them with the users from the CSV file (2nd argument): | |
# ./freeradius_users_csv_to_xml.pl pfSense-config.xml users.csv > pfSense-config-new.xml | |
# | |
# After the config uploaded and pfSense rebooted, https://gist.github.com/jazzl0ver/b605b1b6fc1effa448fa55467797ac81 patch should be applied: | |
# | |
# cd /root; patch -p0 < freeradius.inc.patch | |
# |
View howto-gfs2-proxmox6.txt
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
#-- there're four proxmox boxes (vm-box-1..vm-box-4) | |
#-- all commands should be issued on one of the boxes | |
for i in $(seq 1 4); do ssh vm-box-$i apt install dlm-controld gfs2-utils -y; done | |
for i in $(seq 1 4); do ssh vm-box-$i 'echo DLM_CONTROLD_OPTS="--enable_fencing 0" >> /etc/default/dlm; systemctl restart dlm'; done | |
#-- check if /dev/misc folder exists. if not, run: | |
for i in $(seq 1 4); do ssh vm-box-$i "systemctl stop dlm; rmmod gfs2; rmmod dlm; sleep 3; systemctl restart udev; sleep 3; systemctl start dlm"; done | |
#-- add iscsi storage to proxmox (check shared) |
View LayoutModification.xml
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
<LayoutModificationTemplate xmlns:defaultlayout="http://schemas.microsoft.com/Start/2014/FullDefaultLayout" xmlns:start="http://schemas.microsoft.com/Start/2014/StartLayout" xmlns:taskbar="http://schemas.microsoft.com/Start/2014/TaskbarLayout" xmlns="http://schemas.microsoft.com/Start/2014/LayoutModification" Version="1"> | |
<LayoutOptions StartTileGroupCellWidth="6" /> | |
<DefaultLayoutOverride> | |
<StartLayoutCollection> | |
<defaultlayout:StartLayout GroupCellWidth="6"> | |
<start:Group Name="Windows Server"> | |
<start:DesktopApplicationTile Size="2x2" Column="4" Row="0" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\Windows PowerShell\Windows PowerShell ISE.lnk" /> | |
<start:DesktopApplicationTile Size="2x2" Column="4" Row="2" DesktopApplicationLinkPath="%APPDATA%\Microsoft\Windows\Start Menu\Programs\System Tools\Control Panel.lnk" /> | |
<start:DesktopApplicationTile Size="2x2" Column="0" Row="4" DesktopApplicationLinkPath="%ALLUSERSPROFILE%\Microsof |
NewerOlder