Defragment the NTFS MFT and other hidden crucials in live Windows
article #1265, updated 5 hours ago

The command is CONTIG (also available in 64-bit as CONTIG64), and it is a Sysinternals:

https://docs.microsoft.com/en-us/sysinternals/downloads/contig

You’ll want to put the appropriate binary in C:\Windows. Run it like this, in administrative CMD, it will get all of the hiddens it can for C drive (this is 64-bit):

contig64 -nobanner -accepteula C:$Mft
contig64 -nobanner -accepteula C:$LogFile
contig64 -nobanner -accepteula C:$Volume
contig64 -nobanner -accepteula C:$AttrDef
contig64 -nobanner -accepteula C:$Bitmap
contig64 -nobanner -accepteula C:$Boot
contig64 -nobanner -accepteula C:$BadClus
contig64 -nobanner -accepteula C:$Secure
contig64 -nobanner -accepteula C:$UpCase
contig64 -nobanner -accepteula C:$Extend

Notice the distinct lack of slashes in the above!

Categories:      

==============

Get Version of PowerShell
article #1201, updated 5 days ago

My current favorite way:

[string]$PSVersionTable.PSVersion.Major + '.' + [string]$PSVersionTable.PSVersion.Minor

If it’s 1.0, you’ll get an error, otherwise you will have what you need.

Categories:      

==============

When an Outlook plugin will not enable or reenable
article #1273, updated 5 days ago

Sometimes, newer versions of Outlook will hard-fail a plugin, so that none of the standard GUI changes will permit it to reenable. When this happens, you can override by deleting everything here:

HKEY_CURRENT_USER\Software\Microsoft\Office\[version number]\Outlook\Resiliency\DisabledItem

This does enable every plugin, so there is a bit of danger.

Categories:      

==============

Windows Updates by Powershell
article #1272, updated 7 days ago

There are a lot of out-of-date and/or flatly wrong web references on this topic, so it seemed like a good thing to start one. Updates are likely.

  • Prerequisites. The page reports minimum Powershell version 3.0, but automatic Powershell Gallery downloads don’t start to get good until 5.1. So this document will say PS 5.1. Administrative Powershell session or equivalent is of course needed.
  • Set up the environment:
Install-PackageProvider -Name NuGet -Force
Install-Module PSWindowsUpdate -Force
Get-Command -Module PSWindowsUpdate
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Unrestricted -Force
Import-Module PSWindowsUpdate
Add-WUServiceManager -MicrosoftUpdate -Confirm:$false
  • Get list of current Windows updates available to the setup. This respects anything else in place, e.g., WSUS, standard RMM patching system, et cetera.

Get-WUList

  • Install with automatic reboot

Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot

  • Or, install without automatic reboot

Install-WindowsUpdate -MicrosoftUpdate -AcceptAll -AutoReboot:$false

The beauty of this one, is although it can and will run utterly silently, it gives a marvelously simple Powershell-style progress report, both downloads and install progress, if you are running it in a live window.

Categories:      

==============

Recompiling for Performance on Arch Linux and Derivatives
article #1196, updated 8 days ago

At the core, any current desktop OS is running binary code; and the vast majority of it is binary code which uses only a subset of the CPU at hand. This is because there are so many different CPUs which need to run the same code. Intel and AMD constantly add things to the CPUs they put out, but code of general distribution lags very far behind, because when one downloads and installs, that code set has to run on everything, whether it be ten years old or three months old. On an excellent Linux, one can recompile any package in such a way that the binary code resultant uses the entire CPU which one is using. Performance gains are thus available.

Most of the advice I have been given and found, for recompiling certain packages for Arch Linux and derivatives, has made things very very complicated, and often includes statements that it’s not worth it. Well, I am a witness that it is well worth it, one can increase performance quite a lot, and it’s not too complicated as of this writing.

My Arch derivative of choice is Manjaro, it does a lot of things for us. But all of these methods are pure Arch, all you have to do is get the prerequisites.

Prepare the environment

Before we do anything, we update the system and reboot. This is partly because operations further down will get new packages.

Then we install yaourt. Manjaro has it in its standard repos and can be installed just with pacman -S yaourt; you’ll have to add another repo for pure Arch. Once yaourt is in, you’ll need to create folder “yaourt-tmp” in your home folder (for our purposes, /home/username/yaourt-tmp), edit /etc/makepkg.conf, and find this line:

#BUILDDIR=/tmp/makepkg

Add a line just below it, thus:

BUILDDIR=/home/username/yaourt-tmp

Without the above change, package production may well run out of room, because by default /tmp is stored in RAM.

Secondly for this file, find two lines beginning thus:

CFLAGS=”
CXXFLAGS=”

Both lines will be quite long, with close-quotes, containing several items. One of the items in both is -march=; this needs to be changed from whatever it is to -march=native. We also need an item added or changed if it exists: we need -mtune=native. This will make everything we compile, run by far the best on the very make and model CPU we have in this machine. It will also make the packages not run well on anything else, fair warning :-)

Thirdly for this file, find a line starting with this:

#MAKEFLAGS="-j

There will be a number to the right and a close quote. Find out how many CPU cores your machine has, and add one; so if you have a dual core, you’ll add this line just below the original:

MAKEFLAGS="-j3"

This speeds up package compilation a lot, even with just two cores, and enormously more with 4 or more.

There is one more item to prepare. In this file (“~” means your home directory):

~/.gnupg/gpg.conf

you’ll want to add the following:

keyserver-options auto-key-retrieve
auto-key-locate hkp://pool.sks-keyservers.net

This eliminates the need to manually receive and approve GPG signing keys for various source files as they are downloaded.

Install an Optimized Kernel

So. Once the above is done, it’s not hard to use yaourt to build and install the Xanmod kernel, an excellent desktop-optimized kernel:

yaourt -S linux-xanmod

Yaourt will bring in the PKGBUILD, the file defining how the kernel source is download and package built. It quickly gives the option to edit it, and doing so is part of our procedure. As of this writing, you’ll look for one line:

_microarchitecture=0

and change this to:

_microarchitecture=22

This is according to documentation in the file itself; in this version at least, 22 equals “native”, which means the kernel will be optimized for the very specific CPU make and model in your machine. You can then save and choose the defaults for the rest of the process. It will take a while, 30 minutes often and much more on slower machines. Once the rebuild and install is done, you will notice a performance boost after booting the new kernel. Do be aware that automatic updates may override this kernel down the road; you can use grub-customizer (also available by yaourt) to specify which kernel you will boot.

Build glibc

After the kernel itself, by far the most used boulder of code in a Linux machine is the GNU C Library, glibc for short. So we rebuild this next.

We pull the PKGBUILD and related build scripts with yaourt:

yaourt -G glibc

And then we cd into the directory created, and light off makepkg and watch it go:

cd glibc
makepkg -s

If packages are needed for the build, install will commence, and then compilation. Compilation will take quite a while, longer even than the kernel. After it’s done, install:

sudo pacman -U *.pkg.tar.xz

and reboot to fully engage, though you may see improvement as soon as you start running or restarting programs.

Issues with many packages

There are issues which can show up with many packages.

First of all, compilation may fail. glibc is a huge package with a very large number of complications, and sometimes those complications have to do with specific versions of gcc and other items — which means if your machine is updated past those versions, you won’t compile successfully. You can either dig deep in code and/or forums to see what is going on, or just wait until the (very knowledgeable and capable, much more so than I) primary developers resolve it for all of us. Even something like the Xanmod kernel compilation may fail occasionally for the same reasons; there are quite a few more kernels available to try from yaourt, though each of them have different methods of setting CPU optimization, do watch for this.

Secondly, getting the versions you need. You probably should want the standard version, not the AUR (bleeding edge sometimes, archival and out of date sometimes too!) version. yaourt -G will tell you what it’s doing, but do be careful to not try to use outdated versions, that can break your OS if you go off the beaten path.

And thirdly, when you automatically update using pacman or GUIs, newer un-optimized versions will be autoinstalled over your optimal one. There may be ways to override this, but override is very questionable, because a very outdated package of many sorts is likely to produce crashes, especially something core like glibc or xorg-server. Better to just recompile after the update is installed. It is also helpful to choose such packages for the rarity of their updates, and glibc is one such.

Other packages to CPU-optimize

There are many other packages worth recompiling. I choose these regularly and differently according to high result/effort ratio! Here is a list, there are doubtless many more. These are all for the yaourt -G and makepkg method used for glibc, not yaourt -S. There may well be others which will help more, certainly for particular use purposes, e.g., audio and video.

gtk3
gtkmm3
gtk2
gtkmm
cairo
cairomm
qt4
qt5-base
pth
libxml2
glade
libglade
libglademm

Categories:      

==============

Tweak and Enable Superfetch Et Cetera on Windows 8/2012 and Later
article #1270, updated 9 days ago

In an administrative PowerShell, all of the following. Reports suggest increases in performance if there are CPU cycles available:

Enable-MMAgent -ApplicationLaunchPrefetching
Enable-MMAgent -ApplicationPreLaunch
Set-MMAgent -MaxOperationAPIFiles 8192
Enable-MMAgent -MemoryCompression
Enable-MMAgent -OperationAPI
Enable-MMAgent -PageCombining
Set-Service sysmain -StartupType Automatic
Start-Service sysmain

The last two enable and start the service, if necessary.

Categories:      

==============

Use DMARC to harden SPF and DKIM
article #1255, updated 13 days ago

The following TXT record:

v=DMARC1; p=reject; pct=100; adkim=s; aspf=s

at least theoretically, should harden SPF and, if present, DKIM. “=s” means “strict”. According to DMARC documentation, DMARC can be used without DKIM, and experiences with a first setup of the above without DKIM are playing out well so far.

Some info is here:

https://www.dmarcanalyzer.com/how-to-create-a-dmarc-record/

Categories:      

==============

FQDNs to block Facebook
article #1269, updated 16 days ago

Known list at this writing:

*.facebook.com
*.facebook.net
*.fbcdn.com
*.fbcdn.net
*.instagram.com
*.cdninstagram.com
*.tfbnw.net
*.fbsbx.com
*.fb.com

Categories:      

==============

DISM Fixes Windows 8.1 and 10
article #980, updated 19 days ago

Do this:

DISM /Online /Cleanup-Image /StartComponentCleanup

and then this:

DISM /Online /Cleanup-Image /RestoreHealth

and then reboot. This handles a lot of SFC errors and others too.

Categories:      

==============

Engine Improvement with a Negative Ion Generator?
article #1267, updated 23 days ago

I’ve never been a profound and excellent engine guy, and with computers controlling them I have become even less and less of one over time. But theoretically, one should be able to improve anything at least a bit, and I may have stumbled on a way.

A negative ion generator, is a thing used commonly to improve air quality. They “ionize” molecules and atoms in air, giving them negative electrical charges. This observably coalesces dust particles which fall, and also destroys odors. One can find more health-related reports about them too. Reportedly, right after a thunderstorm, most of the “invigoration” one encounters in the air, is negative ionization.

There used to be “negative ionizer” widgets which were little bricks that plugged in and hung onto wall power sockets; these did help, but the dust tended to coalesce and adhere around a few inches radius of the device, on the wall et cetera, which is why we don’t see those much anymore! But they are being built into air conditioners quite a lot now, even the window air conditioner we bought a year or two ago has one inside it. Little ones with fans are now quite available from a few different companies.

And I do enjoy testing the walls of my current box, so, thought I, I wonder what would happen if we charged the air going into our friendly household truck engine. I have a 1998 Tahoe, 5.7L EFI V8, which underwent some mods before she asked to come into our life (her name is Bertha, she is a big girl with a very low voice)…and she has a certain amount of airspace available in her engine compartment, so I thought, why not. I remember just enough physical chemistry (which I mostly failed) to be dangerous, and the idea of adding electrons to air molecules and atoms to make them more reactive, sounds like a way to get a very nicely excited sort of energy into her heart. After all, it’s not how much energy you have, it’s the preparation of that energy into usable form. We have enormous amounts of unused chemical energy in every engine cycle; if we can bleed off a little engine power electrically to get a noticeably helpful net result, that’s a definite gain.

So I ordered one of these,

after a bit of research, from Alanchi on AliExpress. The pic is for the 12VDC version, it comes in 110VAC and 220VAC too; I ordered the 12VDC of course, to wire straight into existing electrical. It is advertised as a 30 million particle per cm3 negative ionizer, which is literally twice as powerful as any of the others I could find, except one which is 220VAC only. That one is at 100 million particles per cm3…but I’m not going to try to engineer 220VAC under Bertha’s hood ☺ Also unlike what I have seen in the past, this class of ionizer throws its output off little carbon brushes, rather than rows of thin and sharp metal needles. I have seen the metal needles degrade over time, due to corrosion and possibly more interesting behaviors (I saw what looked like a slow-moving, brightly glowing spark, rising off a needle, at least twice); the carbon brushes strike me as a very good idea.

If you are in the U.S., you’ll spend a lot of money on shipping from AliExpress unless you are willing to wait a long time; I waited a long time ☺ and I don’t regret it, it gave me time to think about setting this up in as durable a fashion as possible, which we really do want in an engine compartment. We don’t want to cause ourselves electrical problems of any sort, bad ones are very bad; we have to be careful. One nice thing, this 30 M/cm3 ionizer element is only using 0.5 watts of power, just a tiny sip.

Do note that what we want is explicitly not an “ozone generator”. Ozone is a peculiar and less stable molecular form of oxygen, which is both poisonous and corrosive. We do not want any noticeable amount of this, in regular contact with anything of ours. It is used sometimes as a cleansing agent, to kill invasive bugs and other unpleasantries, but it is not what we are after here. Most if not all electronics produce very tiny amounts of ozone, thunderstorms produce more; the devices we want for this purpose explicitly produce only infinitesimal amounts, and they are explicitly rated for this as well, because years ago this was not done so carefully, there was confusion.

It is also true that I am at least a tad concerned with possible corrosion in this build. Ionization means reactivity: various components of air are being made more likely to do chemical reactions with things they encounter, than they would otherwise. So be warned, if you try this you taking risk just as I am; I have no idea what this is doing to various sensors and other bits in the air intake setup! And as of this writing, 2019-02-18, it’s been in place just 3-4 weeks. I’ll be updating as I learn things and encounter things happening. One idea which did come up recently, was checking the spark plugs, this can be one way to find badness in the cylinders; I’ll have them changed out soon so I can get multiple experienced opinions.

And back to work. I set up the electricals as well as I know how, with crimp-on terminals for every wire, because I intend to run with it in the long term, and Kansas sometimes (and never always) gets very cold winters, very hot summers, wet springs, etc. Power comes from the fuse box, using something called a “fuse tap”,

which I learned about through web-searching; I found the AutoZone three blocks from our home had the ones for Bertha in stock. You take out an existing fuse, plug the fuse tap in, and then plug the old fuse and a second new fuse into the fuse tap’s own sockets. The fuse tap has a wire end to crimp onto, and that runs to the widget needing the power.

We could wire straight to the battery, but that would mean opening the hood to switch it on and off every time. Since we want this widgetry to always have power with the engine, we use the fuse tap, and choose the fuse socket accordingly. The one marked “IGN” (“ignition” I think) is working well for me, though I saw one bit of web-advice against it for unclear reasons, probably related to applications pulling a lot more power than this one. On Bertha, IGN is also the only socket of the correct size in the fuse box under the hood: 10A, which is maximum for all of the fuse taps I found for this vehicle. My friendly neighborhood AutoZone guy also was fast and accurate in finding crimp-on terminals that fit on the switch I wired in (further down), and other items.

So I ran a new wire from the fuse tap, all the way around the back of the engine compartment, threading through items which don’t get hot to hold it in place, to a little switch with a light in it, so I could know for certain when the widget is powered, and so I could shut it off if something happened in certain categories ☺ I followed the simple wording on the switch (+12VDC here, accessory wire there, ground there), and grounded both the device and the switch directly to the battery. Then I drilled four small holes, one for each of the carbon brushes, in the casing for the air filter. This is emphatically pre-filter, not post-filter, because I don’t care how strong those brushes are, I don’t want bits of them ever going into Bertha’s engine! Here’s the result:

Normally everything sits in that little cavity just under the switch, I pulled it all out for the pic. You’ll notice the four wires going into the air filter casing. I used a very nice epoxy from JB Weld advertised to bond any plastic; it works very well, highly recommendable.

I will end up regretting using epoxy if/when I eventually have to replace the ionizer unit, but that’s fine, that’s what cordless electric drills are for ☺ Also I still don’t know what I will use instead of the epoxy. It seems important to hold those wire ends so they don’t get sucked onto the air filter surface, or flap around a lot; they’re sticking through only about an inch.

I can imagine a little metal screw-in stud with a hole in the middle for the wire, but I don’t know what it’s commonly called, or if anyone is actually making them right now ☺ They probably are, these days. If it becomes desireable, I’ll probably send up a RFQ (request for quote) to MFG or AliExpress or something. Wording is the problem then, and the fact that although I might have seen one or two of these in the dim sands of memory, I don’t have precise specs, and my drawing skills aren’t great. I once taught myself rudiments of the DOS version of AutoCAD though, maybe I could revisit that kind of graphics; someone must have an open-source CAD by now, right…?

The device has been in place for just 3-4 weeks at this writing, and it has been very cold mostly, ranging from -5 to +35 F (-21 to +2 C) or so. Noticeable results so far:

  • Cold running. In the extremer cold, Bertha has sounded a bit strained until warm, like many other engines I’ve heard. Not anymore. Even stone cold, at minus five, the gas pedal seems to have about as much juice as warm. She probably burns a good bit more gas doing it, but is happy to help!
  • Starting. Bertha has never had real trouble starting once I gave her a really good (and pricey) battery and new starter, just normal behavior. But now it’s not normal. Hot or one-hour-warm, she takes off, probably turning over once. Cold, one turns the ignition on for a few seconds to run the fuel pump and charge that air…and she turns over just a bit and righto she goes.
  • Idle has an interesting sound change (she does have glasspacks…), very very regular, quite a lot less in volume, clearly doing more motion with less.

I haven’t noticed a whole lot of change in general driving yet, beyond the very cold and overall consistency. Which is why I’ve ordered three more of those negative ion generators ☺ Not going to put them all in Bertha I don’t think, I’m looking for others to join in the fun; we’ll see. I have been tentatively thinking about a second and third vacuum-controlled stage…with white, yellow, and orange LEDs in a row on the dash…maybe…☺

It will be interesting to see how summer plays! Do drop me a line if you have questions, are interested, or try it!!!

Categories: