Linux Doc



Nagios
https://www.digitalocean.com/community/tutorials/how-to-create-nagios-plugins-with-bash-on-ubuntu-12-10
http://www.yourownlinux.com/2014/06/how-to-create-nagios-plugin-using-bash-script.html
http://www.tecmint.com/install-nagios-in-linux/
http://blog.centreon.com/good-practices/


mysql replication
https://www.percona.com/blog/2013/01/09/how-does-mysql-replication-really-work/
http://www.tecmint.com/how-to-setup-mysql-master-slave-replication-in-rhel-centos-fedora/


mysql - pt-query digest- aneometer
http://www.olindata.com/blog/2014/07/anemometer-mysql-slow-query-monitor
https://www.percona.com/blog/2012/08/31/visualization-tools-for-pt-query-digest-tables/


memcached
http://www.tecmint.com/install-memcached-caching-server-on-rhel-centos-fedora/

linux boot process
http://www.thegeekstuff.com/2011/02/linux-boot-process/
https://www.quora.com/How-does-the-Linux-boot-process-work
http://www.slashroot.in/linux-booting-process-step-step-tutorial-understanding-linux-boot-sequence

glusterfs


Raid
http://www.thegeekstuff.com/2010/08/raid-levels-tutorial/
-----------------------------------------------------------------------------------------------------------------

( innovativeness ) 
1) nagios monitoring - plugin creation - third party server .  

( solving problem  slow logs -- appreciation from client  ) 
2) pt-query-digest - anometer 

( cleint apprication  ) 
2) MP DE - se-config issue .  We got a call at 12 mid night and reset those changes.

( inovativeness ) 
3) Had setup behat  scripting for automated smoke testing ( gherkin) ..when I didn't even know how it was done ... using the php composer mink extension.
4) Other initiative I took was integrating slack with jira. Skack bot.

( innovativeness ) 
5) I was a part of.the implementation team.. the dns was managed by our client . He had to create a excel sheet of about 15 dns enteries  for  each domain every time a site went live . I had developed a simple web app that was apache authenticated . The client just had to enter the domans name and region ..He would get all the dns enteries associated with that domain and was downloadable. Client was pretty impressed. 

( innovative ness ) 
6) Had setup up centralized logging with logstash and kibana and elastic search.

( one of the problems we face, appication from the client  )
7) We had bots hitting our server. 
 options 1)  Goaccess.io , provided a dashboard for all the top 100 ips based on request . 
option 2 )  created a script to grep and  

( one of the problems we face )
8)  the script on  haproxy --> elb CNAME ( the name used to change ) - 

( Description of our environment) 
8)   - Every region had its own architecture. -  Elb -->  Varnish/nginx  --> Elb ->  Web ( distributed az zones ) -> Rds (Multi az setup)

code deployment 


                              
[linux troubleshooting ]                                                                                                                                                                                                        Memcached server 
9) trouble shooting skills -- uptime , top , iostat , iotop , sysstat , Sar -f file name
10) boot proecess - BIOS , MBR, Grub ,  Kernel , /sbin/init -> /etc/initab, run level , /etc/rc.d/rc*.d/S23syslog.  
11) format linux file system fdisk device , mkfs -t ext3 device , ./etc/fstab, mount -a  
13) linux hardening :           more partitions,             uncecessary services on ,             netstat,           never login as root,                groupremoved x window system. , psacct ( tracks users activity ), /etc/sysctl.conf ignore ping , Lynis (auditing s/w) , disable pam authenitication only alow with key
14) syslog/ rsynlog/ logstash --
15) puppet - master port 8140, puppet cert sign --all/hostname , puppet cert list -all , puppet cert clean hostname

[AWS]
cloudformation - json, [descrption ,parameter ,  resource and output ]
AWS CLI  --user data 
elasticbeastalk -- pip install awsebcli 


16) ansible 

17 ) how apache wok  - Prefork MPM  and  Worker MPM
18) apache status code - 200 , 400, 401 , 404, 500, 301 
15) raid : 0 , 1 , 5 , 10 
16) content of  /etc/passwd - user:passd:UID: GID: User ID Info: Home directory: 
      /etc/shadow file is by shadow-utils package 

17) lsof 
18) kill - SIGTERL or kill -15 is safe ,  SIGHUP or kill -1 is clean kill , kill -2 or SIGINT is same is ctl+c , kill -9 force kill

19) fine tuning apache : a2enmod a2dismod, disable mod_php and add php-fpm which uses fastcgi protocol 
 Setup appropriate Expires, Etag, and Cache-Control Headers
mod_gzip/mod_deflate , Avoid using hostname in configs , Do Not set KeepAliveTimeout too high,Options +FollowSymLinks, mod_security, mod_evasive 
list modules : apachectl -m 


20 ) what is zombiee process : When a child exits, the parent process will receive a SIGCHLD signal to indicate that one of its children has finished executing; the parent process will typically call the wait() system call at this point. That call will provide the parent with the child’s exit status, and will cause the child to be reaped, or removed from the process table.
Kill -s SIGCHILD pid

21) mysql replication : master -> wr to logsbinary <-- --="" from="" iothread="" slave="">wr relay log<-- nbsp="" read="" span="" sql="" thread="">

22) rewite rules 

23) loading kernel module : insmod , modprobe , lsmod 



There are a number of MPM modules (Multi-Processing Modules), but by far the most widely used (at least on *nix platforms) are the three main ones: prefork, worker, and event. Essentially, they represent the evolution of the Apache web server, and the different ways that the server has been built to handle HTTP requests within the computing constraints of the time over its long (in software terms) history.

prefork
mpm_prefork is.. well.. it's compatible with everything. It spins of a number of child processes for serving requests, and the child processes only serve one request at a time. Because it's got the server process sitting there, ready for action, and not needing to deal with thread marshaling, it's actually faster than the more modern threaded MPMs when you're only dealing with a single request at a time - but concurrent requests suffer, since they're made to wait in line until a server process is free. Additionally, attempting to scale up in the count of prefork child processes, you'll easily suck down some serious RAM.

It's probably not advisable to use prefork unless you need a module that's not thread safe.

Use if: You need modules that break when threads are used, like mod_php. Even then, consider using FastCGI and php-fpm.

Don't use if: Your modules won't break in threading.

worker
mpm_worker uses threading - which is a big help for concurrency. Worker spins off some child processes, which in turn spin off child threads; similar to prefork, some spare threads are kept ready if possible, to service incoming connections. This approach is much kinder on RAM, since the thread count doesn't have a direct bearing on memory use like the server count does in prefork. It also handles concurrency much more easily, since the connections just need to wait for a free thread (which is usually available) instead of a spare server in prefork.

Use if: You're on Apache 2.2, or 2.4 and you're running primarily SSL.

Don't use if: You really can't go wrong, unless you need prefork for compatibility.

However, note that the treads are attached to connections and not requests - which means that a keep-alive connection always keeps ahold of a thread until it's closed (which can be a long time, depending on your configuration). Which is why we have..

event
mpm_event is very similar to worker, structurally; it's just been moved from 'experimental' to 'stable' status in Apache 2.4. The big difference is that it uses a dedicated thread to deal with the kept-alive connections, and hands requests down to child threads only when a request has actually been made (allowing those threads to free back up immediately after the request is completed). This is great for concurrency of clients that aren't necessarily all active at a time, but make occasional requests, and when the clients might have a long keep-alive timeout.

The exception here is with SSL connections; in that case, it behaves identically to worker (gluing a given connection to a given thread until the connection closes).

Use if: You're on Apache 2.4 and like threads, but you don't like having threads waiting for idle connections. Everyone likes threads!


India.com.. Had setup along with my seniors the bsd based 

interview questions 
=======================

ant and maven 
svn and git 
branch in svn 
tag in svn
how to call one ant script from another ant script 
how to call a ant script if it is not build.xml
how to generate ssh key
differnce between top and head !! 


How to set up HAproxy 
How to set up DRBD 
ldap how to set up 
what is inode - description of inode  
how to setup sofware RAID 
hard link and soft link 
how to set up lvm
we have 100gb  os disk space on a certain location ... log file is 100 gb .. we delete that log file . But we dont see the disk space some down.  

we are not able to unable to mount partition  .. error  say system resource is utilizing that partition.  
what are filehandles -- 2>&1  ...lsof 

/etc/hosts how it comes to know it has to look in etc host file 
how traceroute work 
tcp and upd   



---------------------------------------------------------------------------------------------------

1)Are you working as Primary OR Secondary support system admin?  primary
2)Linux and Windows Server setup from scratch in black box. yes
3)Have you closely worked with web developer to resolve the server issue faced during development.  yes ( for all major websites of india.com )
4)SSL configuration? yes


5)SVN repository for multiple developers on multiple project. yes ( set up for the india.com office)
6)Name based Virtual Host on development server.  yes
7)Major Apache Modules installation & configuration. yes
8)Major PHP Extension installation & Configuration yes
9)Server Performance Optimization and enhancement. yes
10)Proficient in Major Linux command without searching on internet. yes
11)What kind of projects have you worked on?     


Setting up entire datacenter for india.com


setting up of the xen servers  on the blade hardware .


setting up automated deployments scripts ( written in perl and shell)


setting up of automated backup systems .


and much more ( do refer my resume )


12)Multitire server architecture for high volume project ... yes ( for india.com & netcore solutions )
13)Technical Expertise for database installation and configuration.  yes
14)Identify and resolve server security issue with prior information to Head. yes
15)Define the timeline for given work.  yes
16)Inform status of work and implementation status everyday by Email.


* Maintain site servers and hosted web applications, ensuring up-time and site responsiveness.
* Troubleshoot problems and issues, escalating issues within the organization.
* Maintain system and network procedure documentation.
* Communication of system and network events and root cause analysis after resolution
* Diagnose and resolve LINUX server, OS, network and other failures and engage internal specialists and vendors in the respective areas as required.
* Provide daily site operations reports to Operations Management.
* Configure new LINUX servers using automated deployment tools.
* Manage Data Center racking, cabling, power, servers, and other devices.
* 3+ years of experience operating a large-scale, 24x7 web environment
* 3+ years experience with Linux or other Windows based operating system
* Familiarity with network management tools.
* Work closely with developers / vendor teams to ensure business and technical compatibility to the functional specification.
* Coordinate with developers and testers to resolve issues during testing phase.



Configuration, troubleshooting, debugging, etc.
    Linux system administration experience.
    Good theoretical knowledge of networking, UNIX-like services and concepts.
    Advanced application debugging knowledge.
    Basic kernel debugging and tuning knowledge.
    Strong troubleshooting skills and a passion for problem solving and investigation.
    Strong Customer focus and service orientation.
    Ability to work with conflicting priorities and able to use initiative to develop solutions.
    Previous knowledge of support systems and tools.
    Solid understanding of Open Source technologies and technical support environments.
    Software development/programming experience is preferred.
    Scripting abilities preferred (Perl/Python/Bash).
    Knowledge of enterprise storage solutions and clustering.
    Knowledge of enterprise database solutions.
    Prior participation in open source software projects is preferred.



------------------------------------------------------------------------------------------------------------------------
pxe installation of centos


iso creation
installation of centos via ks.cfg
OS  hardening
shell scripting
perl scripting
varnish
vmware
aws
xen
LAMP
Gluster
RAID
Zabbix
LDAP
puppet :
postfix mailing ---
http://www.textndata.com/forums/canonical-vs-virtual-192561.html (difference between cononical and virtual tables )


Nagios
touble shooting techniques
apache -- rewrite   --   rules
nginx


repair corrupted database
mysqlcheck -r [DBNAME]





rewrite rule




how apache works




apache : request headers and response headers .







svn --
ks.cfg
varnish sticky session





forking a process in perl : http://www.perlmonks.org/?node_id=176222












syslog --


linux memory issue : http://www.cyberciti.biz/faq/linux-performance-tools-to-troubleshoot-problem/



yum repository explaination --


                               http://www.thegeekstuff.com/2011/06/iptables-rules-examples/





find command --
find . -newermt "2010-03-31 0300" -not -newermt "2010-03-31 0310" -type d




kill command -













apache error codes :









RED HAT interview question .
prepare for
1. software testing methodologies and processes
2. SDLC
3. bugzilla, automation, test cases, test plans,
4. QA terms, regression, sanity, functional, etc
5. gluster + swift authentication mechanism
6. ldap, AD, kerberos


sr system engineer job duties :
 User Administration  Activities - Account Creation/Deletion/Modification.
-         Monitoring  the server Health -   CPU, Memory, Diskspace and network.
-         Monitoring the server backups.
-         printer Administration activities - Creating, Removing  Printers.
-         Maintaining Server inventory list. - Addition, Deletion of the servers
-         Scheduling the  jobs  using  crontab.
-         Monitoring  the mail Queue, Printer Queue jobs.
-         backup and  Restoring the  server data.
-         User password  reset activities.
-         Auditing  the servers  for  failed logins .
-         Escallating the  issues to Level 2 support  when the issue is not resolved by L1.
-         Hardening the Linux servers.
-         Troubleshooting  Backup and  restore  issues.
-         Patches and packages installation.
-         Configuring NTP and NFS servers.
-         Administration of  Linux services.
-         Clearing the defunc processes.
-         Configuring log rotation  for  log files.
-         Implementing  password policy.
-         Network administration activities.
-         Troubleshootiong server performance issues.
-         Mail Configuration.
-         Writing  SOP documents for Linux activities.
-         Server crash dump analysis




==========================================================


* Upgradation of OS
* Linux shell scripting
* Backup Implementation.
* Configuration of NIS and DNS sevrer.
* Installing OS
* Installing and Configuring new hardwares.
* Configuring Raid technologies.
* Upgradaing firmware.
* Upgrading CPU, memory and network resources.
* Implementing DR and BCP plan.
* OS performance tuning.


Desired Candidate Profile:
* Applicant must have experience of 2-4 yrs in Linux Administration.
* Candidate must be well versed with User Administration Activities - Account Creation/Deletion/Modification.
* Hands-on experince on Scheduling the jobs using crontab.
* Experience in troubleshooting Backup and restore issues.
* Expert at Configuring NTP and NFS servers & log rotation for log files
* Experince on Mail Configuration.




netstat command to check route .. wat  does it  stand for ( every thngs )


How to set up a DMZ  
how to increase kernel memory at boot time
how to check with rpm command the list of files installed before intallation
how to check with rpm the list of dependecies before installation


free opensource products



-----------------------------------------------------------------------------------------------------------------------


interview questions

indepth understainding of LVS -- how the webserver knows how to communicated with loadbalancer.
difference between nginx and apache
how replication working in mysql
how to install 100 servers automatically
how to install an application on 100 of servers .

post 8080 is not able to telnet --- hint wait state
content of grub
your website is not working  -- wat are the steps
wat is pingattack
load on the systems what do you check . what tools do you use
how does apache work . -- the flow
wat is rewrite rules -- why is it used
jboss , weblogic , apache-tomcat
what is DOS attack
how do you know dns is not working .




Linux guru


* Hardcore System Administrator, with vast experience in Linux Guru.
* Security and Uptime freak.
* A master of regular expressions and nifty one liner in sed, awk. Perl etc
* Ability to understand and solve complex problems, and to make quick decisions
* Ability to manage large server farms including cloud remotely and in a automated fashion.
* Strong customer service and computer skills.
* Able to manage multiple projects & prioritize diverse tasks
* Ability to solve a problem quickly & completely.
* A solid understanding of a LINUX-based operating system; understands paging and swapping, inter-process communication, devices and what device drivers do, file system concepts. Linux internal hacking.
* A solid understanding of networking/distributed computing environment concepts; understands principles of routing, client/server programming, the design of consistent network-wide file system layouts.
* A deep understanding of networking and networking technologies Switches, Routers, IP routing, load balancers, failure modes, diagnostics,...).
* Strong DNS Concepts.
* In-depth Knowledge of Apache web server and related modules like PHP, mod_security, Tomcat, SSL etc
* - Reverse proxies/HTTP accelerators.
* Ability to setup and maintain High Availability Clusters and Load Balanced environment
* In depth knowledge about Load balancing & High Availability.
* Firewalls (Iptables, BSD packet filter, other commercial etc)
* Understanding of Root kits, IDS, Firewall concepts
* SSH, SSL, Cyphers, PGP etc
* In-depth Knowledge of MRTG, Nagios, selinux.
* Knowledge about Linux system performance monitoring & tuning using tools like sysstat, dstat, oprofile, Frysk, SystemTap.
* Knowledge of MySQL, databases & in-depth fine-tuning procedures & advanced troubleshooting.
* Good knowledge of SQL & Databases (relational and non-relational,the ability to think in sets and graphs, performance tuning).
* Knowledge about RAID & LVM.
* Deep understanding of file systems - ext{234}, ntfs, XFS and recovery techniques.
* Knowledge of replicated & network file systems like NFS, DRBD.
* Knowledge of LDAP & Active Directory.
* Good program debugging skills.
* Scalability (Partitioning, Coupling, Caching etc) & capacity planning concepts.

Key Responsibilities:
* Monitoring of the Network, IT infrastructure and various applications to check for any new and outstanding alarms or issues.
* Troubleshooting, Resolving all Technical issues related to our software/networks and the range of Products and Services
* Design, build & implement infrastructures for large scalable web2.0 applications & networked systems.
* Creating high level architectural design of products & systems.
* Set up Monitoring, Configuration management, Administration & Operation practices for such applications/systems.
* Planning large migrations & executing it.
* Developing better monitoring and systems management practices to maximize uptime.
* Develop/Adopt new & efficient strategies to minimize manual/repetitive work, operational costs, deployment times, response times etc.
* Troubleshooting complex systems/network issues.
* Good understanding of statistics.
* Capacity planning
* Training & managing teams.
* Plan team todo's/goals, product upgrades/releases.
* Documenting processes, troubleshooting information, problems and their resolutions.
* Evaluate software/hardware products (free/commercial) as per needs.
* Prepare & present proposals with respect to systems/software infrastructure.
* Research & build specifications for new products & tools
* Acting as liaisons between junior system administrators, application administrators and software developers
* Converting software package requirements into configuration input for the configuration management system.
* High level log analysis, performance reports, trend analysis.
* Quick in decision making and execution.
* Assist operations teams in daily operations when required
* Assist developers in architectural and design problems.

LVM understanding




--------------------------------------------------------------------------------------------------------------
we use fdisk to format the raw hard disk 

fdisk /dev/sdb

/dev/sdb1               1          14      112423+  83  Linux
/dev/sdb2              15          28      112455   83  Linux
/dev/sdb3              29          42      112455   83  Linux
partprobe
-------------------------------------------------------------------------------------------------------------
now we create a physical volume
pvcreate /dev/sdb1 /dev/sdb2 /dev/sdb3 
pvdisplay
-------------------------------------------------------------------------------------------------------------

We create the volume group vg1

vgcreate vg1 /dev/sdb1 /dev/sdb2 
vgdisplay

------------------------------------------------

We now create the logical volume

lvcreate -L 200M vg1 -n lv1
lvdisplay 
mkfs.ext4 /dev/vg1/lv1
mount    /dev/vg1/lv1   /mnt/
-------------------------------------------------------------------------------------------------------------
to extend new hdd :
pvcreate  /dev/sdb1
vgextend vg1 /dev/sdb1
lvresize -L +100M /dev/vg1/lv1
resize2fs /dev/vg1/lv1
lvdisplay /dev/vg1/lv1

-------------------------------------------------------------------------------------------------------------
the following procedure, in this example we shrink a partition from 10G to 9G:
First, we unmount.
# umount /dev/vg_blah/lv_blah
Check the file system.
# e2fsck -f /dev/vg_blah/lv_blah
Resize the file system.
# resize2fs -p /dev/vg_blah/lv_blah 9G
Reduce the size of the logical volume.
# lvreduce -L -1G /dev/vg_blah/lv_blah
Shrink the volume group if desired.
# vgreduce vg_blah /dev/sdxy


set up of selenium server running in x virtual framebuffer

yum install  xorg-x11-server-Xvfb
yum install xorg-x11-fonts*
yum install libXfont

run in background

 DISPLAY=:1 xvfb-run java -jar  /usr/local/bin/selenium-server-standalone-2.31.0.jar  &

# netstat -tupln |grep :::4444
tcp        0      0 :::4444                     :::*                        LISTEN      17369/java  



Other Articles

Enter your email address: