How can I get the names of the applications that are installed on an application server? - unix

I have an SSH access to my application. Is there any UNIX code that I can use to get the name of the applications installed?
Thanks!

Actually I don't understand when you talk about "my applicattion" or "applications installed" what are you exactly refering.
1) If you want to know what applications are deployed, for example in the application server of your instance, for example Tomcat 7 you can take a look here: List Currently Deployed Applications
2) Or maybe you are looking for SO installed applications.
Depeending on what OS is running may be different. For example for Red Hat Enterprise / Fedora Linux / Suse Linux / Cent OS:
Under Red Hat/Fedora Linux:
$ rpm -qa | grep {package-name}
For example find out package mutt installed or not:
$ rpm -qa | grep mutt
Output:
mutt-1.4.1-10
If you don't get any output ( package name along with version), it means package is not installed at all. You can display list all installed packages with the following command:
$ rpm -qa
$ rpm -qa | less
3) Another useful command is ps command. You can check what is running with the ps command.
Type the following ps command to display all running process:
ps aux | less
Where,
A: select all processes
a: select all processes on a terminal, including those of other users
x: select processes without controlling ttys
Task: see every process on the system
ps -A
ps -e

Related

/etc/init.d/netfs equivalent RHEL 7

I just migrated from RHEL 6 to RHEL 7. I used to call the following in order to list active NFS mounts:
/etc/init.d/netfs status
That would provide this kind of output:
Configured NFS mountpoints:
/data
Active NFS mountpoints:
/data
Since RHEL 7 doesn't use this script anymore, could you please let me know what the equivalent would be? (if there is one)
Thanks!
Run the following command :
mount -l | grep nfs
Another way :
cat /proc/mounts | grep nfs
Also this command is used to get more information about the mountpoints :
nfsstat

Ansible package warning when using sudo

I was following this doc to install shiny package in RedHat 7.3. The command provided in the doc is:
$ sudo su - \
-c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\""
In Ansible, I wrote it like this:
- name: Installing Shiny Packages
shell: sudo su - -c "R -e \"install.packages('shiny', repos='https://cran.rstudio.com/')\""
#when: install_R|changed
I am getting a warning when I run my playbook:
TASK [Installing Shiny Packages] ***********************************************
[WARNING]: Consider using 'become', 'become_method', and 'become_user' rather
than running sudo
changed: [test]
Please let me know how to write this in ansible so that I can avoid the warning.
It is probably because of the outdated sudo usage from version 1.9. From the official Ansible documentation.
Before 1.9 Ansible mostly allowed the use of sudo and a limited use of su to allow a login/remote user to become a different user and execute tasks, create resources with the 2nd user’s permissions. As of 1.9, become supersedes the old sudo/su, while still being backwards compatible.
You can remove it by using the become module which allows you to 'become' another user, different from the user that logged into the machine (remote user). You need to set to true to activate privilege escalation.
name: Installing Shiny Packages
shell: R -e "install.packages('shiny', repos='https://cran.rstudio.com/')"
become: true

Meteor js application cause stuck cpu 100%

i have a small meteor js app suddenly it starts using 100% cpu. i found some blogs that says maybe oplog causing the height usage of the cpu so i've disabled it using:
meteor add disable-oplog
but it did not changing anything. i'm facing this issue on the development environment ( run the app through " meteor " command ) and on the deployment environment (run the app remotly using mup ).
development environment : ubuntu 14.0 2G 64Bit meteor 1.3 node js 0.10.45.
deployment environment (droplet): ubuntu 14.0 512Mb 64Bit meteor 1.3 node js 0.10.45.
installed packages:
monitoring process:
I've run into this problem before, but only when running too many production Meteor development enviornments on one server for too long.
It was the swap solution I put in place. Meteor apps can use a lot of memory, and 512MB can be too little. It was swapping all the time, which oddly showed up as a CPU spike. Once I put a better swap configuration in place, all was fine.
This was on an Ubuntu server, I can't recall if it was 14 or 16. On Digital Ocean hosting (they have Swap disabled by default, and the solution I put in place first was apparently bad).
It may not be likely this is the answer for you, but I'm writing it up as it's certainly possible, and can be very hard to figure out.
Maybe you can try using CPU limiter here's a bash script I created
https://gist.github.com/cortezcristian/5ab4fdddcc573972d44873f1e97a2b88
You'll need to install cpu limiter first:
sudo apt-get install cpulimit
ps ax | grep node | grep meteor | grep -v grep | awk '{print $1}' > /tmp/my-app.pid
cpulimit --p $(cat /tmp/my-app.pid) --limit 77
After that you can choose the limit you want 50 / 100 with the --limit flag.

How to use Qt's 'windeployqt' in Linux / Fedora

I'm currently trying to cross-compile my Qt apps on a Fedora 21 machine to Windows (32 bit, for now). Compilation works without problems, but deployment doesn't. Of cours, I could copy all the necessary files out of the directories, but I think that's a waste of time, so I want to use Qt's 'windeployqt' tool.
But whenever I invoke it, e.g. in Qt Creator as a build step, it just puts out this message(my test application is called day_404 :D) :
Unable to find dependent libraries of /home/marius/Entwicklung/build-day_404-Windows_32bit-Release/release/day_404.exe :Not implemented.
Does any of you know how to fix this, and use windeployqt without using Windows?
Thanks in advance,
Marius
The windeployqt tool doesn't seem to be usable on Fedora 23. It relies on accessing qmake, thus, it doesn't work in the mingw cross-compile environment, where you build with mingw32-qmake-qt5 (or mingw64-qmake-qt5). Even if this issue is patched - it wouldn't work with Qt5 projects using mingw64-cmake.
A relatively simple way to get a list of all DLLs that need to be copied for deployment is to run the application under wine and trace all dll loads.
For example like this:
$ WINEDEBUG=+loaddll wine ./myapp 2> dll.log
The dll paths can be extracted like that:
$ grep Loaded dll.log | grep -v 'system32\|:load_builtin_dll' \
| awk -F'"' '{print $2}' \
| sed -e 's#\\\\#/#g' -e 's/^[A-Z]://' \
| sort > dll.lst
The file dll.lst looks like this for a typical Qt5 project cross-compiled with mingw64:
/path/to/cwd/myapp.exe
/path/to/cwd/project.dll
[..]
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libpng16-16.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libstdc++-6.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libwinpthread-1.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libxml2-2.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt5Core.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt5Gui.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/Qt5Widgets.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/zlib1.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qgif.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qico.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qjpeg.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/platforms/qwindows.dll
You can then deploy those files like this:
$ mkdir -p "$deploy_dir"/{imageformats,platforms}
$ for i in imageformats platforms ; do
grep "/plugins/$i" dll.lst | xargs -r cp -t "$deploy_dir"/$i
done
$ grep -v '/plugins/' dll.lst | xargs -r cp -t "$deploy_dir"
Wine Config
For running a cross-compiled binary under wine, the mingw dll directory has to be added to the wine path, e.g. via:
sed 's/^\("PATH".*\)"$/\1;Z:\\\\usr\\\\x86_64-w64-mingw32\\\\sys-root\\\\mingw\\\\bin"/' \
-i $HOME/.wine/system.reg
The file ~/.wine/system.reg is automatically created by wine if it is doesn't exist, yet.
PELDD
You can also use the tool peldd to get a list of all DLLs that a windows binary depends on. The tool runs on Linux, e.g.:
$ peldd myapp.exe -a -p . \
| sed -e 's#^\./#'"$PWD"'/#' -e 's#^\([^/]\)#'"$PWD"'/\1#' \
| sort > dll2.lst
The tool transitively walks all dependencies as compiled into the binaries - but - DLLs that are conditionally loaded at runtime (think dlopen(), think Qt plugin) don't leave traces in the binary headers. In contrast to that: when running under wine, those DLLs are recorded, as well. For our example, this could be:
/usr/x86_64-w64-mingw32/sys-root/mingw/bin/libjpeg-62.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qgif.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qico.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/imageformats/qjpeg.dll
/usr/x86_64-w64-mingw32/sys-root/mingw/lib/qt5/plugins/platforms/qwindows.dll

How to install R on Solaris on a VirtualBox virtual machine?

This Q&A is a response to this comment. The answer to the question in the comment is not trivial, is too big for a comment, and not suitable as an answer to the question in that thread (answering my own question is officially encouraged). If you have a better answer please post it!
The question is: How to install R on Solaris on a VirtualBox virtual machine?
A more up-to-date version is available from csw: r_base. To install, see the example in Getting started where you replace vim with r_base:
pkgadd -d http://get.opencsw.org/now
/opt/csw/bin/pkgutil -U
/opt/csw/bin/pkgutil -a r_base
/opt/csw/bin/pkgutil -y -i r_base
To install a development environment, you might also want:
/opt/csw/bin/pkgutil -y -i gcc4g++
/opt/csw/bin/pkgutil -y -i texlive
Start by downloading and installing Oracle VM VirtualBox.
Then download and unzip the Oracle Solaris 11.1 VirtualBox Template. After you unzip the Oracle template you should see a file called OracleSolaris11_1.ova, that's what you'll open in VirtualBox.
Start VirtualBox, click on File, then Import Appliance, then navigate to chose the ova file you just extracted. It will take some time to import.
Start the Solaris virtual machine by clicking on the start button on VirtualBox. It will take some time to start up and you'll be prompted to add a root password, user name and user password. You'll then use those details to log in, wait for the system to load, choose gnome to ensure you get a desktop environment, and choose your time zone, keyboard layout and language (mine seems to highlight Chinese as the default choice, so be careful not to click through that one too quickly).
Eventually you'll get a desktop, right-click on the desktop and click open terminal, then in the terminal type (or paste):
sudo wget https://oss.oracle.com/ORD/ord-3.0.1-sol10-x86-64-sunstudio12u3.tar.gz && sudo wget https://oss.oracle.com/ORD/ord-3.0.1-supporting-sol10-x86-64-sunstudio12u3.tar.gz
That will connect to the internet and download two files you need. The next line will unpack those two archives:
sudo tar -xzvf ord-3.0.1-sol10-x86-64-sunstudio12u3.tar.gz && sudo tar -xzvf ord-3.0.1-supporting-sol10-x86-64-sunstudio12u3.tar.gz
And then this next line installs R, watch for the prompts after you run the line:
sudo bash install.sh
A lot will flash by in the terminal, concluding with Installation of <ORD> was successful
Now the next bit is where I deviate from the instructions here because I didn't understand them. You'll move all files beginning with lib from the archives that you unpacked into another directory where they are needed by R:
sudo mv lib* /usr/lib/64/R/lib/
That will return nothing in the terminal. Then we can run R simply by typing in the terminal like so
R
And now you should have a regular R session running in the terminal.

Resources