Skip to content

Instantly share code, notes, and snippets.

<?php
$id = $this->in['id'];
if ($id == $this->uid || $this->permissions['profile.get_users'] == 3)
{
$path = $this->core->path_project . "/images/avatars";
$this->sql->query_var("SELECT * FROM `users` WHERE id=:id", array(':id' => $id));
$data = $this->sql->fetch();
if ($data['vkontakte'] != '')
{
$vk_id = $data['vkontakte'];
@alherd-by
alherd-by / Dockerfile
Last active August 29, 2015 14:06 — forked from jbroadway/Dockerfile
FROM ubuntu:14.04.1
RUN apt-get update
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:nginx/stable
RUN apt-get update
RUN apt-get install -y wget git nano postfix nginx
RUN apt-get install -y php5-cli php5-common php5-mysql php5-sqlite php5-curl php5-fpm php5-json php5-gd php5-mcrypt php5-intl php5-imap php5-tidy php5-mysqlnd php5-dev
RUN wget -O /etc/nginx/sites-available/default https://gist.github.com/jbroadway/6369183/raw/682a1ed8078cc39f59c3624f460b128addff95db/nginx-default
user www-data;
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
server {
server_name www.adminer.dev.unet.by;
return 301 $scheme://adminer.dev.unet.by$request_uri;
}
server {
server_name adminer.dev.unet.by;
root /home/www/adminer;
index index.php;
location / {
<div id="unet-help">
<div id="unet-help-body">
<table>
<tr>
<td>
<div id="unet-help-sidebar">
{if $gid != 10}
<div class="unet-help-sidebar-unit">
<dl>
<dt>Настройка интернета</dt>
<!DOCTYPE html>
<html id="day">
<head>
<script type="text/javascript">(function(){
var
d=(new Date({$time}*1000)).getHours();
document.documentElement.id=d>=23||d<9?"night":"day";
})();</script>
<meta charset="utf-8"/>
<title>box.unet.by</title>
@alherd-by
alherd-by / gist:b0890104ea1bb8a6e50d
Created December 31, 2014 20:10
Nginx upload module fix for version > 1.4
/*
* Copyright (C) 2006, 2008 Valery Kholodkov
* Client body reception code Copyright (c) 2002-2007 Igor Sysoev
* Temporary file name generation code Copyright (c) 2002-2007 Igor Sysoev
*/
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
#include <nginx.h>
#!/bin/bash
changed_files="$(git log --name-status HEAD^..HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "composer.lock" && composer --working-dir=$GIT_WORK_TREE install
}
# `composer install` if the `composer.lock` file gets changed
@alherd-by
alherd-by / imagick-3.4.0-PHP7-forge.sh
Created March 9, 2016 18:57 — forked from pascalbaljet/imagick-3.4.0-PHP7-forge.sh
Install Imagick 3.4.0 on PHP 7.0 server (Laravel Forge)
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
apt-get install pkg-config libmagickwand-dev -y
cd /tmp
wget https://pecl.php.net/get/imagick-3.4.0.tgz
tar xvzf imagick-3.4.0.tgz