Showing posts with label CentOS 7.2. Show all posts
Showing posts with label CentOS 7.2. Show all posts

Sunday, May 24, 2020

How To Install an Old Version of Python on CentOS 7 without messing the default Python 2.7.x version installed

Ok this is how i install old Python 2.6.4 on a specific folder in my CentOS 7 without messing the Python 2.7.5 (default) that was installed in it.

What i want to do:
1. I am trying to run the UPG python script but somehow its binary strictly want to use python 2.6.4 or else it won't run
2. CentOS 7 comes with Python 2.7.x with it and i believe CentOS requires this version to be able to run its python scripts
3. So i need to be able to install Python 2.6.4 on a separate folder without messing with the default python version installed which is 2.7.x

What to do:


  1. 1. download python 2.6.4 source code package: https://www.python.org/downloads/release/python-264/
  2. download the tar file of course.
  3. unpack in any folder in your CentOS system but of course, you install it in preferred location /opt/ltx because UPG script refers to #!/opt/ltx/Python-2.6.4/bin/python 
  4. make sure you login as root
  5. Assuming you unpack it in /opt/ltx, cd to /opt/ltx/Python-2.6.4
  6. run configure like this >./configure --prefix=/opt/ltx/Python-2.6.4/.
    • this make install script to install the binaries and include files to /opt/ltx/Python-2.6.4/
  7. then finally >make install
  8. you can now see  /opt/ltx/Python-2.6.4/bin/python
  9. within this folder, you can do >python --version and the version will be 2.6.4
  10. however, doing >python --version on any other folder will show 2.7.x which means the default is still 2.7.x unless your script such as UPG strictly points to  /opt/ltx/Python-2.6.4/bin/ folder



Wednesday, July 4, 2018

How to Increase Root Partition of CentOS 7 VMware

Part 1: Add a vmdk

1. Shutdown your CentOS 7 VMware and re-launch VMware player

2. Select your CentOS 7 VMware and click "Edit Virtual Machine Settings"


3. In the Hardware tab, click "Add.." button. "Add Hardware Wizard" dialog box will open


4. In the "Add hardware Wizard", select "Hard Disk". click "Next >"

5. Select "SCSI" as disk type. click "Next >"


6. Select "Create a new virtual disk". click "Next >"


7. Specify disk size in GB and select "Split virtual disk into multiple files." click "Next >"


8. Specify file name of the disk file. recommended to leave it as default. click "Finish".


9. In the "Virtual Machine Settings", you will now see "New Hard Disk" in the "Hardware" tab



Part 2: Configure LVM

1. Scan the host
find /sys -type f -iname "scan" -print

2. You will see the following list as shown below
[root@centos7vm localuser]# find /sys -type f -iname "scan" -print
/sys/devices/pci0000:00/0000:00:07.1/ata1/host1/scsi_host/host1/scan
/sys/devices/pci0000:00/0000:00:07.1/ata2/host2/scsi_host/host2/scan
/sys/devices/pci0000:00/0000:00:10.0/host0/scsi_host/host0/scan

3. Rescan the SCSI bus by passing to each host the "- - -".
# echo "- - -" > /sys/devices/pci0000:00/0000:00:07.1/ata1/host0/scsi_host/host0/scan
# echo "- - -" > /sys/devices/pci0000:00/0000:00:07.1/ata2/host1/scsi_host/host1/scan
# echo "- - -" > /sys/devices/pci0000:00/0000:00:10.0/host2/scsi_host/host2/scan

4. create new pv for the new disk
pvcreate /dev/sdb

5. Now check if the new disk is now available
ls -ltr /dev/disk/by-id/

6. You will see the following list from above command
[root@centos7vm localuser]# ls -lrt /dev/disk/by-id
total 0
lrwxrwxrwx 1 root root  9 Jul  4 15:36 lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb
lrwxrwxrwx 1 root root  9 Jul  5  2018 ata-VMware_Virtual_IDE_CDROM_Drive_10000000000000000001 -> ../../sr0
lrwxrwxrwx 1 root root 10 Jul  5  2018 lvm-pv-uuid-GEwd0z-EDrV-hdB6-0o8M-S8eL-RzqU-gnSCIh -> ../../sda2
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-uuid-LVM-VhqLdEZRC9TbJfAu3v0q3aUREkRKgZbQl7dtNtoPOoI8yhrsKP3RFs70WdmfTP4o -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-name-centos_centos7vm-root -> ../../dm-0
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-uuid-LVM-VhqLdEZRC9TbJfAu3v0q3aUREkRKgZbQL9essrhuujmOBF6M9VcK2LK0BUEeWlMR -> ../../dm-1
lrwxrwxrwx 1 root root 10 Jul  5  2018 dm-name-centos_centos7vm-swap -> ../../dm-1

7. One of the disk listed above points to our new disk /dev/sdb. in our above list, it's 
lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb

8. Get your volume group of the root partition that we wish to expand
vgdisplay | grep 'VG Name'

    the output will be as shown below where "centos_centos7vm" is the volume group
[root@centos7vm localuser]# vgdisplay | grep 'VG Name'
  VG Name               centos_centos7vm

9. Let's now extend the root partition with the new disk
vgextend centos_centos7vm /dev/disk/by-id/lvm-pv-uuid-eN9yt9-jzpC-7Md5-9N1a-4bdP-i9Dn-jFZ1N4 -> ../../sdb

10. Do this command to finalize extending the root partition with the new disk. Note that the command says +20GiB but you can set the value to the size you set your new disk.
lvextend -r -L +20GiB /dev/centos_centos7vm/root

   

11. Finally, verify the change
[root@centos7vm localuser]# df -k
Filesystem                        1K-blocks     Used Available Use% Mounted on
/dev/mapper/centos_centos7vm-root  41141472 18793492  20444880  48% /
devtmpfs                            2006452        0   2006452   0% /dev
tmpfs                               2021876      156   2021720   1% /dev/shm
tmpfs                               2021876     9180   2012696   1% /run
tmpfs                               2021876        0   2021876   0% /sys/fs/cgroup
/dev/sda1                            999320   121212    809296  14% /boot
tmpfs                                404376        0    404376   0% /run/user/0
tmpfs                                404376       12    404364   1% /run/user/1001







Tuesday, June 19, 2018

How To Compile CURI FAmodule in CentOS 7.2 with U1709 64-Bit OS and CURI 1.21

Note that this instruction is tested only with the following system and software versions:

OS: CentOS 7.2
Unison: U1709
Curi: CURI_1.12_2.121.x86_64

1. edit your project.makefile to look like this:

TARGET_MINOR_VERSION = 1

SO_TARGET = fademo_hooks.so

# -- Start of project files --
PROJECT_SOURCES = fademo_attach.cpp \
fademo_hooks.cpp  \

PROJECT_HEADERS   = fademo_hooks.h \

NO_PTHREAD=true
MBITS=64
PROJECT_INCLUDE_PATHS = -DLINUX_TARGET -DLINUX -DUNISON -I. -I/ltx/include 
PROJECT_LIBRARIES=-Wl,-rpath,/ltx/lib$(MBITS) -L/ltx/lib$(MBITS) -levxa

ifeq ("$(BUILD_OS)", "Linux")
CFLAGS:=-DLINUX_TARGET
endif

LDFLAGS:=

prepare:

Note the "MBITS=64" added

2. update all "long" arguments in fademo_hooks.h, fademo_attach.cpp, fademo_hooks.cpp to FA_LONG and "unsigned long" to FA_ULONG if any

3. use this command to compile > gmake CFG=Release MBITS=64 MBITS_CURI=64

4. after compiling as above, the .so files are stored in ~Release/ folder. rename Release to Release64 

5. update CURI config file /opt/ateTools/curi/unison/config/curi_conf.xml to point to this FAmodule:

<CURI_CONF>
    <Config Configuration_ID="DefaultConfiguration">
        <ConfigEnv Equipment_Path="/opt/ateTools/curi/unison/lib" Communications_Path="/opt/ateTools/curi/unison/lib" User_Path="/home/localuser/Desktop/famodule/Release"/>
        <CommunicationsList>
            <GPIB_IF>
                <Settings>
                    <stringSetting token="IbcAUTOPOLL" value="0"/>
                </Settings>
            </GPIB_IF>
            <RS232_IF/>
            <TTL_IF/>
            <TTL_IF DriverID="ASL PCI PORT" AccessName="ASL_XP_TTL" Library="curi_asl_ttl" />
            <TTL_IF DriverID="ASL AT PORT" AccessName="ASL_NT_TTL" Library="curi_asl_ttl" />
            <TCPIP_IF Port="65000"/>
            <USB_IF/>
        </CommunicationsList>
    </Config>

    <UserLibrary AccessName="Demo famodule" Library="fademo_hooks">
        <Settings>
    <stringSetting token="Module Type" value="FAPROC Module"/>
    <stringSetting token="Priority" value="50"/>
        </Settings>
    </UserLibrary>

Where /home/localuser/Desktop/famodule/Release is the path (without the '64' suffix) where your Famodule .so file is located and fademo_hooks is the name of the .so file

6. make sure to relaunch Unison

Monday, June 18, 2018

READ THIS if you are trying to use Fademo (GEM Host Simulator) on any platform

CentOS7

  • must create a symbolic link libexpat.so.0 -> /usr/lib/libexpat.so.1.6.0 as fademo references to libexpat.so.0. Note that in previous versions of CentOS, this link may point out to an older version of libexpat (e.g libexpat.so.1.5.0 in CentOS 6.2) libexpat but that's fine. it works.

Sunday, January 21, 2018

GEM FAQ's


How to enable GEM in Unison/CentOS
  • SECS/Gem is initially disabled in Unison. To enable SECS/Gem in Unison, you will need to run the config_gem command from xterm. This command is found in the /ltx/com directory. 
  • config_gem <tester_name> [-enable|-disable] [-verbose] [-reset]
  • The execution of config_gem tool will create the gem_config file for CGem in the tester pwrup directory
    • /ltx/testers/<tester_name>/pwrup/gem_config

SECS-GEM on CentOS 7.2, U1709

  • make sure to yum install the latest version. the first U1709 version release has issue on GEM component and may require update so...