Check version of opensips - switching

I'm trying to check the version of opensips on a soft switch, and the below are not yielding the results I need. How do I check what version of opensips is running?
opensips -v
opensips -version

The OpenSIPS binary also has a version option. Just run:
opensips -V
To list all options, use the help argument:
opensips -h

opensipsctl fifo version
Should show something like this....
Server:: OpenSIPS (1.7.2-tls (x86_64/linux))

Any software you can use xxx -h to find the command and almost "-v" is the command to check the version

Related

FreeBSD install supervisor

I like to install supervisor on FreeBSD. When I try to install from "/usr/ports/sysutils/py-supervisor" with "make install clean"
I get the error:
make: "/usr/ports/Mk/bsd.port.mk" line 1175: Unable to determine OS version. Either define OSVERSION, install /usr/include/sys/param.h or define SRC_BASE.
I cant find a fix on the internet. How can I install it?
For me on another port the Problem was an empty src dir.
Get the FreeBSD version via uname -a, look up your branch here https://cgit.freebsd.org/src and get the sources via.
git clone -b stable/12 --depth 1 https://git.freebsd.org/src.git /usr/src
Note: 12.2 is the latest of "stable/12" as of writing this 24.11.2021. The -b stands for branch.

wget command not found on linux server

I have a linux server (completely new, web hosting, nothing is installed into it), and want to use a "wget" command. Currently, it is not found. Kernel version 2.6.32-896.16.1.lve1.4.54.el6.x86_64
I am completely new to linux, tried to solve this issue by myself, but couldn't do it. I log in into this linux server via PuTTY via my Windows OS laptop.
wget https://www.python.org/ftp/python/3.6.6/Python-3.6.6.tgz
To get "wget" to work, I will need to install it. I guess I will need to install first "sudo" and/or "apt" and/or "apt-get". But couldn't do it. Please give me a short list of steps in which order to install them.
Given your kernel version, it looks like your Linux distribution is CentOS 6 or RHEL 6. Try installing wget with this command:
yum install wget
You must be root when you run this command.
Incase you using Debian version of Linux, use the following:
sudo apt-get install wget
From kernel version, it looks like you are using RHEL/Centos 6.
Please check -
https://centos.pkgs.org/6/centos-x86_64/wget-1.12-10.el6.x86_64.rpm.html
If the mentioned dependencies exist in your system, you can directly fire the rpm command
rpm command guide -
https://docs.fedoraproject.org/ro/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch02s03.html
If it doesn't work, you need to use yum command. (You need to configure yum command first, if not configured already)
yum install wget
To configure yum command in centos6 -
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/6/html/deployment_guide/sec-configuring_yum_and_yum_repositories
Note - you need to be root user for above activities.

apache-spark startup error on alpine linux docker

*I followed https://www.anchormen.nl/spark-docker/ and
When i executed the command ,apache startup fails saying "--" is not recognized.
I am very new to spark.Requesting help from our trusted community members.
bash /opt/spark/sbin/start-master.sh
starting org.apache.spark.deploy.master.Master, logging to /opt/spark/logs/spark--org.apache.spark.deploy.master.Master-1-e6b8f9219a40.out
failed to launch: nice -n 0 /opt/spark/bin/spark-class org.apache.spark.deploy.master.Master --host e6b8f9219a40 --port 7077 --webui-port 8080
nohup: can't execute '--': No such file or directory
full log in /opt/spark/logs/spark--org.apache.spark.deploy.master.Master-1-e6b8f9219a40.out
*
Only difference from the article is that i used alpine linux,which am restricted to.
to verify i tried to cat the log file..and got the same error. alpine linux in docker is not recognizing "--" .am i doing something wrong?
[SOLVED] thanks Robert.
if anyone looking for answer add the following in your docker-file
RUN apk update && apk upgrade && apk add curl ca-certificates tar supervisor bash procps coreutils
Your problem is here in this line
The thing is that the alpine image comes with busybox, which is a replacement of many commands including nohup and ps. So alpine comes with a non-gnu nohup which cannot handle that --, and a ps which cannot handle -p.
So, install coreutils and procps packages before any call to apache spark scripts in order to have the version of nohup and ps that you need.
In Dockerfile or container command line:
RUN apk --update add coreutils procps

wmctrl not executable while running sikulix script in headless mode

I'm using Ubuntu 14.04 lts and sikulix 1.1.0.
while running sikulix script in the ordinary way it's working great, but when i'm trying to use Xvfb just like suggested here, it's says that there is no wmctrl installed. and thats not true, this is the output in shell:
running SikuliX: -Xmx512M -Dfile.encoding=UTF-8 -Dsikuli.FromCommandLine
-jar ./sikulix.jar -r ../sikuliscripts/script.sikuli
[info] runcmd: lsb_release -i -r -s
[error] RunTimeIDE: *** terminating: command 'wmctrl' is not executable
please check the Availability!
thanks in advance!
Try to install it by
sudo apt install wmctrl
happy sikuling!
It doesn't run because wmctrl expects a window manager.
Demostration:
$ wmctrl -m
Cannot get window manager info properties.
(_NET_SUPPORTING_WM_CHECK or _WIN_SUPPORTING_WM_CHECK)
Solution is simple:
$ yum instal icewm
$ icewm&
$ wmctrl -m
Name: IceWM 1.3.8 (Linux 4.3.0-1.fc24.x86_64/x86_64)
Class: N/A
PID: 15972
Window manager's "showing the desktop" mode: N/A
IceWM is a lightweight window manager.
Credits: thanks Ramandeep Singh for providing me the clue. :-)

Which version of PostgreSQL am I running?

I'm in a corporate environment (running Debian Linux) and didn't install it myself. I access the databases using Navicat or phpPgAdmin (if that helps). I also don't have shell access to the server running the database.
Run this query from PostgreSQL:
SELECT version();
I believe this is what you are looking for,
Server version:
pg_config --version
Client version:
psql --version
Using CLI:
Server version:
$ postgres -V # Or --version. Use "locate bin/postgres" if not found.
postgres (PostgreSQL) 9.6.1
$ postgres -V | awk '{print $NF}' # Last column is version.
9.6.1
$ postgres -V | egrep -o '[0-9]{1,}\.[0-9]{1,}' # Major.Minor version
9.6
If having more than one installation of PostgreSQL, or if getting the "postgres: command not found" error:
$ locate bin/postgres | xargs -i xargs -t '{}' -V # xargs is intentionally twice.
/usr/pgsql-9.3/bin/postgres -V
postgres (PostgreSQL) 9.3.5
/usr/pgsql-9.6/bin/postgres -V
postgres (PostgreSQL) 9.6.1
If locate doesn't help, try find:
$ sudo find / -wholename '*/bin/postgres' 2>&- | xargs -i xargs -t '{}' -V # xargs is intentionally twice.
/usr/pgsql-9.6/bin/postgres -V
postgres (PostgreSQL) 9.6.1
Although postmaster can also be used instead of postgres, using postgres is preferable because postmaster is a deprecated alias of postgres.
Client version:
As relevant, login as postgres.
$ psql -V # Or --version
psql (PostgreSQL) 9.6.1
If having more than one installation of PostgreSQL:
$ locate bin/psql | xargs -i xargs -t '{}' -V # xargs is intentionally twice.
/usr/bin/psql -V
psql (PostgreSQL) 9.3.5
/usr/pgsql-9.2/bin/psql -V
psql (PostgreSQL) 9.2.9
/usr/pgsql-9.3/bin/psql -V
psql (PostgreSQL) 9.3.5
Using SQL:
Server version:
=> SELECT version();
version
--------------------------------------------------------------------------------------------------------------
PostgreSQL 9.2.9 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit
=> SHOW server_version;
server_version
----------------
9.2.9
=> SHOW server_version_num;
server_version_num
--------------------
90209
If more curious, try => SHOW all;.
Client version:
For what it's worth, a shell command can be executed within psql to show the client version of the psql executable in the path. Note that the running psql can potentially be different from the one in the path.
=> \! psql -V
psql (PostgreSQL) 9.2.9
If you're using CLI and you're a postgres user, then you can do this:
psql -c "SELECT version();"
Possible output:
version
-------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11.1 (Debian 11.1-3.pgdg80+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 4.9.2-10+deb8u2) 4.9.2, 64-bit
(1 row)
The accepted answer is great, but if you need to interact programmatically with PostgreSQL version maybe it's better to do:
SELECT current_setting('server_version_num'); -- Returns 90603 (9.6.3)
-- Or using SHOW command:
SHOW server_version_num; -- Returns 90603 too
It will return server version as an integer. This is how server version is tested in PostgreSQL source, e.g.:
/*
* This is a C code from pg_dump source.
* It will do something if PostgreSQL remote version (server) is lower than 9.1.0
*/
if (fout->remoteVersion < 90100)
/*
* Do something...
*/
More info here and here.
Execute command
psql -V
Where
V must be in capital.
in shell psql.exe , execute
\! psql -V
Using pgadmin4 it can be seen by double clicking Servers > server_name_here > Properties tab > Version:
Version 3.5:
Version 4.1, 4.5:
A simple way is to check the version by typing psql --version in terminal
In my case
$psql
postgres=# \g
postgres=# SELECT version();
version
---------------------------------------------------------------------------------------------------------------------
PostgreSQL 8.4.21 on x86_64-pc-linux-gnu, compiled by GCC gcc-4.6.real (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
(1 row)
Hope it will help someone
The pg_config command will report the directory where the PostgreSQL programs are installed (--bindir), the location of C include files (--includedir) and object code libraries (--libdir), and the version of PostgreSQL (--version):
$ pg_config --version
PostgreSQL 9.3.6
use VERSION special variable
$psql -c "\echo :VERSION"
Using command line
Server:
postgres -V
Client:
psql -V
Login to postgres then:
postgres=# select version();
Or from cli:
psql -c "SELECT version();"
Use VERSION special variable
Login as postgres user:
sudo su - postgres
Then:
psql -c "\echo :VERSION"
Check out this guide here for full explaination
If you are already using for tool(used DBeaver) to connect PostgreSQL, it will look like this :
Useful Queries to Chck PostgreSQL Database Version
bash-4.1$ psql
postgres=# SELECT version();
postgres=# SHOW server_version;
To Check PostgreSQL Client Version.
bash-4.1$ psql --version
psql (PostgreSQL) 12.1
Run this query from PostgreSQL:
SELECT version();
If you have shell access to the server (the question mentions op does not have, but in case you have,) on a debian/ubuntu system
sudo apt-cache policy postgresql
which will output the installed version,
postgresql:
Installed: 9.6+184ubuntu1.1
Candidate: 9.6+184ubuntu1.1
Version table:
*** 9.6+184ubuntu1.1 500
500 http://in.archive.ubuntu.com/ubuntu artful-updates/main amd64 Packages
500 http://in.archive.ubuntu.com/ubuntu artful-updates/main i386 Packages
500 http://security.ubuntu.com/ubuntu artful-security/main amd64 Packages
500 http://security.ubuntu.com/ubuntu artful-security/main i386 Packages
100 /var/lib/dpkg/status
9.6+184ubuntu1 500
500 http://in.archive.ubuntu.com/ubuntu artful/main amd64 Packages
500 http://in.archive.ubuntu.com/ubuntu artful/main i386 Packages
where the Installed: <version> is the installed postgres package version.
Don’t know how reliable this is, but you can get two tokens of version fully automatically:
psql --version 2>&1 | tail -1 | awk '{print $3}' | sed 's/\./ /g' | awk '{print $1 "." $2}'
So you can build paths to binaries:
/usr/lib/postgresql/9.2/bin/postgres
Just replace 9.2 with this command.
For the current version of PgAdmin: 4.16 at the time of writing.
Select the DB server whose version you need.
Click on the properties tab in
the right pane.
See screenshot below:
This is quite an old question with many good answers. I found that from version 12 onwards, simply invoking the client tells me what I need to know, but I ran them on the server's shell. Examples below with output.
When I was on version 12:
$ sudo su postgres -c "psql"
psql (12.8 (Ubuntu 12.8-0ubuntu0.20.04.1))
I read this as both the client and the server are at version 12.
After I upgraded Ubuntu from 20.04 to 21.04:
$ sudo su postgres -c "psql"
psql (13.4 (Ubuntu 13.4-0ubuntu0.21.04.1), server 12.8 (Ubuntu 12.8-0ubuntu0.20.04.1))
It's telling me clearly that the client is on version 13 but the server is still on 12, as I confirmed:
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 online postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
Notice, by the way, this misleading result, at this stage:
$ pg_config --version
PostgreSQL 13.4 (Ubuntu 13.4-0ubuntu0.21.04.1)
After I upgraded to version 14:
$ sudo su postgres -c "psql"
psql (14.0 (Ubuntu 14.0-1.pgdg21.04+1))
Type "help" for help.
postgres=#
Again, I interpret it as both the client and the server being on version 14, confirmed once more:
$ pg_lsclusters
Ver Cluster Port Status Owner Data directory Log file
12 main 5432 down,binaries_missing postgres /var/lib/postgresql/12/main /var/log/postgresql/postgresql-12-main.log
14 main 5433 online postgres /var/lib/postgresql/14/main /var/log/postgresql/postgresql-14-main.log
This version is, by the way, the same obtained by running the SELECT version(); query.
If Select version() returns with Memo try using the command this way:
Select version::char(100)
or
Select version::varchar(100)

Resources