文章摘要
connmap是一款X11桌面小工具,能够实时显示当前网络连接对端在世界地图上的位置。
文章总结
GitHub项目:connmap - 实时显示网络对端位置的X11桌面小工具
connmap是一个基于X11的桌面小工具,能够实时在世界地图上显示当前网络对端的位置。该项目由h2337开发,支持在Wayland环境下运行。
主要功能
- 实时显示:通过世界地图展示当前网络连接的对端位置。
- 自定义配置:用户可以通过配置文件调整小工具的位置、地图大小、更新间隔等参数。
- 跨平台支持:虽然主要针对X11开发,但也支持Wayland。
安装与依赖
- 安装步骤:克隆仓库后,安装依赖并编译安装。
bash git clone https://github.com/h2337/connmap --depth 1 make install ./connmap.elf - 依赖项:包括
xlib、libxext、libxfixes、libcairo2等。
配置文件
安装后会在~/.config/connmap/目录下生成connmaprc文件,用户可以通过该文件自定义小工具的位置、地图大小、更新间隔等。
限制
- 环境限制:目前仅在i3wm环境下测试,其他桌面环境可能无法正常工作。
- 协议支持:仅支持IPv4。
许可证
该项目采用MIT许可证,允许用户自由使用和修改代码。
项目资源
- GitHub地址:h2337/connmap
- 许可证:MIT License
connmap是一个简单但实用的工具,适合需要实时监控网络连接位置的用户。
评论总结
评论内容总结:
安全性问题:
- wslh指出代码存在基本的安全问题,特别是使用
strcat和strcpy可能导致缓冲区溢出。- 引用:"No basically secure: char mapFilename[256]; strcat(strcpy(mapFilename, getenv("HOME")), RESOURCES); strcat(mapFilename, mapName);"
- wslh指出代码存在基本的安全问题,特别是使用
技术实现与代码风格:
- hamburglar赞赏代码的简洁和易读性,但也指出使用
popen和管道链的方式较为粗糙。- 引用:"This is some old school style bare bones C. popen with a big old pipe chain is pretty quick n dirty."
- rxwxx指出
IpRangeVector_resize()函数中的realloc使用不当,存在bug。- 引用:"In the fonction IpRangeVector_resize() in ip.c, you have a bug, that's not how realloc are supposed to be used."
- hamburglar赞赏代码的简洁和易读性,但也指出使用
功能与实用性:
- lxgr询问该工具是否完全离线运行,不依赖GeoIP数据库。
- 引用:"Neat! This runs fully offline (i.e. without calls to a GeoIP database), right?"
- rootbear表示对工具的功能不太理解,地图显示的红点与其实际位置不符。
- 引用:"Forgive my ignorance, but I'm not sure what this is showing me. The map shows three red dots, none of which are near me."
- lxgr询问该工具是否完全离线运行,不依赖GeoIP数据库。
历史与灵感:
- GranPC认为该工具让他想起了游戏《Uplink》。
- 引用:"Pretty cool! Reminds me of the game Uplink."
- anthk提到OpenBSD开发者曾使用类似工具,并介绍了如何在Viking中加载GeoJSON文件。
- 引用:"OpenBSD devs did the same with either XPlanet or Xearth, can't rememeber. Now they use a GeoJson format."
- GranPC认为该工具让他想起了游戏《Uplink》。
其他观点:
- ben0x539和generalizations分别对工具的想法和作者的i3wm使用表示赞赏。
- 引用:"That's a really neat idea, damn." 和 "Of course this was made by an i3wm user. Nicely done!"
- raldi对“网络对等体”这一概念表示疑惑。
- 引用:"What's a network peer?"
- ben0x539和generalizations分别对工具的想法和作者的i3wm使用表示赞赏。