mosquitto (on windows) command not found - windows

I'm a newbie to MQTT and mosquitto.
I recently installed mosquitto on my Windows OS using the Windows binary installation file on the website (http://www.eclipse.org/downloads/download.php?file=/mosquitto/binary/win32/mosquitto-1.4.2-install-win32.exe).
However, when I try to run the mosquitto commands, it displays an error saying that the command is not found. Upon Googling this, I found the same instructions to download the binary installation.
Even when I open the mosquitto folder saved in my Program Files and try to run the broker application, the window opens for a split second and then shuts off.
I also have HiveMQ downloaded. Could that be the issue?
I cannot understand what I might have done wrong during the installation otherwise. Please help!

None of mosquitto, mosquitto_pub nor mosquitto_pub are gui programs. You will need to run them through cmd.exe or powershell or similar. So for example:
run cmd.exe
cd <path to executables>
mosquitto_sub -h test.mosquitto.org -t '#'
On the "command not found" error, did you follow the instructions in the installer for installing dependencies?
OpenSSL - install 'Win32 OpenSSL vXXXXX Light' then copy dlls to the mosquitto directory - http://slproweb.com/products/Win32OpenSSL.html
pthreads - copy 'pthreadVC2.dll' to the mosquitto directory ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/

As per the readme-windows.txt file (found under the installation director), the dependencies (OpenSSL abd Pthread) are not provided with the installer and needs to be installed separately:
libeay32.dll ssleay32.dll from open ssl (Download the OpenSSL from here and copy/paste these two dlls under mosquitto installation director)
pthreadVC2.dll (download the dll from here and paste under mosquitto installation director)

do not install win64openSSL, even you do have 64bit OS :)
as far as mosquitto is 32bit app, it will work with Win32OpenSSL only ...

Related

Install Memcached on Windows

While doing some web development, I needed to have Memcached (source code) installed on my local machine to closely simulate what was going on my server.
How to install Memcached on Windows?
Steps to install Memcached on Windows:
Download a stable version, in either 32-bit or 64-bit I have tested the 64-bit version.
Unzip it in some hard drive folder. For example C:\memcached
There will be memcached.exe file in the unzipped folder.
Open a command prompt (need to be opened as administrator).
Run c:\memcached\memcached.exe -d install
For start and stop run following command line
c:\memcached\memcached.exe -d start
c:\memcached\memcached.exe -d stop
As told in some previous comments the v1.4.4 is sometimes coming from a trusted source, sometimes not and it becomes hard to find. But there is now a very stable Windows native port for both 32 bits and 64 bits versions.
https://github.com/jefyt/memcached-windows
It's running well on our two PHP servers (PHP7 and PHP8).
Hope this helps.
Another Cygwin version is also available here and runs well too
https://github.com/nono303/memcached

How do I install just the client tools for PostgreSQL on Windows?

I have a PostgreSQL database on a Linux system that I want to access from my Windows PC. But the only Windows binaries I have been able to find are the full installer, which includes the database server and client.
Is it possible to get a client-only Windows binary install for PostgreSQL from anywhere?
(To clarify, I want the standard PostgreSQL client, psql - not a GUI client or independent tool).
Unfortunately there is no real client "only" installer.
What you can do, is to download the ZIP archive of the complete Postgres binaries:
http://www.enterprisedb.com/products-services-training/pgbindownload
and then remove the "server" part from it.
When you unzip it, you get the following directories:
bin
doc
include
lib
pgAdmin III
share
StackBuilder
symbols
You can remove the doc, include, pgAdmin III, StackBuilder and symbols directories. As far as I can tell (but I am not sure) the client also doesn't need the share or lib directories, but you would need to test that. So that leaves only the bin directory.
I think the share directory could be needed for localized error messages in psql but I'm not sure about that.
Inside the bin directory you can essentially remove all .exe files (except psql.exe of course). You can also remove all wx*.dll files, they are only needed for pgAdmin. The libxml2.dll and libxslt.dll are also only needed for the server.
If you do want some of the other client tools, you might want to keep
pg_dump.exe
pg_dumpall.exe
pg_restore.exe
One drawback of this approach is that this requires the Visual C++ Redistributable to be installed. But you can overcome that as well by simply putting the MSVCR120.DLL from some computer where it is installed into the bin directory.
So that leaves you with these files (from the bin directory) that are required for the psql client:
iconv.dll (libiconv-2.dll in newer Postgres versions)
libeay32.dll
libintl-8.dll
libpq.dll
msvcr120.dll
ssleay32.dll
zlib1.dll
psql.exe
Of course you can also take all that from an existing Postgres installation without the need to download the ZIP archive.
It is obviously not a real installer, but if you put the cleaned up directory into a ZIP file, you can distribute that and whoever needs it just unzips the archive. Personally I find unzip to be the best "installer" anyway (I also use that to install the Postgres server, the Windows installer just has too many quirks)
As of 2020, when you click download the full installer from here , click next and next and you get the option to install only the command line - tools
. Remember to add the path to the bin folder in the PATH variable.
Actually there are client CLI tools in pgAdmin. All you need is just to install it on your Windows machine from https://www.postgresql.org/download/windows/.
Then you'll be able to find those tools in folder like C:\Program Files (x86)\pgAdmin III\1.22 or C:\Program Files (x86)\pgAdmin 4\v2\runtime, depends on the pgAdmin version you have installed.
Thanks to everyone who has posted on this thread.
For what it's worth, I got psql.exe from PostgreSQL 10.10 working under Windows 10 with just the following files from the zip archive:
libcrypto-1_1-x64.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
libssl-1_1-x64.dll
psql.exe
When connecting to AWS Redshift, I got the following error:
psql: FATAL: invalid value for parameter "client_encoding": "WIN1252"
I resolved this by running
set PGCLIENTENCODING=UTF8
I found this solution at https://forums.aws.amazon.com/thread.jspa?messageID=600088
HTH.
I realize this is an older question, but when I used the Windows installer for the latest version of Postgres (10.4), it gave me the option to install just the command line tools. I just unchecked server and pgadmin in the installer's window when prompted to choose what I wanted to install.
Below are the steps I followed to connect to Amazon Redshift with postgres12 psql on windows:
download postgres 12.4 from below location:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
run the installer which will take few minutes and prompt you for installations options
select command line tools as shown in below screenshot and install that
Above will install postgres12 command line in below folder C:\Program Files\PostgreSQL\12\bin. Make sure to add this to your PATH environment variable
open cmd and run command
set PGCLIENTENCODING=UTF8
run psql to connect to redshift. Make sure to change below parameters highlighted in red for your cluster endpoint, userid, copy script file name and log script file name respectively
psql -h redshift-cluster-1.abcdefgh.us-east-1.redshift.amazonaws.com -U demo_user -d dev -p 5439 -f d:\demo\redshift_script.sql -L d:\demo\log_redshift_script.log
all commands in redshift_script.sql file would get executed in PSQL and logs will be stored in log_redshift_script.log file
There is a third-party command-line tool available known as PGCLI - A command-line interface for Postgres with auto-completion and syntax highlighting.
Install:
pip install pgcli
Connect to POSTGRES Server from Command-line:
pgcli -h localhost -U xyz -d app_db
For official documentation, visit PGCLI
If there's pgadmin v4 installed then just copy these libraries (from C:\Program Files\pgAdmin 4\v4\runtime\):
libcrypto-1_1-x64.dll
libpq.dll
libssl-1_1-x64.dll
These were enough for me to connect from a client Windows 10 x64 PC to a remote Postgres 13 server. Note, that libraries coming with the ZIP archive mentioned above are slightly different and have more dependencies.
I kind of cheat. I install sqlbackupandftp.com on a Windows server - which has a free version that can schedule a single database backup. In the binaries, pg_dump.exe is there - typically on the C: drive like C:\Program Files (x86)\SQLBackupAndFTP\dbms\PostgreSql
I built standalone versions for windows and linux.
It has less dll dependecies and smaller size and work with many linux.
https://github.com/hemnstill/StandaloneTools/releases?q=pg_dump
You can also download "https://www.nuget.org/packages/Postgres.psql" nuget package to get "psql.exe"

Installing PacketBeat on Windows

I am unable to find a reliable way to install elastic's packetbeat on windows. I know I'll have to download source and create my own windows package. However, all instructions are outdated and are from before it moved to elastic's domain.
Anyone know how to compile this package for windows?
Download and install WinPcap from this page. WinPcap is a library that uses a driver to enable packet capturing.
Download the Packetbeat Windows zip file from here.
Extract the contents of the zip file into C:\Program Files.
Rename the packetbeat--windows directory to Packetbeat.
Open a PowerShell prompt as an Administrator (right-click the PowerShell icon and select Run As Administrator). If you are running Windows XP, you may need to download and install PowerShell.
Run the following commands to install Packetbeat as a Windows service:
PS > cd 'C:\Program Files\Packetbeat'
PS C:\Program Files\Packetbeat> .\install-service-packetbeat.ps1
Note
If script execution is disabled on your system, you need to set the execution policy for the current session to allow the script to run. For example: PowerShell.exe -ExecutionPolicy UnRestricted -File .\install-service-packetbeat.ps1.
Before starting Packetbeat, you should look at the configuration options in the configuration file, for example C:\Program Files\Packetbeat\packetbeat.yml or /etc/packetbeat/packetbeat.yml
Here is the link to the documentation of installing packetbeat on windows.
Follow the instructions on this page to install packetbeat on your windows machine.
Note:
winpcap.dll is required for packetbeat to function on a windows machine. WinPCap itself isn't currently supported, so the current best practice is to use npcap in winpcap compatibility mode instead. See this section of the Packetbeat FAQ
You can download npcap's installer here.
The command line call to install npcap (version 0.86) in winpcap compatibility mode is:
npcap-0.86.exe /winpcap_mode=yes
The silent install would be:
npcap-0.86.exe /S /winpcap_mode=yes

Cygwin Openssl uninstall

I'm a complete newbie on cygwin, it was placed on our server to configure ssh or openssl, not by me :-) .
server: windows 2003 SP2
cygwin: (cannot find version, but it says GNU bash, version 4.1.10(4)-release (i686-pc-cygwin))
OpenSSL-Win32: version 1.0.2a
In the cygwin terminal I see two things that disturb and confuse me:
If I open the cygwin terminal I can type
>$ openssl
>cygwin warning: MS-DOS style path detected: C:\OpenSSL-Win32\bin\openssl.cfg ...(etc)
So the cygwin can see the other openssl install. I would be happy with that if I would not get the following:
>OpenSSL> version
>OpenSSL 0.9.8t 18 Jan 2012
So, there seems to be be 2 versions of openssl installed, even though I think that this 0.9.8t version doesn't seem to do anything.
How do I uninstall this openSSL version?
Thanks in advance!
To uninstall any package from Cygwin, run setup.exe (which you should already have), and on the package selection screen you should search for "openssl". After that you should click the round arrow icon for the packages until it says "Uninstall", then continue.
Anyway the warning indicates that you run the win32 version, and not the cygwin package. To make sure of that, you should run this command: which openssl. This will print the path to the executable. If this path is not what you want, then use an absolute path at the command line. E.g: /cygdrive/c/path_to_openssl/openssl.exe.

GAE Go Windows - "Cannot run program", "is not a valid Win32 application"

I've been trying to run a GAE Go project I developed on my Mac on my Windows machine with GoClipse after installing and configuring the appropriate SDKs and so forth. When attempting to run the project, I get this error:
Exception occurred executing command line. Cannot run program
"C:\GoogleAppEngine\dev_appserver.py" (in directory
"D:\Golang\workspace\Project\src\pkg"): CreateProcess
error=193, %1 is not a valid Win32 application
How can I fix that error in order to run my project?
While the below configuration works on the Mac as it has Python installed by default, Windows requires a different configuration.
On Mac the GoClipse External Tools Configuration would be:
Location: /GoogleAppEngine/dev_appserver.py
Working Directory: ${workspace_loc:/Project/src/pkg}
Arguments: .
The Windows configuration should look like:
Location: C:\Python27\Python.exe
Working Directory:
Arguments: C:\GoogleAppEngine\dev_appserver.py "${workspace_loc:/Project/src/pkg}"
Trying to run .py (Which IMO is a Python file?) wont work directly on windows. You will need to install Python and then pass the above filename to Python something like (I don't know Python so don't go by exact syntax, you might need to look around)
python "C:\GoogleAppEngine\dev_appserver.py
The reason it's working on Mac is because Python comes pre-installed on mac as cited here But on windows it doesn't. So you can install Python and add the Python's bin folder to path, and then run above script and it should run fine!

Resources