惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - bluce chen

swif debounce实现 oculus quest2的思考 博文阅读密码验证 - 博客园 用户中心 - 博客园 https点对点转发响应示意图 Share架构的一些心得 flutter输入颜色枚举卡顿假死 n2n网络环境搭建 p2p技术之n2n源码核心简单分析一 分享一个14年写的用户管理类-swift版 MIUI通过xposed自动设置root权限 基于xposed实现android注册系统服务,解决跨进程共享数据问题 2017 UICollectionView swift2模版 angularjs 分页精华代码 Reveal分析IOS界面,plist文件读取 php嵌套数组递归搜索返回数组key sqlite3 根据实体自动生成建表语句 prism4 StockTrader RI 项目分析一些体会2
结合阿里云服务器,设置家中jetson tk1随时远程登陆
bluce chen · 2015-02-05 · via 博客园 - bluce chen

前提条件:

1.路由配置dmz主机为tk1的ip ,设置路由器中ssh 端口22的访问权限

2.有一台远程服务器,服务器安装了php可以运行php文件(我使用的是阿里云)

家中tk1配置:

脚本python 部署在jetson tk1上,然后设置crontab 定时执行

把python脚本放在 /jetson/testip.py 

crontab -e 

*/10 * * * * /jetson/testip.py >>/dev/null 2>&1

/*----------------------testip.py-------------------------------*/

#!/usr/bin/python
import re,httplib
conn = httplib.HTTPConnection("1111.ip138.com")
conn.request("GET", "/ic.asp")
r1 = conn.getresponse()
data1 = r1.read()
conn.close()
matchObj = re.search( r'(\d+)\.(\d+)\.(\d+)\.(\d+)', data1, re.M|re.I)
if matchObj:
    ip=matchObj.group()
    conn = httplib.HTTPConnection("remotedIP")
    conn.request("GET", "/testip.php?debug="+ip)
    r1 = conn.getresponse()
    print r1.read()
    conn.close()
else:
    print "error"

2.远程服务器配置,直接在php网站目录下放下面php代码 

/*------------testip.php--------------*/

<?php
$ipfile = "/var/log/homeip.txt";
if (isset($_GET['debug'])) {
	$ip = $_GET['debug'];
	preg_match_all('|\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}|', $ip, $out, PREG_PATTERN_ORDER);
	if (!empty($out[0][0])) {
		$ip = $out[0][0];
	} else {
		die();
	}
	$myfile = fopen($ipfile, "w") or die("Unable to open file!");
	echo ($ip);
	fwrite($myfile, $ip);
	fclose($myfile);
	die();
}
$myfile = fopen($ipfile, "r") or die("Unable to open file!");
echo fread($myfile, filesize($ipfile));
fclose($myfile);
die();

 使用:

http://远程服务器ip/testip.php 

返回得到家中jetson tk1 的公网地址,然后 ssh ip就可以登陆上家里的机器了