#!/bin/more ============================== SCRIPT NAME: arrayex.sh ============================== #!/bin/bash # simple array list and loop for display SERVERLIST=("websrv01" "websrv02" "websrv03" "websrv04") COUNT=0 for INDEX in ${SERVERLIST[@]}; do echo "Processing Server: ${SERVERLIST[COUNT]}" COUNT="`expr $COUNT + 1`" done ============================== ============================== SCRIPT NAME: checkargs2.sh ============================== #!/bin/bash : ${3?"USAGE: $1 ARGUMENT $2 ARGUMENT $3 ARGUMENT"} echo "I got all three!" ============================== … Continue reading Few sample scripts
Category: Uncategorized
screen command
Install the screen package yum install screen -y apt-get install screen -y mohammedrafi@NOC-RAFI:~$ tty /dev/pts/0 screen -S session-name will create a new session on terminal with that name mohammedrafi@NOC-RAFI:~$ screen -S session1 Open another terminal and search with command screen -ls to list sessions's mohammedrafi@NOC-RAFI:~$ tty /dev/pts/5 mohammedrafi@NOC-RAFI:~$ screen -ls There is a screen on: … Continue reading screen command
Puppet Resources,types,providers
Chapter 1. Puppet Resources Resources are the fundamental building blocks used to model system state in Puppet. They describe the desired end state of unique elements managed by Puppet on the system. Everything that Puppet manages is expressed as a resource. In fact, every interaction between Puppet and the underlying system is expressed as a resource, too. … Continue reading Puppet Resources,types,providers
File descriptors
All I/O, including files, pipes, and sockets, are handled by the kernel via a mechanism called the file descriptor. A file descriptor is a small unsigned integer, an index into a file-descriptor table maintained by the kernel and used by the kernel to reference open files and I/O streams. Each process inherits its own file-descriptor … Continue reading File descriptors
diff,cut,head,tail,more,less,paste,join,uniq,comm,tr,sort,
The diff command mohammedrafi@NOC-RAFI:~$ vim file1 I go for shopping on Saturday I rest completely on Sunday I use Facebook & Tweeter for social networking mohammedrafi@NOC-RAFI:~$ vim file2 Today is Monday. I go for shopping on Saturday I rest completely on Sunday I use Facebook & Tweeter for social networking mohammedrafi@NOC-RAFI:~$ diff file1 file2 0a1 … Continue reading diff,cut,head,tail,more,less,paste,join,uniq,comm,tr,sort,
Diffrence b/w at and cron
cron command is used to schedule the task daily at the same time repeatedly. "at" command is used to schedule the task only once i.e to run only one time. cron can be edited at cannot be edited, after its schedule. mohammedrafi@NOC-RAFI:~$ at 21:22 warning: commands will be executed using /bin/sh at> echo "this is … Continue reading Diffrence b/w at and cron
Introducing process basics
Introducing process basics A running instance of a program is called as process. A program stored in the hard disk or pen drive is not a process. When that stored program starts executing, then we say that process has been created and is running. Let's very briefly understand the Linux operating system boot-up sequence: 1. In … Continue reading Introducing process basics
shell-scripting deep dive
Before Learning shell-script we need to know few prerequisite lets know them first things first https://shaikmdrafi.wordpress.com/2016/04/28/shell-scripts/ Comparison of shells Initially, the UNIX OS used a shell program called Bourne Shell. Then eventually, many more shell programs were developed for different flavors of UNIX. The following is brief information about different shells: •Sh—Bourne Shell •Csh—C Shell •Ksh—Korn … Continue reading shell-scripting deep dive
AWS Certified Developer – Associate Level
AWS SDK Boto Configuration 1) If you're executing code against AWS on an EC2 instance that is assigned an IAM role, which of the following is a true statement? The code will assume the same permissions as the EC2 role 2) An IAM role, when assigned to an EC2 instance, will allow code to be … Continue reading AWS Certified Developer – Associate Level
Managing kernel parameters
To list all kernel parameters [root@instance-1 ~]# sysctl -a abi.vsyscall32 = 1 crypto.fips_enabled = 0 debug.exception-trace = 1 debug.kprobes-optimization = 1 dev.hpet.max-user-freq = 64 dev.mac_hid.mouse_button2_keycode = 97 dev.mac_hid.mouse_button3_keycode = 100 ex: [root@instance-1 ~]# cat /proc/sys/fs/file-max 373992 [root@instance-1 ~]# sysctl -a |grep fs.file-max fs.file-max = 373992 [root@instance-1 ~]# sysctl -w fs.file-max=380000 fs.file-max = 380000 [root@instance-1 ~]# … Continue reading Managing kernel parameters




