Monday, October 22, 2018

Fixing yum command on linux





You may find yourself having to fix more packages. So you can just remove everything you had installed via pipand reinstall everything that you had installed via yumBEWARE. The following uninstalls yum itself:


pip  freeze --local | xargs pip uninstall -y

# Actually clear out ALL python stuff:
rm -rf /usr/lib/python2.7/site-packages

# Install yum:
rpm -ihv --force --replacepkgs http://mirror.centos.org/centos/7/os/x86_64/Packages/yum-3.4.3-154.el7.centos.noarch.rpm
rpm -ihv --force --replacepkgs http://mirror.centos.org/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-8.el7.noarch.rpm

# Fix yum:
yum info yum --show-duplicates
yum reinstall yum-3.4.3-154.el7.centos.1
yum reinstall yum-*

# Reinstall everything:
yum -y upgrade # in case reinstall isn't possible for older version packages which are no longer available
yum -y reinstall \*



If may seem a little harsh to reinstall everything but this will definitely fix the system and whatever Python packages you had “broken” via pip (example pyOpenSSL or MySQL-python).














Wednesday, May 16, 2018

How to make DB connection string encrypted in wildfly 10?



How to make DB connection string encrypted?


Go inside wildfly directory on your machine.

cd /wildfly

then run below command with your own password


sudo java -cp modules/system/layers/base/org/picketbox/main/picketbox-4.9.6.Final.jar org.picketbox.datasource.security.SecureIdentityLoginModule <password>

you will get something encrypted password string like below.

ufqewbrqeqewcn4398790291kjxfe



Put Datasource Change in standalone.xml:

                  <security>
                        <security-domain>encrypted-ds-WASM2</security-domain>
                    </security>
                    <validation>
                        <validate-on-match>false</validate-on-match>
                        <background-validation>false</background-validation>
                        <background-validation-millis>1</background-validation-millis>
                    </validation>
                    <statement>
                        <prepared-statement-cache-size>0</prepared-statement-cache-size>
                        <share-prepared-statements>false</share-prepared-statements>
                    </statement>


Added Security Domain and updated data source being used in application for DB encrypted string in standalone.xml.

<security-domain name="encrypted-ds-WASM2" cache-type="default">
                    <authentication>
                        <login-module code="org.picketbox.datasource.security.SecureIdentityLoginModule" flag="required">
                            <module-option name="username" value="admin"/>
                            <module-option name="password" value="ufqewbrqeqewcn4398790291kjxfe"/>
                            <module-option name="managedConnectionFactoryName" value="jboss.jca:service=LocalTxCM,name=MySqlDS_Pool"/>
                        </login-module>
                    </authentication>
                </security-domain>


Friday, January 19, 2018

START AND STOP WILDFLY USING TERMINAL



START AND STOP WILDFLY USING TERMINAL

To start Wildfly:
$ ./standalone.sh
To stop Wildfly:
$ ./jboss-cli.sh --connect command=:shutdown

Fixing yum command on linux

You may find yourself having to fix more packages. So you can just remove everything you had installed via  pip and reinstall everythin...