This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SignalHandler | |
{ | |
/** | |
* @var bool | |
*/ | |
private $isRunning; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Mysql | |
docker run --name="MYSQL" --rm -p 3306:3306 -e MYSQL_ALLOW_EMPTY_PASSWORD="yes" mysql/mysql-server:5.7 | |
# Redis | |
docker run --name="REDIS" -p=7780:6379 -d redis redis-server | |
# filter services by name | |
docker ps -a -f NAME=sentry --format "{{.Names}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# show commiter date and authot date | |
git log --format=fuller | |
# commit 0b4cbb6028d413b582c8710166ff66a3fc56f80e | |
# Author: Dmytro Sokil <[email protected]> | |
# AuthorDate: Wed Aug 2 09:19:06 2017 +0300 | |
# Commit: Dmytro Sokil <[email protected]> | |
# CommitDate: Wed Aug 2 09:19:06 2017 +0300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
bitbuckerRepoUrlList=$(cat $PROJECT_DIR/composer.json | grep bitbucket.com | awk -F'"' '{print $4}') | |
githubRepoUrlList=$(cat $PROJECT_DIR/composer.json | grep github.com | awk -F'"' '{print $4}') | |
set -- $bitbuckerRepoUrlList $githubRepoUrlList$armRepos \ | |
"ssh://[email protected]:2600/repo1.git" \ | |
"ssh://[email protected]:2600/repo2.git" \ | |
"ssh://[email protected]:2600/repo3.git" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server | |
{ | |
listen 80; | |
server_name server.com.ua; | |
location / | |
{ | |
try_files $uri @underconstruction; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat siteDomains | xargs -I{} bash -c "ping -c 1 {} > /dev/null 2>&1 && echo {} 'ok' || echo {} 'er'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- create temporary table | |
create temporary table cloned_rows_table like source_table; | |
-- clone some tows to temporary table | |
insert into cloned_rows_table select * from source_table where some_condition = 42; | |
-- apply some data modifications to cloned_rows_table | |
-- .... | |
-- regenerate auto increment id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
branchName=`git rev-parse --abbrev-ref HEAD` | |
taskNumber=`echo $branchName | awk -F'-' '{print $4 "-" $5}'` | |
taskSubject=`echo $branchName | awk -F'-' '{print $6}' | sed 's/_/ /g'` | |
commitMessageFile=$1 | |
commitMode=$2 | |
messageInFile=`cat $commitMessageFile` | |
# $2 is the commit mode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Table status | |
show table status; | |
-- same as | |
SELECT * FROM information_schema.tables WHERE table_schema = DATABASE(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Local: | |
ssh-keygen -t rsa | |
scp ~/.ssh/id_rsa.pub [email protected]://home/user/.ssh | |
# ssh remoteserver.com | |
# Remote: | |
cd ~/.ssh | |
cat .ssh/id_rsa.pub >> .ssh/authorized_keys |