tianyun 3 gadi atpakaļ
vecāks
revīzija
31ba41d767

+ 0 - 9
fastapi-demo/fastapi-demo.iml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="PYTHON_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="jdk" jdkName="Python 3" jdkType="Python SDK" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 0 - 9
flask-demo/flask-demo.iml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="PYTHON_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="jdk" jdkName="Python 3" jdkType="Python SDK" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 13 - 0
index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <title>Title</title>
+    <script>
+        window.location.href="https://memory.tianyunperfect.cn/"
+    </script>
+</head>
+<body>
+
+</body>
+</html>

+ 16 - 0
sh-demo/raw.sh

@@ -0,0 +1,16 @@
+bb="RUNNING"
+
+aa=`yarn application --list | grep inference-raw-item-etl | awk '{print $6}'`
+if [ "$aa" != "$bb" ]; then
+  sh /home/user01/inference-job/inference-raw-item-etl-1.0/bin/inference-raw-item-etl.sh
+fi
+
+aa=`yarn application --list | grep inference-raw-event-etl | awk '{print $6}'`
+if [ "$aa" != "$bb" ]; then
+  sh /home/user01/inference-job/inference-raw-event-etl-1.0/bin/inference-raw-event-etl.sh
+fi
+
+aa=`yarn application --list | grep inference-raw-user-etl | awk '{print $6}'`
+if [ "$aa" != "$bb" ]; then
+  sh /home/user01/inference-job/inference-raw-user-etl-1.0/bin/inference-raw-user-etl.sh
+fi

+ 0 - 8
sh-demo/sh-demo.iml

@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="WEB_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 5 - 13
tmp/kafka/kafkaReceiveTest.py

@@ -1,19 +1,11 @@
-from kafka import KafkaConsumer
+from kafka import KafkaConsumer, TopicPartition
+
+
 
 consumer = KafkaConsumer('eip_rec_behave',
-                         group_id='test1',  # 一个组消费一次
-                         auto_offset_reset='earliest',  # 从最新数据读取,earliest,latest
-                         enable_auto_commit=False,  # 关闭自动提醒
+                         group_id='test11',  # 一个组消费一次
+                         auto_offset_reset='latest',  # 从最新数据读取,earliest,latest
                          bootstrap_servers=['eip-kafka-2.qa.mlamp.cn']
                          )
 for msg in consumer:
     print(msg.value)
-    consumer.commit()
-
-# consumer = KafkaConsumer('eip_rec_behave',
-#                          group_id='test1',  # 一个组消费一次
-#                          auto_offset_reset='latest',  # 从最新数据读取,earliest,latest
-#                          bootstrap_servers=['eip-kafka-2.qa.mlamp.cn']
-#                          )
-# for msg in consumer:
-#     print(msg.value)

+ 7 - 2
tmp/redis/simple.py

@@ -1,4 +1,9 @@
+import time
+
 import redis
 
-r = redis.StrictRedis(host='localhost', port=6379, db=0)
-print(r.config_get("maxclients"))
+r = redis.StrictRedis(host='192.168.86.23', port=6379, db=1)
+print(r.llen("test"))
+print(time.time())
+time.sleep(1)
+print(time.time())

+ 0 - 9
tmp/tmp.iml

@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<module type="PYTHON_MODULE" version="4">
-  <component name="NewModuleRootManager" inherit-compiler-output="true">
-    <exclude-output />
-    <content url="file://$MODULE_DIR$" />
-    <orderEntry type="jdk" jdkName="Python 3" jdkType="Python SDK" />
-    <orderEntry type="sourceFolder" forTests="false" />
-  </component>
-</module>

+ 27 - 0
tmp/tmp.py

@@ -0,0 +1,27 @@
+import aiohttp
+import asyncio
+
+
+async def fetch(session, url):
+    print("发送请求:", url)
+    async with session.get(url, verify_ssl=False) as response:
+        content = await response.content.read()
+        file_name = url.rsplit('_')[-1]
+        with open(file_name, mode='wb') as file_object:
+            file_object.write(content)
+    return "OK"
+
+
+async def main():
+    async with aiohttp.ClientSession() as session:
+        url_list = [
+            'https://www3.autoimg.cn/newsdfs/g26/M02/35/A9/120x90_0_autohomecar__ChsEe12AXQ6AOOH_AAFocMs8nzU621.jpg',
+            'https://www2.autoimg.cn/newsdfs/g30/M01/3C/E2/120x90_0_autohomecar__ChcCSV2BBICAUntfAADjJFd6800429.jpg',
+            'https://www3.autoimg.cn/newsdfs/g26/M0B/3C/65/120x90_0_autohomecar__ChcCP12BFCmAIO83AAGq7vK0sGY193.jpg'
+        ]
+        res = await asyncio.gather(*[fetch(session, url) for url in url_list])
+        print(res)
+
+
+if __name__ == '__main__':
+    asyncio.run(main())