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

Find the path to the executable

You can use os.Executable for getting executable path on Go 1.8 or above version. import ( “os” “path” “log” ) func main() { ex, err := os.Executable() if err != nil { log.Fatal(err) } dir := path.Dir(ex) log.Print(dir) }

Certificates Basic Constraint’s Path Length

Taken from RFC 5280, section 4.2.1.9: A pathLenConstraint of zero indicates that no non-self-issued intermediate CA certificates may follow in a valid certification path. Where it appears, the pathLenConstraint field MUST be greater than or equal to zero. Where pathLenConstraint does not appear, no limit is imposed. I.e. a pathLenConstraintof 0 does still allow the … Read more

msys path conversion (or cygpath for msys?)

Update (Aug-2016): This question is no longer relevant, as msys2 now comes with cygpath in its installation. … I’ll summarize my research here. The cygpath equivalent in MSYS is to use this command: { cd /c/some/path && pwd -W; } | sed ‘s”https://stackoverflow.com/”\\|g’ The problem with this approach is that it requires existing path, e.g. … Read more

Extend $PATH variable in git bash under Windows

Here are two ideas. You can have your path with double quote mark. export PATH=$PATH:”/C/Program Files (x86)/apache-maven-3.3.3/bin” Or, You can also make symbolic link for the directory. ln -s “/C/Program Files (x86)/apache-maven-3.3.3/bin” ./mvnbin export PATH=$PATH:/your-path/mvnbin It works for me in mingw32 environment.

Expand tilde to home directory

Go provides the package os/user, which allows you to get the current user, and for any user, their home directory: usr, _ := user.Current() dir := usr.HomeDir Then, use path/filepath to combine both strings to a valid path: if path == “~” { // In case of “~”, which won’t be caught by the “else … Read more