w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Resolve GCC error when installing python-ldap on Redhat Enterprise Server
But wait! I can help you, because I figured it out after a copious amount of cursing! Step 1: Verify Prerequisites are Installed According to the docs you must have OpenLDAP libraries installed on your system. At the time that I'm writing the version requirement for the libraries was >= 2.4.11 To see whether or not you have such libraries installed on your system, run this command: yum list installed openldap* Here is the output from my system as an example of what you might see: PACKAGE VERSION openldap24-libs.i386 2.4.23-5.el5 openldap24-libs.x86_64 2.4.23-5.el5 openldap2

Categories : Python

How to fix TPM in Redhat Linux? RedHat Linux hang on first time to boot after installing
After all my search I found out that in Redhat 6 there is a problem tboot and best way to fix it is to remove tboot package (it is located in System Base>Base>tboot.6) For more info about tboot you can check these links: enter link description here

Categories : Linux

How to install gcc onto a RedHat Enterprise 5 virtual machine?
Your .tar.gz probably didn't work because it was the raw source code for GCC. The source for the compiler requires a compiler to build it — the classic chicken & egg problem. To get around this, you'd need to get a precompiled compiler for your system's architecture. GCC is not offered in a precompiled form by the FSF, as far as I know. If you're ever interested in actually trying to build a Linux system from the ground up like that, you might find Linux From Scratch interesting. You'll probably not even need GCC to get rsync, tcl, etc. There are almost certainly pre-built packages available from yum repos for those tools. As @PeteyT said, RHEL uses a subscription to allow you to access packages using yum. You can learn more from the Red Hat Subscription Management Guide. If you do

Categories : Linux

Installing Maven 3.0.5 in RedHat Linux
The first thing we need to do is to download the Maven tar file and untar it to a shared location on the workstation wget http://mirrors.gigenet.com/apache/maven/maven-3/3.0.5/binaries/apache-maven-3.0.5-bin.tar.gz su -c "tar -zxvf apache-maven-3.0.5-bin.tar.gz -C /opt/" Setup the Maven Environment Variables in shared profile. The next step is to setup the Maven environment variables in a shared profile so all users on the system will get them import at login time. su -c "vi /etc/profile.d/maven.sh" # Add the following lines to maven.sh export M2_HOME=/opt/apache-maven-3.0.5 export M2=$M2_HOME/bin PATH=$M2:$PATH Now test your install of Maven. Logout of the system and then log back into it. Enter the following command: [jsmith@regan ~]$ mvn -version If you did everything right

Categories : Linux

Installing RubyOnRails on a RedHat linux box
Use RVM and it will be a matter of copy pasting a command and you are done. https://rvm.io/rvm/install To install both Ruby and Rails: curl -L https://get.rvm.io | bash -s stable --rails

Categories : Ruby On Rails

to use latest GCC(4.8.1) on older Linux Svrs (Redhat EL 5.7)
You need to install the required dependencies (and their required versions) to build GCC 4.8; notice that MPFR, CLOOG etc are only needed to the compiler (so are needed at compilation time, not at run time of your compiled program), so you don't need to install them to deploy your compiled program. Don't link the compiler to older versions of required dependencies. The gcc-4.8 source tarball has a contrib/download_prerequisites script which could be helpful. If building GCC 4.8 from source tarball, don't forget to build outside of the source tree, and to follow the install instruction. You may want to link your program with the -static-libgcc option, or even to ..../configure the compiler with --disable-shared and --program-suffix=-4.8 configure options (with that program-suffix option

Categories : Linux

.dat attachment instead of text using mailx in RedHat Linux
Make sure that your file encoding is the same as the locale (man locale) set on your system. Either convert your file (e.g. using iconv) to the according locale or set the locale of the system to the current file encoding. Moreover make sure to remove any carriage returns from the file cat test_1.txt | tr -d ' ' > test_2.txt; Then cat test_2.txt | mailx -s 'Test' me@email.ca; should work correctly.

Categories : Linux

Invalid configuration i686-redhat-linux-gnu on CentOS
i also run into the same problem, according to qmailtoaster installation script the command suppose to be rpmbuild --rebuild --with cnt5064 vqadmin-toaster-2.3.7-1.4.1.src.rpm built it has the same error msg as above and I Google around and found out vqadmin build error many of our programs are running automake versions that PREDATE 64-bit linux... and while most apps will build just fine (albeit less optimized), vqadmin 2.3.7 does NOT build successfully in this "unknown-linux" environment. He offers a x86_64 rpm at the bottom

Categories : Linux

Linux Redhat Command Execution via executable files
Yes. Use BASH, the shell common to most Linux distributions. You will find the "Advanced BASH scripting Guide" useful.

Categories : Linux

How to Configure Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP
Below are steps to install, configure and start using the Microsoft SQL Server ODBC Driver for Linux, and using it from PHP - it assumes that you have SQL Server already available and configured to accept connections over TCP/IP, also that you have some familiarity with Linux. First, the SQL Server (and the appropriate database) must be configured for Windows and SQL Server Authentication. This requires a restart of the SQL Server service if changed. In addition, the server must also have TCP/IP connections enabled with a static port defined (I will be using the default of 1433), and the firewall on the host for the SQL Server must allow connections to SQL Server on the static port. Load necessary modules: Run the following command line to remove previous installations. yum remove php

Categories : PHP

Determine list of non-OS packages installed on a RedHat Linux machine
yum provides some useful information about when & from where a package was installed. If you have the system installation date then can you pull out packages that were installed after that, as well as packages that were installed from different sources & locations. Coming at it from the other direction you can query rpm to find out which packages provides each of the binaries in /sbin /lib etc ... - any package that doesn't provide a "system" binary or library is part of your initial set for consideration.

Categories : Linux

Is a difference in the implementation of boost::asio between Unix(AIX, HP-UX) and Linux(RedHat, Ubuntu)?
The platform specific implementation notes describes the supported platforms and how the event demultiplexing is implemented. Newer Linux kernels will use epoll(4) while older versions use select(2). AIX and HP-UX both use select(2). kqueue(2) is used on BSD systems, including Mac OS X and iOS. It is very similar to epoll on Linux. Generally speaking, epoll will perform better than select. When using select, it performs a linear search over the list of n descriptors, this is O(n). Using epoll has the concept of an epoll_event structure when adding descriptors to the epoll descriptor. This means modifying the list of events to wait for is somewhat expensive, but waiting for these events is very fast at O(1).

Categories : Misc

Get OS name with C [Linux, portable for distros: Centos, Debian, Fedora, OpenSUSE, RedHat, Ubuntu]
You could try to use popen(3) to run and read the output of command /usr/bin/lsb_release -ds. If that fails, you might read and parse /etc/issue Notice that clever or paranoid sysadmins might edit and configure that /etc/issue file at will. But I don't understand why you want to know all that (from inside a C program), in other words, why the uname syscall is not enough. In particular, there are a lot of Debian (or Redhat) derived specialized distributions, and I don't understand why the name of the particular distribution would matter to a C program. It matters much more for packaging purposes....

Categories : C

Use integer keys in Berkeley DB with python (using bsddb3)
Well, there's no workaround. But you can use two approaches Store the integers as string using str or repr. If the ints are big, you can even use string formatting use cPickle/pickle module to store and retrieve data. This is a good way if you have data types other than basic types. For basics ints and floats this actually is slower and takes more space than just storing strings

Categories : Python

Microsoft® ODBC Driver 11 for SQL Server® on RedHat Linux with PHP - gives an error when bind parameter with PDO for stored procedures
Finally I found the solution for this, Microsoft driver has develop for C or C++ application and the PDO parameter binding does not work as expected. If you pass parameters without using PDO everything works as expected. Replace with @paravalue = N'".$v1."' Fore example - normal parameter binding - SQLBindParameter PDO parameter binding - $stmt->bindParam(1, $v1 = 5, PDO::PARAM_STR, 100); Corrected cod snippet: $stmt = $con->prepare( "SET NOCOUNT ON DECLARE @return_value int EXEC @return_value = [sp_insert_into_t_contact_test] @paravalue = N'".$v1."' SELECT 'returnV' = @return_value"); $stmt->execute(); $return =$stmt->fetch(); echo $return['returnV'];

Categories : PHP

Python + Django run under a different user on apache2 (httpd), Redhat
WSGIDaemonProcess has a user parameter for the user under which the daemon processes will run. In your case: WSGIDaemonProcess syntyma.djangoserver user=newuser processes=10 etc... From the documentation: user=name | user=#uid.rst Defines the UNIX user name or numeric user uid of the user that the daemon processes should be run as. If this option is not supplied the daemon processes will be run as the same user that Apache would run child processes and as defined by the User directive. Note that this option is ignored if Apache wasn’t started as the root user, in which case no matter what the settings, the daemon processes will be run as the user that Apache was started as. Also be aware that mod_wsgi will not allow you to run a daemon process group as the

Categories : Python

Various versions of chrome on linux
You can take screenshots in different versions in Browserstack. Also you can browse there using different browsers, but you will need to pay for that.

Categories : Linux

How to make a JNI application support multiple versions of JVM on Linux?
You can specify the library path: java -Djava.library.path="path_here" Edit: note that it expects a folder to look in, not a specific file. :) Edit2: the path can be relative.

Categories : Java

Multiple python versions: How to set default python binary
Create a symbolic link python in /usr/bin and point it to /usr/local/bin/python2.7. Something like this should work: ln -s /usr/local/bin/python2.7 /usr/bin/python Make sure you have permissions to do that. Once done, hit python command and it should get you to python 2.7 Hope this helps.

Categories : Python

Install OpenCV for Python (multiple python versions)
Use virtualenv virtualenv -p python2.7 env source env/bin/activate python --version # prints «Python 2.7.3» pip install pyopencv If you need support of 2.4 (or other version), just create new environment.

Categories : Python

Cannot add Module to Java EE Enterprise Application - nullPointer when creating Enterprise Application Project
Root cause is that the WTP project configuration fails due to the wrong java web facet being installed. You could try to determine if the EAR project has deployment descriptor, if so, then force save. final ReferencedComponent ref = AddComponentToEnterpriseApplicationOp.findReferencedComponent(earwc, wc, se, compse);

Categories : Eclipse

interfacing Rust with Berkeley DB
Given the sheer size and complexity of the DB struct, there doesn't appear to be a "clean" way to expose the whole thing to Rust. A tool similar to C2HS to generate the FFI from C headers would be nice, but alas we don't have one. Note also that the Rust FFI can't currently call into C++ libraries, so you'll have to use the C API instead. I'm not familiar with the DB APIs at all, but it appears plausible to create a small support library in C to actually create an instance of the DB struct, then expose the public members of the struct __db via getter and setter functions. Your implementation might look something like this: [#link_args = "-lrust_dbhelper"] extern { fn create_DB() -> *c_void; fn free_DB(db: *c_void); } struct DB { priv db: *c_void } impl Drop for DB {

Categories : Misc

implementing a cache with berkeley db
The solution is to use both a key and a hash for each data. The hash is used to retrieve the location in the DB, and the key to identify the data at that location. Thus, you can control the number of locations used by your cache by controlling the hash function. The key is then used to detect "collisions". There is a lot of writings about hash functions. Simplest ones are simply linear modulo function like h = a*data+b modulo p where a and b are relative prime numbers. This ensures you that not too much collisions are produced. I'm not sure (I can't remember as I didn't use BDB for years now) but I think that BDB provides hashing as needed.

Categories : C

How to structure Python code to support multiple releases of MY project (i.e. not multiple versions of Python)
Your subprocess offers an API to the web sites. The trick is to make it so that API v2 of the subprocess code can handle calls from both v1 and v2 web sites. This is called backward compatibility. Also, it's nice if the v1 web site is not too picky about the data it receives and can for instance handle a v2 answer from the subprocess that has more information than it used to have in v1. This is called forward compatibility. Json and xml are good ways to achieve it, since you can add properties and attributes at will without harming the parsing of the old properties. So the solution, I think, does not lie in a python trick, but in careful design of the API of your subprocess such that the API will not break as the subprocess's functionality increases.

Categories : Python

Retrieving a range of data from Berkeley DB
I've taken a quick look at http://pybsddb.sourceforge.net/bsddb3.html , and the following idea looks promising: create a DBCursor object, call its .set method to find key 10, then call its .next method until you reach 20. I don't know the details of the C API, but I'd try the same idea: try to create a cursor, and call functions named like set and next on the cursor.

Categories : Misc

how to increase berkeley db cache size
i am not familiar with python interface of BDB. When i use c api, i really appreciate opening the bdb with an environment and set a lot configurations in the environment. For example, open a bdb file with environment and the env dir is set to ~/env/. Then put a file named DB_CONFIG in ~/env/ with content: set_cachesize 4 0 1 The cachesize will be set to 4GB. No code needed. You can check this for all the available configurations in DB_CONFIG.

Categories : Python

switching between python 2 and 3 versions while scripting
You have a few possible methods varing slightly with os: Invoke python 2 as python and 3 as python3 Extensions of .py and .py3 Virtualenv A script or batch file to switch envionments. I use this to test my code against different versions of python 2. Note that you can have different envionments set in separate command sessions at the same time. Testing in virtual machines. Use an IDE that allows you to specify python versions on a project or debug session basis I use WingIDE but it is not the only one to allow this. It may well pay you to look at six and working in python 3 than back converting to 2.7 for older installations. See also here for both how to install python 3 libraries under python 3 with virtualevn and without, (modify version numbers as appropriate).

Categories : Python

exception handling with multiple python versions
You can write two different try...except for two different versions basically for those mis match exception in two different versions. import sys if sys.version_info[:2] == (2, 7): try: pass except: # Use 2.7 compatible exception pass elif sys.version_info[:2] == (2, 5): try: pass except: # Use 2.5 compatible exception pass

Categories : Python

Different versions of python-requests on identical systems
This was caused by having installed python-requests by $ pip install requests on the VM with the newer version. That places it in /usr/local, and that directory is a prioritized Python path.

Categories : Python

Is there a reference table which shows which mysql versions are supported by which rails versions?
I don't think it should be in Rails documentation. The reason is that communication with DB is handled via adapters and is not in core rails functionality, so it is a matter of compatibility between rails and some particular adapter (mysql or mysql2 for example for MySQL) rather than between rails and some particular DBMS. Adapter is a 3rd party product, so how the rails team can be responsible for it? You should find out 2 things - 1) which adapter works for MySQL 5.5 and 2) with which rails versions that adapter can be used. In any case you should focus on adapter, not on rails if you want to use some particular DBMS.

Categories : Mysql

Chrome keeps all versions of my hosted app/extension (takes up MB's). How tell it to remove old versions? To downgrade?
https://code.google.com/p/chromium/issues/detail?id=126394, basically same issue. No. But you can delete them yourself by dragging them to the trash. The extension isn't kept in local storage or the HTML5 filesystem, so no. No.

Categories : Google Chrome

Server is serving old versions of static files, but trimmed or padded to match length of new versions
In the end it turned out that this was probably being caused by VM issues. The code in question was located on a Windows drive, but was being served from within a Linux VM that was accessing the code via a shared directory. Remounting the share seemed to fix the problem (although not necessarily reliably).

Categories : Caching

Java EE Application Servers and JDK versions need to match certified versions?
your main argument should be that java 6 has been EOL'ed by Oracle and will not be getting any new (freely available) security updates. should you ship a jdk-6-based product some of your customers will definitely complain about it (i know some of the customers of the company i work for routinely scan products they buy and install and notify vendors of any EOL'ed or known-to-be-insecure versions in use).

Categories : Java

Install package on multiple python versions using easy_insatll
This isn't a particularly helpful answer, but have you tried virtualenv? It'll help you avoid issues like this in the future. http://www.virtualenv.org/en/latest/

Categories : Python

How do I find out all previous versions of python with which my code is compatible
I don't really know of a way to get around doing this without some test cases. Even if your code could run in an older version of python there is no guarantee that it works correctly without a suite of test cases that sufficiently test your code

Categories : Python

CPU Utilization on Redhat 6
usleep parameter is MILLIONTHS of seconds, not thousandths. micro vs milli. Add three more zeroes and I think you'll see what you expect. http://linux.die.net/man/3/usleep The usleep() function suspends execution of the calling thread for (at least) usec microseconds

Categories : C

RedHat 5 - pstack and gdb
A clear example of: http://en.wikipedia.org/wiki/Heisenbug Red Hat Linux 5 is ancient. I don't think you can expect any good help for it. If you happened to write RH5 by mistake but it really is RHEL (Red Hat Enterprise Linux 5) then contact Red Hat support. They can help you debug your issue. As for debugging I'm not sure what do you have with so old distro. but you can try changing some components the program is using to help you understand where issue comes from. For example X server (perhaps try vnc). Or try swapping HDD of machines to see if it is some hardware problem or a BIOS difference.

Categories : Linux

Killall -u and RedHat 3
Take a look at skill in particular the -u option. I can't verify, because i haven't an available environment with Red Hat 3. Or you can use a solution like this ps aux | grep -ie user | awk '{print "kill -9 " $2}'

Categories : Linux

How to convert/compile 64-bit python (2.7.4) as 32-bit python on linux?
You need proper so files for proper OS. Cant use just like that.. You need 64 bit libexpect5.44.1.9.so file from 64 bit machine. and load it before executing your code. You can also bundle up 64 bit libexpect5.44.1.9.so using sdx binary and keep loading it at the time of invocation.

Categories : Python

tomcat7 redhat could not start up
The Tomcat server may have bound to port 8080, but was unable to complete startup for some reason, and so not is not servicing requests yet. Check the tomcat logs for errors, and make sure that the server has started successfully. Successful startup of tomcat is usually indicated by the log statement "Server startup in XXXX ms" in catalina.out.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.