如何在 Linux 中使用 Internet 自动设置系统默认时区?在我看来,NTP 服务器只能更新时间,不能更新时区。有没有可以更改时区的服务器?
我想在 bash 脚本中使用我现在所在的国家/地区的名称。我可以使用下一个命令获取外部 IP:
curl ifconfig.me
Run Code Online (Sandbox Code Playgroud)
但是我怎样才能得到我的国名呢?
使用 Debian 8 Jessie
我不喜欢geoclue。我想删除它
试图做:
apt-get remove geoclue*
Run Code Online (Sandbox Code Playgroud)
我有:
The following packages will be REMOVED:
empathy geoclue-2.0 gnome gnome-clocks gnome-core gnome-maps
task-gnome-desktop
Run Code Online (Sandbox Code Playgroud)
有没有办法在不卸载整个 gnome 的情况下删除它?除了 gnome 我没有任何窗口管理器我不想破坏我的安装。
谢谢
在命令行中,如何获取geoclue2要报告的当前位置?
bin/我的 Arch 包中没有手册页或可执行文件。
redshift(使用geoclue2)将我的位置报告为:
7.98 98.37
但谷歌地图给了我:
9.749160、99.975484
有什么方法可以配置源geoclue2使用什么来获得更好的准确性?
大多数谷歌geoclue2搜索都提出了redshift这不太有用:(
给定.jpg一张没有关联 GPS 坐标的图片,您会如何建议为其添加自定义坐标?
我正在尝试让 Redshift 再次工作。由于 geoclue2,它似乎失败了。
这是奇怪的事情。直到今天早些时候,它工作得很好,而且 geoclue 自 12 月(2.5.2)以来没有更新。
无论我做什么,我都会收到以下信息
geoclue[2905]:无法查询位置:禁止
当我跑systemctl status geoclue.service.
什么都行不通。不降级 redshift 或 geoclue2,甚至不作为 redshiftsudo进程运行。绝对没有。这一切都以相同的结果结束:被禁止。
(是的,我在geoclue.conf文件中添加了 redshift /etc/geoclue/geoclue.conf。)
我在 Openbox 和 Xinitrc 中使用 Arch Linux。
在我的台式电脑(arch)和笔记本电脑(debian)上,我使用 gnome-maps。我在两台设备上都使用 VPN。(iptables防火墙不允许非 VPN 流量,无 DNS 泄漏。)
在我的桌面上,“当前位置”是 VPN 所在的城市,正如预期的那样。
然而,在我的笔记本电脑上,gnome-maps 能够获取我的实际位置(非常精确,几乎到脚)。
这怎么可能?使用什么技术?笔记本电脑没有 GPS。
我目前正在做一个小项目;在一个名为weatherdata.kml的kml文件中,我想提取每个<Placemark>元素的海平面压力。我正在尝试解析有关海平面压力的信息并将其放入名为report.csv;的文件中。并每次在新行上打印海平面压力。
我认为这会起作用awk,到目前为止我已经尝试过:
awk -F '[>,]' '/minSeaLevelPres/ {print $2}' report.csv
Run Code Online (Sandbox Code Playgroud)
但是当我在 shell 中运行此命令时,我得到以下信息:
1002</minSeaLevelPres
1002</minSeaLevelPres
1002</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1001</minSeaLevelPres
1002</minSeaLevelPres
1002</minSeaLevelPres
1003</minSeaLevelPres
Run Code Online (Sandbox Code Playgroud)
当我想得到这个时:
1002
1002
1002
1001
1001
1001
1001
1001
1001
1001
1001
1002
1002
1003
Run Code Online (Sandbox Code Playgroud)
我不知道如何摆脱</minSeaLevelPres。有人可以帮忙吗?
下面是地标元素的一部分的示例weatherdata.kml
<Placemark>
<styleUrl>#ex</styleUrl>
<lat>19.2</lat>
<lon>-24.1</lon>
<stormName>NINE</stormName>
<stormNum>10</stormNum>
<basin>AL</basin>
<stormType>LO</stormType>
<intensity>20</intensity>
<intensityMPH>23</intensityMPH>
<intensityKPH>37</intensityKPH>
<minSeaLevelPres>1002</minSeaLevelPres>
<atcfdtg>2020082350</atcfdtg>
<dtg>0000 UTC JAN 07</dtg>
</Placemark>
Run Code Online (Sandbox Code Playgroud) 使用 CentOS 8。
我想强制dnf只在某个位置附近使用镜子,而不必手动维护所需镜子的列表。所以我想修改/etc/yum.repo.d/.
举/etc/yum.repo.d/CentOS-Linux-BaseOS.repo个例子,这是它的默认状态:
[baseos]
name=CentOS Linux $releasever - BaseOS
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=BaseOS&infra=$infra
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
Run Code Online (Sandbox Code Playgroud)
我想知道查询时是否有一个参数mirrorlist.centos.org可以指定按位置过滤,如下所示:
mirrorlist=http://mirrorlist.centos.org/?country=us&other-params-ommitted
Run Code Online (Sandbox Code Playgroud)
(country=我试过了,什么也没做)
我在该网站的 API 上找不到任何相关文档。
geolocation ×9
geoclue ×2
arch-linux ×1
awk ×1
centos ×1
debian ×1
dnf ×1
file-format ×1
gnome ×1
gpsd ×1
images ×1
internet ×1
ip ×1
jpeg ×1
linux ×1
networking ×1
repository ×1
timezone ×1
xml ×1
yum ×1