Pages

Thursday, February 23, 2012

Hypervisor/Patch/Quilt/QNX

Hypervisor
In computing, a hypervisor, also called virtual machine manager (VMM), is one of many hardware virtualization techniques that allow multiple operating systems, termed guests, to run concurrently on a host computer. It is so named because it is conceptually one level higher than a supervisory program. The hypervisor presents to the guest operating systems a virtual operating platform and manages the execution of the guest operating systems. Multiple instances of a variety of operating systems may share the virtualized hardware resources. Hypervisors are installed on server hardware whose only task is to run guest operating systems. Non-hypervisor virtualization systems are used for similar tasks on dedicated server hardware, but also commonly on a desktop, portable and even handheld computers.
The term is often used to describe the interface provided by the specific cloud computing functionality infrastructure as a service (IaaS).
The term "hypervisor" was first used in 1965, referring to software that accompanied an IBM RPQ for the IBM 360/65. It allowed the model IBM 360/65 to share its memory: half acting like an IBM 360; half as an emulated IBM 7080. The software, labeled "hypervisor," did the switching between the 2 modes on the split time basis. The term hypervisor was coined as an evolution of the term "supervisor," the software that provided control on earlier hardware.
The Red Hat Kickstart installation method is used primarily (but not exclusively) by the Red Hat Enterprise Linux operating system to automatically perform unattended operating system installation and configuration. Red Hat publishes Cobbler as a tool to automate the Kickstart configuration process.

Patch
A patch is a piece of software designed to fix problems with or update a computer program or its supporting data. This includes fixing security vulnerabilities and other bugs, and improving the usability or performance. Though meant to fix problems, poorly designed patches can sometimes introduce new problems (see software regressions).
Patch management is the process of using a strategy and plan of what patches should be applied to which systems at a specified time.

Quilt
 The quilt is a software utility for managing a series of changes to the source code of any computer program. Such changes are often referred to as "patches" or "patch sets", and essentially Quilt takes N patches and turns them into a single patch. In doing so, quilt makes it easier for other programmers to test and evaluate the different changes before they are permanently inserted into the source code. This type of tool is very important for distributed software development where many programmers are collaborating to test and build a single large codebase. It's heavily used, for example, by the maintainers of the Linux kernel.

QNX
As a microkernel-based OS, QNX is based on the idea of running most of the OS in the form of a number of small tasks, known as servers. This differs from the more traditional monolithic kernel, in which the operating system is a single very large program composed of a huge number of "parts" with special abilities. In the case of QNX, the use of a microkernel allows users (developers) to turn off any functionality they do not require without having to change the OS itself; instead, those servers are simply not run.
The system is quite small, with earlier versions fitting on a single floppy disk.
QNX Neutrino (2001) has been ported to a number of platforms and now runs on practically any modern CPU that is used in the embedded market. This includes the PowerPC, x86 family, MIPS, SH-4 and the closely related family of ARM, StrongARM and XScale CPUs.

In order to compile and use c/c++ under Linux you need following packages
=> autoconf : GNU's Autoconf is a tool for configuring source code and Makefiles.
=> make/automake : A GNU tool for controlling the generation of executables and other
non-source files of a program from the program's source files.
=> GNU GCC C compiler (gcc) : The gcc package contains the GNU Compiler Collection version 4.1
=> GNU GCC C++ compiler (gcc-c++): This package adds C++ support to the GNU Compiler Collection

To remove ^M character form a vi file
:%s/(ctrl-v)(ctrl-m)//g

diff source destination > newfile

env
vi ~/.cshrc
source ~/.cshrc

cshrc file will be present under /users/nlekhak

Show current process active
ps -efa

Show process information
psrinfo -v

Show version of unix
uname -a

Display System Configuration
sysdef
or
prtconf

Print VTOC
prtvtoc /dev/dsk/c0t0d0s0

Query Disk space
df -k disk space in kilobytes
du -sk disk space summary in kilobytes

How To Configure Sun 450 Hot swap disk drives
1. drvconfig
2. disks

Remove all files and sub-directories
rm -r *

Move all files from one directory to another using tar pipe
from directory /var
mkdir /var1
cd /var

tar cf - . | (cd /var1 && tar xBf -)

Directory compare (don't show files that are the same)
dircmp -s /var /var1

Give User execute permission on a file
chomod u+x filename gives execute permission to the owner.

Find command to find in current directory and sub directory
find . -name "dbmslogmnr.sql" -print

Find Command for certain size files
find . -size +10000c
This example say find all the file > 10000 bytes.

Find command to find a word in the directory and sub directory
find . -exec grep -ls pkzip {} \;
smartbit 10.64.109.68
find . | xargs grep ""

Steps to install vnc
pick a vncserver
login to this server through anyserver with your passowrd
sjc-xdm-015:2> vncpasswd
Password: provide vnc password
Verify:
sjc-xdm-015:3> vncserver
New 'sjc-xdm-015:52 (nlekhak)' desktop is sjc-xdm-015:52

Starting applications specified in /users/nlekhak/.vnc/xstartup
Log file is /users/nlekhak/.vnc/sjc-xdm-015:52.log

now login to vnc server

How to do CVS
cvs add dir
cvs commit dir
cvs stat dir or filename
cvs add filename
cvs commit filename
if need merge option is shown
do cvs update filename

How do I copy-n-paste from VNC to my computer and vice-versa?
1.Execute vncconfig in a terminal / console of VNC Server
2.You can copy-n-paste to / from your computer any text as long as vncconfig is running.

How do I kill a VNC session?
1.Execute ps command on console of VNC server to get session IDs created in your name: e.g., ps  -ef | grep vnc | grep 
2.To delete an unwanted VNC session, execute, vncserver -kill :

If u r using upvar in a proc then while calling just mention arrayname
If return is used in the proc then while calling use $arrayname(index)

How to power cycle
So here are the steps to power cycle..
1.Login to the console server in this case 10.85.67.149
2. Enter line config mode (Ex: config---> line 08 (port which R4 router power cycler connected))
3.  configure modem DTR-active    ( This command will power off the device)
4. Exit

To Restart the router again
Un configure the command mentioned in step 3 using no modem DTR-active

Some useful steps in CVS checking:
Quick way to add directories and subdirectories to an existing CVS repository
cvs add top_level_directory
find top_level_directory -type d -print | xargs cvs add
find top_level_directory -name CVS -prune -o -type f -print | xargs cvs add
The instruction below adds the top-level called top_level_directory directory to the CVS repository
cvs add top_level_directory

The instruction below finds all subdirectories under top_level_directory and issues a cvs add command to subdirectories that are found
find -type d -print | xargs cvs add
The instruction below finds all files not including CVS files and issues a cvs add command
find -name CVS -prune -o -type f -print | xargs cvs add

IOS  vs  IOX OS Features
IOX:
-preemptive
-No paging
-Shared memory
- Add-on Application DLL Complian
- POSIX-Compliant

 IOS:
- Non Preemptive
-Paging
- Separate address space
-Monolithic
- CISCO Propriety APIs

connect to pc:
===============
proc connect_host {ip_addr username password} {
        global Spawn_Id
        set TcSteps [set_variables]
        eval $TcSteps

        set prompt {^.*#.*$|^.*>.*$|^.*%.*$|^.*\$.*$}
        spawn telnet "$ip_addr"

        set Spawn_Id $spawn_id
        set timeout 600

        sleep 5
        expect {
                -re {login.*} {
                        send -i $Spawn_Id "$username\r"
                        sleep 2
                        exp_continue
                }
                -re {Password.*} {
                        send -i $Spawn_Id "$password\r"
                        sleep 2
                        exp_continue
                }
                -re "$prompt" {
                        send -i $Spawn_Id "ifconfig\r"
                        sleep 2
                        expect {
                                -re "$prompt" {
                                        puts " Value of $expect_out(0,string)"
                                        sleep 2
                                        sleep 2
                                }
                        }
                }
        }
        return $Spawn_Id
  }

In python:

```python
import paramiko

def connect_to_pc(hostname, username, password, command):
    try:
        # Create an SSH client
        ssh_client = paramiko.SSHClient()
        ssh_client.set_missing_host_key_policy(paramiko.AutoAddPolicy())

        # Connect to the remote PC
        ssh_client.connect(hostname, username=username, password=password)

        # Execute a command (you can customize this part)
        stdin, stdout, stderr = ssh_client.exec_command(command)

        # Print the output of the command
        print("Command Output:")
        print(stdout.read().decode('utf-8'))

    except Exception as e:
        print(f"Error: {e}")
    finally:
        # Close the SSH connection
        if ssh_client:
            ssh_client.close()

# Example: Replace with your PC's hostname/IP, username, password, and command
hostname = 'your_pc_hostname_or_ip'
username = 'your_username'
password = 'your_password'
command_to_execute = 'ls'  # Replace with the command you want to execute

# Connect to the PC and execute the command
connect_to_pc(hostname, username, password, command_to_execute)
```

This example uses the `paramiko` library, which is a Python implementation of SSH. You can install it using:

```bash
pip install paramiko
```

No comments:

Post a Comment