Skip to content

Instantly share code, notes, and snippets.

View topwebmaster's full-sized avatar
:octocat:
Always answer.

Dmitriy Petrov topwebmaster

:octocat:
Always answer.
View GitHub Profile
@topwebmaster
topwebmaster / hosts.sh
Created August 25, 2014 06:59
полу Автоматическое добавление хостов
#!/bin/bash
echo "Creating Virtual Host"
cd /etc/apache2/sites-available
cat <<EOF >> "$1"
<VirtualHost 127.0.0.1:80>
ServerAdmin webmaster@localhost
ServerName $1
ServerAlias www.$1
DocumentRoot "/var/www/$1"
@topwebmaster
topwebmaster / Mail Server on Ubuntu 14.04
Last active September 3, 2023 23:57
Settings Linux mint after fresh install for php developing
https://www.exratione.com/2014/05/a-mailserver-on-ubuntu-1404-postfix-dovecot-mysql/
Ex
Ratione
GitHub • Consulting • Blog • Archives • Feed
A Mailserver on Ubuntu 14.04: Postfix, Dovecot, MySQL
By Reason May 1, 2014 Permalink
This long post contains a recipe for building a reasonably secure Ubuntu 14.04 mail server in Amazon Web Services, using Postfix, Dovecot, and MySQL, with anti-spam packages in the form of amavisd-new, Clam AntiVirus, SpamAssassin, and Postgrey. Local users are virtual rather than being system users. Administration of users and domains is achieved through the Postfix Admin web interface. Webmail is provided by Roundcube.
@topwebmaster
topwebmaster / .htaccess
Created September 24, 2014 13:22
.htaccess tips and tricks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
<?php
/**
* An helper file for Laravel 4, to provide autocomplete information to your IDE
* Generated for Laravel 4.2.8 on 2014-08-26.
*
* @author Barry vd. Heuvel <barryvdh@gmail.com>
* @see https://github.com/barryvdh/laravel-ide-helper
*/
namespace {
@topwebmaster
topwebmaster / Apache+Mysql+PHP
Last active August 29, 2015 14:08
Vagrant Ubuntu Lamp Ruby Python - quick settings fot dev env. Настройка окружения для PHP
for non english sudo apt-get install language-pack-UTF-8 or sudo locale-gen UTF-8
@topwebmaster
topwebmaster / functions.php
Last active August 29, 2015 14:09
Разное
<?php
add_action( 'init', 'create_team_contacts' );
function create_team_contacts() {
register_post_type( 'team_contacts',
array(
'labels' => array(
'name' => 'Команда сайта',
'singular_name' => 'Контакт команды',
'add_new' => 'Добавить новый',
@topwebmaster
topwebmaster / Nginx config for Drupal 7
Last active August 29, 2015 14:24
Ubuntu+Nginx+Apache+PHP+MySQL+PhpMyAdmin
server {
server_name domain.tld;
root /var/www/drupal7; ## <-- Your only path reference.
# Enable compression, this will help if you have for instance advagg‎ module
# by serving Gzip versions of the files.
gzip_static on;
location = /favicon.ico {
log_not_found off;
#!/bin/bash
## Common Packages
# ---------------
sudo apt-get -y update
sudo apt-get -y upgrade
sudo apt-get -y install software-properties-common libssl-dev openssl wget
## Install latest Python 3
# -----------------------
PY_VERSION=3.4.3
@topwebmaster
topwebmaster / Jetbrains Idea PhpStorm Pycharm
Last active December 16, 2015 20:12
Настройки Ubuntu/Mint после установки
Сглаживание шрифтов
-Dawt.useSystemAAFontSettings=lcd
-Dswing.aatext=true
-Dawt.useSystemAAFontSettings=on
-Dsun.java2d.xrender=true
@topwebmaster
topwebmaster / gunicorn_start.bash
Created December 26, 2015 07:45 — forked from postrational/gunicorn_start.bash
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name