Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Max roquie

🎯
Focusing
View GitHub Profile
View example.php
<?php
// file1
// bind UserRepositoryInterface to EloquentUserRepository object
class EloquentUserRepository extends UserRepositoryInterface
{
// ...
public function all()
{
return $this->model->all();
@roquie
roquie / AuthServiceProvider.php
Created Jul 27, 2018
Laravel 5.6 Cartalyst Sentinel Integration
View AuthServiceProvider.php
<?php
declare(strict_types=1);
namespace App\Providers;
use Auth;
use Domain\SentinelGuard;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
@roquie
roquie / lumen-stdout.php
Created Jun 15, 2018
Write Lumen framework log entities to stdout.
View lumen-stdout.php
// bootstrap/app.php
```php
<?php
$app->extend(\Psr\Log\LoggerInterface::class, function ($logger) {
$logger->popHandler();
$logger->pushHandler(new \Monolog\Handler\ErrorLogHandler());
return $logger;
});
```
View perm.php
<?php
namespace App\Criteria;
use App\User;
use Auth;
/**
* Глобальный скоуп сужающий
* выборку до данных пользователя (where user_id = ${CURRENT_USER_ID}).
View after start
root@roquie-hetzner-2 ~ # flynn-host ps
ID STATE CREATED CONTROLLER APP CONTROLLER TYPE ERROR
roquiehetzner2-2db06c5e-b279-4bd4-af2a-2377bf01188a running 51 seconds ago controller web
roquiehetzner2-8cdadeca-a831-46d8-bcfc-8e259a1b6eaf running About a minute ago controller web
roquiehetzner2-aba5c7ff-01fc-41db-ae67-391b3a9ea3d4 running 2 minutes ago controller web
roquiehetzner2-509d8e5e-a8db-42c1-a0c6-3fc40e980e78 running 3 minutes ago controller web
roquiehetzner2-0ed7ad8d-8907-4380-ab34-56bd169bc287 running 4 minutes ago controller web
roquiehetzner2-0089d27f-92e3-49c6-b1f8-b9db8dbb89be running 5 minutes ago controller web
roquiehetzner2-00b23195-a0d7-46f9-b2de-6f46c12edc1d running 6 minutes ago controller web
roquiehetzner2-6762c3be-c500-4328-afb9-4a0a5559b67d running 7 minutes ago controller web
View m2m-megafon-limits-resp.json
{
"serviceName": "M2MSIMCardLimitList",
"errorCode": "12546304",
"userMessage": "Недостаточно прав для доступа к выбранной функции",
"developerMessage": "com.peterservice.openapi.m2m.backend.exceptions.PermissionException: \n\tat com.peterservice.openapi.m2m.backend.camel.InitProcessor.process(InitProcessor.java:90)\n\tat org.apache.camel.processor.DelegateSyncProcessor.process(DelegateSyncProcessor.java:63)\n\tat org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)\n\tat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n\tat org.apache.camel.processor.Pipeline.process(Pipeline.java:118)\n\tat org.apache.camel.processor.Pipeline.process(Pipeline.java:80)\n\tat org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)\n\tat org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)\n\tat org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncPro
View full-log.log
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.388842 Command line options: map[trusted-subnets: ipalloc-range: nickname:Ubuntu-1604-xenial-64-minimal port:6783 status-addr:127.0.0.1:6782 http-addr:127.0.0.1:6784 name:e2:17:6d:eb:53:45 resolv-conf:/var/run/weave/etc/resolv.conf datapath:datapath dns-domain:kontena.local dns-effective-listen-address:172.17.0.1 dns-listen-address:172.17.0.1:53]
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.389231 Communication between peers via untrusted networks is encrypted.
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.495586 Our name is e2:17:6d:eb:53:45(Ubuntu-1604-xenial-64-minimal)
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.496004 Launch detected - using supplied peer list: []
2017-07-31T20:35:14.000Z weave: INFO: 2017/07/31 20:35:14.498975 Docker API on unix:///var/run/docker.sock: &[GitCommit=78d1802 GoVersion=go1.6.2 Os=linux Arch=amd64 KernelVersion=4.8.0-58-generic BuildTime=2017-01-31T23:35:14.312544877+00:00 Versio
View kontena-grid-logs.log
max@Roquie-mac:~/google_drive/infra/kontena-ansible$ kontena grid logs -t
weave | INFO: 2017/07/31 20:35:14.388842 Command line options: map[trusted-subnets: ipalloc-range: nickname:Ubuntu-1604-xenial-64-minimal port:6783 status-addr:127.0.0.1:6782 http-addr:127.0.0.1:6784 name:e2:17:6d:eb:53:45 resolv-conf:/var/run/weave/etc/resolv.conf datapath:datapath dns-domain:kontena.local dns-effective-listen-address:172.17.0.1 dns-listen-address:172.17.0.1:53]
weave | INFO: 2017/07/31 20:35:14.389231 Communication between peers via untrusted networks is encrypted.
weave | INFO: 2017/07/31 20:35:14.495586 Our name is e2:17:6d:eb:53:45(Ubuntu-1604-xenial-64-minimal)
weave | INFO: 2017/07/31 20:35:14.496004 Launch detected - using supplied peer list: []
weave | INFO: 2017/07/31 20:35:14.498975 Docker API on unix:///var/run/docker.sock: &[GitCommit=78d1802 GoVersion=go1.6.2 Os=linux Arch=amd64 KernelVersion=4.8.0-58-generic BuildTime=2017-01-31T23:35:14.312544877+00:00 Version=1.12.6 ApiVersion=1.24]
weave | INFO: 2017/0
View cls-on-master.log
root@Ubuntu-1604-xenial-64-minimal ~ # vi /etc/kontena-
kontena-agent.env kontena-server.env
root@Ubuntu-1604-xenial-64-minimal ~ # vi /etc/kontena-agent.env
root@Ubuntu-1604-xenial-64-minimal ~ # service kontena-agent restart
root@Ubuntu-1604-xenial-64-minimal ~ # service docker restart
root@Ubuntu-1604-xenial-64-minimal ~ # docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
fb739f6db415 mongo:3.0 "docker-entrypoint.sh" 5 seconds ago Up 4 seconds 27017/tcp kontena-server-mongo
32633b36432f kontena/agent:1.3.4 "/app/bin/kontena-age" 6 seconds ago Up 5 seconds kontena-agent
59787fd693ec google/cadvisor:v0.24.1 "/usr/bin/cadvisor -l" 26 seconds ago Up 6 seconds kontena-cadvisor
View etcd-log.json
This file has been truncated, but you can view the full file.
{"log":"2017-07-24 09:48:53.329917 W | flags: unrecognized environment variable ETCD_RELEASE=2.3.7\n","stream":"stderr","time":"2017-07-24T09:48:53.396272003Z"}
{"log":"2017-07-24 09:48:53.396023 I | etcdmain: etcd Version: 2.3.7\n","stream":"stderr","time":"2017-07-24T09:48:53.39635564Z"}
{"log":"2017-07-24 09:48:53.396033 I | etcdmain: Git SHA: fd17c91\n","stream":"stderr","time":"2017-07-24T09:48:53.396371793Z"}
{"log":"2017-07-24 09:48:53.396039 I | etcdmain: Go Version: go1.6.2\n","stream":"stderr","time":"2017-07-24T09:48:53.396378154Z"}
{"log":"2017-07-24 09:48:53.396086 I | etcdmain: Go OS/Arch: linux/amd64\n","stream":"stderr","time":"2017-07-24T09:48:53.396383422Z"}
{"log":"2017-07-24 09:48:53.396116 I | etcdmain: setting maximum number of CPUs to 4, total number of available CPUs is 4\n","stream":"stderr","time":"2017-07-24T09:48:53.396388262Z"}
You can’t perform that action at this time.