cx_Oracle on linux: ImportError: libclntsh.so.12.1: cannot open shared object file: No such file or directory - cx-oracle

I'm having problems using cx_Oracle on a linux system. I get the error message: libclntsh.so.12.1: cannot open shared object file: No such file or directory.
What exactly do I need to install to make it work?

You need to install an Oracle client. The simplest is the Oracle Instant client which you can download from here:
http://www.oracle.com/technetwork/database/features/instant-client/index.html
Follow the instructions at the bottom of the page for the specific platform you are using. If you are using an RPM based distribution you can simply install the RPMs which do all of the dirty work for you!

Related

Ghidra headless analyzer

I am trying to decompile nodejs bytecode using ghidra, and there is this specific plugin which decompiles the the nodejs bytecode. How can I install that plugin using ghidra headless method?
And another question I have is, after analysing the nodejs bytecode it generated a .rep folder, which I am not sure what to do about now, as I thought it will be giving me the source code after analysis.
Thanks in advance :)
Installing a plugin in Ghidra via GUI is just an unzip with extra checks. Headless install is described in the doc at https://ghidra-sre.org/InstallationGuide.html#GhidraExtensionNotes
To install an extension in these cases, simply extract the desired Ghidra extension archive file(s) to the /Ghidra/Extensions directory. For example, on Linux or macOS:
Set current directory to the Ghidra installed-extensions directory: cd <GhidraInstallDir>/Ghidra/Extensions
Extract desired extension archive file(s) to the current directory:
unzip /path/to/<extension>.zip
The extension(s) will be installed the next time Ghidra is started.
How to dump the source code will depend on the plugin you are using, without a link it's hard to tell. I guess it just allows disassembling NodeJS bytecode, so you have to use the regular Ghidra APIs or scripts to dump disassembly?

How to properly install Ghostscript under Linux as shared library

The link on this page (https://www.ghostscript.com/download.html) for Linux x64, gets you a .tgz with an executable binary.
However, while trying to use this binary as an .so, (after renaming it into libgs.so and putting into appropriate place) via Ghost4J, I invariably get errors as follows:
java.lang.UnsatisfiedLinkError: /tmp/jna-100923095/jna3513656669313044092.tmp: cannot dynamically load executable
Once I install the Ghostscript via apt-get install ghostscript, the same code runs fine (as it now loads an .so from /usr/lib/x86_64-linux-gnu/libgs.so.9.22)
Question: which minimal set of files should I put to some folder, so that I could link to Ghostscript dynamic library (.so) successfully, without Ghostscript being installed on the machine/container?
UPD: under Windows, this seems to be possible, the /bin folder of the installation contains both DLL and EXE files; if I put that .dll file into a win32-x86-64 folder under resources, it is being picked up by JNA (via Ghost4j) and Ghostscript instance works fine, even once I remove the "official" installation). I would like to have same behaviour (i.e. self-sufficient, self-containing JAR file) for Linux as well.
Well, I ended up building the shared object myself, using Ubuntu 18.04 installed as WSL 1 distribution, following the guidelines from here: https://www.ghostscript.com/doc/current/Make.htm#Shared_object
These were the exact commands:
./configure --without-luratech --with-system-libtiff --with-drivers=PCLXL
make so
and then, in the sobin folder, you have libgs.so, that works as expected. But sad it's not possible to download it from the official site.

Deploy instant oracle on Pivotal CloudFoundry for cx_Oracle

so im trying to push a python api with cx_oracle dependency which also need oracle instant client,but i couldnt found an tutorial to deploy instant client on pcf,is anybody ever do this before or have any example what should be done? appreciate it
Update:
This is the inside of my .profile
LD_LIBRARY_PATH=/home/vcap/app/oracle/instantclient:${LD_LIBRARY_PATH:-}
export OCI_LIB_DIR=/home/vcap/app/oracle/instantclient
export OCI_INC_DIR=/home/vcap/app/oracle/instantclient/sdk/include
export PYTHONPATH=/home/vcap/app/vendor:$PYTHONPATH
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib
Use the zip installer of the Oracle Instant Client and not a package manager.
Extract the files to a subfolder under your application, like oracle/.
Install cx-Oracle like normal with pip.
Generate requirements.txt.
Add a file with the exact name of .profile to the root of your application, in it put export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/vcap/app/oracle/lib (where /home/vcap/app is the path to your application files and oracle/lib is the path to the lib directory beneath the folder where you extracted files in step #2).
Then push your app.
The .profile file will run before your actual application starts and it will adjust the library search path so that the Oracle client libraries can be found.
If you get the error:
cx_Oracle.DatabaseError: DPI-1047: Cannot locate a 64-bit Oracle Client library: "/home/vcap/app/oracle/instantclient/libclntsh.so: file too short"
Double check your .profile script and make sure that you have the correct LD_LIBRARY_PATH setting.

How to fix service error Oracle jws webserver

After RHEL6-7 migration setting up oracle jws web servers says "error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory "
/apps/oracle/jws-webserver-3.0.3/jws_proxy/httpd/sbin/httpd: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
Well, it looks like your migration messed up a couple of things.
Check if you actually have or not the library.
find / -name libpcre.so.1
If you do, then check your LD_LIBRARY_PATH, if not, then add the path to it so the binary can get it.
Another option is, pcre is not even installed, then process to get it and install it.

Freeswitch mod_java installation problem

I am trying to install mod_java on ubuntu.
I have installed the latest java(1.6).
I have configured freeswitch with mod_java module enabled in module.conf.xml
then when i run the make file, it says:
freeswitch_java.h:5:17: error: jni.h: No such file or directory
I have searched through the java installtion folders, but did not find any include folder or jni.h.
Can anyone help, what is being the problem here.
Thanks for reading this question.
I had the same problem. The solution was to run configure with the option --with-java:
./configure --with-java=/usr/lib/jvm/java-1.6.0-openjdk/include/
I don't know if it makes any difference but I added mod_java after building freeswitch without it. It was disabled in my initial build in module.conf.xml but afterwards I ran the above command plus:
make mod_java-install
It worked for me on ubuntu with openjdk. Are you using the Sun JDK? Maybe in the version you have dont have the include folder which has the source files. Try installing the other JDK. Or try and see of ther are some other related packages in apt that will get you the include folder.
Type this linux command to locate your jni.h file on your filesystem.
locate jni.h
you should be able to get it somewhere
in /usr/lib/java directory or some other directory
depending upon your java home.
copy paste the jni.h in src/include folder of your freeswitch src.
It will throw you some more errors for different .h files
just copy all of them to your src/include folder.
in latest freeswitch, installing through Makefile, its not possible to configure as the Makefile downloads and installs. Its possible by modifying the Makefile.in file to add the include path
mod_java_la_CPPFLAGS
-I/usr/lib/jvm/default-java/include \

Resources