c5d575ccae5ae5f30dd59037210edb8220de2cbe

Author
mikka <miklos.martin@gmail.com>
Committer
mikka <miklos.martin@gmail.com>
Date

Message

cleaned up

Diff

This diff is truncated to protect this page.

  1diff --git a/plugins/lesscss/lesscss.plugin.zsh b/plugins/lesscss/lesscss.plugin.zsh
  2deleted file mode 100644
  3index 6c666adb20eb038ec4457c8a4d7f343726b98276..0000000000000000000000000000000000000000
  4--- a/plugins/lesscss/lesscss.plugin.zsh
  5+++ /dev/null
  6@@ -1,46 +0,0 @@
  7-# basics taken from here:
  8-# http://www.ravelrumba.com/blog/watch-compile-less-command-line/comment-page-1/#comment-2464
  9-# Requires watchr: https://github.com/mynyml/watchr
 10-
 11-watchless () {
 12-    compressed=0
 13-    compile=""
 14-    
 15-    while getopts ":xc:h" option
 16-    do
 17-      case $option in
 18-        x ) compressed=1 ;;
 19-        c ) compile=$OPTARG ;;
 20-        h ) _watchless_usage; return ;;
 21-      esac
 22-    done
 23-    
 24-    if [ $compressed -eq 1 ]; then
 25-        x=' -x'
 26-    else
 27-        x=''
 28-    fi
 29-    
 30-    if [ -n "$compile" ]; then
 31-        if [ ! -e $compile ]; then
 32-            echo "\033[337;41m\n$compile doesn't exist!\n\033[0m"
 33-            return
 34-        fi
 35-        
 36-        name=$(echo $compile | cut -d . -f 1)
 37-        
 38-        watchr -e 'watch(".*\.less$") { |f| system("lessc '$name'.less > '$name'.css'$x' && echo \"'$name'.less > '$name'.css\" ") }'
 39-    else
 40-        watchr -e 'watch(".*\.less$") { |f| system("lessc #{f[0]} > $(echo #{f[0]} | cut -d\. -f1).css'$x' && echo \"#{f[0]} > $(echo #{f[0]} | cut -d\. -f1).css\" ") }'
 41-    fi
 42-}
 43-
 44-_watchless_usage () {
 45-    echo "Usage: watchless [options]"
 46-    echo
 47-    echo "Options"
 48-    echo "  -x   Compiles less files into minified css files"
 49-    echo "  -c   Watch all files but compile only the one given here"
 50-    echo "  -h   Get this help message"
 51-    return
 52-}
 53diff --git a/plugins/nginx/nginx.plugin.zsh b/plugins/nginx/nginx.plugin.zsh
 54deleted file mode 100644
 55index 4d2c4122d35fc3d6ad2069f585505970aa319d37..0000000000000000000000000000000000000000
 56--- a/plugins/nginx/nginx.plugin.zsh
 57+++ /dev/null
 58@@ -1,186 +0,0 @@
 59-: ${NGINX_DIR:=/etc/nginx}
 60-: ${NGINX_VHOST_TEMPLATE:=$ZSH/plugins/nginx/templates/symfony2}
 61-
 62-if [ $use_sudo -eq 1 ]; then
 63-    sudo="sudo"
 64-else
 65-    sudo=""
 66-fi
 67-
 68-# nginx basic completition
 69-
 70-_nginx_get_en_command_list () {
 71-    ls -a $NGINX_DIR/sites-available | awk '/^[a-z][a-z.-]+$/ { print $1 }'
 72-}
 73-
 74-_nginx_get_dis_command_list () {
 75-    ls -a $NGINX_DIR/sites-enabled | awk '/^[a-z][a-z.-]+$/ { print $1 }'
 76-}
 77-
 78-_nginx_en () {
 79-   compadd `_nginx_get_en_command_list`
 80-}
 81-
 82-_nginx_dis () {
 83-   compadd `_nginx_get_dis_command_list`
 84-}
 85-
 86-# Enabling a site
 87-en () {
 88-    if [ ! $1 ]; then
 89-        echo "\033[337;41m\nThe name of the vhost is required!\n\033[0m";
 90-        return
 91-    fi
 92-    
 93-    if [ ! -e $NGINX_DIR/sites-available/$1 ]; then
 94-        echo "\033[31m$1\033[0m doesn't exist";
 95-        return
 96-    fi
 97-
 98-    if [ ! -e $NGINX_DIR/sites-enabled/$1 ]; then
 99-  	    $sudo ln -s $NGINX_DIR/sites-available/$1 $NGINX_DIR/sites-enabled/$1;
100-	    if [ -e /etc/nginx/sites-enabled/$1 ]; then
101-        	echo "\033[32m$1\033[0m successfully enabled";
102-        else
103-            echo "An error occured during the enabling of \033[31m$1\033[0m";
104-        fi
105-    else
106-        echo "\033[31m$1\033[0m is already enabled";
107-    fi
108-}
109-compdef _nginx_en en
110-
111-# Disabling a site
112-dis () {
113-    if [ ! $1 ]; then
114-        echo "\033[337;41m\nThe name of the vhost is required!\n\033[0m";
115-        return
116-    fi
117-
118-    if [ ! -e $NGINX_DIR/sites-enabled/$1 ]; then
119-        echo "\033[31m$1\033[0m doesn't exist";
120-    else
121-	    $sudo rm -f $NGINX_DIR/sites-enabled/$1;
122-	    if [ ! -e $NGINX_DIR/sites-enabled/$1 ]; then
123-        	echo "\033[32m$1\033[0m successfully disabled";
124-        else
125-            echo "An error occured during the disabling of \033[31m$1\033[0m";
126-        fi
127-    fi
128-}
129-compdef _nginx_dis dis
130-
131-# Completition of vhost
132-_nginx_get_possible_vhost_list () {
133-    ls -a $HOME/www | awk '/^[^.][a-z0-9._]+$/ { print $1 }'
134-}
135-
136-_nginx_vhost () {
137-   compadd `_nginx_get_possible_vhost_list`
138-}
139-
140-# Parsing arguments
141-vhost () {
142-    local user=$USER;
143-    local template=$NGINX_VHOST_TEMPLATE
144-    local tpl="non_existing_template"
145-    local enable=1
146-    local write_hosts=0
147-
148-    while getopts ":lu:t:nwh" option
149-    do
150-      case $option in
151-        l ) ls $NGINX_DIR/sites-enabled; return ;;
152-        u ) user=$OPTARG ;;
153-        t ) tpl=$OPTARG ;;
154-        n ) enable=0 ;;
155-        w ) write_hosts=1 ;;
156-        h ) _vhost_usage; return ;;
157-      esac
158diff --git a/plugins/nginx/templates/plain_php b/plugins/nginx/templates/plain_php
159deleted file mode 100644
160index f7995f5d5ab822a9e7cbd49e0cbcd6733857e428..0000000000000000000000000000000000000000
161--- a/plugins/nginx/templates/plain_php
162+++ /dev/null
163@@ -1,27 +0,0 @@
164-server {
165-    root /home/{user}/www/{vhost};
166-    index index.php;
167-
168-    server_name {vhost};
169-
170-    error_log /var/log/nginx/{vhost}.error.log;
171-    access_log /var/log/nginx/{vhost}.access.log;
172-
173-    location / {
174-        try_files $uri $uri/ $uri/index.php;
175-    }
176-
177-    location ~ \.php$ {
178-        include fastcgi_params;
179-        fastcgi_index index.php;
180-        fastcgi_pass   127.0.0.1:{pool_port};
181-        fastcgi_split_path_info ^(.+\.php)(/.*)$;
182-
183-        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
184-        fastcgi_param  HTTPS              off;
185-    }
186-
187-    location ~ /\.ht {
188-        deny all;
189-    }
190-}
191diff --git a/plugins/nginx/templates/symfony2 b/plugins/nginx/templates/symfony2
192deleted file mode 100644
193index c2eeaec0ab29b34594c86aa1a52be9697983352a..0000000000000000000000000000000000000000
194--- a/plugins/nginx/templates/symfony2
195+++ /dev/null
196@@ -1,27 +0,0 @@
197-server {
198-    root /home/{user}/www/{vhost}/web;
199-    index app_dev.php;
200-
201-    server_name {vhost};
202-    client_max_body_size 10M;
203-    
204-    error_log /var/log/nginx/{vhost}.error.log;
205-	access_log /var/log/nginx/{vhost}.access.log;
206-    
207-    location / {
208-        try_files $uri $uri/ /app_dev.php$uri /app_dev.php$is_args$args;
209-    }
210-
211-    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:{pool_port}
212-    location ~ ^/(app|app_dev|check)\.php(/|$) {
213-        fastcgi_pass   127.0.0.1:{pool_port};
214-        fastcgi_split_path_info ^(.+\.php)(/.*)$;
215-        include fastcgi_params;
216-        fastcgi_param  SCRIPT_FILENAME    $document_root$fastcgi_script_name;
217-        fastcgi_param  HTTPS              off;
218-    }
219-
220-    location ~ /\.ht {
221-        deny all;
222-    }
223-}
224diff --git a/plugins/php-fpm/php-fpm.plugin.zsh b/plugins/php-fpm/php-fpm.plugin.zsh
225deleted file mode 100644
226index 3c095058ac4321430fb0203516ceb095f199261f..0000000000000000000000000000000000000000
227--- a/plugins/php-fpm/php-fpm.plugin.zsh
228+++ /dev/null
229@@ -1,75 +0,0 @@
230-: ${FPM_DIR:=/etc/php5/fpm}
231-
232-if [ $use_sudo -eq 1 ]; then
233-    sudo="sudo"
234-else
235-    sudo=""
236-fi
237-
238-_fpm_get_possible_pool_list () {
239-    cat /etc/passwd | awk -F : '{print $1 }'
240-}
241-
242-_fpm_pool () {
243-    compadd `_fpm_get_possible_pool_list`
244-    
245-}
246-
247-pool () {
248-    while getopts ":lh" option
249-    do
250-      case $option in
251-        l ) ls $FPM_DIR/pool.d; return ;;
252-        h ) _pool_usage; return ;;
253-       * ) _pool_usage; return ;; # Default.
254-      esac
255-    done
256-    
257-    if [ ! $1 ]; then
258-      user=$USER
259-    else
260-      user=$1
261-    fi
262-    
263-    _pool_generate $user
264-}
265-compdef _fpm_pool pool
266-
267-_pool_usage () {
268-    echo "Usage: pool [options] [user]"
269-    echo
270-    echo "Options"
271-    echo "  -l   Lists fpm pools"
272-    echo "  -h   Get this help message"
273-    return
274-}
275-
276-_pool_generate () {
277-    user=$(cat /etc/passwd | grep $1 | awk -F : '{print $1 }')
278-    
279-    if [ ! $user ]; then
280-      echo "User \033[31m$1\033[0m doesn't have an account on \033[33m$HOST\033[0m"
281-      return
282-    fi
283-
284-    group=$(groups $user | cut -d " " -f 3)
285-    
286-    echo "Generating pool for \033[33m$user\033[0m user with \033[33m$group\033[0m group"
287-        
288-    user_id=$(cat /etc/passwd | grep $1 | awk -F : '{print $3 }')
289-    pool_port=1$user_id
290-    : ${FPM_POOL_TEMPLATE:=$ZSH/plugins/php-fpm/templates/pool}
291-    
292-    conf=$(sed -e 's/{user}/'$user'/g' -e 's/{group}/'$group'/g' -e 's/{pool_port}/'$pool_port'/g' $FPM_POOL_TEMPLATE )
293-    
294-    echo $conf > $user.conf
295-    $sudo mv $user.conf $FPM_DIR/pool.d/$user.conf
296-    
297-    if [ -e $FPM_DIR/pool.d/$user.conf ]; then
298-        echo "Pool for \033[32m$user\033[0m user has been successfully created"
299-    else
300-        echo "An error occured during the creating of pool for \033[31m$user\033[0m user"
301-    fi
302-}
303-
304-alias fpmr="$sudo service php5-fpm restart"
305diff --git a/plugins/php-fpm/templates/pool b/plugins/php-fpm/templates/pool
306deleted file mode 100644
307index 80f6693e04d1d3a833acabe13244ce078c2a36d9..0000000000000000000000000000000000000000
308--- a/plugins/php-fpm/templates/pool
309+++ /dev/null
310@@ -1,11 +0,0 @@
311-[{user}]
312-user = {user}
313-group = {group}
314-
315-listen = 127.0.0.1:{pool_port}
316-
317-pm = dynamic
318-pm.max_children = 10
319-pm.min_spare_servers = 1
320-pm.max_spare_servers = 3
321-pm.max_requests = 100