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 & |
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
ffmpeg -re -i video.mp4 -vf scale=-1:720 -c:v libx264 -preset fast -ar 44100 -ac 2 -b:a 128k -crf 24 -g 3 -b:v 6M -maxrate 6M -bufsize 3M -f flv video.flv | |
ffmpeg -re -i video.flv -c copy -f flv rtmp://%STREAM_URL% |
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
# Создание туннеля | |
ssh -f -N -L 10006:127.0.0.1:3306 user@domain | |
# Подключение к базе | |
mysql -h 127.0.0.1 --port 10006 |
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
$('body').on('keydown', 'textarea', function (event) { | |
if (event.keyCode === 9) { | |
let v = this.value, s = this.selectionStart, e = this.selectionEnd; | |
this.value = v.substring(0, s) + '\t' + v.substring(e); | |
this.selectionStart = this.selectionEnd = s + 1; | |
return false; | |
} | |
}); |
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
# -copy none убирает все метаданные из исходного файла | |
# -optimize оптимизирует изображение | |
# -quality 85 степень сжатия | |
find /dir/ -name "*.jpg" -type f -exec jpegtran -quality 85 -copy none -optimize -outfile {} {} \; | |
# Изменяет формат на progressive | |
find /dir/ -name "*.jpg" -type f -exec jpegtran -progressive -outfile {} {} \; |
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
grep -nr 'word' /dir/ --color |
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
// Расширяем объект | Extend object | |
Object.prototype.isset = function (path = '') { | |
if (path === '') { | |
return true; | |
} | |
let keys = path.split('.'); | |
return typeof this[keys[0]] === 'undefined' || this[keys[0]] === null ? false : this[keys[0]].isset(keys.slice(1).join('.')); | |
}; | |
// Проверяем наличие первого символа в строке | Check for the first character in the string |
NewerOlder