Interesting: some PowerShell scripts that pipe a user and password through cmdkey.exe /generic:TERMSRV/$Computer /user:$User /pass:$Pass
- [WayBack] Remote Desktop Auto Login Powershell Script · GitHub
- [WayBack] mstsc auto login command line
–jeroen
Posted by jpluimers on 2020/05/29
Interesting: some PowerShell scripts that pipe a user and password through cmdkey.exe /generic:TERMSRV/$Computer /user:$User /pass:$Pass
–jeroen
Posted in *nix, Development, Linux, Power User, Software Development | Leave a Comment »
Posted by jpluimers on 2020/05/28
Cool stuff: TOP 10 CD/DVD/Floppy Drives based Projects – YouTube.
Via:
–jeroen
Posted in Development, Hardware Development, LifeHacker, Power User | Leave a Comment »
Posted by jpluimers on 2020/05/28
[WayBack] GitHub – dschmenk/apple2pi: Apple II client/server for Raspberry Pi: hybrid computer of a Raspberry Pi inside an Apple II (either ][, or ][+, or //e) so the Apple II can be a front-end to the Raspberry Pi which then can run an Apple IIGS emulator, talk to the Apple II storage hardware and much more.
It can run [WayBack] RASPPLE II: A2CLOUD, A2SERVER, Apple II Pi for Raspberry Pi
Lot’s of videos below, all by David Schmenk https://www.youtube.com/user/dschmenk/videos
Via:
–jeroen
Posted in *nix, *nix-tools, //e, 6502, Apple, Apple ][, Development, Hardware Development, Hardware Interfacing, History, Power User, Raspberry Pi, USB | Leave a Comment »
Posted by jpluimers on 2020/05/28
If I land a project using Zabbix again, one of the things I need to look into is [WayBack] Best android apps for zabbix – AndroidMeta.
–jeroen
Posted in *nix, Android, Android Devices, Development, Linux, Mobile Development, Monitoring, Power User, Zabbix | Leave a Comment »
Posted by jpluimers on 2020/05/27
When doing multi-threading, I’m always reminded of [WayBack/Archive.is] Davidlohr Bueso on Twitter: A programmer had a problem. He thought to himself, “I know, I’ll solve it with threads!”. has Now problems. two he
Even with the advent of multi-core architectures long behind us (multi core hardware has been in a mature state for a long time), software for it often is not.
It is not just that programmers are not ready to do it (indeed often they are not: multi-threading is hard), but also that many pieces of software run perfectly fine in a single thread.
So when you do want to implement multi-threading, think twice.
It is one of the reasons I ported a C# version of the Deadlock Empire game (written in HTML + JavaScript) to generate Delphi code and examples. I was really glad that Dalija Prasnikar pointed to it in [WayBack] What is thread safety anyway?, and also pointed to the very important [WayBack] What is this thing you call “thread safe”? – Fabulous Adventures In Coding.
That last one stresses that multi-threading has vague definitions. It will stay vague because the problems you can encounter are virtually endless. There is no silver bullet: Lars Fosdal made this really nice remark in [WayBack] Multithreading can be hard to do right… – Dalija Prasnikar – Google+:
Locking too much is even worse than locking too little. It is very easy to deadlock with overly detailed locking. Applying locking in the wrong place, can serialize threads through a lock bottleneck.
Learning multithreading is a long series of mistakes that you probably can’t avoid, even if told about them up front. You are probably best off having to make the mistakes yourself and then learn from them ;)
To which Asbjørn Heid added:
… after a while I came to the realization that recursive locks are evil. They make it so easy to “just lock everything”. In contrast, non-recursive locks forces you to have explicit “thread-safety borders” in your code. And such borders really leads to better designs.
Here are the games:
Related:
–jeroen
Posted in Conference Topics, Conferences, Development, Event, Multi-Threading / Concurrency, Software Development | Leave a Comment »
Posted by jpluimers on 2020/05/27
At the time of looking, FiraCode would not work in Delphi but would in Visual Studio. Reminder for me to look at it again: [WayBack] GitHub – tonsky/FiraCode: Monospaced font with programming ligatures.
A cool feature of the font is that it has ligatures for common multi-character combinations like := or ...
Back when scheduling this, I was still at Lucida Console because of its large x-height and small line spacing.
It is time to revisit my font choice, so lets include at least these candidates:
–jeroen
related:
Edit 20200527: observations by Uwe Schuster
Posted in .NET, Delphi, Development, Font, Power User, Programmers Font, Software Development, Visual Studio 2015, Visual Studio and tools, vscode Visual Studio Code | Leave a Comment »
Posted by jpluimers on 2020/05/26
Not yet structured logging, but it brings more structure to your console.log() output:
There is more to debugging JavaScript than console.log to output values. It might seem obvious I’m going to pimp the debugger, but…
Via: [WayBack] Really useful article for #JavaScript developers: Going beyond #console.log for #debugging and #logging. Some gold i nthis article that may just save yo… – Jason Mayes – Google+
–jeroen
Posted in Development, JavaScript/ECMAScript, Scripting, Software Development, Web Development | Leave a Comment »
Posted by jpluimers on 2020/05/26
It’s a few steps as per [WayBack] How to move Git submodule to sub-directory? – Stack Overflow, so I’m not sure it is the best solution, but it at least works (thanks Philzen):
Had the same problem just the moment ago and ended up deleting the submodule reference (as outlined in this article) and recreating it where i wanted it to go.
To follow your example of moving submodule
jqueryintorepos/jquery
- Delete the (typically three lines) submodule reference from
.gitmodules.- Check
.git/configfor references to the submodule and remove them, if existent- do
git rm --cached jqueryto cut the submodule reference out of the repository- remove the old submodule folder
- recreate you submodule reference (as you possibly did before) with
git submodule add git://github.com/jquery/jquery.git repos/jqueryIn case your submodule was set to specific tag, respectively commit (which you’ll surely have in a stable project) you will have set it again.
Due to this complex process i am strongly hoping there is (or will be, at least on the git roadmap) a more straightforward way of achieving this. If not, surely some scripts could be fumbled together to do this quicker…
References:
cd submodule_directory
git checkout v1.0
cd ..
git add submodule_directory
git commit -m "moved submodule to v1.0"
git push
–jeroen
Posted in Development, DVCS - Distributed Version Control, git, Software Development, Source Code Management | Leave a Comment »
Posted by jpluimers on 2020/05/26
Two years later, it is a reminder to look at my statement again: [WayBack] Jeroen Pluimers on Twitter: “Hi dpi is a mess, not just on Windows. It will take considerable time to overcome the decades long Pixel mess we’ve been coming from (:”
–jeroen
Posted in Apple, Development, Mac OS X / OS X / MacOS, Power User, Software Development, Windows | Leave a Comment »
Posted by jpluimers on 2020/05/25
Sometimes an NTFS shrink still fails, even though you use the built in Windows defragmentation tools, of SysInternals contig tool.
The best you can do is to follow the steps in:
diskmgmt.msc to try shrinking the disk, then often it is already in the error message: “You can’t shrink a volume beyond the point where any unremoveable files are located see the defrag event in application log for detailed information about the operation when it has completed.”eventvwr.exe and look at the Windows Logs for the most recent Application entries that has Source set to defragThose defrag entries usually tell about the last file that could not be moved.
You can use
wevtutillto query events on the commandline.Note that contrary to [WayBack] WEVTUTIL – Windows CMD – SS64.com documentation, the option
/rdcannot be expanded to/reversedirection, as you will get an error “invalid option reversedirection” – Google Search.For querying the above
defragevent, use this command line (replace/format:XMLwith/format:textfor more readable but also more verbose output):
wevtutil query-events Application /count:2 /format:XML /rd:true /query:"*[System[(EventID=259)]]"
On Windows 10, this is often caused by “System Protection” which locks files under C:\Recovery, but I have also seen $BITMAP, $MFT and $DATA entries.
To view which drives are currently used for system protection (this opens the “System Properties” dialog focussed on the “System Protection” tab):
SystemPropertiesProtection.exe
To disable it for one drive:
Disable-ComputerRestore -Drive "C:"
To enable it for one drive:
Enable-ComputerRestore -Drive "C:"
There seems to be no easy one-command PowerShell way to view the drives have ComputerRestore enabled, as this does not show drive letters:
PowerShell Get-ComputerRestorePoint ^| Format-List
The above gives more detailed output than a plain PowerShell Get-ComputerRestorePoint
PowerShell does not have a built-in option to delete restore points, but vssadmin has, but calls them “shadows”.
First list them:
vssadmin list shadows
Then delete them (but be aware this will not prompt for confirmation because of the /quiet):
vssadmin delete shadows /for=C: /quiet
You can also delete them for all drives (this will not prompt for confirmation either):
vssadmin delete shadows /all /quiet
Stopping the volume shadow copy service:
net stop vss
Hibernation:
powercfg.exe /hibernate off
powercfg.exe /hibernate on
Page file:
wmic pagefile list /format:list
AllocatedBaseSize=2944
CurrentUsage=0
Description=C:\pagefile.sys
InstallDate=20181018215808.683376+120
Name=C:\pagefile.sys
PeakUsage=0
Status=
TempPageFile=FALSE
wmic computersystem where name="%computername%" get AutomaticManagedPagefile
AutomaticManagedPagefile
TRUE
wmic computersystem where name="%computername%" set AutomaticManagedPagefile=False
Updating property(s) of '\\MYCOMPUTER\ROOT\CIMV2:Win32_ComputerSystem.Name="LAPTOPUW08"'
Property(s) update successful.
wmic computersystem where name="%computername%" get AutomaticManagedPagefile
AutomaticManagedPagefile
FALSE
wmic.exe pagefileset where name="C:\\pagefile.sys" delete
Deleting instance \\MYCOMPUTER\ROOT\CIMV2:Win32_PageFileSetting.Name="C:\\pagefile.sys"
Instance deletion successful.Sometimes the deletion does not work (see below for workaround):
wmic pagefile list /format:list
AllocatedBaseSize=2944
CurrentUsage=0
Description=C:\pagefile.sys
InstallDate=20181018215808.683376+120
Name=C:\pagefile.sys
PeakUsage=0
Status=
TempPageFile=FALSE
Do not do this:
wmic pagefile delete
Deleting instance \\MYCOMPUTER\ROOT\CIMV2:Win32_PageFileUsage.Name="C:\\pagefile.sys"
ERROR:
Description = Provider is not capable of the attempted operation
wmic pagefileset set name="c:\\pagefile.sys",InitialSize=0,MaximumSize=0
No Instance(s) Available.
Sometimes it still fails, so then you have to use the UI:
SystemPropertiesAdvanced.exePerformance, click on SettingsAdvanced tabVirtual memory, click the Change buttonAutomatically manage page file size for all drives is disabledNo paging file is selectedSet buttonOK buttons to fully leave the Advanced System Properties dialog.After resizing the disk, reverse the steps:
SystemPropertiesAdvanced.exePerformance, click on SettingsAdvanced tabVirtual memory, click the Change buttonAutomatically manage page file size for all drives is enabledOK buttons to fully leave the Advanced System Properties dialog.Sometimes the file blocking the resize is the NTFS "\$BitMap::$DATA", which few defragmentation tools can move as it is the MFT Bitmap.
–jeroen
Posted in CommandLine, Console (command prompt window), Development, Power User, PowerShell, PowerShell, Scripting, Software Development, Windows | Leave a Comment »