Batchfile: What’s the best way to declare and use a boolean variable?

set “condition=” and set “condition=y” where y could be any string or numeric. This allows if defined and if not defined both of which can be used within a block statement (a parenthesised sequence of statements) to interrogate the run-time status of the flag without needing enabledelayedexpansion ie. set “condition=” if defined condition (echo true) … Read more

How do I change the default virtualenv prompt?

If you are working on a custom PS1 (as I when found out this issue), I recommend you to disable prompt change, use export VIRTUAL_ENV_DISABLE_PROMPT=1 (see virtualenv docs), and make your own virtualenv prompt in order to add to your PS1. See this snippet that I’ve used: function virtualenv_info(){ # Get Virtual Env if [[ … Read more

How do I remove the process currently using a port on localhost in Windows? [closed]

Step 1: Open up cmd.exe (note: you may need to run it as an administrator, but this isn’t always necessary), then run the below command: netstat -ano | findstr :<PORT> (Replace <PORT> with the port number you want, but keep the colon) The area circled in red shows the PID (process identifier). Locate the PID … Read more

Error “‘git’ is not recognized as an internal or external command”

You may not have set your PATH correctly to point at your Git installation. You need to add the following paths to PATH: C:\Program Files\Git\bin\ C:\Program Files\Git\cmd\ And check that these paths are correct. You may have Git installed on a different drive, or under Program Files (x86). Correct the paths if necessary. Modifying PATH … Read more

How to show records vertically in mysql command line?

I think you are using \g instead of \G. Unless you use \G you get default output pattern. Default is \g. mysql> show databases\g +——————–+ | Database | +——————–+ | information_schema | | mysql | | test | +——————–+ 3 rows in set (0.00 sec) mysql> show databases\G *************************** 1. row *************************** Database: information_schema *************************** … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)