Can Fabric display Yum or apt-get progress sliders correctly? - fabric

If you run
run('yum upgrade')
You'll see that the progress slider is repeated on screen, that is, every time it increments, a new line appears on screen unlike what you see in a 'real' ssh session (where the slider just increments to 100% on a single line).
Is there a way to make Fabric display this properly? I don't want to use -q because this silence all output.

That's an example of curses at work. What version of Fabric are you on? Newer fabrics should handle this better. But anyhow you could also limit the output returned, yum has the -d flag for debug level, so you could get some info, but less.

Related

Install VB Guest Additions before booting Ububtu-based OS

I'm trying to install Elementary OS in VirtualBox, but the minimum resolution of the OS is 1024x768 and VirtualBox always boots in a much lower resolution. I can't install Guest Additions until the OS has been fully installed and I am on the desktop. I can't go through with the installation, though, because I only see about 60% of the screen in the top left corner. I've tried increasing video resolution to 128mb, but as I thought, that didn't work. Is there a way to increase the resolution with Guest Additions or something else before booting the system to install it?
I had an issue with the installation of Elementary OS 6 with VirtualBox for the same reason. The right side and bottom portion of the installer screens were cutoff. That area of the screen has buttons for back, submit, cancel.
I resolved this by making to selection to erase/complete install, then using the tab key twice followed by the enter key. Apparently this sequence of keystrokes allowed me to initiate the full installation script successfully.
same issue here,
end up add boot kernel parameter to fix this,
when first boot prompt(5 secs),
hit any key within the 5 secs count down to show boot options,
hit TAB to edit first option,
add the vga=ask to the end of boot kernel lines.
then it will show another 30 secs count down for VGA mode selection,
hit ENTER to choose proper one, in my case I choose 1280x800x32.
that's all,
more detail regarding boot vga parameters can refer to this URL.
https://linuxhint.com/set_screen_resolution_linux_kernel_boot/

Is there a way to make vim run the “make” command in another terminal window?

I mainly use vim as an editor for C/C++ programming. Unfortunately, I'm not quite satisfied with the way my build process works. I know that it's possible to type in (or map to a key) :make to run the make process. I dislike the way this command works, though, as it runs the build process in the same terminal window without proper highlighting. I therefore usually run the make command in another window on my second monitor so that I have both proper highlighting and can look at the build errors the compiler shows me in one window while scrolling through the source code in my main vim window. This is also quite tedious because it requires me to change focus to another window, then type in the make command.
Now, my question is as follows: Is it possible to make vim run the make command in this other window without having to change focus? This way, I could just map the "build in other window" command to some key in vim and could achieve all of this with a single key press.
My system is Manjaro Linux with i3 as DWM.
(I was unsure wether to post this on the unix forum or here, please forgive me if this is the wrong forum.)
You can achieve this by using xdotool and i3 config-file mappings. These mappings require that the last command executed in the terminal of the window rightwards was make.
set $prevR xdotool key --clearmodifiers --delay 2 super+l ctrl+p Return super+h
set $prevRclr xdotool key --clearmodifiers --delay 2 super+l ctrl+l ctrl+p Return super+h
And then map those commands to your preferred keys, for example:
bindsym --release Mod4+Shift+e exec --no-startup-id $prevR
bindsym --release Mod4+e exec --no-startup-id $prevRclr
The first mapping runs the previous command on the window right to the current one.
The second one does the same while first clearing the terminal. You need to substitute the super+[lh] with your own mappings that change the focus to your alternate monitor.
You may also have to increase the --delay to accommodate for the lag of changing windows.
If you also want to populate the quickfix list, you have to separately run :make in vim. By doing this you can both see the errors properly colored and formatted on your alternate monitor and be able to jump to the next error in vim with :cnext, :cprevious (see :help quickfix.txt for more info).
If you want to apply your make command to an arbitrary window, have a look at the
'WINDOW_STACK' section of the man page xdotool(1).

Is there a way to restart quicklookd on demand?

Whenever I update my QuickLook thumbnail/preview generator, I need to wait up to a minute for quicklookd to be automatically restarted before I can see the change.
$ qlmanage -m
...
generators change detected: quicklookd will restart soon
Is there a way to trigger quicklookd restart manually without having to wait for it to automatically restart?
You should use qlmanage -r to manually reset Quick Look Server and all Quick Look client's generator cache.
Sometimes relaunching Finder (press cmd on Finder > Relaunch) also helps as you wont see immediate changes if the finder View hasn't changed and you just preview files.

How to detect windows update status

I want to detect current windows 10 update status programmatically.
I tried wuapi and it works well but there are some problems in wuapi.
First, it takes long time to get update information.
Second, it can not be used at offline.
Is there any other method to detect current windows 10 update status?
Is there any registry or system file to detect it?
I tried procmon to analyse but there are too many files and registries linked with windows udpate.
Thank you...
There is no documented way to access the search results that Automatic Updates is using (the results that the Windows Update page in Settings displays).
However, there are two things that might be of use to you:
You can use IAutomaticUpdatesResults::LastInstallationSuccessDate to immediately see the last time the computer installed updates successfully. If all you want to know is "Is this PC processing updates successfully?", then this may be all you need.
You can use a Windows Update API search to see what updates are needed. Here's a script you can use as a starting point. If you use this script as written, it will go online to find newly-released updates, which isn't what you want in your scenario. But you can set your IUpdateSearcher object's Online property to false before calling Search. Doing that will perform an offline scan, in which WU just re-evaluates the updates it already knows about. This will work offline and will also return faster results.
"COM API
The COM API is a good way to directly access Windows Update without having to parse logs. Applications of this API range from finding available updates on the computer to installing and uninstalling updates.
You could use the Microsoft.Update.Session class to run an update search and then count the number of updates available to see if there are any updates for the computer.
PowerShell Example:
$updateObject = New-Object -ComObject Microsoft.Update.Session
$updateObject.ClientApplicationID = "Serverfault Example Script"
$updateSearcher = $updateObject.CreateUpdateSearcher()
$searchResults = $updateSearcher.Search("IsInstalled=0")
Write-Host $searchResults.Updates.Count
If the returned result is more than 0 then there are updates for the computer that need to be installed and/or downloaded. You can easily update the powershell script to fit your application.
Just a heads up, it appears that the search function is not async so it would freeze your application while searching. In that case you will want to make it async."
Registry method
Source:
https://serverfault.com/questions/891188/is-it-possible-to-detect-the-windows-update-status-via-registry-to-see-if-the-s

Touch keypad buttons in calabash-android

Is there any way to tap on keypad button in calabash -android (like :1,2,3,4)
Note : Tap should be physical tap , as we got with "keyboard_enter_text" command in iOS
For Android you can use keyboard_enter_text"1,2,3,4".
You have to have touched the field first, so that it is in focus.
Is that what you are asking for?
Calabash doesn't support it but you can use adb to press keyboard keys
adb shell input text "what%syou%want%stype"
In ruby you can execute terminal commands in a couple of ways but I use backticks
`adb shell input text "what%syou%want%stype"`
See here for more info - http://krazyrobot.com/2014/02/calabash-android-enter-text-from-keyboard-using-adb/
EDIT: Not too sure on the cause of the downvote but here's a bit more info on my answer in case it makes any more sense to anyone.
The equivalent function of keyboard_enter_text for calabash-android has the same name. It is in the TextHelpers module of calabash-android. To use it, you have to
require 'calabash-android/text_helpers'
However the implementation of keyboard_enter_text seems to be different behind the scenes for android in as far as it sets the text value in the field to the whole word/phrase like it has been pasted in, rather than with individual keypresses like it does for ios. As far as I know you can simulate the individual keypresses using adb commands if that is what you want.
I'm not sure why you would need to click on the keyboard buttons specifically, rather than just be happy that the text is in the field, as it is slower, but if you do for some reason then the adb commands should work.