Skip to content

Instantly share code, notes, and snippets.

pip3 install virtualenv
pip3 install virtualenvwrapper
export WORKON_HOME=~/Envs
mkdir -p $WORKON_HOME
source /usr/local/bin/virtualenvwrapper.sh
@63phc
63phc / install
Last active April 12, 2017 11:46
py
python3 --version
which python3
sudo apt-get install virtualenv python-pip python3-dev
cd ~
mkdir venvs
# specify the system python3 installation
virtualenv --python=/usr/bin/python3 venvs/djproject
@63phc
63phc / git
Created April 4, 2017 05:11
git
#Unix/
git config --global core.autocrlf input
git config --global core.safecrlf true
#Log/
git log --pretty=oneline
git log --pretty=oneline --max-count=2
git log --pretty=oneline --since='5 minutes ago'
git log --pretty=oneline --until='5 minutes ago'
git log --pretty=oneline --author=<your name>
git log --pretty=oneline --all
jpegoptim *.jpg
optipng *.png
array_rand, disk_free_space, file_get_contents, file_put_contents, filter_var,
htmlspecialchars, import_request_variables, localeconv, number_format, parse_
url, strip_tags, wordwrap
@63phc
63phc / new host nginx
Last active February 3, 2017 10:24
nhn
sudo ln -s /etc/nginx/sites-available/phpmyadmin /etc/nginx/sites-enabled/
//cd /etc/nginx/sites-enabled/
//ln -s /etc/nginx/sites-available/yourdomain yourdomain
#удаляем nginx и все связанные пакеты
sudo apt-get remove nginx*
#удаляем рабочие директории и логи
sudo rm -rf /etc/nginx/ /usr/sbin/nginx /usr/share/man/man1/nginx.1.gz
#удаляем остатки nginx из базы apt
sudo apt-get --purge autoremove nginx && sudo dpkg --purge nginx
#устанавливаем nginx заново с чистыми конфигами
public function actionNewAddons()
{
\Yii::$app->response->format = Response::FORMAT_JSON;
$item = new TypeCarAddons();
$item->loadDefaultValues();
return [
'success' => 1,
'data' => $this->renderPartial('partial/update/_addons_item', ['form' => new ActiveForm(), 'item' => $item, 'key' => uniqid()])
];
}
@63phc
63phc / LEMP
Last active January 24, 2017 07:24
sudo apt-get update
sudo apt-get install nginx
nginx -v
sudo apt-get install mysql-server
sudo mysql_secure_installation
sudo systemctl status mysql
mysql --version
sudo apt-get install php php-cli php-fpm php-mysql
@63phc
63phc / server nginx yii2
Created December 21, 2016 08:36
alias4ubuntu
alias www="cd / && cd var/www/html" && alias nx="cd / && cd etc/nginx" && alias cf="cd / && cd var/www/html/fgos/frontend/config"