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
# Блокировка запросов в nginx по user agent (включая пустой user_agent - ^$) | |
if ( $http_user_agent ~* (^$|wget|curl) ) { | |
return 418 " "; | |
} | |
# Блокировка по части ссылки | |
location ~ (wp-|\.php$|\.jsp$|\.asp$|\.perl$|\.env$|\.git) { | |
return 418 " "; | |
} |
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
sudo find /mnt/files/ -type f -mtime +5 -delete | |
sudo find /mnt/files/ -type f -mmin +30 -delete |
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
sudo setfacl -d -m u:username:r-x /var/log/nginx | |
sudo setfacl -R -m u:username:r-x /var/log/nginx/ |
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
gitBranch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ [\1]/' | |
} | |
#server | |
PS1='\[\e[38;5;15m\]\u\[\e[38;5;7m\]@\[\e[38;5;9m\]\h\[\e[38;5;7m\]:\[\e[38;5;45m\]\w\[\033[0m\]\[\033[01;33m\]$(gitBranch)\[\033[00m\] \$ ' | |
#local | |
#PS1='\[\e[38;5;10m\]\u\[\e[38;5;7m\]@\[\e[38;5;10m\]\h\[\e[38;5;7m\]:\[\e[38;5;45m\]\w\[\033[0m\]\[\033[01;33m\]$(gitBranch)\[\033[00m\] \$ ' |
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
sudo apt-get install dcraw | |
sudo apt-get install imagemagick | |
# NEF | |
dcraw -c -w 1.NEF | pnmtojpeg > 1.nef.jpg | |
# BMP | |
convert 2.bmp 2.bmp.jpg | |
# EPS |
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
events { | |
# Устанавливает максимальное количество соединений одного рабочего процесса | |
worker_connections 1024; | |
# Будет принимать максимально возможное количество соединений | |
multi_accept on; | |
} |
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 | |
/usr/bin/curl --silent 'https://api.vk.com/method/account.setOnline?access_token={TOKEN}&v=5.131' > /dev/null |
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
Буква Õ вместо Ё | |
```sudo nano /usr/share/X11/xkb/symbols/ru``` | |
Найти строку | |
```key <TLDE> { [ Cyrillic_io, Cyrillic_IO ] };``` | |
Закоментировать, и под ней написать новую: | |
```key <TLDE> { [ 245, 213 ] };``` | |
Что бы применилось достаточно в настройках удалить и добавить русскую раскладку |
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
На сервере | |
```sudo nano /etc/ssh/sshd_config``` | |
Ставим: GatewayPorts yes | |
```sudo service ssh restart``` | |
На локальной машине_1 | |
```ssh -o "ServerAliveInterval 60" -N -R 5000:127.0.0.1:80 username@servername``` | |
На сервере появится порт 5000, который будет отдавать ваш 80 | |
На локальной машине_2 |
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 | |
ffmpeg -re -i video.flv -c copy -f flv rtmp://%STREAM_URL% | |
ffmpeg -re -i video2.flv -c copy -f flv rtmp://%STREAM_URL% | |
bash stream.sh > /dev/null 2>&1 < /dev/null & |
NewerOlder