CyberKeeda In Social Media

Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5




Error Code 

Can't locate Net/SNMP.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .


Fix.

Install below mentioned two packages and off course it's dependencies, I'm not adding the versions try to install the latest one.



  • perl-Net-SNMP
  • mrtg


Read more ...

Linux Command to find Hard disk serial number and details.


Most of the times, when a linux system contains more then 1 hard drives and during the process of re installation to keep the user data safe and simply format the system without effecting the user data placed in another physical drive, we face challenges while discriminating hardisks by sda, sdb, sdc

The best approach is to identify the hard disk serial number and the apply actions accordingly.

So in my case i have two hard disks as sda and sdb one hard disk has system files and configurations and one has user data 

I have identified this using pvs command

[root@cyberkeeda ~]# pvs

     PV         VG       Fmt  Attr PSize   PFree
  /dev/sda2  rootvg   lvm2 a--u 465.25g    0

  /dev/sdb1  homevg lvm2 a--u 465.75g    0


I can easily identify from here, which hdd has root file, system files installed within it.

here sda  -- system files
       sdb  -- user data

Find the hard disk details from the below mentioned commands.

hdparm


[root@cyberkeeda ~]# hdparm -I /dev/sd? | grep 'Serial\ Number'

Output will look like

       Serial Number:      WD-WCC2SFS30435
       Serial Number:      WD-WCC2HEFS25680


One can also use lshw or smartctl to fetch more details of hard drives

lshw

[root@cyberkeeda ~]# lshw -class disk

smartctl

[root@cyberkeeda ~]#  smartctl -i /dev/sda

If you are missing those tools, just install following packages

# apt-get install smartmontools
# yum install  smartmontools

# apt-get install lshw
# yum install lshw

Read more ...

The 'oslo_middleware.ssl' module usage is deprecated, please use oslo_middleware.http_proxy_to_wsgi instead


The problem was as simple as nothing but it really troubled me a lot, i have googled a lot so you don't have to.

I was trying to upload a centos image which was in qcow format, i processed everything but i don't know it gives a lot of errors while doing it.

Some of that I can see within my Horizon was

Horizon image upload failed - Danger error submitting form

Failed to list images

I'm new to Openstack but still got to know that GLANCE is responsible for the imaging part in Horizon.

Went through the log file of glance at tail -100f /var/log/glance/api.log

And found some lines error to connect at my ip with 9292 port, i somehow figured out it is relevant with the glance-api , tried to netstat the port but could not find anything.

Found solution from some website as start the glance services

glance-control all  status
 glance-control all  start

it might can help, but I was not that much lucky at all, some blog suggested me to run command as

# glance-api

The moment i run that command well some python error was there and it was 

The 'oslo_middleware.ssl' module usage is deprecated, please use oslo_middleware.http_proxy_to_wsgi instead

I searched more and more then accidentally found one of my installed oslo package contains bug that leads to the eroor

python2-oslo-middleware-3.19.0-1.el7.noarch

This specific version has this bug associated with it, you can overcome this by installing 

oslo.middleware-3.20 or more

I have downloaded this from internet and installed the python package using pip


# pip install oslo.middleware-3.23.1.tar.gz

Offcourse it has some dependency , but you can sort it out at your own iknow
Read more ...

Download all Puppet Packages , puppet packages



Puppet Package Repository links.

Download any packages relevant with puppet directly through puppet repository.

http://yum.puppetlabs.com/el/

Add direct repo for REDHAT/ CentOS 7 , if you are connected to internet.

http://dl.fedoraproject.org/pub/epel/beta/7/x86_64/epel-release-7-0.1.noarch.rpm





Read more ...

How to install VMWare tools from rpm using VMWare repository.



We got this requirement, when our Linux beginners folks tried to install the vmware tools from source / tar ball, they went through a lot of difficulties.

Everyone is not so comfortable while installing any application from source code, and some times i too went through a lot of challenges , the best fix is find the relevant RPM fro it and install it from one line command at all.

Somehow, i managed to find the vmware-tools repository from vmware itself.

Find and download the appropriate repos that fulfill your requirement:  

http://packages.vmware.com/tools/esx/latest/repos/index.html

http://packages.vmware.com/tools/esx/index.html.

And the below link is for latest packages and updates 

http://packages.vmware.com/tools/esx/latest/index.html 

Download and install the respective repo and install it from yum command

[root@localhost ~]# wget https://packages.vmware.com/tools/esx/latest/repos/vmware-tools-repo-RHEL6-10.0.9-1.el6.x86_64.rpm

[root@localhost ~]# rpm -Uvh vmware-tools-repo-RHEL6-10.0.9-1.el6.x86_64.rpm

Once done, you can simply run the YUM tool to install the packages

[root@localhost ~]#  yum install -y vmware-tools-esx-nox

And if your linux box has not access to internet, download from the corrosponding repos from your desktop and copy it into your linux box.

Once you have the packages, you can simply install it from rpm command line.

# rpm -Uvh vmware-tools-esx-nox-10.0.9-1.el6.x86_64.rpm

It might ask for dependencies too, you can find the dependencies from the same link , download and complete your installation.


Read more ...

PHP How to install, configure and enable ZIP Extension from source code within centos / rhel 6



So Enabling ZIP within PHP 5.6 dose not meet with the common approach of enabling a extension, Since it requires the libzip packages with a greater version of 0.11 or more.

RHEL ships libzip greater then 0.9 with RHEL 7.3 or more, hence the approach for enabling this must be slight different.


To avoid these challenges, we must go the way of installation of modules using PECL

Download Packages as required from --  http://pecl.php.net/package/zip

Here I have downloaded     zip-1.11.0.tgz

Now just execute the below mentioned PECL command.

# pecl install zip-1.11.0.tgz

# pecl uninstall XXXX

Though it will guide it to rest of the work but still I too want to add.

Locate your php.ini file and the

You should add "extension=zip.so" to php.ini

Once you are done, remember to reload/restart apache to apply the effect / changes.

Verify -: You should see, something like below within your phpinfo.php page






Read more ...

configure: error: and their fixes for RHEL / CentOS



This post is dedicated to the various config errors that we encounter while compiling any specific software from source code, the application / software may be different.
But their errors and fixes are same for everyone.

Here are some config errors and their fixes.


  • configure: error: mcrypt.h not found. Please reinstall libmcrypt
For RHEL/CENTOS/FEDORA

   #  yum install libmcrypt
    #   yum install  libmcrypt-devel

For Ubuntu
  
   #  sudo apt-get install libmcrypt-dev


   #  sudo apt-get install libmcrypt
  • configure: error: xml2-config not found. Please check your libxml2 installation
For RHEL/CENTOS/FEDORA

   #  yum install libxml2
    #   yum install libxml2-devel

For Ubuntu
  
   #  sudo apt-get install libxml2*

  • configure: error: Please reinstall the libcurl distribution – easy.h should be in /include/curl/

For RHEL/CENTOS/FEDORA

   #  yum install curl-devel
    #   yum install curl

For Ubuntu
  
   #  sudo apt-get install curl-dev



Read more ...

How to Install OCi8 extension within PHP and Apache



Necessity is the mother of Invention ( * googling ).

I get to know this how to install oci8 from various blogs and forums, hence consolidated all the points from different blogs and forums, so that you don't have to look for it.

Oracle extension has a dependency of Oracle Client Packages.

Download the oracle client packages from Oracle Offcl website


I have downloaded the below mentioned packages

oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-basiclite-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-devel-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-odbc-12.1.0.2.0-1.x86_64.rpm
oracle-instantclient12.1-sqlplus-12.1.0.2.0-1.x86_64.rpm

Ignore the package conflicts between old and new, hence use U with rpm

# rpm -Uvh oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm
# rpm -Uvh  oracle-instantclient12.1-basic-12.1.0.2.0-1.x86_64.rpm

Same way, install the remaining packages too.

Once done, confirm the ORACLE_HOME as it will be required for oci8 installation

# echo $ORACLE_HOME

If it shows the old versions path as 10.1 or 9.01 path or any other, atleast for the installation we have to set the path temporarily to new location where Oracle client package exists

Set environment variable temporarily for Oracle clinet 12 version

# export ORACLE_HOME="/usr/lib/oracle/12.1/client64/"

Verify using command

# echo $ORACLE_HOME

It must show  /usr/lib/oracle/12.1/client64/

-* It might be even required to set the set the LD_LIBRARY_PATH

# export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib


*** Remember it is temporary environment variable not permanent, once user exits from the terminal it will show the permanent path

You can set the permanent path in bash environment files.

Installation of oci8 package from PECL.
Now Download the oci8 packages from Pecl official website


Remember, you must download the linux package with an extension of tgz else pecl will not recognize the package provided to it for installation.


Run the last command to install and enable oci8 extension.
# pecl install  oci8-2.0.5.tgz 

If the installation completed successfully, locate your php.ini and add the following line.

extension=oci8.so

#locate php.ini

In my case, i found it within /usr/local/lib/php.ini, run the below command to add the above line

# echo "extension=oci8.so" >>  php.ini

That’s it !!! Enough

But for me, it was not even enough for the installation I got some additional errors as

checking Oracle ORACLE_HOME install directory... /usr/lib/oracle/12.1/client64/lib/
checking ORACLE_HOME library validity... configure: error: Expected an ORACLE_HOME top level directory but /usr/lib/oracle/12.1/client64/lib/ appears to be an Instant Client directory. Try --with-oci8=instantclient,/usr/lib/oracle/12.1/client64/lib/
ERROR: `/var/tmp/oci8/configure --with-oci8=/usr/lib/oracle/12.1/client64/lib/' failed

Here is the fix for it, again a temporary path for PECL

# echo "instantclient,/usr/lib/oracle/12.1/client64/lib" | pecl install oci8-2.0.5.tgz

Here I just passed , what it is asking for :)

Confirm the same, using phpinfo.php page you must get a category of oci8 extension like the below mentioned screenshot.



Read more ...

Begin with Ethitical Hacking / How to hack for newbies



Again a Wonder full post from our group members,  if you are really interested in topic of Ethitical Hacking, find the below links and download the PDFs  they will really give more then overview of ethitical hacking.






Disclaimer - Hacking is an illegal/criminal work, this post is meant for education purpose and to explore the securities required in our systems.
We don't encourage or support Hacking by any means.
Read more ...

Remove old kernels safely just by single command.




Every time we upgrade our kernel, it consumes some of the valuable space from our /boot partition, definitely a time comes its asking to free some spaces out of it.

But to keep some old kernels within your boot menu is also useful, in case some of the kernel fails to boot other might help us to boot.

Now in case you are puzzled which one to remove to free up some space, here is the solution.
The best approach is to keep the latest kernel and remove the old one, now again which one is older or latest ?

Let don't think so much Redhat Linux has already created a solution for it already, before knowing the below mentioned command, i used to do the same stuffs manually by carefully moving the oldest kernels relevant files one by one manually.

Just move on now to the a scenario

Suppose i have three kernels installed and i want to keep the latest two and else remove other kernels.

Simply run the below mentioned command.

root@localhost ]-:#  package-cleanup --oldkernel --count=2

Count =2 means it will keep the latest 2 kernel and remove rest.

Thanks to one of my group members and friend Ravish Rana, for sharing such a useful stuff with us and thus I'm sharing with all the blog readers.
Read more ...

How to enable PHP LDAP module / extension in XAMP



Before proceeding,do check whether LDAP module is enabled by default or not, you can verify the same using phpinfo.php page.

To check create the a php file within htdocs folder as phpinfo.php

create a notepad file and rename it as phpinfo.php

paste the below mentioned code into it and save it into  htdocs folder

<?php
        phpinfo();
?>


Open the browser and hit, https://localhost/phpinfo.php

If you find the below mentioned screenshot, Well !!! you don't need to do anything PHP_LDAP module is already enabled within your XAMP server.



Now, if you can't find anything like that just follow the steps.


  • Change directory to C :  -- xampp -- php

  • Find and Copy the listed files 
  1.      libeay32.dll
  2.      libsasl.dll
  3.      ssleay32.dll
  • Copy into C:\Windows\System32

  • Now again toggle / change directory into C :  -->  xampp -->  php
  • Find and open file named   php.ini 
  • Again find and UnComment the below mentioned line to enable it.
       ;extension=php_ldap.dll


and make it look like the below screenshot by removing the  ;
to look it as extension=php_ldap.dll


Now restart Apache from XAMP control pannel



Read more ...

Understanding / Overview of CPU units


I don't know how much I'm right about the above explained figure, but i got this understanding from one of my knowledgeable friend , Ashish Thakur.

I thought of sharing the same with you guys and keep it within my knowledge base (my blog).

Do correct me within comment, if you feel anything wrong explained within this figure.


Read more ...

vmware-view Configure Smart Card reader service




Recently I have got an requirement from my client to configure my Redhat 6 Workstatiom to pass Smart Card access to VMware Horizon Client.

So here we will configure our Linux workstation with SMART card reader service and then further bypass it to Vmware-View Horizon Client.

Thanks to the my one of friendly techie blog Jeppson -- He used it on UBUNTU and following it I'm successful to make it work on Redhat / CentOS  too.
https://techblog.jeppson.org/2015/12/configure-vmware-view-smartcard-in-ubuntu/



Steps are as follow.

  • I presume that you already have installed the horizon bundle within your linux workstation, and you came here just to find the Smart Card solution.


  • Install necessary packages for SMART card reader (PC/SC smart card )
[cyberkeeda@testhost ~]$  yum install libpcsclite1 pcscd pcsc-tools

  • Start the pcscd daemon

[cyberkeeda@testhost ~]$   /etc/init.d/pcscd restart 

  • Ensure about the Smart Card , whether it's detected by system or not.


[cyberkeeda@testhost ~]$  pcsc_scan

output may look like this.










If that command is stuck on “Waiting for the first reader…” then you need to install your smartcard drivers. If it sees your smartcard, skip this next step and proceed to next step

Install your smartcard driver. This process is different for each card. For the card reader I have (the Identive SCR3500 A Contact Reader), I was able to obtain the drivers after much difficulty from here. The link to the drivers itself are here (alternate link). In my case I was able to untar and run the install script, which worked beautifully.


  • Start the vmware-USBArbitrator and vmware-view-USBD services

[cyberkeeda@testhost ~]$  /etc/init.d/vmware-USBArbitrator restart

[cyberkeeda@testhost ~]$  /etc/init.d/vmware-view-USBD restart


  • Add vmware configuration parameter to redirect view client to use SMART Card reader/services.

[cyberkeeda@testhost ~]$  echo 'viewusb.IncludeFamily = "smart-card"' > ~/.vmware/config

FINALLY the command.

[cyberkeeda@testhost ~]$ vmware-view





Read more ...

Redhat / CentOS - Show address bar with full path in Nautilus instead of breadcrumbs bar


We can obtain it from nautilus utility.







use the command.

[root@localhost] # nautilus --browser
Read more ...

PHP Installed but browser is not loading php script, showing as a raw html text



So I encountered the problem , while loading php file with Apache.

I was expecting a page with php information as i have uploaded the phpinfo.php into /var/www/html
restarted apache,

Aww.. i got just text when i hit down the browser as

<?php
        phpinfo();
?>

Now, if your are running in the same problem, below mentioned is the fix.

open your http.conf file and append the below lines within it.

AddHandler php5-script .php

AddType text/html .php


Restart Apache and reload webpage again, the problem will be solved.


Read more ...

SED to remove last character for a line or every line



So this sed command will help you to remove the unwanted string from your word to make your life more automotive at all.

Lets take an example,

[icinga@cyberkeeda ~]$ cat myfile.txt

sampletext,

I have a word as  sampletext,  and i need to remove sign  ,  from the above word to look it as sampletext only.

Hence i can SED to trim that specific word.

[icinga@cyberkeeda ~]$ sed -i 's/,$//' myfile.txt
Now, if if you don't care whatever the last character
 it may be , or % or & 
It must be removed then use the below command
[icinga@cyberkeeda ~]$ sed 's/.$//' myfile.txt
Read more ...

USB Flash drive recognized within lsusb but not in fdisk



While on my way to format the Transcend flash drive, i went through the normal procedure to format an external usb storage.

I executed my command to check it's showing within the kernel or not.

# lsusb

and i found it as

Bus 002 Device 005: ID 066d:c09d Transcend Information, Inc. JetFlash

but when i executed the command fdisk -l  i couldn't find any extra drive as /dev/sdd as i already have three hardisk as /dev/sda, /dev/sdb, /dev/sdc

I figured out the error can be resolved using the command.

[root@localhost]#  modprobe usb_storage

and all fixed within this cammand at all.


Read more ...
Designed By Kunal Saha