Skip to content

Instantly share code, notes, and snippets.

View varunpalekar's full-sized avatar

Varun Palekar varunpalekar

  • Siemens
  • Pune
View GitHub Profile

This document includes details about chef-dk tool set.

Chef-dk tool set consists of following tools:

  • chef
  • kitchen
  • berks
  • chef-apply
  • chef-client
  • chef-shell

Create database dump

mysqldump -h mysqlhost --port 3306 -u reporting -p database_name | gzip > database_name_$(date '+%y-%m-%d').gz

Restore mysql dump to database

mysql -u <user> -p -h mysqlhost [database] < db_backup.dump

See size of all Database in MySQL

1 Java Application Monitoring Architecture

2 Components:

2.1 Application Metric monitoring agent StageMonitor:

An open source solution to application performance monitoring for java server applications. Its application is divided in two main parts:

Run normal shell command on:

salt '*' cmd.run 'hostname'

In above cmd => function and run => module function of main function, you can also write your own function and many people already made many of them, you can also use them.

salt '*' disk.usage

Above function is for disk usage

Re-run cloud-init

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

sudo rm -rf /var/lib/cloud/* sudo cloud-init init sudo cloud-init modules -m final

cfn-init

========

Tomcat7 setup extra application instance on Ubuntu

  1. Install tomcat7-user package
  2. Run following command sudo tomcat7-instance-create -p 8081 -c 8006 tomcat7_odc
  3. Copy /etc/init.d/tomcat7 to /etc/init.d/tomcat7_odc for service file
  4. Make folder common if required in tomcat7_odc directory
  5. copy /etc/tomcat7/policy.d to tomcat7_odc/conf/policy.d
  6. copy server.xml to new installed conf folder if required.
  7. Copy /etc/default/tomcat7 to /etc/default/tomcat7_odc

Make AWS IAM role/user for access cloudwatch

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "logs:CreateLogGroup",

FTP cli upload by curl

curl -T file.zip --progress-bar ftp.server.com --user user:pass

elastalert Used for alert Elasticsearch Events:

Rules parameters

# (Required)
# Rule name, must be unique
name: Java Error application