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 | |
# Developer deploy, if change in dev branch then run deploy_dev.sh | |
cd /path/to/site && git fetch | |
if [[ $(git log --oneline -n1 dev..origin/dev) ]]; then | |
echo Delpoy dev... | |
./deploy_dev.sh | |
fi | |
# Prodaction deploy, if change in master branch then run deploy_prod.sh |
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 | |
xfreerdp /u:user /p:password /f /v:server:port +clipboard |
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 | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sudo sh get-docker.sh | |
sudo usermod -aG docker $USER | |
newgrp docker |
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 | |
# Install Go | |
sudo pacman -S --noconfirm go | |
# Build MailHog and mhsendmail from source in GitHub | |
go get github.com/mailhog/MailHog | |
go get github.com/mailhog/mhsendmail | |
# Copy execucate files |
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
version: '2' | |
services: | |
shadowsocks: | |
image: shadowsocks/shadowsocks-libev:latest | |
environment: | |
- TZ=Europe/Moscow | |
- PASSWORD=<password> | |
- METHOD=chacha20-ietf-poly1305 | |
- DNS_ADDRS=1.1.1.1,1.0.0.1 | |
- ARGS=--fast-open --no-delay --reuse-port |
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 | |
/** | |
* Получить число из строки | |
* @param string $string Исходная строка | |
* @param int $min Минимальная граница (0 по умолчанию) | |
* @param int $max Максимальная граница (100 по умолчанию) | |
* @param int $precision Точность от 1 до 32 (16 по умолчанию) | |
* @return int | |
*/ |
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
# Удалить все ветки кроме master | |
git checkout master && git branch | grep -v "* master" | xargs git branch -D |
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
current_dir=$PWD | |
echo "Finding repositories in $current_dir" && echo | |
for repo in `find ${current_dir} | grep ".git$"` | |
do | |
echo "Repository ${repo%.git} size `du -hcs ${repo} | grep 'total\|итого'`" | |
cd ${repo%.git} && git gc > /dev/null 2>&1 | |
echo "Size after optimization `du -hcs ${repo} | grep 'total\|итого'`" && echo | |
cd ${current_dir} | |
done |
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
# gen ed25519 | |
ssh-keygen -o -a 100 -t ed25519 | |
# gen strong rsa | |
ssh-keygen -t rsa -b 4096 -o -a 100 | |
# new passphrase | |
ssh-keygen -f ~/.ssh/id_rsa -p -o -a 100 | |
# ssh-agent |
NewerOlder