Skip to content

Instantly share code, notes, and snippets.

View skamithi's full-sized avatar

Stanley Karunditu skamithi

  • Raleigh, North Carolina
View GitHub Profile
@skamithi
skamithi / key_fun
Last active October 16, 2018 04:46
funguo yangu
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCxf7IGX+reoBVrvi8LWl8bbbXS6sbw/I1mwzJ4ixCEgGqRtC8EENkCBZaQWcuJ92GoIvG6Obtj1PhcsFekTFOZnChUrxvM9BTNWZbPukbCZTlVWib4U85WsDoNwsWdr+PH13yUgEyDr7iKgxY0i4fi8ooNM5YT7Zj3wENGThbpIah8PFWaWfK1IYmGFo/5FECEgykcoVfO3gJlBo59ObvlRb+V2M759Rk0Mq5aYhe3JMnCGtEKbsbnRMQvbvAjJexjC0rf4vfH6euEsSdEnyXLwvNQz8cD5aPzRj9M2sQiJm7AZyxaed0gPYITZiLYF3UCqo44yKlKYQll0+F0EbCf
https://codepen.io/skamithi/pen/eLjGGd?editors=1100
@skamithi
skamithi / working.log
Created May 20, 2018 13:10
RabbitMQ recovery
Last login: Sun May 20 02:09:59 2018 from 192.168.121.1
[vagrant@tower3 ~]$ sudo tail -f /var/log/rabbitmq/rabbitmq\@tower3
tail: cannot open ‘/var/log/rabbitmq/rabbitmq@tower3’ for reading: No such file or directory
tail: no files remaining
[vagrant@tower3 ~]$ sudo tail -f /var/log/rabbitmq/rabbitmq\@tower3.log
Mirrored queue '2e1669a9-2e90-3577-a332-644a2c24352d.reply.celery.pidbox' in vhost 'tower': Synchronising: all slaves already synced
=INFO REPORT==== 20-May-2018::13:05:07 ===
Mirrored queue '2e1669a9-2e90-3577-a332-644a2c24352d.reply.celery.pidbox' in vhost 'tower': Synchronising: 0 messages to synchronise
@skamithi
skamithi / pgsql-replication.yml
Created May 11, 2018 01:25
Copy of the pgsql-replication script from samdoran/ansible-role-pgsql-replication
- name: Configure PostgreSQL streaming replication
hosts: database_replica
tasks:
- name: Find recovery.conf
find:
paths: /var/lib/pgsql
recurse: yes
patterns: recovery.conf
register: recovery_conf_path
@skamithi
skamithi / test.yml
Created May 6, 2018 04:16
block rescue
- hosts: linuxsimbasvr
gather_facts: no
tasks:
- block:
- name: create tempfile
tempfile:
state: file
suffix: ".file.tmp"
register: mytmpfile
@skamithi
skamithi / install-postgres.yml
Created April 24, 2018 19:33
installing postgres on 2nd postgres node
---
- hosts: second_database
tasks:
- name: Find recovery.conf
find:
paths: /var/lib/pgsql
recurse: yes
patterns: recovery.conf
register: recovery_conf_path
---
- hosts: localhost
connection: local
tasks:
- name: run a shell command
shell: cat /tmp/123
register: shell_output
# failed_when: false # do not print out json blob if it fails
ignore_errors: yes # print out json blob with error message
changed_when: false
@skamithi
skamithi / postvalidate.yml
Last active February 24, 2018 03:05
postvalidate.yml
---
- hosts: all
vars:
tasks:
- block:
- name: get interface status
shell: /usr/sbin/ip -o link show | awk '{print $2 $3 }'
register: iface_output
changed_when: false
@skamithi
skamithi / prevalidate.yml
Last active February 22, 2018 19:17
rhel prevalidate
---
# User Input Variables (extra vars)
# memory_threshold: Value in MB. If free memory is less than this value then stop prevalidation
# swap_threshold: Value in MB. If free swap is less than this value then stop prevalidation
# disk_threshold: Value in MB. If free disk space is less than this value then stop prevalidation
# change selected host group to match requirements
- hosts: all
# ensure gather facts is on
gather_facts: yes
vars:
@skamithi
skamithi / analysis_tower.json
Last active February 20, 2018 15:05
analyse tower script
HOST VAR ANALYSIS
-------
mygrouptwovarstwo {'host_count': 2, 'group_count': 1}
myvars {'host_count': 2, 'group_count': 1}
anothergroup2 {'host_count': 2, 'group_count': 1}