Linux

Linux 学习 > 第一节课

半世苍凉 提交于 2021-02-20 04:39:54
今天开始第一节Linux在线培训课程,虽然是开班仪式,听了老师的讲解,很兴奋,希望能从这里学到真正的干货。坚持两个月,自我蜕变。 来源: oschina 链接: https://my.oschina.net/u/4159070/blog/3070317

non blocking keyboard input python

家住魔仙堡 提交于 2021-02-20 04:37:05
问题 Im building a p2p system when the peers are constantly listening for incoming connections (new peers) and sending commands through the terminal (user input) to the other peers. I am having difficulty looking for user input from the keyboard while always looking for new peers. print 'Listening...' while not shutdown: while sys.stdin in select.select([sys.stdin], [], [], 0)[0]: #look for keyboard input... not working line = sys.stdin.readline() if line: send_message(line) else: # an empty line

vmware三种网络模式配置(转载)

旧时模样 提交于 2021-02-20 04:23:17
虚拟机系统安装的是Linux系统 首先,在本机上查看所有网络配置连接,使用命令:ipconfig Microsoft Windows [版本 6.1.7600] 版权所有 (c) 2009 Microsoft Corporation。保留所有权利。 C:\Users\Administrator>ipconfig Windows IP 配置 以太网适配器 本地连接 3: 连接特定的 DNS 后缀 . . . . . . . : IPv4 地址 . . . . . . . . . . . . : 10.5.5.46 子网掩码 . . . . . . . . . . . . : 255.255.255.0 默认网关. . . . . . . . . . . . . : 10.5.5.254 以太网适配器 本地连接 2: 媒体状态 . . . . . . . . . . . . : 媒体已断开 连接特定的 DNS 后缀 . . . . . . . : 以太网适配器 本地连接: 连接特定的 DNS 后缀 . . . . . . . : IPv4 地址 . . . . . . . . . . . . : 192.168.137.1 子网掩码 . . . . . . . . . . . . : 255.255.255.0 默认网关. . . . . . . . . . . . . :

Fork, execlp and kill. Zombie process

ぃ、小莉子 提交于 2021-02-20 04:13:06
问题 I have a c program that executes another process (bash script) with fork and execlp. When I want to kill this process it moves to a zombiee state. Why is this?? Create a process: switch (PID_BackUp= fork()) { case -1: perror("fork"); printf("An error has occurred launching backup.sh script!\n"); break; case 0: execlp("/usr/local/bin/backup.sh", "/usr/local/bin/backup.sh", NULL, NULL, NULL); break; default: printf("backup.sh script launched correctly! PID: %d\n", PID_BackUp); break; } Kill a

run python scripts on apache (linux and windows)

狂风中的少年 提交于 2021-02-20 04:12:21
问题 I need help with how to run scripts test.cgi for example in apache ? I created test script: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print print "Hello World! When I run localhost/cgi-bin/test.cgi It gives me error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster

run python scripts on apache (linux and windows)

孤街浪徒 提交于 2021-02-20 04:10:41
问题 I need help with how to run scripts test.cgi for example in apache ? I created test script: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print print "Hello World! When I run localhost/cgi-bin/test.cgi It gives me error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster

Linux BlueZ custom Manufacturing Scan Response Data

依然范特西╮ 提交于 2021-02-20 04:10:05
问题 I have a custom GATT Server working as a plugin using BlueZ 4.101 on Linux. I am now trying to set custom Scan Response advertising data. I am using LightBlue on iOS to debug my GATT Server and advertising parameters. I tried the following code, and LightBlue can see the Advertising Payload and Device Name, but not the Scan Response data. How do I set custom Scan Response data with BlueZ? Thanks. # BLE Name echo "<GATT SERVER> Setting BLE Advertising Name..." btmgmt -i $BLUETOOTH_DEVICE name

run python scripts on apache (linux and windows)

人走茶凉 提交于 2021-02-20 04:09:19
问题 I need help with how to run scripts test.cgi for example in apache ? I created test script: #!/usr/bin/env python # -*- coding: UTF-8 -*- # enable debugging import cgitb cgitb.enable() print "Content-Type: text/plain;charset=utf-8" print print "Hello World! When I run localhost/cgi-bin/test.cgi It gives me error. Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, webmaster

Linux BlueZ custom Manufacturing Scan Response Data

大憨熊 提交于 2021-02-20 04:07:04
问题 I have a custom GATT Server working as a plugin using BlueZ 4.101 on Linux. I am now trying to set custom Scan Response advertising data. I am using LightBlue on iOS to debug my GATT Server and advertising parameters. I tried the following code, and LightBlue can see the Advertising Payload and Device Name, but not the Scan Response data. How do I set custom Scan Response data with BlueZ? Thanks. # BLE Name echo "<GATT SERVER> Setting BLE Advertising Name..." btmgmt -i $BLUETOOTH_DEVICE name

Linux BlueZ custom Manufacturing Scan Response Data

谁都会走 提交于 2021-02-20 04:05:19
问题 I have a custom GATT Server working as a plugin using BlueZ 4.101 on Linux. I am now trying to set custom Scan Response advertising data. I am using LightBlue on iOS to debug my GATT Server and advertising parameters. I tried the following code, and LightBlue can see the Advertising Payload and Device Name, but not the Scan Response data. How do I set custom Scan Response data with BlueZ? Thanks. # BLE Name echo "<GATT SERVER> Setting BLE Advertising Name..." btmgmt -i $BLUETOOTH_DEVICE name