Skip to content

Instantly share code, notes, and snippets.

View denysbutenko's full-sized avatar

Denys Butenko denysbutenko

View GitHub Profile
@denysbutenko
denysbutenko / list.py
Last active December 11, 2015 22:58 — forked from gumeniukcom/gist:1358881
Python: Списки
# Создание списков
List = [] # пустой список
List = [ 'hello', 5, [1,2,3] ] # список с вложенным списком
List[i] # индекс
@denysbutenko
denysbutenko / modx-packages.php
Last active December 12, 2015 02:58
modx-packages install
<?php
/*
--------------------
Package installer for MODX Revolution
--------------------
Author: Jeroen Kenters <www.kenters.com>
First released: 2012-02-08
License: GNU GENERAL PUBLIC LICENSE Version 2, June 1991
*/
<?php
$id = $modx->resource->id;
$tpls = explode(',', $modx->getOption('minishop.goods_tpl'));
if (!isset($limit)) {$limit = 10;}
if (!isset($tpl)) {$tpl = 'tpl.msGoods.row';}
// Вносим ID просмотренных товаров
if (in_array($modx->resource->template, $tpls)) {
if (!isset($_SESSION['viewed'])) {
@denysbutenko
denysbutenko / modx-install.sh
Last active December 22, 2019 14:28
modx-install
#!/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`
##############
@denysbutenko
denysbutenko / modx-update.sh
Created February 3, 2013 19:57
modx-update
#!/bin/bash
echo "Enter username"
read USERNAME
##############
echo "Updating MODx"
cd /var/www/$USERNAME/www/
@denysbutenko
denysbutenko / modx-remove.sh
Created February 3, 2013 19:57
removeplace
#!/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
rm -f /etc/nginx/sites-available/$USERNAME.conf
@denysbutenko
denysbutenko / a readme.md
Created February 10, 2013 03:27 — forked from Mark-H/a readme.md
MODX CLI

modCLI

modCLI is a wrapper for the MODX Revolution Processors, allowing you to pretty much do anything from the commandline that you would normally do within the manager.

To use modCLI, simply download the modcli.php file and put it in the MODX_BASE_PATH of your installation. Next open up the console or terminal, and start firing some commands at it.

Syntax

<?php
/**
* emailObfuscate output modifier for MODx
* Version: 1.0.0
*
* based on ObfuscateEmail plugin 0.9.1 (Apr 15, 2007) by Aloysius Lim.
* released under Public Domain.
* http://modxcms.com/extras/package/?package=322
*
* This modifier searches for all email addresses and "mailto:" strings in the
#!/bin/bash
# MySQL root password
ROOTPASS=$(cat /root/.passwd)
TIMEZONE='Europe/Kiev'
MYSQLPASS=`< /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`
##############