{"id":708,"date":"2023-04-14T12:21:19","date_gmt":"2023-04-14T04:21:19","guid":{"rendered":"http:\/\/www.inhhh.com\/blog\/?p=708"},"modified":"2023-09-03T11:27:49","modified_gmt":"2023-09-03T03:27:49","slug":"ubuntu-22%e4%bd%bf%e7%94%a8instock","status":"publish","type":"post","link":"http:\/\/www.inhhh.com\/blog\/?p=708","title":{"rendered":"ubuntu 22\u4f7f\u7528InStock"},"content":{"rendered":"\n<p>\u73af\u5883\uff1aubuntu22<\/p>\n\n\n\n<p>g\\<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>apt-get install -y wget \napt-get install -y vim \napt-get install -y make\napt-get install -y openssl\napt-get install -y iw\napt-get install -y usbutils\napt-get install -y v4l-utils\napt-get install -y ntfs-3g\napt-get install -y zip\napt-get install -y unzip\napt-get install -y cpio\napt-get install -y pkg-config\napt-get install -y automake\napt-get install -y gcc \napt-get install -y gimp\napt-get install -y swig \napt-get install -y libtool\napt-get install -y nasm \napt-get install -y autoconf \napt-get install -y automake \napt-get install -y git \napt-get install -y mercurial \napt-get install -y libcurl4\napt-get install -y cmake\napt-get install -y yasm\napt-get install -y chkconfig<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5PIP3<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y python3-pip<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"104\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/1aeda4edc2b7b305a85a8fd12449300.png\" alt=\"\" class=\"wp-image-710\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/1aeda4edc2b7b305a85a8fd12449300.png 669w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/1aeda4edc2b7b305a85a8fd12449300-300x47.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"43\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/ca0d7b44716f14405c8ca1df28954aa.png\" alt=\"\" class=\"wp-image-709\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/ca0d7b44716f14405c8ca1df28954aa.png 574w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/ca0d7b44716f14405c8ca1df28954aa-300x22.png 300w\" sizes=\"auto, (max-width: 574px) 100vw, 574px\" \/><\/figure>\n\n\n\n<p>\u5b89\u88c5talib<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p \/var\/www\/setup\/talib\ncd \/var\/www\/setup\/talib\nwget http:\/\/prdownloads.sourceforge.net\/ta-lib\/ta-lib-0.4.0-src.tar.gz\ntar -xvf ta-lib-0.4.0-src.tar.gz\ncd \/ta-lib\n.\/configure --prefix=\/usr\/local\/ta-lib\nmake\nsudo make install<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5pip\u91cc\u7684\u63d2\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip3 install --upgrade SQLAlchemy\npip3 install --upgrade bokeh\npip3 install --upgrade tornado\npip3 install --upgrade akshare\npip3 install --upgrade TA_Lib\npip3 install --upgrade pandas\npip3 install --upgrade APScheduler\npip3 install --upgrade numpy\npip3 install --upgrade pytz\npip3 install --upgrade pymysql\npip3 install --upgrade pipreqs<\/code><\/pre>\n\n\n\n<p>\u5b89\u88c5mysql\u6570\u636e\u5e93<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y mysql-server mysql-client libmysqlclient-dev<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\u6570\u636e\u5e93\u5bc6\u7801<\/p>\n\n\n\n<p>1.\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff1a\u8fdb\u5165\/etc\/mysql\/mysql.conf.d\/ \uff0c<br>\u5728\u914d\u7f6e\u6587\u4ef6mysqld.cnf\u4e0b\u6dfb\u52a0 skip-grant-tables<br>2.\u5728\u7ec8\u7aef\u8f93\u5165\u547d\u4ee4\uff1asudo service mysql restart\u6765\u91cd\u65b0\u542f\u52a8mysql\u670d\u52a1<br>3.\u8f93\u5165:mysql -u root -p\uff0c\u56de\u8f66\u8fdb\u5165mysql\uff08\u6b64\u65f6\u4e0d\u9700\u8981\u5bc6\u7801\u5373\u53ef\u76f4\u63a5\u8fdb\u5165\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>use mysql;\nupdate user set authentication_string='' where user='root';,\nalter user 'root'@'localhost' identified by '123456';\nFLUSH PRIVILEGES;\nalter user 'root'@'localhost' identified by '123456';\nselect user,plugin from mysql.user;\nupdate user set plugin='mysql_native_password' where user='root';\nFLUSH PRIVILEGES;\nalter user 'root'@'localhost' identified by '123456';\nFLUSH PRIVILEGES;<\/code><\/pre>\n\n\n\n<p>5.\u5c06\u7b2c\u4e00\u6b65\u7684skip-grant-tables\u6ce8\u91ca\u6389;<br>6.\u8f93\u5165service mysql restart\u91cd\u542fmysql<\/p>\n\n\n\n<p>\u5b89\u88c5git<\/p>\n\n\n\n<p>sudo apt-get install git<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt-get install -y git\nmkdir -p \/var\/www\/develop\/InStock\ncd \/var\/www\/develop\/InStock\ngit clone https:\/\/github.com\/myhhub\/InStock.git<\/code><\/pre>\n\n\n\n<p>\u4fee\u6539\u76ee\u5f55 \u4e0b \\instock\\lib\\database.py \u6570\u636e\u5e93\u8fde\u63a5\u8fd9\u7b26\u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>db_host = \"localhost\"  # \u6570\u636e\u5e93\u670d\u52a1\u4e3b\u673a\ndb_user = \"root\"  # \u6570\u636e\u5e93\u8bbf\u95ee\u7528\u6237\ndb_password = \"root\"  # \u6570\u636e\u5e93\u8bbf\u95ee\u5bc6\u7801\ndb_database = \"instockdb\"  # \u6570\u636e\u5e93\u540d\u79f0\ndb_port = 3306  # \u6570\u636e\u5e93\u670d\u52a1\u7aef\u53e3\ndb_charset = \"utf8mb4\"  # \u6570\u636e\u5e93\u5b57\u7b26\u96c6<\/code><\/pre>\n\n\n\n<p>\u521d\u59cb\u8d27\u6570\u636e\u5e93\uff0c\u751f\u6210instock\u6570\u636e\u5e93\u4e0e\u5bf9\u5e94\u7684\u8868<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 \/var\/www\/develop\/InStock\/instock\/job\/init_job.py<\/code><\/pre>\n\n\n\n<p>\u83b7\u53d6\u4e0a\u4e00\u4ea4\u6613\u65e5\u7684\u6570\u636e<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 \/var\/www\/develop\/InStock\/instock\/job\/execute_daily_job.py<\/code><\/pre>\n\n\n\n<p>\u542f\u52a8web\u670d\u52a1\u5668<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>python3 \/var\/www\/develop\/InStock\/instock\/web\/main.py<\/code><\/pre>\n\n\n\n<p>\u6d4f\u89c8\u5668\u8f93\u5165 http:\/\/localhost:9999<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"611\" height=\"518\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-5.png\" alt=\"\" class=\"wp-image-715\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-5.png 611w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-5-300x254.png 300w\" sizes=\"auto, (max-width: 611px) 100vw, 611px\" \/><\/figure>\n\n\n\n<p>\u67e5\u770b \u67d0\u4e00\u80a1\u7968\u7684\u6570\u636e<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"894\" height=\"549\" src=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-6.png\" alt=\"\" class=\"wp-image-716\" srcset=\"http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-6.png 894w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-6-300x184.png 300w, http:\/\/www.inhhh.com\/blog\/wp-content\/uploads\/2023\/04\/image-6-768x472.png 768w\" sizes=\"auto, (max-width: 894px) 100vw, 894px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883\uff1aubuntu22 g\\ \u5b89\u88c5PIP3 \u5b89\u88c5talib \u5b89\u88c5pip\u91cc\u7684\u63d2\u4ef6 \u5b89\u88c5mysql\u6570\u636e\u5e93 \u4fee\u6539\u6570\u636e<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/www.inhhh.com\/blog\/?p=708\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-708","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/708","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=708"}],"version-history":[{"count":4,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/708\/revisions"}],"predecessor-version":[{"id":826,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/708\/revisions\/826"}],"wp:attachment":[{"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=708"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=708"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.inhhh.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=708"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}