This file contains hidden or 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
<?php | |
/** | |
* SecureDownload - Protected File Download with Counter for MODX Revolution | |
* | |
* Features: | |
* 1. Generates secure time-limited download links | |
* 2. Tracks download counts in a Template Variable | |
* 3. Automatically resolves file paths from Media Source | |
* 4. Prevents direct access to files | |
* 5. Detailed logging for debugging |
This file contains hidden or 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
<?php | |
/** | |
* pageViewCounter - Unique page views counter with cookie-based tracking | |
* by Colorwebdesigner | |
* based on: https://itchief.ru/modx/page-hit-counter | |
* | |
* EVENT: OnLoadWebDocument | |
* | |
* CONFIGURATION: | |
* 1. Create a TV (Template Variable) with name "views_page" (type: Number) |
This file contains hidden or 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
function DEV_LIFE() { | |
while true; do | |
FRAMEWORK | |
if [ DEPENDENCIES -gt UNDERSTANDING ]; then | |
continue | |
elif [ SOUL -eq FREEDOM ]; then | |
LINUX && BASH | |
break | |
fi | |
done |
This file contains hidden or 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 | |
# pcinfo.sh | |
# --- | |
# Collect general inormation about PC hardware, | |
# generate nice report and print to cli or file | |
# -------------------------------------------------------- | |
# author : [email protected] | |
# license : GNU | |
# date : 17.02.2022 | |
# src : https://gist.github.com/colorwebdesigner/b8cd5225741066c502c2f9435f7ae47a |
This file contains hidden or 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 | |
# modx_update | |
# | |
# MODx Revo advanced update script | |
# 1) Put this file in your website folder | |
# 2) Make it executable | |
# 3) Run | |
# -------------------------------------------------------- | |
# Script will automaticaly find all configs, core folder | |
# (even if you change default name and location), make |
This file contains hidden or 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 | |
# system-updater | |
# --- | |
# CLI GUI for system update and upgrade | |
# -------------------------------------------------------- | |
# author: Ivan Pro Tools | |
# github: https://github.com/colorwebdesigner | |
# date: 17-01-2022 | |
# license: GNU | |
# -------------------------------------------------------- |
This file contains hidden or 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 | |
# translit function | |
# ---------------------- | |
translit() { | |
local trs="${1// /-}" | |
trs=$(sed "y/абвгдезийклмнопрстуфхцы/abvgdezijklmnoprstufxcy/" <<< "${trs}") | |
trs=$(sed "y/АБВГДЕЗИЙКЛМНОПРСТУФХЦЫ/ABVGDEZIJKLMNOPRSTUFXCY/" <<< "$trs") | |
trs=${trs//ч/ch} |
This file contains hidden or 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
<? | |
$filter = Array ("xxxxxxx" => "xx"); | |
$rsUsers = CUser::GetList(($by="ID"), ($order="asc"), $filter); | |
while($rsUsers->NavNext(true, "f_")) : | |
echo "[".$f_ID."] (".$f_LOGIN.") ".$f_NAME." ".$f_LAST_NAME."<br>"; | |
endwhile; | |
?> |
This file contains hidden or 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
/* | |
-------------------------------------- | |
Restore backup password | |
start from PHP console in your Bitrix admin | |
-------------------------------------- | |
*/ | |
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/classes/general/backup.php"); | |
var_dump(CPasswordStorage::Get('dump_temporary_cache')); |
This file contains hidden or 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
# For root user | |
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;34m\]@\h:\[\033[;033m\]\w\[\033[00m\] \$ " | |
# For common user | |
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[01;34m\]@\h:\[\033[;033m\]\w\[\033[00m\] \$ " |
NewerOlder