This script monitors a hardcoded process called "ssh" and restarts it if it stops running. It will attempt to restart the process 3 times before reporting a failure. The script logs status messages to a log file called "procmon.log". It uses color codes to identify status messages. The script contains functions to monitor the process, detect failures, and close the script logging the ending status.
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Zyxware Technologies
A workshop on "An introduction to BASH shell scripting". Conducted at CSI Students Convention at TKM College of Engineering, Kollam, Kerala on 15th September, 2012
http://www.zyxware.com/articles/3080/zyxware-conducts-workshop-on-bash-scripting-at-tkm-college-of-engineering-kollam
Introduction to Bash Scripting, Zyxware Technologies, CSI Students Convention...Zyxware Technologies
A workshop on "An introduction to BASH shell scripting". Conducted at CSI Students Convention at TKM College of Engineering, Kollam, Kerala on 15th September, 2012
http://www.zyxware.com/articles/3080/zyxware-conducts-workshop-on-bash-scripting-at-tkm-college-of-engineering-kollam
Ansible, Simplicity, and the Zen of Pythontoddmowen
Slides from the following talk presented at PyCon Australia 2015:
https://www.youtube.com/watch?v=JlrkizEBjXk
Ansible is a configuration management tool, written in Python, that has taken the world of IT automation by storm. Its most remarkable quality is simplicity.
The Zen of Python is a set of aphorisms which capture the design philosophy of the Python language, one being "Simple is better than complex".
Asynchronous PHP and Real-time MessagingSteve Rhoades
With every major browser supporting WebSockets, HTML 5 has changed how we handle client to server communications. The high demand for real time client and server messaging has developers flocking away from PHP to languages such as Node.js. In this session we'll explore the libraries and extensions that make Asynchronous PHP possible and analyze the performance differences with Node.js. In addition we'll identify use cases and walk through examples of how Asynchronous PHP can handle everything from WebSockets and Message Queues to MySQL.
The Raspberry Pi is a series of credit card–sized single-board computers developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.
The original Raspberry Pi and Raspberry Pi 2 are manufactured in several board configurations through licensed manufacturing agreements with Newark element14 (Premier Farnell), RS Components and Egoman. These companies sell the Raspberry Pi online. Egoman produces a version for distribution solely in China and Taiwan, which can be distinguished from other Pis by their red colouring and lack of FCC/CE marks. The hardware is the same across all manufacturers.
The original Raspberry Pi is based on the Broadcom BCM2835 system on a chip (SoC), which includes an ARM1176JZF-S 700 MHz processor, VideoCore IV GPU, and was originally shipped with 256 megabytes of RAM, later upgraded (models B and B+) to 512 MB. The system has Secure Digital (SD) (models A and B) or MicroSD (models A+ and B+) sockets for boot media and persistent storage.
Going from zero to Puppet by Pedro Pessoa, Operations Engineer at Server Density.
Abstract: Using out-of-the-box Puppet for non-sysadmin work - steps from going from no config management to managing 100 nodes and allowing non-sysadmin tasks to be performed.
Speaker Bio: Linux admin for 10+ years. Java/Python/C developer 12+ years. Ops engineer at http://www.serverdensity.com - a hosted server and website monitoring service. Currently processing 12TB+ per month into MongoDB running on dedicated and virtual instances.
www.serverdensity.com/puppetcamp/
Redis & ZeroMQ: How to scale your applicationrjsmelo
Presented at #PHPLX 11 July 2013
When you need to do some heavy processing how do you scale you application?
You can use Redis and ZeroMQ to leverage the heavy work for you!
With this presentation we will know more about this two technologies and how they can be used to help solve problems with the performance and scalability of your application.
Using Mikko Koppanen's PHP ZMQ extension we will look at how you can easily distribute work to background processes, provide flexible service brokering for your next service oriented architecture, and manage caches efficiently and easily with just PHP and the ZeroMQ libraries. Whether the problem is asynchronous communication, message distribution, process management or just about anything, ZeroMQ can help you build an architecture that is more resilient, more scalable and more flexible, without introducing unnecessary overhead or requiring a heavyweight queue manager node.
Ansible, Simplicity, and the Zen of Pythontoddmowen
Slides from the following talk presented at PyCon Australia 2015:
https://www.youtube.com/watch?v=JlrkizEBjXk
Ansible is a configuration management tool, written in Python, that has taken the world of IT automation by storm. Its most remarkable quality is simplicity.
The Zen of Python is a set of aphorisms which capture the design philosophy of the Python language, one being "Simple is better than complex".
Asynchronous PHP and Real-time MessagingSteve Rhoades
With every major browser supporting WebSockets, HTML 5 has changed how we handle client to server communications. The high demand for real time client and server messaging has developers flocking away from PHP to languages such as Node.js. In this session we'll explore the libraries and extensions that make Asynchronous PHP possible and analyze the performance differences with Node.js. In addition we'll identify use cases and walk through examples of how Asynchronous PHP can handle everything from WebSockets and Message Queues to MySQL.
The Raspberry Pi is a series of credit card–sized single-board computers developed in the UK by the Raspberry Pi Foundation with the intention of promoting the teaching of basic computer science in schools.
The original Raspberry Pi and Raspberry Pi 2 are manufactured in several board configurations through licensed manufacturing agreements with Newark element14 (Premier Farnell), RS Components and Egoman. These companies sell the Raspberry Pi online. Egoman produces a version for distribution solely in China and Taiwan, which can be distinguished from other Pis by their red colouring and lack of FCC/CE marks. The hardware is the same across all manufacturers.
The original Raspberry Pi is based on the Broadcom BCM2835 system on a chip (SoC), which includes an ARM1176JZF-S 700 MHz processor, VideoCore IV GPU, and was originally shipped with 256 megabytes of RAM, later upgraded (models B and B+) to 512 MB. The system has Secure Digital (SD) (models A and B) or MicroSD (models A+ and B+) sockets for boot media and persistent storage.
Going from zero to Puppet by Pedro Pessoa, Operations Engineer at Server Density.
Abstract: Using out-of-the-box Puppet for non-sysadmin work - steps from going from no config management to managing 100 nodes and allowing non-sysadmin tasks to be performed.
Speaker Bio: Linux admin for 10+ years. Java/Python/C developer 12+ years. Ops engineer at http://www.serverdensity.com - a hosted server and website monitoring service. Currently processing 12TB+ per month into MongoDB running on dedicated and virtual instances.
www.serverdensity.com/puppetcamp/
Redis & ZeroMQ: How to scale your applicationrjsmelo
Presented at #PHPLX 11 July 2013
When you need to do some heavy processing how do you scale you application?
You can use Redis and ZeroMQ to leverage the heavy work for you!
With this presentation we will know more about this two technologies and how they can be used to help solve problems with the performance and scalability of your application.
Using Mikko Koppanen's PHP ZMQ extension we will look at how you can easily distribute work to background processes, provide flexible service brokering for your next service oriented architecture, and manage caches efficiently and easily with just PHP and the ZeroMQ libraries. Whether the problem is asynchronous communication, message distribution, process management or just about anything, ZeroMQ can help you build an architecture that is more resilient, more scalable and more flexible, without introducing unnecessary overhead or requiring a heavyweight queue manager node.
Keystroke dynamics, or typing dynamics, is the detailed timing information that describes exactly when each key was pressed and when it was released as a person is typing at a computer keyboard.
This prentation describes quality in the context of commonly understood (but under-appreciated) Unix programming best practices in three general categories.
Transparency: The ease with which a script can be understood by reading the code
Clear communication: How well the script informs the user of its activities
Scalability: Whether the script can be used across the enterprise without intervention
unix training | unix training videos | unix course unix online training Nancy Thomas
Website : http://www.todaycourses.com
Unix & Shell Scripting Course Content :
UNIX Background:
Introduction about Operating System(OS)
Introduction to UNIX
List of UNIX vendors available in Market
Introduction to various UNIX Implementations
History of UNIX OS Evolution from 1969
Open Source (vs.) Shared source (vs.) Closed source
Is Unix Open Source software?
UNIX (vs.) LINUX
LINUX OS background
LINUX (vs.) WINDOWS
Popular LINUX distributions/Vendors
Similarities between Unix & Linux
Differences between Unix & Linux
About POSIX standards
UNIX System architecture:
Hardware
Kernel
Shell
Utilities and User programs
Layers in Unix OS
Unix Servers/Dumb terminals/nodes
UNIX System features:
Multitasking
Multiuser
Easy Portability
Security
Communication
UNIX day-to-day used commands:
System Information commands (uname, date, etc)
man command
User Related (w, who, etc)
Terminal Related (stty, etc)
Filter commands (more, less, etc)
Miscellaneous commands (cal, banner, clear, etc)
Viewing exit status of commands
Disk Related commands
unix training, unix training videos, unix training topics, unix online training,unix classes online, unix training online, free unix training, unix courses, learn unix online, unix certification, unix course, learning linux, how to learn linux, linux training, red hat linux, how to linux, unix shell scripting, unix shell (software), unix shell scripting tutorial for beginners, unix shell scripting tutorial, unix (software), unix training in pune, unix training in hyderabad, unix training in pune
SysAdmins love Apache. It allows one to run websites on the Internet with minimal configuration and administration.
However, this fexibility and simplicity is what typically leads Apache to become a memory hog. Utilizing these easy to understand tips, you can significantly boost Apache's performance.
Finding and fixing bugs is a major chunk of any developers time. This talk describes the basic rules for effective debugging in any language, but shows how the tools available in PHP can be used to find and fix even the most elusive error
Inspired by Liz Rice, I'll attempt to create a container runtime of myself in Go while eventually explaining linux containerization primitives and discussing the ecosystem.
I’ve been keeping a collection of Linux commands that are particularly useful; some are from websites I’ve visited, others from experience
I hope you find these are useful as I have. I’ll periodically add to the list, so check back occasionally.
Do you sometimes feel like long Bash scripts look like a mix of dark magic and rocket science? Me too! But I’ve finally managed to understand a set of reasonable guidelines to make my interaction with Bash not only effective, but also enjoyable! Now you can learn the best 10 Bash scripting tips too.
Puppi is a Puppet modules that drives Puppet's knowledge of the Systems to a command line tool that you can use to check services availability, gather info on the system and deploy application with a single command.
Backdooring the web is the cheapest and most hidden way to achieve
persistence on a compromised network, both if you're looking at
privileges on the webapp itself or at executing command to underlying
system.
During the talk, we will discuss the context of a web backdoor: the
environment where she can born and grow up will be defined.
Each environmental aspect will be thoroughly analyzed: where is the best
point of injection, why we choose a specific function or trick, what
permissions are needed, how to trigger the backdoor in a safe, hidden
and reproducible way, and of course what to inject.
The talk will thus present several ways to inject obfuscated and hard to
spot vulnerabilities in PHP code. Shown examples will backdoor CMS
plugins as well as custom code, altering the code and polluting the
webapp ecosystem (read: DBMS and webservers).
Phishing for Root (How I Got Access to Root on Your Computer With 8 Seconds o...Vi Grey
It is often said that if an attacker gets physical access to your computer, all bets are off. In this presentation, I show how an attacker can gain root access to a Mac or Linux computer with just 8 seconds of physical access by using an attack that spoofs the sudo password prompt and cleans up after itself.
Slide presentation on web site analytics for UIBE, believe me when I say you want to watch the video on this one. Video will be at the end of this one when done.
Macroeconomics- Movie Location
This will be used as part of your Personal Professional Portfolio once graded.
Objective:
Prepare a presentation or a paper using research, basic comparative analysis, data organization and application of economic information. You will make an informed assessment of an economic climate outside of the United States to accomplish an entertainment industry objective.
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Operation “Blue Star” is the only event in the history of Independent India where the state went into war with its own people. Even after about 40 years it is not clear if it was culmination of states anger over people of the region, a political game of power or start of dictatorial chapter in the democratic setup.
The people of Punjab felt alienated from main stream due to denial of their just demands during a long democratic struggle since independence. As it happen all over the word, it led to militant struggle with great loss of lives of military, police and civilian personnel. Killing of Indira Gandhi and massacre of innocent Sikhs in Delhi and other India cities was also associated with this movement.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Francesca Gottschalk - How can education support child empowerment.pptxEduSkills OECD
Francesca Gottschalk from the OECD’s Centre for Educational Research and Innovation presents at the Ask an Expert Webinar: How can education support child empowerment?
Honest Reviews of Tim Han LMA Course Program.pptxtimhan337
Personal development courses are widely available today, with each one promising life-changing outcomes. Tim Han’s Life Mastery Achievers (LMA) Course has drawn a lot of interest. In addition to offering my frank assessment of Success Insider’s LMA Course, this piece examines the course’s effects via a variety of Tim Han LMA course reviews and Success Insider comments.
2. Top
Gets you a list of processes that are consuming the CPU
htop
Near real time list of running processes by CPU, includes
scrolling, and mouse support
vmstat
Provides information about processes, memory, paging, I/O,
traps and CPU
w/who/finger
Provides information about users that are consuming
resources on the computer
ps (ps –ef )
Lists all the currently running processes on a Linux computer
3. pgrep/pkill
pgrep <process name> lists the PID of the process based on
name
pkill <process name> sends a specific kill signal (default
sigterm or shutdown) to a matching process
free
Shows the current memory usage of the system. Shows
physical and swap memory
mpstat
mpstat 2 5 - shows five set of data of global statistics among
all processors at two second intervals.
mpstat –P ALL 2 5 - shows 5 sets of statistics for all processors
at two second intervals.
4. iostat
reports CPU statists for devices and partitions
(including NFS Samba partitions)
pmap
This command reports memory map of a process. This
can be used to find memory usage of the process.
5. Set the debug mode for this, you will want it,
remember what each debug mode switch does
1. # set -n : Uncomment to check script syntax, without
execution.
2. # Note: Do not forget to put the comment back in
or
3. # the shell script will not execute!
4. # set -x : Uncomment to debug this shell script
6. PROC_MON=`basename $0` # Defines the script_name variable as the
file name of this script
LOGFILE="/home/ganesh/procmon.log" # Shows log file and where
located
[[ ! -s $LOGFILE ]] && touch $LOGFILE # This checks to see if the file exists
# if not it creates one.
TTY=$(tty) # Current tty or pty
PROCESS="ssh" # This will define which process to monitor
SLEEP_TIME="1" # This is the sleep time in second between
monitoring
txtred=$(tput setaf 1) # Red: will indicate a failed process and the information
txtgrn=$(tput setaf 2) # Green: this is successful process information
txtylw=$(tput setaf 3) # Yellow: this is used to show cautionary information
txtrst=$(tput sgr0) # resets text
7. function exit_trap # this is the behavior of the trap
signal
{
# Log an ending time for process monitoring
DATE=$(date +%D)
TIME=$(date +%T) # Get a new timestamp...
echo "$DATE @ $TIME: Monitoring for $PROCESS
terminated" >> $LOGFILE & # this will create an entry in
the logfile
echo "$DATE @ $TIME: ${txtred}Monitoring for
$PROCESS terminated${txtrst}"
#kill all functions
kill -9 $(jobs -p) 2>/dev/null
8. Set the trap to see if the process exits
trap 'exit_trap; exit 0' 1 2 3 15
# this will see if process is running if not will start it
ps aux | grep "$PROCESS" | grep -v "grep $PROCESS"
| grep -v $PROC_MON >/dev/null
9. if (( $? != 0 ))
then
DATE=$(date +%D)
TIME=$(date +%T)
echo
echo "$DATE @ $TIME: $PROCESS is NOT active...starting $PROCESS.." >> $LOGFILE & #
creates
# an entry in the logfile
echo "$DATE @ $TIME: ${txtylw}$PROCESS is NOT active...starting $PROCESS..${txtrst}"
echo
sleep 1
service $PROCESS start &
echo "$DATE @ $TIME: $PROCESS has been started..." >> $LOGFILE & #puts an enrty in logfile
else # this will say what to do if process is already running
echo -e "n" # a blank line
DATE=$(date +%D)
TIME=$(date +%T)
echo "$DATE @ $TIME: $PROCESS is currnetly RUNNING..." >> $LOGFILE & # puts entry in logfile
echo "$DATE @ $TIME: ${txtgrn}$PROCESS is currently RUNNING...${txtrst}"
fi
10. while (( RC == 0 )) # this will loop until the return code is not zero
do
ps aux | grep $PROCESS | grep -v "grep $PROCESS"
| grep -v $PROC_MON >/dev/null 2>&1
if (( $? != 0 )) # check the return code
then
echo
DATE=$(date +%D)
TIME=$(date +%T)
echo "$DATE @ $TIME: $PROCESS has STOPPED..." >> $LOGFILE & # entry
in logfile
echo "$DATE @ $TIME: ${txtred}$PROCESS has STOPPED...${txtrst}"
echo
service $PROCESS start &
echo "$DATE @ $TIME: $PROCESS has RESTARTED..." >> $LOGFILE & #
ENTRY IN LOGFILE
echo "$DATE @ $TIME: ${txtgrn}$PROCESS has RESTARTED...${txtrst}"
sleep 1
11. ps aux | grep $PROCESS | grep -v "grep $PROCESS"
| grep -v $PROC_MON >/dev/null 2>&1
if (( $? != 0 )) # This will check the return code
then
echo
DATE=$(date +%D) # New time stamp
TIME=$(date +%T)
echo "$DATE @ $TIME: $PROCESS failed to restart..." >> $LOGFILE
& #entry in logfile
echo "$DATE @ $TIME: ${txtred}$PROCESS failed to
restart...${txtrst}"
exit 0
fi
fi
sleep $SLEEP_TIME # This is needed to reduce CPU Load!!!
done
12. Process is hard coded in the script
# Process to be monitored
target="ssh"
16. # Monitor process and restart if necessary
for attempt in 1 2 3
do
ps aux | grep "$target" | grep -v "grep $target"
| grep -v $script_name >/dev/null
if [ $? != 0 ]
then
log_time=$(date)
echo
echo "$(tput setaf 3)$target is not running. Attempt will be made to restart. This is attempt
$attempt of 3.$(tput sgr0)"
echo >>$log_file
echo "$log_time: $target is not running. Restarting. Attempt $attempt of 3.">>$log_file
echo
service $target start &
sleep 2 # Pause to prevent false positives from restart attempt.
else
attempt="3"
fi
done
sleep 2 # Pause to prevent false positives from restart attempt.
}
17. detect_failure()
{
ps aux | grep "$target" | grep -v "grep $target"
| grep -v $script_name >/dev/null
if [ $? != 0 ]
then
log_time=$(date)
echo
echo "$(tput setaf 1)$target is not running after 3 attempts. Process has failed and
cannot be restarted. $(tput sgr0)" # Report failure to user
echo "This script will now close."
echo "">>$log_file
echo "$log_time: $target cannot be restarted.">>$log_file # Log failure
script_failure="1" # Set failure flag
else
log_time=$(date)
echo
echo "$log_time : $target is running."
echo "$log_time : $target is running." >> $log_file
fi
}
18. program_closing()
{
# Report and log script shutdown
log_time=$(date)
echo
echo "Closing ProcMon script. No further monitoring of $target will be
performed." #Reports closing of ProcMon to user
echo
echo "$(tput setaf 1)$log_time: Monitoring for $target terminated. $(tput sgr0)"
echo
echo "$log_time: Monitoring for $target terminated.">>$log_file # Logs closing
of ProcMon to log_file
echo >> $log_file
echo "***************" >> $log_file
echo >> $log_file
# Ensure this script is properly killed
kill -9 > /dev/null
}
19. # Trap shutdown attempts to enable logging of shutdown
trap 'program_closing; exit 0' 1 2 3 15
# Inform user of purpose of script
clear
echo
echo "This script will monitor $target to ensure that it is running,"
echo "and attempt to restart it if it is not. If it is unable to"
echo "restart after 3 attempts, it will report failure and close."
sleep 2
#Perform monitoring
while [ $script_failure != "1" ]
do
process_monitoring # Monitors process and attempts 3 restarts if it fails.
detect_failure # Reports failure in the event that the process does not restart.
if [ $script_failure != "1" ]
then
sleep $wait_time
fi
done
sleep 2
program_closing # Logs script closure
exit 0