Basic Docker Commands

If you wish to view all available commands in docker, use the following command: sudo docker or docker mohammedrafi@NOC-RAFI:~$ docker Usage: docker [OPTIONS] COMMAND [arg...] A self-sufficient runtime for linux containers. Options: --api-cors-header= Set CORS headers in the remote API -b, --bridge= Attach containers to a network bridge --bip= Specify network bridge IP -D, --debug=false … Continue reading Basic Docker Commands

limits.conf with ansible

[root@localhost ~]# ansible-galaxy init limits.conf - limits.conf was created successfully [root@localhost ~]# ansible-doc pam_limits [root@localhost ~]# vim limits.conf/tasks/main.yml --- # tasks file for limits.conf - pam_limits: domain: "{{ item.domain }}" limit_type: "{{ item.limit_type }}" limit_item: "{{ item.limit_item }}" value: "{{ item.value }}" with_items: "{{ limits_conf_settings }}" [root@localhost ~]# vim limits_conf.yml --- - hosts: all roles: … Continue reading limits.conf with ansible

how to use sysctl with ansible

[root@localhost ~]# sysctl -a |grep vm.swappiness vm.swappiness = 30 [root@localhost ~]# ansible-galaxy init sysctl - sysctl was created successfully [root@localhost ~]# ansible-doc sysctl [root@localhost ~]# vim test.yml --- - hosts: localhost roles: - sysctl vars: sysctl_settings: - name: vm.swappiness value: 90 [root@localhost ~]# vim sysctl/tasks/main.yml --- # tasks file for sysctl - name: sysctl settings … Continue reading how to use sysctl with ansible

How to set ulimit values

1. Soft limit: is the value that the kernel enforces for the corresponding resource. 2. Hard limit: acts as a ceiling for the soft limit. [root@localhost ~]# cat /etc/security/limits.conf # /etc/security/limits.conf # #This file sets the resource limits for the users logged in via PAM. #It does not affect resource limits of the system services. … Continue reading How to set ulimit values

learning php

Note: install vagrant on your physical machine(laptop or desktop) mohammedrafi@NOC-RAFI:~$ mkdir phplearning mohammedrafi@NOC-RAFI:~$ cd phplearning/ mohammedrafi@NOC-RAFI:~/phplearning$ mohammedrafi@NOC-RAFI:~/phplearning$ vagrant --version Vagrant 1.8.1 mohammedrafi@NOC-RAFI:~/phplearning$ vim Vagrantfile VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty32" config.vm.network "forwarded_port", guest: 80, host: 8080 config.vm.provision "shell", path: "provisioner.sh" end mohammedrafi@NOC-RAFI:~/phplearning$ vim provisioner.sh #!/bin/bash sudo apt-get install python-software-properties -y sudo C_ALL=en_US.UTF-8 … Continue reading learning php

Allow icmp with specific Message Types

It can be with Type or Description ICMP Message Types Description ICMP Message Types: ex: iptables -I INPUT -p icmp --icmp-type echo-request -s 1.2.3.4 -j ACCEPT Type:  ex: iptables -I INPUT -p icmp --icmp-type 8 -s 1.2.3.4 -j ACCEPT ICMP Message Types The type field identifies the type of the message sent by the host or gateway. Many of … Continue reading Allow icmp with specific Message Types

Installing PHP

Installing PHP: PHP originally stood for Personal Home Page, but of late it is referred to as Hypertext Preprocessor. It is a server-side scripting language designed for web development. It is one of the core standing pillars for the LAMP (Linux, Apache, MySQL, and PHP) or LEMP (Linux, Nginx, MySQL, and PHP) stack. Please keep … Continue reading Installing PHP

nginx deep dive

What Is a Web Server ? Web server is a server that hosts an application that listens to the HTTP requests. It is the web server’s responsibility to hear (i.e., to understand HTTP) what the browser is saying , and respond appropriately. Sometimes, it could be as simple as fetching a file from the file … Continue reading nginx deep dive

Managing Container in docker

Make sure you have already installed vagrant and virtual-box https://shaikmdrafi.wordpress.com/2017/01/13/vagrant/ mohammedrafi@NOC-RAFI:~$ mkdir practise && cd practise mohammedrafi@NOC-RAFI:~/practise$ mohammedrafi@NOC-RAFI:~/practise$ vim Vagrantfile VAGRANTFILE_API_VERSION = "2" $bootstrap=<<SCRIPT apt-get update apt-get -y install wget wget -qO- https://get.docker.com/ | sh gpasswd -a vagrant docker service docker restart SCRIPT Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.box = "ubuntu/trusty64" config.vm.network "private_network", ip: "192.168.33.10" config.vm.provider "virtualbox" … Continue reading Managing Container in docker

Types of Modules (roles & profiles) file structure in puppet

Types of Modules Component Modules: Modules managing specific technologies. Profile Modules: Wrapper modules which used multiple component modules to create a technology stack. ex: creating app server module by using webserver and tomcat Role Module: Wrapper modules which uses multiple profiles to create complete system configuration. ex: create web-serve role with by using web-server host … Continue reading Types of Modules (roles & profiles) file structure in puppet