Misc. Notes
This page contains a collection of unrelated notes pertaining to issues I have Googled more than once.
Start a process as a different user in Windows
In PowerShell:
Start-Process -FilePath "${env:ProgramFiles(x86)}\Google\Chrome\Application\chrome.exe" -Credential (Get-Credential)
Directly from a link, i.e. with the default CMD shell:
%windir%\System32\runas.exe /profile /u:domain\user "%programfiles(x86)%\Microsoft\Edge\Application\msedge.exe"
"God mode"
In Windows, create a folder on the desktop and rename it to:
Recommend VS Code plugin
Create a file .vscode/extensions.json
with a recommendation array of extension ids, e.g.:
Terraform docs for 0.12+
docker run --rm \
-v $(pwd):/data \
cytopia/terraform-docs \
terraform-docs-012 --sort-inputs-by-required --with-aggregate-type-defaults md . > README.md
Decompiler plugin Java
Run command as admin
To run a command as admin without the mouse:
Win-R
to open file dialog- type command name and run with
Ctrl-Shift-Enter
Export an existing environment to Terraform
docker run --rm -iv "${PWD}":/outputs cycloid/terracognita aws --tfstate /outputs/terraform.tfstate \
--access-key $AWS_ACCESS_KEY_ID --secret-key $AWS_SECRET_ACCESS_KEY --region eu-west-1 --hcl /outputs/main.tf
260 character path length restriction
To remove path length restriction in Windows 10 anniversary edition, run:
Can break old 32 bit apps.
GitHub
- License overview: https://help.github.com/articles/licensing-a-repository/
Free S/MIME certificates
Actalis provides free S/MIME certifcates for non-commercial use.
Allow changing the password on first login via RDP
Add a line to the RDP file with the text (or change the existing one):
Afterwards, delete the line again. Technet has a good explanation.
Removing bloat ware from a new Windows machine
Removing bloat ware from a new Windows machine
Turn a JAR file into an executable
Download JSmooth. Only works if JAVA_HOME
is set to a working JRE.
SecurityException on binaries running from a network share
Let's say I get a SecurityException when running my .NET console application from "\vmware-host\Shared Folders". In this case, simply open a developer prompt and type:
From "Using CasPol to Fully Trust a Share".
Netcopy
Want to copy a file from one *Nix macine to another without the hassle of FTP?
DestinationShell:
SourceShell:
TWiki syntax high-lighting
TWiki sucks. But it sucks harder without syntax higlighting of snipptes. This plugin fixes that: DpSyntaxHighlighterPlugin
Cruft detection
Legacy projects are hoary with cruft. Find it and remove it with ...
Codesigning
Signing a .NET binary post build is easy with a X.509 certificate. Heres how to sign MyApp.exe
with mycert.pfx
:
signtool.exe sign /v /f "mycert.pfx" -t "<http://timestamp.verisign.com/scripts/timstamp.dll>" "MyApp.exe"
Custom Security Contexts in Jersey
Jersey (JAX-RS) SecurityContext in action
Linux & PAM
Sometimes you have a Linux server that uses PAM/ActiveDirectory to validate logins. If the connection to the AD lapses for some reason, you can find yourself locked out. These steps fix that.
Boot into single-user mode, hold shift during startup and choose advanced options -> recoverymode -> drop to root shell
from the Grub menu.
Remount hard disk in RW mode:
Reestablish AD trust with Kerberos:
... where xxx
is an AD browser account on the MY-DOM
domain.
.NET Core notes
- .NET Core download
- Documentation
- How to setup Https on Kestrel
- Using both xproj and csproj with .NET Core