Monday, June 19, 2017

Fedora Dual Monitor - One Workspace Per Monitor



I recently upgraded to Fedora 11 and plugged in a second monitor for my at-home workstation. However, I'd really like to figure out a way to use each monitor as its own workspace that I can move back and forth between with my mouse.



Right now, a single workspace covers both monitors so when I open an application, it opens it on the left monitor only, regardless of which monitor the link to the application is on. Except for the Terminal link, oddly enough.



Any help would be appreciated.


Answer




I had a similar (not identical) problem to yours and managed to find a solution. Maybe it will be helpful to someone anyway.




  • I assume that you've got the two monitors working and that the single desktop is extended across both (i.e. such that you can drag apps onto the second monitor).


  • Right clicking on the GNOME panel at the top or bottom of the screen gives the option of 'New Panel'. Click this and drag the new panel onto the second monitor.


  • Now right click on the new panel and select 'Add to panel'. Scroll down to the bottom of the resulting list and select 'Window List'.




Now you have a list of windows on your second monitor. The new window list will only show the windows which are sitting on the extended part of the desktop, while the window list on your main monitor will similarly only show windows residing there.




All these windows are running in the same workspace, but this technique 'approximates' the one-workspace-per-monitor that you originally asked for. With this setup you can easily drag windows from one monitor to the other and, naturally, copying/pasting works properly too.


What is the cause of a high CPU usage of 'system and compressed memory' in Windows 10?




There is an observation to be made for Windows 10 on my laptop running with 24G memory available, and 2.5G used. There is no 'memory pressure'. Other questions have looked at memory consumption (which isn't the problem here). In all the related questions here and elsewhere, I havn't been able to find an adequate explanation to the issue of this exccessive cpu utilization over the last month or two after one of the Windows 10 updates.



I can accept that there is value in this service or process, but to run continually, and to use additional cpu resources, and as a consequence, use battery power less efficiently, that is the issue I am trying to resolve.



In some article on this site, it was suggested that I turn off SuperFetch, and set a registry entry for PrefetchParameters to 0. I did both and performed a reboot.



I reboot the machine, turn off screen saver, and start the task manager. After a few minutes, the service labeled as 'System and compressed memory' starts taking 5% of my cpu, consistently. My base cpu utilization is maybe 1%, which keeps the fan low. But when the 'system and compressed memory' service runs at the 5%, the fans ramp up. And just keeps running.



Sillyness. Why does that service need to be running consistently like that with no memory pressure? Any additional mechanisms I can try for turning it off or determining what it is actually doing? Are there logs file entries somewhere? Or an in-depth diagnostic tool?




how-to-disable-windows-10-memory-compression -- no real answers here



windows-10-system-process-taking-massive-amounts-of-ram



17993-windows-10-memory-compression



desktop-build-10525-and-windows-10-memory



www.techish.net/system-and-compressed-memory/




windows-10-build-1511-overheating-cpu-fan-always



Windows Performance Recorder - now need a link for info on how to interpret the info



scrub maintenance


Answer



Analyzing the ETL file with WPA shows, that the CPU usage doesn't come from system memory compression. It comes from ntoskrnl.exe!MiScrubMemoryWorker:



Line #, DPC/ISR, Process, Stack Tag, Stack, Count, TimeStamp (s), % Weight

8, , , , | | |- ntoskrnl.exe!MiScrubMemoryWorker, 79667, , 12,45
9, , , , | | | ntoskrnl.exe!MiScrubNode, 79667, , 12,45
10, , , , | | | ntoskrnl.exe!MiScrubNodeLargePages, 79667, , 12,45
11, , , , | | | ntoskrnl.exe!MiScrubNodeLargePageList, 79667, , 12,45
12, , , , | | | |- ntoskrnl.exe!MiScrubPage, 79663, , 12,45
13, , , , | | | | |- ntoskrnl.exe!RtlScrubMemory, 79653, , 12,45
14, , , , | | | | | |- ntoskrnl.exe!RtlpGenericRandomPatternWorker, 38549, , 6,02


This is a function to test the memory for errors by filling / reading some patterns (ntoskrnl.exe!RtlpGenericRandomPatternWorker).




This is by design and happens when the idle maintenance task kicks up when your device is idle.


security - Securely format a hard drive




I have just taken 8 old 250gb drives out of one of our servers.
I need to securely wipe all the data on these drives, before they are decomissioned.
Can anyone suggest an open source software that could do this? My idea is to mount the drive into a usb caddy, and run some kind of tool on the drive, to wipe it completely.

rename - Renaming all files of a particular type to lowercase batch


In this link Is there a way to batch rename files to lowercase?


there is a command given


for /f "Tokens=*" %%f in ('dir /l/b/a-d') do (rename "%%f" "%%f")

This works when i want to convert all filenames in a folder to lowercase.


However, is there any way to convert files of only one type (eg .RMT) to lowercase?


Thanks in advance.


Answer



Sure thing, just add "*.RMT" inside the dir expansion, so:


('dir /l/b/a-d')

becomes


('dir /l/b/a-d *.RMT')

Sunday, June 18, 2017

windows - Running python scripts in their directory with Notepad++


I am trying to get a run command set up in Notepad++ that will run the python file I have open in NP++ with the current_directory set to the folder containing the open script. It is not working, and I have hit a point where I can't figure out why.


I can get the run command to open CMD and change the directory appropriately with the following:


cmd /K cd "$(CURRENT_DIRECTORY)"

This works as I expect, CMD open in the current directory, waiting for a command. I can type python in here and python starts in this cmd window!


I expect the following run command to do what the previous one did, then run python in the CMD window:


cmd /K cd "$(CURRENT_DIRECTORY)" python

But this does not work, it gives the error:


The system cannot find the path specified.

Does anyone know why this would be happening / what I must do instead to get python to run here?


Answer



Does anyone know why this would be happening / what I must do instead?



cmd /K cd "$(CURRENT_DIRECTORY)" python



The above is an invalid command.


You should instead run the two commands sequentially using the & operator


cmd /K cd "$(CURRENT_DIRECTORY)" & python


commandA & commandB


Run commandA and then run commandB



Source Command Redirection, Pipes - Windows CMD - SS64.com


windows - Why does my computer run fast after a clean install?


I recently formatted and reinstalled Windows on my laptop. It now runs much faster.
I have been doing this about once a year for the past decade. Why is this needed?


I always figured this had to do with installing and removing programs, which over time fill up the registry with junk. Is this true? Are there any programs that can tweak the system without reformatting?


Answer



The registry is a bit of a misconception, The way it works, it could be filled with junk but it shouldn't slow down your machine - imagine, all roads are linked, but just because there is a traffic jam somewhere doesn't always mean it will affect you somewhere completely different!


It is pretty much just software that starts with your computer, updaters and bad drivers.


You can greatly speed up your computer using Microsoft / Sysinternals AutoRuns and delete/disable enries you do not want to start up with your machine.


windows 10 - Write to current user's registry through a different admin account


I have 2 users:



  • Domain\Me (domain user)


  • .\MeAdmin (local administrator)



I frequently have to update my registry for multiple purposes (IE trusted sites, override policies, etc.).


e.g.


[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\gov.pt]
[HKEY_CURRENT_USER\SOFTWARE\Policies\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\gov.pt\portaldasfinancas]
"https"=dword:00000001
"http"=dword:00000001

My problem lies with the fact that have been told that I cannot make myself (domain account) local admin, I have to use an independent local admin account for all administrator tweaks.


The thing is, if I run this as user .\MeAdmin, it will run current user of MeAdmin and not user Domain\Me; if I run as Domain\Me, I will bump into permissions wall.


Is there a way to assign Domain\Me permissions to edit registry without being Administrator, or update current user of that account through local admin?


Note: I've read about remote registry connections, but I was hoping to still run this as a script/shell for automation purposes.


Update:
When I run through domain user (all HKEY_CURRENT_USER entries):


enter image description here


Answer



To access another user's registry:



  1. You must use the full path – you need HKEY_USERS\ instead of HKEY_CURRENT_USER (which is only a symlink to the former), and likewise HKEY_USERS\_Classes instead of HKEY_CLASSES_ROOT. Use whoami /user to figure out your SID.


  2. The registry hive must be loaded (mounted) – each user's registry is stored in their own ntuser.dat file (HKCU) and UsrClass.dat (HKCR) separately from the system registry (loaded/unloaded on login/logout).


    In case the target user isn't logged in, you can use reg load or the similar Regedit menu item to mount their ntuser.dat under HKU (but don't forget to unload it later, or that user might be unable to log in).


  3. The registry keys (folders) must have the correct permissions allowing write by another user – they work more-or-less the same way as file permissions; open Regedit, right-click a folder, choose "Permissions…", and add the user which is doing the modifications.



hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...