Posts

Showing posts with the label OSA

Rules for drawing a FLOWCHART

Image
Terminator All flowcharts start and end with the terminator or terminal shape. This is a rounded rectangle and is shown below. You use this same shape for both the start and the end. You will see some charts with slightly different terminal shapes. For example, sometimes an oval is used. This is because there is no golden standard for flowcharting. Different companies and different technical areas use different shapes. There are a few basic rules and, beyond that, you can create your own rules for your organization. If you add your own shapes, it is important that you explain what they are used for, so others can understand your chart. Just click on the terminator shape in the stencil and then type in the text.   To read a flowchart, you follow the arrows from shape to shape. To draw a line in RFFlow, click on the line in the stencil at the left and then drag the mouse to draw the line in your chart. It is faster to place all your shapes first and t...

OSA: Lower case to upper case conversion and vice-versa

while(true) do echo " MENU ______________________________________________________________________________ 1)Create a file and write into it 2)Convert Lower to Upper case 3)Convert Upper to Lower case 4)open file 5)Exit" read choice case $choice in 1) echo " Create and Write ------------------------------------------------------------------------------ Enter the name of file to be created ->" read filename if [ -f $filename ]; then echo "filename $filename already exists,please try another filename" else touch $filename chmod 777 $filename # echo "Enter the data to be written into the file ->" # read data # cat>$filename fi ;; 2) echo " Convert from Lower to Upper ------------------------------------------------------------------------------ Loading and translating Existing file :- $filename " tr '[a-z]' '[A-Z]' <$filename ;; 3) echo " ...

OSA: Display O.S. name,login name,host-name

while(true) do echo " MENU ------------------------------------------------------------------------------ 1)Print O.S. name 2)Dispaly login name 3)Display host name 4)Exit Please enter your choice -> " read choice case $choice in 1) echo "OS name -> " uname    echo "OS version -> " cat /proc/version ;; 2) echo "Login name -> " whoami ;; 3) echo "Host name -> " hostname ;; 4) echo "program will be terminated " exit 0 ;; esac done

OSA: Process mangement

while(true) do echo " MENU ------------------------------------------------------------------------------ 1)Display current shell 2)Display information of processes 3)Display global priority of processes 4)Change a priority of a process 5)Exit Enter your choice -> " read choice case $choice in 1) echo " displaying current shell ------------------------------------------------------------------------------ " ps ;; 2) echo " Information of processes ------------------------------------------------------------------------------ " ps -al ;; 3) echo " Display global priority of processes ------------------------------------------------------------------------------ " ps -ecl ;; 4) echo " Change priority ------------------------------------------------------------------------------ " ps -ecl echo "Enter process ID" read PID echo "Enter new priority valu...

OSA: Directory- create,delete,display PWD and change directory

while(true) do echo " MENU ------------------------------------------------------------------------------ 1)Make a new directory 2)Delete a directory 3)Display current working directory 4)Change directory" read choice case $choice in 1) echo " New directory ============================================================================== Enter name of directory to be created ->" read name if [ -d $name ]; then echo "directory already exists, please try another name" else mkdir $name echo "directory has been created successfully" fi ;; 2) ls echo " Delete directory ============================================================================== Enter the name of directory to be deleted ->" read dname if [ -d $dname ]; then rmdir $dname echo "directory has been deleted  " else echo "invalid name, please try a valid directory name" fi ;; 3) ech...

OSA: User- add,delete,change access permissions for a file

while(true) do echo " MENU ------------------------------------------------------------------------------ 1)Super User 2)Add user 3)Delete user 4)Change access permissions 5)Exit" read choice case $choice in 1) echo "act as super user inorder to add user ==============================================================================" su sh 3.sh s ;; 2) echo " add user ============================================================================== Enter the User name -> " read name useradd $name echo "User added successfully" ;; 3) echo " Delete user ============================================================================== Enter the name of user to be deleted -> " read username userdel userdel $username echo "the user has been deleted" ;; 4) echo " change access permissions ==============================================================...

OSA: File management (Create,rename,delete and list the file's in present working directory)

while(true) do echo  " Enter operation you want to perform ------------------------------------------------------------------------------ 1)Create a File 2)Rename a File 3)Delete a File 4)List File's " echo "enter your choice->" read choice case $choice in 1) echo "Enter the name of file to be created" read filename if [ -f $filename ]; then echo "file already exists,please try another name" else touch $filename echo "file has been created successfully" fi # ;; 2) echo "Enter the name of File to be renamed " read oldfilename if [ -f $oldfilename ]; then echo "enter the new file name to be assigned " read newfilename mv $oldfilename $newfilename else echo "file doesn't exist please try an existing filename" ls fi # ;; 3) echo "Enter name of File to be deleted " read name if [ -f $name ]; then rm -f $name echo "file ha...

OSA: [Grp C-1] CPU MANUFACTURER INFO

while(true) do echo "CPU INFORMATION       1.CPU CORES AND THREADS       2.CPU MANUFACTURER       3.EXIT" read a; case $a in 1)echo "CPU INFORMATION.." dmidecode -t processor ;; 2)echo "CPU MANUFACTURER.." dmidecode -s processor-manufacturer    ;; 3)echo "stopped...."   exit 0 ;; esac; done

OSA:[Grp B-15] CONVERT FILE INFO INTO LOWER/UPPER CASE

while true do echo "1.Create files :"; echo "2.To Upper :"; echo "3.To Lower"; echo "4.Exit"; echo "Enter your choice : "; read ch; case $ch in 1) echo "Please enter File1 name : "; read dirr; touch $dirr.txt chmod 777 $dirr.txt echo "Open and write into $dirr.txt file manually" ;; 2) echo "Upper Case is: "; tr '[a-z]' '[A-Z]' < $dirr.txt #tr '[:lower:]' '[:upper:]' < $dirr.txt ;; 3) echo "Lower Case is: "; tr '[A-Z]' '[a-z]' < $dirr.txt #tr '[:upper:]' '[:lower:]' < $dirr.txt ;; 4) exit 0; ;; esac done #OUTPUT [root@localhost apcoer]# sh upper.sh 1.Create files : 2.To Upper : 3.To Lower 4.Exit Enter your choice : 1 Please enter File1 name : roro Open and write into roro.txt file manually 1.Create files : 2.To Upper : 3.To Lower 4.Exit Enter your choice : 2 Uppe...

OSA:[GRP A-5] PROCESS INFO

while (true) do echo "enter your choice     1.current shell     2. process information     3.global priority     4.change priority of process     5. exit"; read a; case $a in 1)echo"current shell"; read b; ps b; ;; 2)echo" process information"; read c; ps -f $c; ;; 3)echo"global priority"; read d; ps -ao tty nice $d; ;; 4)echo"change priority of process"; read e; ps -f $e; echo"which want to change priority of process"; read f; echo"enter parent id"; read g; renice $f$g; ;; 5)exit 0 ;; esac; done

OSA: ADD & DELETE USER

while (true) do echo "enter your choice      1. add user      2. delete user      3.exit"; read a; case $a in     1) echo"enter user name to be add:";  read c;  useradd $c; ;;    2)echo"enter user name to be delete:";  read b;  userdel $b;  echo"device delete successfully"; read d; ;;   3)exit 0 ;; esac; done

OSA: MOUNT & UNMOUNT

while(true) do echo    "  MENU ------------------------------------------------------------------------------         1)Display mounted devices 2)Mount a device 3)Unmount a device 4)See physical name and instance number 5)Exit" read choice case $choice in 1) echo "Mounted devices are -> " mount ;; 2) echo " MOUNT ------------------------------------------------------------------------------- Enter the name of device -> " read name    echo "Enter the mount point -> " read point mount $name $point echo "the device has been mounted successfully" ;; 3) echo " Unmount ------------------------------------------------------------------------------- enter source of device ->" read devsource umount -f  $devsource echo "the device has been unmounted successfully" ;; 4) echo " Physical name and instance number --------------------------------------...

OSA:System information c++

#include <iostream> #include <sys/utsname.h> using namespace std; int main(){ struct utsname sysinfo; uname(&sysinfo); cout << "System Name: "<<sysinfo.sysname<<endl; cout << "Host Name: "<<sysinfo.nodename<<endl; cout << "Release(Kernel) Version: "<<sysinfo.release<<endl; cout << "Kernel Build Timestamp: "<<sysinfo.version<<endl; cout << "Machine Arch: "<<sysinfo.machine<<endl; cout << "Domain Name: "<<sysinfo.domainname<<endl; return 0; }

OSA: System info shell program

while(true) do echo "CPU INFORMATION       1.CPU CORES AND THREADS       2.CPU MANUFACTURER       3.PROCESSOR FAMILY       4.PROCESSOR VERSION       5.PROCESSOR FREQUENCY       6.SYSTEM MANUFACTURER       7.BIOS VERSION       8.RAM INFO        9.EXIT" read a; case $a in 1)echo "CPU INFORMATION.." dmidecode -t processor ;; 2)echo "CPU MANUFACTURER.." dmidecode -s processor-manufacturer    ;; 3)echo "PROCESSOR FAMILY.." dmidecode -s processor-family ;; 4)echo "PROCESSOR VERSION.." dmidecode -s processor-version    ;; 5)echo "PROCESSOR FREQUENCY.." dmidecode -s  processor-frequency    ;; 6)echo "SYSTEM MANUFACTURER.." dmidecode -s  system-manufacturer ;; 7)echo "BIOS VERSION.."...

OSA: linux commands(terminal)

An A-Z Index of the Bash command line for Linux. alias Create an alias • apropos Search Help manual pages (man -k) apt-get Search for and install software packages (Debian/Ubuntu) aptitude Search for and install software packages (Debian/Ubuntu) aspell Spell Checker awk Find and Replace text, database sort/validate/index b basename Strip directory and suffix from filenames bash GNU Bourne-Again SHell bc Arbitrary precision calculator language bg Send to background break Exit from a loop • builtin Run a shell builtin bzip2 Compress or decompress named file(s) c cal Display a calendar case Conditionally perform a command cat Concatenate and print (display) the content of files cd Change Directory cfdisk Partition table manipulator for Linux chgrp Change group ownership chmod Change access permissions chown Change file owner and group chroot Run a comm...