Skip to content

Instantly share code, notes, and snippets.

View vbatushev's full-sized avatar

Vitaly Batushev vbatushev

  • Издательство "Просвещение"
  • Krasnodar, Russia
View GitHub Profile
@vbatushev
vbatushev / zip-split-unzip.md
Created December 21, 2023 16:26 — forked from nasirkhan/zip-split-unzip.md
Split a Zip file and combine and unzip next linux

You have existing.zip but want to split it into 50M sized parts.

zip existing.zip --out new.zip -s 50m

will create

new.zip
@vbatushev
vbatushev / packages.php
Last active August 29, 2015 14:17 — forked from govza/packages.php
<?php
$installPackages = array(
'sdStore'
, 'translit'
, 'SanitizeUpload'
, 'TinyMCE'
, 'FormIt'
, 'Analytics'
, 'Big Brother'
@vbatushev
vbatushev / settings.php
Last active August 29, 2015 14:17 — forked from govza/settings.php
<?php
require_once dirname(__FILE__).'/config.core.php';
include_once MODX_CORE_PATH . 'model/modx/modx.class.php';
$modx= new modX();
$modx->initialize('mgr');
$modx->setLogLevel(modX::LOG_LEVEL_INFO);
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML');
@vbatushev
vbatushev / 0_reuse_code.js
Last active August 29, 2015 14:07
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
$siteName = $modx->getOption('siteName', $scriptProperties, $modx->getOption('site_name')); // Имя сайта
$companyName = $modx->getOption('companyName', $scriptProperties, $modx->getOption('site_name')); // Компания
$bid = $modx->getOption('bid', $scriptProperties, 10); // Цена за клик
$categoriesTpl = $modx->getOption('minishop.categories_tpl'); // Шаблоны категорий
$goodsTpl = $modx->getOption('minishop.goods_tpl'); // Шаблоны товаров
$siteUrl = $modx->makeUrl($modx->getOption('site_start'), '', '', 'full'); // Ссылка на главную страницу сайта
$descTpl = strip_tags($modx->getOption('descTpl', $scriptProperties, '[[+description]]')); // Шаблон для описания товара, без html
// Параметры товаров
#!/bin/bash
##############
echo "Welcome to MODx autoinstaller.
------------------------------------
Enter MySQL root password"
read ROOTPASS
echo "Enter username for site and database"
#!/bin/bash
echo "Enter username"
read USERNAME
##############
echo "Updating MODx"
cd /var/www/$USERNAME/www/
#!/bin/bash
# MySQL root password
ROOTPASS='password'
TIMEZONE='Europe/Moscow'
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############
#!/bin/bash
ROOTPASS='password'
echo "Enter username to delete:"
read USERNAME
mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost"
mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
rm -f /etc/nginx/sites-enabled/$USERNAME.conf
#!/bin/bash
# MySQL root password
ROOTPASS='password'
TIMEZONE='Europe/Moscow'
MYSQLPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
SFTPPASS=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
PASSWORD=`< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c12`
##############