Skip to content

Instantly share code, notes, and snippets.

View AntonTyutin's full-sized avatar

Anton Tyutin AntonTyutin

  • Russia, Rostov-na-Donu
View GitHub Profile
@AntonTyutin
AntonTyutin / sendmail.sh
Last active June 9, 2022 11:37
A stub of "sendmail" command. Appends mail to file instead of send it to mail server. Depends on Perl and its "MIME::QuotedPrint" module.
#!/bin/bash
MAIL_LOG=${LOG_DIR:-/var/log}/mails.log
echo '== [' $(date +%Y-%m-%d_%H-%M-%S) '] ==' >> $MAIL_LOG
perl -MMIME::QuotedPrint -pe '$_=MIME::QuotedPrint::decode($_);' | tee -a $MAIL_LOG > /dev/null
@AntonTyutin
AntonTyutin / github-pullrequest.sh
Created June 16, 2014 14:26
Attach GitHub pull-request to an existent issue
#!/bin/bash
API_TOKEN="~"
NL="
"
NL2="$NL$NL"
HELP="$NL2 Usage: $0 vendor/repo feature_branch 15$NL"
define(['lodash'], function (_) {
'use strict';
return {
resolve: {
departmentResource: ['resourceManager', function (resources) {
return resources.getResource('department');
}],
department: ['departmentResource', '$stateParams', function (resource, $stateParams) {
return resource.read({id: $stateParams.id}).$promise;
@AntonTyutin
AntonTyutin / github-pullrequest.sh
Created May 19, 2016 18:02
Make GitHub pull-request from an issue
#!/bin/bash
// export GITHUB_API_TOKEN=051e00e0fd07b55f661da8c3068befa06518227e
NL="
"
NL2="$NL$NL"
HELP="$NL2 Usage: $0 vendor/repo feature_branch 15 master$NL Make sure you export GITHUB_API_TOKEN environment variable$NL2"
@AntonTyutin
AntonTyutin / postfix-mailcatcher-config.txt
Last active January 21, 2022 14:56
Postfix mailcatcher configuration
# ====================== /etc/postfix/main.cf =========================
# ...
catcher_destination_recipient_limit = 1
virtual_mailbox_domains = reply.domain.com
virtual_transport = catcher
virtual_mailbox_maps =
virtual_alias_maps =
recipient_delimiter = +
@AntonTyutin
AntonTyutin / docker-compose.yml
Last active March 20, 2018 07:48
WebDev: Common services running under Docker
version: "2"
services:
# implementing hostname-based routing of HTTP queries coming thru localhost:80
# see https://hub.docker.com/r/jwilder/nginx-proxy/
http-proxy:
image: jwilder/nginx-proxy
ports:
- "80:80"
- "443:443"
volumes:
@AntonTyutin
AntonTyutin / .backup.conf
Last active November 1, 2018 12:07
Утилита для бэкапа
# tgz <chdir> [<tar-name> <directory or file> ...|<single file or directory>]
# dump <database name>
# sync <ssh destination>
# purge <days to keep> <gnu find conditions>
@AntonTyutin
AntonTyutin / yaml.sh
Created April 24, 2019 06:08
Converts JSON to YAML with query capabilities
#!/bin/sh
if ! docker images -q yq | grep '' 1>/dev/null
then
docker build --pull -t yq - <<EOF
FROM alpine
RUN apk add --no-cache py2-pip jq && pip install -q yq
ENTRYPOINT ["yq"]
@AntonTyutin
AntonTyutin / popolochkam-dct-openapi.yaml
Last active October 26, 2020 11:05
API Сервиса обработки данных с ТСД
openapi: 3.0.0
servers:
- description: Тестовый сервис
url: https://pre.tsd.po-polochkam.ru
info:
title: Сервис обработки данных с ТСД
description: |
Сервис предназначен для извлечения данных о товарах из фотографий экранов