This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # XenServer Pool Patching Script | |
| set -euo pipefail | |
| readonly PATCHFILE=$1 | |
| pushd /root/hotfix >/dev/null || exit 1 | |
| readonly HOSTS=$(xe host-list --minimal |tr , ' ') | |
| UUID=$(xe patch-upload file-name="$PATCHFILE") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Tunnel 1 | |
| =================================== | |
| set security ike proposal ike-prop-vpn-to-aws-1 authentication-method pre-shared-keys | |
| set security ike proposal ike-prop-vpn-to-aws-1 authentication-algorithm sha1 | |
| set security ike proposal ike-prop-vpn-to-aws-1 encryption-algorithm aes-128-cbc | |
| set security ike proposal ike-prop-vpn-to-aws-1 lifetime-seconds 28800 | |
| set security ike proposal ike-prop-vpn-to-aws-1 dh-group group2 | |
| set security ike policy ike-pol-vpn-to-aws-1 mode main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| root@db-001:~# mygrants $@ mygrants() | |
| { | |
| mysql -BN $@ -e "SELECT DISTINCT CONCAT('SHOW GRANTS FOR ''',user,'''@''',host,''';') AS query FROM mysql.user" | \ | |
| mysql $@ | \ | |
| sed 's/\(GRANT .*\)/\1;/;s/^\(Grants for .*\)/## \1 ##/;/##/{x;p;x;}' | |
| } | |
| This will generate GRANTS for each user in your MySQL database server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #! /bin/bash | |
| # Dijeesh Padinhaethil | |
| # Script to take MySQL backups to remote server using Percona Xtrabackup | |
| # Confirm log directory exist, create on if doesn't. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # XenServer Disk Monitoring and post message to XenCenter | |
| # Get this host's UUID | |
| thisUUID=`xe host-list name-label=$HOSTNAME params=uuid --minimal` | |
| # Threshold of disk usage to report on | |
| threshold=75 # an example of how much disk can be used before alerting | |
| # Get disk usage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cd /var/named | |
| sed -i 's/20[0-9][0-9]\{7\}/2016120701/g’ *.db | |
| This will set Serial Numbers for all zones to : 2016120701 [ YYYYMMDDNN ] | |
| Take a backup of named directory before updating serial numbers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- | |
| AWSTemplateFormatVersion: '2010-09-09' | |
| Description: 'CloudFormation - EKS VPC Stack' | |
| Parameters: | |
| EnvironmentName: | |
| Description: 'CloudFormation - EKS VPC Stack' | |
| Type: String | |
| Default: '- CloudFormation - EKS VPC Stack' | |
| VPCName: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Install jq | |
| 2. Run | |
| ( | |
| NAMESPACE=YOUR-NAMESPACE | |
| kubectl proxy & | |
| kubectl get namespace $NAMESPACE -o json |jq '.spec = {"finalizers":[]}' >temp.json | |
| curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT table_schema "DB Name", Round(Sum(data_length + index_length) / 1024 / 1024, 1) "DB Size in MB" FROM information_schema.tables GROUP BY table_schema; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3' | |
| services: | |
| db: | |
| container_name: db | |
| image: postgres:9.6 | |
| restart: always | |
| volumes: | |
| - "/data/metabase/pgdata:/var/lib/postgresql/data" |
OlderNewer