Posts

Showing posts from June, 2015

How to clean all the foreman task and locked task

1.- First make su to postgres user su -s /bin/bash - postgres  2.-Execute psql psql  3.- connect to the foreman database \c foreman;  4.- Delete all the foreman task and foreman task locks delete from foreman_tasks_tasks;  delete from foreman_tasks_locks;  5.- Quit from postgres and exit \q  exit  6. Restart all the services for s in {qpidd,pulp_celerybeat,pulp_ resource_manager,pulp_workers, httpd}; do sudo service $s restart; done  Update in todays foreman you can clean the task using the following command: foreman-rake foreman_tasks:cleanup

Migration Script from Winbind to SSSD

#!/bin/bash echo Disable winbind authconfig --disablewinbindauth  --disablewinbind --disablekrb5 --updateall service winbind stop chkconfig winbind off echo Setup Kerberos rm -f /etc/krb5.conf  cat > /etc/krb5.conf << "EOF" [logging]  default = FILE:/var/log/krb5libs.log  kdc = FILE:/var/log/krb5kdc.log  admin_server = FILE:/var/log/kadmind.log [libdefaults]  default_realm = EXAMPLE.COM  dns_lookup_realm = true  dns_lookup_kdc = true  ticket_lifetime = 24h  renew_lifetime = 7d  forwardable = true [realms]  EXAMPLE.COM = {   kdc = ad.example.com   admin_server = ad.example.com  } [domain_realm]  example.com = EXAMPLE.COM  .example.com= EXAMPLE.COM EOF echo Samba Setup rm -f /etc/samba/smb.conf  cat > /etc/samba/smb.conf << "EOF" [global]         workgroup = EXAMPLE         server string = Samba Server Version %v # Max Log Size let you specify the max size log

Postgresql BDR Setup

yum install http://packages.2ndquadrant.com/postgresql-bdr94-2ndquadrant/yum-repo-rpms/postgresql-bdr94-2ndquadrant-redhat-1.0-2.noarch.rpm yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm yum update yum install postgresql-bdr94-bdr Initialize Node1 and 2 database /usr/pgsql-9.4/bin/postgresql94-setup initdb Setup Postgresql.conf and hba node 1 /var/lib/pgsql/9.4-bdr/data/postgresql.conf listen_addresses = '*'  port = 5598   shared_preload_libraries = 'bdr'     wal_level = 'logical'     track_commit_timestamp = on     max_connections = 100     max_wal_senders = 10     max_replication_slots = 10     # Make sure there are enough background worker slots for BDR to run     max_worker_processes = 10     # These aren't required, but are useful for diagnosing problems     #log_error_verbosity = verbose     #log_min_messages = debug1     #log_line_prefix = 'd=%d p=%p a