Thursday, October 11, 2018

Modifying Default Inactivity Timeout vSphere Web Client ,

For Vsphere 6.5 Web Client

From VCSA cli, modify the property named session.timeout = 120 to 0 in vi /etc/vmware/vsphere-client/webclient.properties and then, restart the service vsphere-client service

service-control –stop vsphere-client
service-control –start vsphere-client



Steps


  1. Connect (ssh) to VCSA using root password, 
  2. vi /etc/vmware/vsphere-client/webclient.properties
  3. Modify session.timeout = 120 to 0 in above file
  4. Restart vsphere-client service service-control –stop vsphere-client; service-control –start vsphere-client




Tuesday, June 26, 2018

SSD & it's Types (SLC, MLC, TLC)

The Anatomy of an SSD



SSD with two enclosed NAND flash memory chips installed. The controller chip is designed by PHISON.
    A. NAND Flash: The part where your data is stored, in blocks of non-volatile (does not require power to maintain data) memory.
    B. DDR Memory: Small amount of volatile memory (requires power to maintain data) used to cache information for future access. Not available on all SSDs.
    C. Controller: Acts as the main connector between the NAND flash and your computer. The controller also contains the firmware that helps manage your SSD.

TYPES OF SSD
  1. Single Level Cell (SLC)
  2. eMLC (enterprise Multi Level Cell)
  3. MLC (Multi Level Cell)
  4. TLC (Triple Level Cell)
Flash Type SLC (Single Level Cell) eMLC (enterprise Multi Level Cell) MLC (Multi Level Cell) TLC (Triple Level Cell)
Read-Write Cycles 90k-100k 20k-30k 8k-10k 3k-5k
Cost Most Expensive Medium Lower Cheapest
Endurance Highest Medium Lower Lowest
Bits per Cell 1 2 2 3
Usage Enterprise Enterprise Consumer/Gaming Consumer
Write Speed Highest Medium Lower Lowest
Reference :-
https://www.mydigitaldiscount.com/everything-you-need-to-know-about-slc-mlc-and-tlc-nand-flash.html

Thursday, May 24, 2018

Python API Execution Server Setup


In this post, I'm outling the process i used to setup an execution server used to run API tests using python.

Setup an API automation ready execution server

  1. Confirm Python -version (python --version)
  2. Install pip (yum -y install python-pip)
  3. Install pip environment (https://docs.pipenv.org/) (pip install pipenv)
  4. Upgrade it (pip install --upgrade pip)
  5. Install requests module (pip2.7 install requests)
  6. Install git (Yum install gut -y)
  7. Clone the git repo (git clone git://github.com/requests/requests.git)
  8. Cd requests; pip install.

I also found the below guides very useful to get a fundamental understanding of api testing. 
  1. Beginner's Guide to API Automation with Python - https://www.grossum.com/blog/beginner-s-guide-to-automating-api-tests-using-python
  1. API Tutorials - https://www.dataquest.io/blog/python-api-tutorial/


GET Status codes
  • 200 -- everything went okay, and the result has been returned (if any)
  • 301 -- the server is redirecting you to a different endpoint. This can happen when a company switches domain names, or an endpoint name is changed.
  • 401 -- the server thinks you're not authenticated. This happens when you don't send the right credentials to access an API (we'll talk about authentication in a later post).
  • 400 -- the server thinks you made a bad request. This can happen when you don't send along the right data, among other things.
  • 403 -- the resource you're trying to access is forbidden -- you don't have the right permissions to see it.
  • 404 -- the resource you tried to access wasn't found on the server.

Finding your way in vi (the editor)

While in command mode (case sensitive)
  • move the cursor with arrow keys; if there aren't any arrow keys, use j,k,h,l (Fn + left/right key to navigate to start/end of line)

  • i - change to insert mode (before cursor)
  • a - change to insert mode (after cursor)
  • A - change to insert mode (at end of line)
  • r - replace one character
  • R - overwrite text
  • x - delete one character
  • dd - delete one line
  • yy - yank line (copy)
  • p - paste deleted or yanked text after cursor
  • P - paste deleted or yanked text before cursor
  • G - go to end of the file
  • 1G - go to top of the file
  • J - merge next line with this one
  • / - search, follow / with text to find
  • :wq - write file and quit
  • :q! - quit without saving
  • %s/old/new/g - substitute; replace "old" with "new" on all lines
  • :g/pattern/d - delete all lines that match the pattern
  • 0 - move to the beginning of the current line
  • $ - move to end of line
  • H - move to the top of the current window (high)
  • M - move to the top of the current window (middle)
  • L - move to the top of the current window (low)
  • 1G - move to the first line of the file
  • 20G - move to the bottom line of the file
  • G - move to the last line of the file.
While in insert mode
  • ESC - change to command mode
  • any text typed is entered at the cursor
Typical vi session
  1. Type "vi file.txt" at command prompt
  2. Move cursor to where new text will be added
  3. Type "i" to change to insert mode
  4. Type new text
  5. Type ESC to go back to command mode
  6. type ":wq" and ENTER to write the file and quit

Thursday, May 3, 2018

Jenkins installation as a service using .war files on a Virtual Machine


Steps to bring up a Jenkins instance on a centOS7 instance


1. Bringup a VM and & Install any linux distro of your preference. In this case, I'm using CentOS7.
2. Install supported Jenkins v1.624 wget https://updates.jenkins-ci.org/download/war/1.624/jenkins.war.
3. Install Java 7 yum install java-1.7.0-openjdk (https://www.atlantic.net/cloud-hosting/how-to-install-java-jre-jdk-centos-7/) and configure the OS to use java 1.7 by default
4. Set environment (export $JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.171-2.6.13.0.el7_4.x86_64" | sudo tee -a /etc/profile;  echo 'export $JRE_HOME=/usr/lib/jvm/jre/' | tee -a /etc/profile; source /etc/profile)
5. Install Jenkins (cd ~; java -jar jenkins.war)
6. Configure Jenkins as a service ( cd /etc/systemd/system; vi jenkins.service and add below lines to it.

[Unit]
Description=Jenkins Service
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/bin/java -jar /usr/local/bin/jenkins.war
Restart=on-abort

[Install]
WantedBy=multi-user.target

7. Start the Jenkins Service (systemctl daemon-reload; systemctl start jenkins.service)


Establishing trust between Jenkins and other applications

Get the certificate of the application (in this case it's named as 'ccm.cer')
  1. export $JAVA_HOME="/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.171-2.6.13.0.el7_4.x86_64" | sudo tee -a /etc/profile
  2. echo 'export $JRE_HOME=/usr/lib/jvm/jre/' | tee -a /etc/profile
  3. source /etc/profile

  1. echo $JRE_HOME
  2. echo $JAVA_HOME

  1. java InstallCert 10.193.180.190
  2. cp jssecacerts $JAVA_HOME/lib/security
  3. cp jssecacerts ~/.keystore
  4. keytool -list -alias 10.193.180.190-1
  5. Cd /usr/lib/jvm/jre-1.8.0-openjdk/lib/security
  6. keytool -importcert -file /root/ccm.cer -keystore cacerts -alias 10.193.180.190-1
  7. keytool -list -alias 10.193.180.190-1
  8. reboot
  9. systemctl status jenkins.service
  10. systemctl start jenkins.service
  11. systemctl status jenkins.service
  12. java SSLPoke 10.193.180.190 443