Installing PacketBeat on Windows - 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

Related

Is it possible install Ubuntu in Windows 10 WSL without Microsoft Store? [closed]

Closed. This question is not about programming or software development. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 21 days ago.
The community reviewed whether to reopen this question 21 days ago and left it closed:
Original close reason(s) were not resolved
Improve this question
On my work are not allowed to install apps from the Microsoft Store. Yes, this is a bank, that not supported Windows 10 (it's hell).
Is it possible to install Ubuntu in WSL without downloading it from the app store?
Or is it possible to download Ubuntu app without Microsoft Store and then install it?
Yes, it is possible to download the app without the Store. Some available distributions are listed in the Manual Installation section of the MS guide (https://learn.microsoft.com/en-us/windows/wsl/install-manual)
The actual manual installation instructions are hidden in the Server Install section of the manual (https://learn.microsoft.com/en-us/windows/wsl/install-on-server), but my understanding is that you can just run the .appx file you downloaded and it should work anyway.
Whether it's wise to install WSL/Ubuntu on a work computer that you don't control is another question, but one which only you can answer.
I had the same problem, could do it like this (from PowerShell):
# go into some folder into which you want the file to be downloaded
cd <somefolder>
# download Ubuntu 20.04
Invoke-WebRequest -Uri https://aka.ms/wslubuntu2004 -OutFile Ubuntu.appx -UseBasicParsing
# install downloaded *.appx file
Add-AppxPackage .\Ubuntu.appx
Afterwards I did Windows+S and typed "Ubuntu" to show the installed app, then executed it to finish setup (new user name + password must be given).
I checked the success doing: wsl --list --verbose and received this:
NAME STATE VERSION
Ubuntu-20.04 Running 1
So finally, I needed to convert my Ubuntu to WSL2 like this:
wsl --set-version Ubuntu-20.04 2
Voila!
I created a powershell script to install wsl2 with optional X-Windows and Pulse Audio support. I also captured my experience with installing wsl without Store access in the Readme.md.
For the detail see here: https://github.com/andras-varro/wsl2i
I believe these are the most important points:
Check if your installation supports WSL2: Windows logo key + R, type winver [enter]. You should have Version 1903 or higher, with Build 18362 or higher
Enable WSL2
Open an admin prompt (Press shift+ctrl and click on PowerShell/cmd)
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Reboot your computer
Download and install the WSL2 kernel from: https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
Open a PowerShell or cmd and execute:
wsl --set-default-version 2
Install a Linux distro
Please only download an available distro from here: https://learn.microsoft.com/en-us/windows/wsl/install-manual
Explanation: if you install through appx installer without Windows Store enabled, you might run into a 'File not found' or 0x80070002 error.
Create a location on your system drive (see: https://learn.microsoft.com/en-us/windows/wsl/install-win10#troubleshooting-installation, but it works for me on D: drive) where you want your distro to run from (like c:\work\wsl)
Extract the downloaded distro appx file using your favorite zip tool (7Zip or WinZip or ..) into the selected location (Right click on the appx and extract to the created folder (like c:\work\wsl))
Set access rights for your Linux installer folder so that everybody has all the rights
Open a cmd or PowerShell and execute: icacls [your folder] /t /grant Everyone:(OI)(CI)F
Example: icacls c:\work\wsl /t /grant Everyone:(OI)(CI)F
Start the setup as Administrator. Example with Ubuntu: right click on ubuntu2004.exe and select Run as adminsitrator
Follow the on screen instructions
Test your WSL2
After the setup finished and you have the Linux command prompt try to start bash from Windows' Run (Win+R)
Exit from the started bash and from the bash you got after the installation
Start bash from Windows' Run (Win+R) (again)
Yes, It is possible to install Ubuntu without opening the store.
Open settings in windows and enable developer mode.
Once the developer mode is enabled, Go to Windows search and Type Bash.
It will open Bash command prompt. Allow it to download Ubuntu automatically.
Cheers!!!
You can use winget (Windows Package Manager):
winget install -e --id Canonical.Ubuntu
To get another version than the "latest", search for them via:
winget search -s winget Ubuntu
If you omit the -s winget option, the versions from other sources like the Microsoft store will be displayed too.
In an administrator PowerShell or Windows Command Prompt and then restarting your machine:
wsl --install --distribution Ubuntu
You can get distributions list by:
wsl --list --online

Run appx file in current Windows 10 device using the PowerShell cmdlets

I have an appx file which was generated elsewhere and I would like to test it in my Windows 10 machine.
The appx file is already available to me and I can deploy it to other devices using the WinAppDeployCmd, which works for the XBox One. This works perfectly with the following command:
WinAppDeployCmd install -file "!MY_FILE!" -ip "!DEVICE_IP!" -pin "!DEVICE_PIN!"
My question is, is there a similar command to simply run my .appx in the windows machine where it currently is? Is there perhaps even a way to use the WinAppDeployCmd to install it in the current machine?
I don't know about cmd, but in PowerShell you can use
Add-AppxPackage -Path C:\Users\User\MyApp.appx
If the package is unsigned, you will need to enable developer mode in Windows 10 before it can be installed.
Open Settings.
Click on Update & security
Click on For developers.
Under “Use developer features”, enable Developer mode.
More information on Add-AppxPackage: https://technet.microsoft.com/en-us/library/hh856048.aspx
Update: Regarding using WinAppDeployCmd for this see: Can I Use WinAppDeployCmd install, update on pc itself

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"

MSOnline can't be imported on PowerShell (Connect-MsolService error)

I had this issue and couldn´t find any answer. The issue was that I was trying to use Azure cdmlets to connect to O365 via c# code, but I couldn´t get the connect-msolservice.
""The term is not recognized" error when you try to run administrative Windows PowerShell cmdlets in Office 365"
After reviewing Microsoft's TechNet article "Azure Active Directory Cmdlets" -> section "Install the Azure AD Module", it seems that this process has been drastically simplified, thankfully.
As of 2016/06/30, in order to successfully execute the PowerShell commands Import-Module MSOnline and Connect-MsolService, you will need to install the following applications (64-bit only):
Applicable Operating Systems: Windows 7 to 10
Name: "Microsoft Online Services Sign-in Assistant for IT Professionals RTW"
Version: 7.250.4556.0 (latest)
Installer URL: https://www.microsoft.com/en-us/download/details.aspx?id=41950
Installer file name: msoidcli_64.msi
Applicable Operating Systems: Windows 7 to 10
Name: "Windows Azure Active Directory Module for Windows PowerShell"
Version: Unknown but the latest installer file's SHA-256 hash is D077CF49077EE133523C1D3AE9A4BF437D220B16D651005BBC12F7BDAD1BF313
Installer URL: https://technet.microsoft.com/en-us/library/dn975125.aspx
Installer file name: AdministrationConfig-en.msi
Applicable Operating Systems: Windows 7 only
Name: "Windows PowerShell 3.0"
Version: 3.0 (later versions will probably work too)
Installer URL: https://www.microsoft.com/en-us/download/details.aspx?id=34595
Installer file name: Windows6.1-KB2506143-x64.msu
After hours of searching and trying I found out that on a x64 server the MSOnline modules must be installed for x64, and some programs that need to run them are using the x86 PS version, so they will never find it.
[SOLUTION]
What I did to solve the issue was:
Copy the folders called MSOnline and MSOnline Extended from the source
C:\Windows\System32\WindowsPowerShell\v1.0\Modules\
to the folder
C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules\
And then in PS run the Import-Module MSOnline, and it will automatically get the module :D
The solution with copying 32-bit libs over to 64-bit did not work for me. What worked was unchecking Target Platform Prefer 32-bit check mark in project properties.
I'm using a newer version of the SPO Management Shell. For me to get the error to go away, I changed my Import-Module statement to use:
Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking;
I also use the newer command:
Connect-SPOService
Connects to both Office 365 and Exchange Online in one easy to use script.
REMINDER: You must have the following installed in order to manage Office 365 via PowerShell.
Microsoft Online Services Sign-in Assistant:
http://go.microsoft.com/fwlink/?LinkId=286152
Azure AD Module for Windows PowerShell
32 bit - http://go.microsoft.com/fwlink/p/?linkid=236298
64 bit - http://go.microsoft.com/fwlink/p/?linkid=236297
MORE INFORMATION FOUND HERE:
http://technet.microsoft.com/en-us/library/hh974317.aspx
The following is needed:
MS Online Services Assistant needs to be downloaded and installed.
MS Online Module for PowerShell needs to be downloaded and installed
Connect to Microsoft Online in PowerShell
Source: http://www.msdigest.net/2012/03/how-to-connect-to-office-365-with-powershell/
Then
Follow this one if you're running a 64bits computer:
I’m running a x64 OS currently (Win8 Pro).
Copy the folder MSOnline from (1) –> (2) as seen here
1) C:\Windows\System32\WindowsPowerShell\v1.0\Modules(MSOnline)
2) C:\Windows\SysWOW64\WindowsPowerShell\v1.0\Modules(MSOnline)
Source: http://blog.clauskonrad.net/2013/06/powershell-and-c-cant-load-msonline.html
Hope this is better and can save some people's time

Chocolatey setup on USB drive

I'm trying to set up Chocolatey for the first time. My ultimate goal is to be able to install the packages on a USB drive which shows up in my computer as F: so following the directions in the Chocolatey wiki, I created a folder on the F drive called Chocolatey and set an environmental variable ChocolateyInstall to F:/Chocolatey. I followed the basic directions, by opening up a command prompt and then pasting in the following.
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%systemdrive%\chocolatey\bin
After installation I went to the PowerShell command prompt as follows and tried to install Notepad++ I got the following:
C:\Windows\system32>cinst notepadplusplus
The filename, directory name, or volume label syntax is incorrect.
How can I fix this problem?
It appears that you went to a custom location with Chocolatey's install. When it finished the install, did it say it was installed on F:/chocolatey? Is it actually installed there? If so, take a look at your path environment variable and see if that is included in the path. Also close and reopen the shell/command line. Does it work now? If the path (user PATH) has the choco location in it and the shell/command line is not proper after reloading, then reboot and see if that fixes the issue.
If all of that is good, type just chocolatey /? and see what you get. Then try cinst again. If it has issues again, try cinst pkgname -debug and see where the error happens.
NOTE: Trying to install Chocolatey to a USB drive is not a supported case. Sure you might be able to get it to work but I'm not sure what you really gain. Say you install Notepad++, now it is installed to the system (not the USB drive). What do you gain by having the choco repository on the USB drive?

Resources