April 19, 2017

树莓派动态IP更新器

这是一个python3的脚本,每隔10分钟监控一次IP地址,如果发生变化则会通过AutoRemote消息通知你。 关于AutoRemote的使用可参考这里 这里推荐使用ipgetter来获取外网IP,地址为https://github.com/phoemur/ipgetter 安装ipgetter sudo apt-get install python3 pip sudo pip3 install ipgetter 你可以从以下地址获取每个通知设备的AutoRemote所需google key ​ http://autoremotejoaomgcd.appspot.com/?key=[it's the part that is here] 以下为python3脚本: import ipgetter import urllib.request import requests currentIP = ipgetter.myip() #AutoRemote function to send a notification YOUR_KEY goes here def sendAR(x): AR_key = 'YOUR_KEY' AR_url = 'http://autoremotejoaomgcd.appspot.com/sendmessage?key='+ AR_key +'&message=IP%20' message = AR_url + x response = urllib.request.urlopen(message).read() print(x) #check the internet and check if previous file is present try: requests. Read more

March 20, 2017

Linux下设置IP、网关、掩码、MAC和DNS

先用ifconfig来查看所有活动网络接口 eth0 Link encap:Ethernet HWaddr b8:27:eb:1b:63:a8 inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0 inet6 addr: fe80::6502:67ff:89b:b2fd/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:43239 errors:0 dropped:24 overruns:0 frame:0 TX packets:30644 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:25068614 (23.9 MiB) TX bytes:5993030 (5.7 MiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:1961 errors:0 dropped:0 overruns:0 frame:0 TX packets:1961 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:160232 (156. Read more

© unixetc.com 2012 - 2019
README