TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Antigravity.py (2020)

116 点作者 chha将近 4 年前

9 条评论

isp将近 4 年前
This looked innocuous at first glance, but this &quot;antigravity&quot; Easter egg has been found to have security implications.<p>See &quot;Hacking with Environment Variables&quot;, which specifically exploits the antigravity module for arbitrary code execution - <a href="https:&#x2F;&#x2F;www.elttam.com&#x2F;blog&#x2F;env&#x2F;#content" rel="nofollow">https:&#x2F;&#x2F;www.elttam.com&#x2F;blog&#x2F;env&#x2F;#content</a><p>Previous HN comments: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23828045" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23828045</a>
评论 #28199820 未加载
评论 #28199213 未加载
评论 #28198847 未加载
评论 #28198959 未加载
Waterluvian将近 4 年前
Might not be obvious to all:<p>This is in the python standard library. So you can open a python REPL and type `import antigravity`
tersers将近 4 年前
TIL python has a webbrowser module
评论 #28201162 未加载
评论 #28198441 未加载
评论 #28198382 未加载
评论 #28198464 未加载
评论 #28198284 未加载
评论 #28198852 未加载
szszrk将近 4 年前
I chuckled a bit, but it took me a while to realize what code repository it is from. Chuckled again.
chronolitus将近 4 年前
A description of what the code does:<p>First, the line<p>webbrowser.open(&quot;<a href="https:&#x2F;&#x2F;xkcd.com&#x2F;353&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;353&#x2F;</a>&quot;)<p>is obvious, it opens a browser pointing to the relevant XKCD comic, containing a joke which inspired this code.<p>Then, a geohash function is declared which takes the user&#x27;s current latitude&#x2F;longitude, and the current date-time, and returns a target latitude&#x2F;longitude. According to a previous comic (<a href="https:&#x2F;&#x2F;xkcd.com&#x2F;426&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;426&#x2F;</a>) this corresponds to the game of &#x27;geohashing&#x27; where players are supposed to physically travel to arbitrary locations and prove it.
评论 #28200663 未加载
diogenesjunior将近 4 年前
I get a type error in line 13 running the code:<p><pre><code> TypeError: openssl_md5() takes no keyword arguments</code></pre>
评论 #28198980 未加载
glofish将近 4 年前
reading the module, I have also learned about the Munroe geohashing:<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Geohashing" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Geohashing</a><p>and<p><a href="https:&#x2F;&#x2F;xkcd.com&#x2F;426&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;426&#x2F;</a><p>official website:<p><a href="https:&#x2F;&#x2F;geohashing.site&#x2F;geohashing&#x2F;Main_Page" rel="nofollow">https:&#x2F;&#x2F;geohashing.site&#x2F;geohashing&#x2F;Main_Page</a><p>oddly the geohash function in the antigravity module prints to the screen rather than returning the values ... seems odd to say the least
Xavdidtheshadow将近 4 年前
I&#x27;ve long known that `import antigravity` would open the xkcd comic, but I never knew there was also a geohashing function!<p>That was a favorite activity of mine in high school. On Friday evening, we&#x27;d look at the nearest graticule(s) to our town and pick one for a Saturday day trip. Trucking out to a random point on a map is a great way to explore your metro area and see things you never would otherwise.<p>Heartily recommend trying it out. Looks like the map (linked from the comic) is no longer working: <a href="http:&#x2F;&#x2F;carabiner.peeron.com&#x2F;xkcd&#x2F;map&#x2F;map.html" rel="nofollow">http:&#x2F;&#x2F;carabiner.peeron.com&#x2F;xkcd&#x2F;map&#x2F;map.html</a><p>But, with this function, there may yet be hope!
评论 #28204462 未加载
chha将近 4 年前
Related: <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;353&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;353&#x2F;</a>
评论 #28198403 未加载
评论 #28198317 未加载
评论 #28198264 未加载