Skip to content

Instantly share code, notes, and snippets.

View ptflp's full-sized avatar
🤟
Quality over quantity?

Petr Filippov ptflp

🤟
Quality over quantity?
View GitHub Profile
@ptflp
ptflp / test.json
Last active April 1, 2024 08:24
test data for Kata students
[{"message":"Others pounce tomorrow little hardly.","uuid":"426f16dd-d044-4844-be5c-0571b9411db5","date":"2022-07-05"},{"message":"Failure his all comb them.","uuid":"7374257f-1ca0-441a-81ad-8bf5515c346f","date":"2020-06-27"},{"message":"Thai of totally irritably even.","uuid":"32d42389-58d2-4996-95da-62ad89db6412","date":"2022-01-26"},{"message":"Moreover nest of out where.","uuid":"79e515c8-10ba-414a-821a-64b255224ad6","date":"2022-02-25"},{"message":"Couple orchard ours Polish nice.","uuid":"2a7b5ea8-fe08-44c7-8257-645f043cb1cc","date":"2022-03-25"},{"message":"Chastise all then lately did.","uuid":"5658f589-9734-43c2-b693-5b315f4c5bc3","date":"2021-04-24"},{"message":"Was inside tonight wide at.","uuid":"88ff2f24-123d-4a8d-a45f-2e36dc3a5a27","date":"2021-03-15"},{"message":"Why far monthly tomorrow first.","uuid":"26d1e1e5-2802-445c-b337-b93e4f35b161","date":"2020-11-05"},{"message":"How were bathe nevertheless yours.","uuid":"d39b6650-0991-461f-91a5-0403181d3c4d","date":"2021-03-12"},{"message":"Then sit
@ptflp
ptflp / dao.go
Created January 15, 2024 08:44
task3.1.1.4
package dao
import (
"context"
"database/sql"
"fmt"
"golang-course/test/dao/tabler"
"reflect"
"strings"
@ptflp
ptflp / Dockerfile
Last active December 7, 2023 12:20
docker php install imagemagick alpine 3.8
FROM php:7.0-fpm-alpine
RUN set -ex && \
apk add --no-cache --virtual .build-deps \
libxml2-dev \
shadow \
autoconf \
g++ \
make \
&& apk add --no-cache imagemagick-dev imagemagick libjpeg-turbo libgomp freetype-dev \
@ptflp
ptflp / .htaccess
Created January 23, 2018 10:06
Yii2 advanced .htaccess configuration
Options -Indexes
Options FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.(.*)$
RewriteRule ^(.*)$ http://%1/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^/admin/$
RewriteRule ^(admin)/$ /$1 [R=301,L]
RewriteCond %{REQUEST_URI} ^/admin
@ptflp
ptflp / main.go
Created August 29, 2023 10:33
Self hosted Gitlab user registrtation api
package main
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
@ptflp
ptflp / main.go
Created July 25, 2019 22:56
go Golang windows reboot shutdown
package main
import (
"fmt"
"syscall"
"unsafe"
)
// error is nil on success
func reboot() error {
@ptflp
ptflp / prometheus.yml
Created March 3, 2023 21:02
Basic prometheus configuration
global:
scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
metrics_path: '/metrics'
static_configs:
version: '3.3'
services:
api:
container_name: ${APP_NAME}api
image: ${IMAGE}
env_file: .env
command: bash -c "cd ${REPOSITORY} && go mod tidy -compat=1.17 && go run ./cmd/api"
restart: always
volumes:
- ./:/go/src/${REPOSITORY}
@ptflp
ptflp / README.md
Last active December 13, 2022 10:52
docker tun device into container

Docker tun device into container install openvpn or other soft, which uses tun devices

@ptflp
ptflp / .gitlab-ci.yaml
Last active October 13, 2022 11:52
Kata Golang gitalb CI/CD
# This file is a template, and might need editing before it works on your project.
image: golang:latest
variables:
# Please edit to your GitLab project
REPO_NAME: gitlab.com/ptflp/go-kata
GIT_DEPTH: 10
stages:
- lint