https://www.zdnet.com/article/microsoft-security-chief-ie-is-not-a-browser-so-stop-using-it-as-your-default/
Автор: Evgen
Отправка почты из docker контейнера
RUN apt-get update && \ apt-get install -y msmtp && \ apt-get clean && \ echo "account yandex" >> ~/.msmtprc && \ echo "logfile ~/.msmtp.log" >> ~/.msmtprc && \ echo "host smtp.yandex.ru" >> ~/.msmtprc && \ echo "port 587" >> ~/.msmtprc && \ echo "from no-reply@serov.eu" >> ~/.msmtprc && \ echo "keepbcc on" >> ~/.msmtprc && \ echo "auth on" >> ~/.msmtprc && \ echo "user no-reply@serov.eu" >> ~/.msmtprc && \ echo "password Uzum2G9pkZt" >> ~/.msmtprc && \ echo "tls on" >> ~/.msmtprc && \ echo "tls_starttls on" >> ~/.msmtprc && \ echo "tls_certcheck off" >> ~/.msmtprc && \ chmod 0600 ~/.msmtprc && \ cp -p ~/.msmtprc /etc/.msmtp_php && \ chown www-data:www-data /etc/.msmtp_php && \ touch /var/log/msmtp.log && \ chown www-data:www-data /var/log/msmtp.log
в php.ini
sendmail_path = "/usr/bin/msmtp -C /etc/.msmtp_php --logfile /var/log/msmtp.log -a yandex -t"
Другие конфиги
account yandex logfile /var/log/msmtp.log host smtp.yandex.ru port 587 from mail@yandex.ru keepbcc on auth on user mail@yandex.ru password пароль tls on tls_starttls on account yahoo tls on tls_starttls off tls_certcheck off auth on host smtp.mail.yahoo.com user user1 from user1@yahoo.com password yourYahooPa5sw0rd account gmail tls on tls_certcheck off auth on host smtp.gmail.com port 587 user user1@gmail.com from user1@gmail.com password yourgmailPassw0rd
Тестирование:
echo -e "test message" | /usr/bin/msmtp --debug -t -i name@site.ru
Капча
docker backup mysql DB
My
docker exec app-mysql /usr/bin/mysqldump -u bitrix --password=tA32KVQ bitrix | gzip -9 > backup.sql.gz
Other
# Backup docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql # Restore cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
script
#!/bin/bash
DATA=`date +"%Y-%m-%d_%H-%M"`
PATHB=/mnt/backups
# Бэкапим дампом
docker exec container_name /usr/bin/mysqldump -u root --password=rootpass db_name > "$PATHB"/"$DATA"-db_name.sql
# Жмем
/bin/gzip "$PATHB"/"$DATA"-db_name.sql
# Чистим, удаляя файлы старше 10-ти дней
/usr/bin/find "$PATHB" -type f -mtime +10 -exec rm -rf {} \;
rsync для забора с другого ПК
/usr/bin/rsync -av -e "ssh -p 17222 -i /root/.ssh/id_rsa" rsyncuser@162.111.178.155:/mnt/backups/* /backups/mysql
Backup a MySQL local or remote database
Command to backup a local or remote MySQL database using Docker:
$ docker run -it mysql /usr/bin/mysqldump -h [MYSQL_HOST] -u [MYSQL_USER] --password=[MYSQL_PASSWORD] [MYSQL_DATABASE] > backup.sql
Command to backup a local or remote MySQL database using Docker with compression (using gzip):
$ docker run -it mysql /usr/bin/mysqldump -h [MYSQL_HOST] -u [MYSQL_USER] --password=[MYSQL_PASSWORD] [MYSQL_DATABASE] | gzip -9 > backup.sql.gz
Backup a containerized MySQL database
Command to backup a containerized MySQL database creating a compressed file using Docker and gzip:
$ docker exec [MYSQL_CONTAINER] /usr/bin/mysqldump -u [MYSQL_USER] --password=[MYSQL_PASSWORD] [MYSQL_DATABASE] | gzip -9 > backup.sql.gz
Когда надо обратиться с apache на nginx
docker-compose
nginx:
image: nginx
restart: always
container_name: app-nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./nginx/:/etc/nginx/conf.d/
- ./apache/data/:/data/
environment:
TZ: "Europe/Moscow"
ports:
- "80:80"
- "443:443"
networks:
- front
- backend
apache:
build: ./apache
container_name: app-apache
restart: always
volumes:
- ./php.ini:/usr/local/etc/php/php.ini
- ./apache/data/:/data/
links:
- "nginx:test1.yandex.ru"
Когда нужно дать понять php что он работает по ssl
if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )
{
$_SERVER['HTTPS'] = 'on';
$_SERVER['SERVER_PORT'] = 443;
}
Steps to clear out the history of a git/github repository
-- Remove the history from rm -rf .git -- recreate the repos from the current content only git init git add . git commit -m "Initial commit" -- push to the github remote repos ensuring you overwrite history git remote add origin git@github.com:/ .git git push -u --force origin master
warning: CRLF will be replaced by LF in
error: warning: CRLF will be replaced by LF in style.scss. The file will have its original line endings in your working directory. solution: git config core.autocrlf true
Подсчет количества по дате
SELECT COUNT(id) AS count_id, DATE_FORMAT(`date`, '%Y %m %d %H') AS d, header, anons FROM cms_news GROUP BY d ORDER BY id
Creating ISO images from a folder in OSX
hdiutil makehybrid -o ~/Desktop/image.iso ~/path/to/folder/to/be/converted -iso -joliet

