2017年6月21日 星期三

RU.EXE

RU


Features:

  1. Select SMBIOS directly from type, no more unreadable handle number!
    ALT-9 will list all SMBIOS type description.  You can directly type any string you want to find on that list like below:


    When you press Enter or RIGHT it will show the details with the string displayed in green.  Old version of RU did not have details and strings like this version.

    You can go back by pressing LEFT to the type selection list as previous picture shown.  Then use LEFT/RIGHT arrow keys to go back and forth between SMBIOS types selection and type's details.  Same operations are applied to any other screen list.

    You can also directly type string like: "memory"


    RU will find it for you, no more up/down/page up/down to navigate yourself.  For examples, it finds type 016: "Physical Memory Array" for you.

    What if you want to find more about "memory"?  Simply press CTRL-DOWN to find forward or CTRL-UP to find backward for the last entered string.
  2. The same UI from above SMBIOS is applied to the following types:
    • ACPI ALT-6
    • E820 ALT-F2
    • IDE ALT-5
    • PCI F6
    • Mass storage ALT-F1
    • SMBIOS ALT-9
    • UEFI variables ALT-=
    • System information CTRL-I
  3. EFI configuration table is added to System Information CTRL-I
    You can directly jump to the selected table on that screen.
    For example, if we want to go EFI_SYSTEM_RESOURCE_TABLE.  First press CTRL-I and it will show:


    Type: "resource"


    Found it!  The selecting bar turns to magenta color with "[Go]" string at the end.  That means you can press Enter to go to that address.


    This is the location of EFI_SYSTEM_RESOURCE_TABLE:
  4. Mass storage now shows all block IO devices like below example "33MB RAM disk".  When there is no component name it will show the device path.
  5. SPD information changed.  Previous RU has wrong information for SPD, this version only shows the module name and size like below:


    And this:
  6. System information shows CPUIDs like below:
  7. SMBIO 3.0 is supported.
 Minor changes:
  1. Fixed ALT-M is not working for SMBIOS.
  2. UEFI variables: Fixed DEL deletes a variable but the list was not updated accordingly.
  3. Highlight color for key help in command line.
  4. CTRL-F and CTRL-D are just for the first search.  CTRL-DOWN and CTRL-UP will continue the last search.
  5. Added more key list on the pull-down menu.
  6. Mass storage: Fixed search did not advance to next LBA.
  7. SMBUS: Fixed compare SMBUS saved file is not working.
  8. RU.EFI screen is moved to the center of 100*31 resolution.
  9. E820: Added 2 more type according to ACPI E820 spec: Unusable and Disabled.
  10. E820: Added Extended Attribute support.
  11. MEMORY: Fixed memory address is always reset while input a new one and RU.EXE could display garbage characters.
  12. SPD: Support Skylake 2 pages SPD.
  13. F1 is changed to display all help lines on info block.
  14. CTRL-F1 is added to display original help window.

    Download 5.17.0284 here.
    Password: 10441018174128




    2017年6月9日 星期五

    xdotool


    安裝
    ubuntu/debian
    sudo apt-get install xdotool

    suse
    https://software.opensuse.org/download.html?project=openSUSE%3A11.4%3AContrib&package=xdotool


    範例
    鍵盤輸入 a
    xdotool key a

    按住 a 放開 a
    xdotool keydown a xdotool keyup a

    滑鼠移動到 (100, 200) 的位置
    xdotool mousemove 100 200
    按下滑鼠左鍵(左鍵:1、滾輪:2、右鍵:3、滾輪上/下:4/5)
    xdotool click 1

    按住滑鼠放開滑鼠
    xdotool mousedown xdotool mouseup

    取得目前滑鼠位置
    xdotool getmouselocation

    各個動作下還可以加上一些參數,下面一個 man page 裡的例子

    送出 ctrl + c 到所有 title 是 'gdb' 的視窗中
    xdotool search --name gdb key ctrl+c

    比較詳細的資料可以參考 man page 中的說明
    執行方式
    執行方式大概有下面幾種
    直接下命令
    像上面範例中的作法一樣,直接在 CLI 上輸入xdotool click

    從檔案中讀取指令
    xdotool filename
    從標準輸入(stdin)讀取
    可以搭配 redirection 來從檔案中讀取
    xdotool -
    xdotool - < filename


    寫成 script exp
    #!/usr/bin/
    xdotool mousemove 500 500 
    xdotool key a 

    2017年6月1日 星期四

    Linux Wake From Sleep Automatically

    Want to put your Linux PC into sleep or hibernate mode and have it automatically wake at a specific time? You can easily do this with the rtcwake command, included by default with most Linux systems.
    This can be useful if you want your computer to do something at a specific time, but don’t want it running 24/7. For example, you could put your computer to sleep at night and have it wake up before you do to perform some downloads.

    Using rtcwake

    The rtcwake command requires root permissions, so it must be run with sudo on Ubuntu and other Ubuntu-derived distributions. On Linux distributions that don’t use sudo, you’ll have to log in as root with the su command first.
    Here’s the basic syntax of the command:
    sudo rtcwake -m [type of suspend] -s [number of seconds]
    For example, the following command suspends your system to disk (hibernates it) and wakes it up 60 seconds later:
    sudo rtcwake -m disk -s 60

    Types of Suspend

    The -m switch accepts the following types of suspend:
    • standby – Standby offers little power savings, but restoring to a running system is very quick. This is the default mode if you omit the -m switch.
    • mem – Suspend to RAM. This offers significant power savings – everything is put into a low-power state, except your RAM. The contents of your memory are preserved.
    • disk – Suspend to disk. The contents of your memory are written to disk and your computer is powered off. The computer will turn on and its state will be restored when the timer completes.
    • off – Turn the computer off completely. rtcwake’s man page notes that restoring from “off” isn’t officially supported by the ACPI specification, but this works with many computers anyway.
    • no – Don’t suspend the computer immediately, just set the wakeup time. For example, you could tell your computer to wake up at 6am. After that, can put it to sleep manually at 11pm or 1am – either way, it will wake up at 6am.

    Seconds vs. Specific Time

    The -s option takes a number of seconds in the future. For example, -s 60 wakes your computer up in 60 seconds, while -s 3600 wakes your computer up in an hour.
    The -t option allows you to wake your computer up at a specific time. This switch wants a number of seconds since the Unix epoch (00:00:00 UTC on January 1, 1970). To easily provide the correct number of seconds, combine the date command with the rtcwake command.
    The -l switch tells rtcwake that the hardware clock is set to local time, while the -u switch tells rtcwake that the hardware clock (in your computer’s BIOS) is set to UTC time. Linux distributions often set your hardware clock to UTC time and translate that to your local time.
    For example, to have your computer wake up at 6:30am tomorrow but not suspend immediately (assuming your hardware clock is set to local time), run the following command:
    sudo rtcwake -m no -l -t $(date +%s -d ‘tomorrow 06:30’)


    More Tips

    Use the && operator to run a specific command after rtcwake wakes your system from sleep. For example, the following command suspends your computer to RAM, wakes it two minutes later, and then launches Firefox:
    rtcwake -m mem -s 120 && firefox
    Integrate the rtcwake command into a cron script to automatically wake your computer at a specific time. The -m no switch can also be useful in a cron script. For example, you could run the rtcwake -m no -s 28800 command in a cron script at 10pm every day. This would set your computer to wake up in 28800 seconds at 6:00am. However, your computer wouldn’t go to sleep immediately – you could put it to sleep at 11pm or 1am and it would still wake at 6am normally.

    Caveats

    • RTC stands for real-time clock. rtcwake uses your computer’s hardware clock, which you can set in your BIOS, to determine when your computer will wake up. If you’re using an old computer with a dying CMOS battery that can’t keep the clock running properly, this won’t work.
    • If sleep, suspend to RAM, or hibernate don’t work properly with your Linux system – perhaps because Linux doesn’t have the drivers to make them work properly with your hardware – this may not work.
    • Be careful when setting a laptop to automatically wake at a specific time. You wouldn’t want it waking up, running, and overheating or running down its battery in a laptop bag.

    2017年5月7日 星期日

    ubuntu_16.10 BusyBox v1.22.1 Fix

    BusyBox v1.22.1 (Ubuntu 1:1.22.0-15ubuntu1) built-in shell (ash)
    Enter 'help' for a list of built-in commands
    command : fsck /dev/sda1  # or sda2