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
| cat postgresql.conf |awk '{$1=$1};1' |grep -v "^#" | egrep -v "^[ ]*$|^#" |more |
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
| # foreman-rake db:migrate --trace | |
| ** Invoke db:migrate (first_time) | |
| ** Invoke environment (first_time) | |
| ** Execute environment | |
| TABLE dynflow_schema_info | |
| rake aborted! | |
| Sequel::Migrator::Error: More than 1 row in migrator table | |
| /opt/theforeman/tfm/root/usr/share/gems/gems/sequel-4.20.0/lib/sequel/extensions/migration.rb:590:in `schema_dataset' | |
| /opt/theforeman/tfm/root/usr/share/gems/gems/sequel-4.20.0/lib/sequel/extensions/migration.rb:444:in `initialize' |
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 | |
| # requires 'bc' installed | |
| # Sum up the RAM used by processes with given name | |
| # eg: | |
| # $ mem-process-sum postgres | |
| # 1.6777 GB | |
| ps aux | sort -nk6 |grep $1 | awk '{print $6}' | paste -sd+ | bc | awk '{$1=$1/(1024^2); print $1,"GB";}' |
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
| while true; | |
| do | |
| hammer --no-headers --csv content-view list | grep -v "Default Org" | awk -F, '{print $1}' | xargs -I arg1 -n 1 hammer -u admin -p changeme content-view publish --id arg1; | |
| done |
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
| ## Logging | |
| ErrorLog "/var/log/httpd/foreman-ssl_error_ssl.log" | |
| ServerSignature Off | |
| CustomLog "/var/log/httpd/foreman-ssl_access_ssl.log" combined | |
| # Add custom forwarded log to track origin IP addresses through a smart-proxy | |
| CustomLog "/var/log/httpd/foreman-ssl_forwarded_ssl.log" forwarded | |
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 | |
| echo "Refreshing repository certificates." | |
| echo ' | |
| organizations = Organization.all | |
| organizations.each do |org| | |
| repositories = ::Katello::Repository.in_default_view.in_product(::Katello::Product.redhat.in_org(org)) | |
| repositories.each do |repo| | |
| task = ForemanTasks.async_task(Actions::Katello::Repository::RefreshRepository, repo) |
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
| ./app/lib/actions/katello/organization/manifest_refresh.rb | |
| module Actions | |
| module Katello | |
| module Organization | |
| class ManifestRefresh < Actions::AbstractAsyncTask | |
| middleware.use Actions::Middleware::PropagateCandlepinErrors | |
| def plan(organization) | |
| action_subject organization | |
| manifest_update = organization.products.redhat.any? |
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
| echo "select usesysid,usename,state,waiting,query from pg_stat_activity where state = 'active'" | sudo -u postgres psql |
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
| curl https://mirrors.rit.edu/fedora/epel/7/x86_64/Packages/f/fuse-sshfs-2.10-1.el7.x86_64.rpm > fuse-sshfs-2.10-1.el7.x86_64.rpm | |
| yum -y install fuse-sshfs-2.10-1.el7.x86_64.rpm | |
| mkdir /mnt/remote | |
| sshfs -o allow_other root@xxx.xxx.xxx.xxx:/ /mnt/remote |
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 | |
| TABLEQUERY=$(cat <<-END | |
| SELECT table_name, pg_size_pretty(total_bytes) AS total | |
| , pg_size_pretty(index_bytes) AS INDEX | |
| , pg_size_pretty(toast_bytes) AS toast | |
| , pg_size_pretty(table_bytes) AS TABLE | |
| FROM ( | |
| SELECT *, total_bytes-index_bytes-COALESCE(toast_bytes,0) AS table_bytes FROM ( |