How can I use a shebang in a PowerShell script?

Quick note for Linux/macOS users finding this: Ensure the pwsh or powershell command is in PATH Use this interpreter directive: #!/usr/bin/env pwsh Ensure the script uses Unix-style line endings (\n, not \r\n) Thanks to briantist’s comments, I now understand that this isn’t directly supported for PowerShell versions earlier than 6.0 without compromises: …[in PowerShell Core … Read more

Cygwin – command not found

Right click on “My Computer” -> Properties -> Advanced -> Environment Variables Add a new environment variable, called CYGWIN_HOME and set its value to C:\cygwin Edit the PATH environment variable and add %CYGWIN_HOME%\bin to it (usually separated by a ‘;’). Just click okay, exit any command prompts or bash shells (over cygwin) you may have … Read more

SSL certificate rejected trying to access GitHub over HTTPS behind firewall

The problem is that you do not have any of certificate authority (CA) certificates installed on your system. And these certificates cannot be installed with Cygwin’s setup.exe. Install Net/ca-certificates package in Cygwin (thanks dirkjot) There are two solutions: Actually install root certificates. The curl guys extracted the certificates from Mozilla for you. cacert.pem file is … Read more

Git slows down Emacs to Death – How to Fix this?

There’s a built-in profiler called ELP. You can try something like M-x elp-instrument-package, enter “vc”, and then try finding a file. Afterwards, M-x elp-results will show you a profile report. (Note that if the time is instead being spent in non-vc-related functions, this technique will not show it, but you can instrument further packages if … Read more

tech