Skip to content

Instantly share code, notes, and snippets.

Avatar

DevOps School devops-school

View GitHub Profile
@devops-school
devops-school / apache-conf.yaml
Created Apr 8, 2021
Configure Ansible for Deployment of Datadog Agent in Multiple Linux Servers
View apache-conf.yaml
## All options defined here are available to all instances.
#
init_config:
## @param proxy - mapping - optional
## Set HTTP or HTTPS proxies for all instances. Use the `no_proxy` list
## to specify hosts that must bypass proxies.
##
## The SOCKS protocol is also supported like so:
##
@devops-school
devops-school / commands.sh
Last active Feb 15, 2021
PHP script to dump full HTTP request to file (method, HTTP headers and body).
View commands.sh
$ grep -o 'account id: [^ ]\+' dumprequest.txt | sort | uniq -c
993 account id: 2919295
496 account id: 2956515
99 account id: 2956534
989 account id: 2984338
494 account id: 2984644
495 account id: 2984661
@devops-school
devops-school / mod_log_forensic.txt
Last active Feb 15, 2021
Enable mod_log_forensic module using following lines in httpd.conf
View mod_log_forensic.txt
LoadModule log_forensic_module /usr/lib64/httpd/modules/mod_log_forensic.so
<IfModule log_forensic_module>
ForensicLog /opt/lampp/logs/forensic_log
</IfModule>
@devops-school
devops-school / linux-file.yml
Last active Nov 25, 2020
Newrelic - Example of a logging.d configuration file in YAML format
View linux-file.yml
###############################################################################
# Log forwarder configuration file example #
# Source: file #
# Available customization parameters: attributes, max_line_kb, pattern #
###############################################################################
logs:
# Basic tailing of a single file
- name: basic-file
file: /var/log/logFile.log
@devops-school
devops-school / Enable-mod_status-Apache-web-server.md
Created Nov 24, 2020
Enable mod_status to Monitor Apache Web Server Load and Page Statistics
View Enable-mod_status-Apache-web-server.md

$ sudo vi /etc/httpd/conf/httpd.conf

DocumentRoot "/var/www/html"
LoadModule status_module modules/mod_status.so
<Location /server-status>
   SetHandler server-status
   Order deny,allow
   Deny from all
   Allow from all
@devops-school
devops-school / Newrelic-Infrastructure-start-stop.md
Created Nov 23, 2020
Newrelic Infrastructure: Start, stop, and restart the infrastructure agent
View Newrelic-Infrastructure-start-stop.md

Linux: Start, stop, restart, or check agent status

$ sudo systemctl <start|stop|restart|status> newrelic-infra

System V (Debian 7, SLES 11.4, CentOS 5, RHEL 5):
$ sudo /etc/init.d/newrelic-infra <start|stop|restart|status>

Upstart (Amazon Linux, CentOS 6, RHEL 6, Ubuntu 14.04 or lower):
$ sudo initctl <start|stop|restart|status> newrelic-infra
@devops-school
devops-school / clean-kubernetes-master-worker.md
Last active Sep 10, 2020
How to delete/remove/clean existing corrupted or old kubeadm kubernetes clusters setup?
View clean-kubernetes-master-worker.md
$ docker rm $(docker ps -aq)
$ docker rm -f -v $(docker ps -q)
$ systemctl stop kubelet
$ systemctl stop docker
$ find /var/lib/kubelet | xargs -n 1 findmnt -n -t tmpfs -o TARGET -T | uniq | xargs -r umount -v
$ rm -r -f /etc/kubernetes /var/lib/kubelet /var/lib/etcd
$ kubeadm reset
$ iptables --flush
$ sudo rm -rf ~/.kube
@devops-school
devops-school / docker-install-centos-rthel.md
Last active Sep 10, 2020
How to install Docker Community Edition via YUM?
View docker-install-centos-rthel.md

Command 1 - Install required packages. yum-utils provides the yum-config-manager utility, and device-mapper-persistent-data and lvm2 are required by the devicemapper storage driver.

$ sudo -s
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2

Command 2 - Use the following command to set up the stable repository

$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
@devops-school
devops-school / phpmyadmin.txt
Created Sep 5, 2020
phpmyadmin access on network with password config setup
View phpmyadmin.txt
Refer
https://www.ostraining.com/blog/coding/error-1045-phpmyadmin/
https://www.quora.com/How-do-we-force-phpMyAdmin-to-prompt-me-for-my-username-and-password
GRANT ALL PRIVILEGES ON dbname.* TO 'dbuser'@'localhost';
flush privileges;
1 - Log into mysql as root
$ mysql -u root -p
@devops-school
devops-school / aws-s3-policy-ipaddress-domain.json
Created Aug 28, 2020
Example of S3 Bucket Policy to allow from IP address and Domain name
View aws-s3-policy-ipaddress-domain.json
# Example of S3 Bucket Policy to allow from IP address and Domain name
{
"Version": "2008-10-17",
"Id": "http referer policy example",
"Statement": [
{
"Sid": "Allow get requests originated from www.example.com and example.com",
"Effect": "Allow",
"Principal": {