{"id":133,"date":"2018-04-12T14:53:37","date_gmt":"2018-04-12T11:53:37","guid":{"rendered":"http:\/\/itbru.ru\/?p=133"},"modified":"2019-03-20T10:08:04","modified_gmt":"2019-03-20T07:08:04","slug":"bash-add-row-to-mysql","status":"publish","type":"post","link":"https:\/\/itbru.ru\/index.php\/2018\/04\/12\/bash-add-row-to-mysql\/","title":{"rendered":"Bash. \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u043e\u043a \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 MySQL."},"content":{"rendered":"<p>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 MySQL \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Bash \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0447\u043a\u0438 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0432 blacklist. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<p>1. \u0424\u0430\u0439\u043b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u043e\u0432<br \/>\n2. \u0422\u0430\u0431\u043b\u0438\u0446\u0430 \u0432 \u0431\u0434 \u0441 \u0434\u0432\u0443\u043c\u044f \u043f\u043e\u043b\u044f\u043c\u0438(\u0438\u043c\u044f \u0434\u043e\u043c\u0435\u043d\u0430 \u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435)<\/p>\n<pre class=\"lang:default decode:true\">user=\"%Mysql_user%\"\r\npass=\"%Mysql_pass%\"\r\ndb=\"%Mysql_db%\"\r\ncat %FileWithBadDomain% | while read line\r\ndo\r\n        echo \"INSERT INTO %table_name% (addr,status) VALUES ('$line', 'REJECT');\" | mysql -h127.0.0.1 -u$user -p$pass $db;\r\n        echo $line\r\ndone<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u0442\u0430\u0431\u043b\u0438\u0446\u0443 MySQL \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Bash \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u0447\u043a\u0438 \u0434\u043e\u043c\u0435\u043d\u043e\u0432 \u0432 blacklist. \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: 1. \u0424\u0430\u0439\u043b \u0441\u043e \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0434\u043e\u043c\u0435\u043d\u043e\u0432 2.&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"class_list":["post-133","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts\/133","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":1,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"predecessor-version":[{"id":134,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/posts\/133\/revisions\/134"}],"wp:attachment":[{"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itbru.ru\/index.php\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}