AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-793647

MelBourbon's questions

Martin Hope
MelBourbon
Asked: 2019-10-29 03:34:33 +0800 CST

rtcwake 仅在时间过去后使用明天

  • 0

我的服务器在闲置 30 分钟后进入睡眠状态。而且我需要每天凌晨 3 点唤醒我的服务器。到目前为止,我使用以下 cron 条目:

@reboot /usr/sbin/rtcwake -m no -u -t $(date +\%s -d `tomorrow 03:00`)

工作正常,有一个例外。如果服务器在 00:00 和 03:00 之间启动(如果由客户端使用或激活),则唤醒时间设置为第二天,服务器在 03:00 之前被发送到空闲状态,计划作业在 03:05没有开始。

如何使用 rtcwake 将唤醒时间设置为下一次将是 03:00,这意味着在一天的 00:00 和 03:00 之间,唤醒应该设置为当天的 03:00 和 03 之后:00 应该设置为第二天的 03:00。

suspend cron
  • 1 个回答
  • 276 Views
Martin Hope
MelBourbon
Asked: 2018-06-09 12:13:26 +0800 CST

在 Acer Travelmate Spin B1 的旋转屏幕中将触控笔(笔)与触摸屏对齐

  • 0

我找到了一个脚本来将我的屏幕和触摸板向左旋转并恢复正常:

#!/bin/sh 

# Find the line in "xrandr -q --verbose" output that contains current screen orientation and "strip" out current orientation. 

rotation="$(xrandr -q --verbose | grep 'connected' | egrep -o  '\) (normal|left|inverted|right) \(' | egrep -o '(normal|left|inverted|right)')" 

# Using current screen orientation proceed to rotate screen and input tools. 

case "$rotation" in 
normal) 
#    -rotate to the left 
xrandr -o left 
xinput set-prop --type=int --format=8 "ELAN Touchscreen" "Evdev Axes Swap" 1
xinput set-prop --type=int --format=8 "ELAN Touchscreen" "Evdev Axis Inversion" 1 0
xinput set-prop --type=int --format=8 4 "Evdev Axis Inversion" 1 0
;;
left) 
#    -rotate to normal 
xrandr -o normal 
xinput set-prop --type=int --format=8 "ELAN Touchscreen" "Evdev Axes Swap" 0
xinput set-prop --type=int --format=8 "ELAN Touchscreen" "Evdev Axis Inversion" 0 0
xinput set-prop --type=int --format=8 4 "Evdev Axis Inversion" 0 0
;; 
esac

工作正常。但是,如果屏幕旋转,手写笔不起作用。我通过更改笔的坐标变换矩阵找到了一个潜在的解决方案:

xinput set-prop 'ELAN Touchscreen Pen Pen (0)' "Coordinate Transformation Matrix" 0 1 0 -1 0 1 0 0 1

这工作正常,意味着如果屏幕方向正常并且我运行此命令

xinput list-props 'ELAN Touchscreen Pen Pen (0)' | grep "Coordinate Transformation Matrix"

导致

Coordinate Transformation Matrix (144): 0.000000, 1.000000, 0.000000, -1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000

但是每次我在脚本中使用它或者如果我在屏幕以纵向模式定向时运行它时都会重置它,这意味着如果我运行

xinput list-props 'ELAN Touchscreen Pen Pen (0)' | grep "Coordinate Transformation Matrix"

在我运行脚本或以“左”方向运行后,我得到

Coordinate Transformation Matrix (144): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000

并且手写笔在此更改方向下无法正常工作(左上等)

touchscreen acer touchpad stylus xinput
  • 1 个回答
  • 1114 Views
Martin Hope
MelBourbon
Asked: 2018-06-08 03:38:57 +0800 CST

在 Thunderbird 中导入 S/MIME 证书 (*.p12)

  • 2

我无法在 Thunderbird 中导入 S/MIME 证书。文件格式为 *.p12。我找到的所有说明都将我引导至“设置 > 高级”,我应该在其中打开证书选项卡。但是这个选项卡没有显示在我的设置中(见屏幕)。

系统:

  • Ubuntu 18.04 LTS
  • 雷鸟 52.8.0(64 位)

截图设置

thunderbird
  • 1 个回答
  • 1128 Views
Martin Hope
MelBourbon
Asked: 2018-06-06 12:18:01 +0800 CST

在安装 grub2 时冻结以在 Acer Travelmate Spin B1 上安装 ubuntu

  • 0

我无法在 Acer Travelmate Spin B1 上安装 ubuntu。每次安装在安装 grub2 包时冻结。问题与此处相同:Installation freeze at GRUB2 on Acer TravelMate Spin B1 B118-RN-P7XQ。但我无法取出 SSD。

我做了什么:

  • 用 Rufus 创建了一个 USB 启动棒
  • 在 UEFI 中禁用安全启动
  • 启动棒(grub2 出现)并选择安装 ubuntu
    1. 试图安装“正常”
    2. 尝试通过自己创建分区来安装“扩展”

没有任何效果。

每次它被困在:

x86_64-efi will be installed for your platform

安装 debian stretch 时也会出现同样的错误。如果我在没有 grub2 的情况下安装 ubuntu(如何?)然后可能使用 SuperGrub2Disk 修复它是否有效?

编辑1:

我做了这里描述的事情:如何在基于 EFI 的 PC 上为 Ubuntu 准备磁盘?这里GRUB2 failed to install,意味着:

  • 使用 gparted 创建了一个引导 USB
  • 创建了分区
    • 500 MB FAT32,标签引导,特别是
    • 5000 MB linux交换
    • 20000 MB 分机 4
    • 100000 MB 分机

然后我启动了一个ubuntu live棒并打开一个终端并运行

sudo dosfsck -t -a -w /dev/sda1

从这个现场 USB 记忆棒安装 ubuntu。安装在“安装包 grub2”处冻结。终端中的新消息是

g_udev_device_has_property: assertion 'G_UDEV_IS_DEVICE (device)' failed
grub2 boot acer uefi
  • 1 个回答
  • 891 Views
Martin Hope
MelBourbon
Asked: 2018-02-11 08:03:17 +0800 CST

在脚本中使用 hdparm 状态只能手动工作,不能通过 cron

  • 0

我使用以下 if ... 然后在 cron 每 15 分钟启动一次的自动关机脚本中进行测试。

# Check if disk1 is currently spinning
    if [ "$(hdparm -C /dev/sdb1 | grep -o "active/idle\|standby")" = "active/i$
            logit disk1 running, auto shutdown terminated
            return 1

如果我使用手动启动脚本,这很好./autoshutdown.sh。将正确检测磁盘状态。

但如果 cron 正在启动此脚本并且未检测到状态,则使用 else 语句。

为什么会有这种差异?我需要改变什么?

scripts bash cron hdparm
  • 1 个回答
  • 645 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve