-- 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
mysql trigger history table
Поддержка для триггеров включена, начиная с MySQL 5.0.2.
Когда нужно историчность данных
CREATE TABLE `user` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL DEFAULT NULL, `password` CHAR(32) NULL DEFAULT NULL, PRIMARY KEY (`id`) ) COLLATE='utf8_general_ci' ENGINE=InnoDB AUTO_INCREMENT=0 ; CREATE TABLE `user_history` ( `id` INT(11) NOT NULL AUTO_INCREMENT, `user_id` INT(11) NULL DEFAULT NULL, `name` VARCHAR(255) NULL DEFAULT NULL, `password` CHAR(32) NULL DEFAULT NULL, `date_changed` DATETIME NULL DEFAULT NULL, PRIMARY KEY (`id`) ) COLLATE='utf8_general_ci' ENGINE=InnoDB AUTO_INCREMENT=0 ; CREATE DEFINER=`root`@`%` TRIGGER `history` BEFORE UPDATE ON `user` FOR EACH ROW BEGIN INSERT INTO user_history SELECT NULL, h.*, NOW() FROM user h WHERE id = OLD.id; END
Log cron
grep CRON /var/log/syslog
Docker конфиг некоторых моментов
Часовой пояс в докере
environment: TZ: "Europe/Moscow"
Mysql выводим на 127.0.0.1 чтобы потом можно было пробросить через ssh для управления с другого компьютера
ports: # - 3306:3306 - 127.0.0.1:3306:3306