Skip to content

Instantly share code, notes, and snippets.

Avatar

Александр yii2-developer

View GitHub Profile
View user group
id newuser
usermod -aG vboxsf newuser
View git-fetch-cron.sh
#!/bin/bash
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BASE_DIR=/var/www/html
SUDO_USER='sudo -u site -H'
GIT="$SUDO_USER /usr/bin/git"
cd $BASE_DIR
$GIT fetch --all
$GIT reset --hard origin/master
View git-pull-cron.sh
#!/bin/bash
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BASE_DIR=/var/www/yiiframework
GIT='/usr/bin/git'
cd $BASE_DIR
$GIT pull
View git-pull.sh
#!/bin/bash
set -eu
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
BASE_DIR=/var/www/yiiframework
SUDO_USER='sudo -u www-data -H'
GIT="$SUDO_USER /usr/bin/git"
cd $BASE_DIR
$GIT pull
View ContentRoute.php
<?php
namespace components\routes;
use yii\web\UrlRule;
use \app\models\Content;
use Yii;
/**
* @author Rom <rommcr@gmail.com>
@yii2-developer
yii2-developer / phantomjs
Created Sep 28, 2015
Phantomjs startup script for Centos
View phantomjs
#!/bin/sh
#
# chkconfig: 35 99 99
# description: Script for starting phantomjs.
#
. /etc/rc.d/init.d/functions
USER="phantomjs"