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
Setup the OS for provisioning | |
1) Hosts -> Operating Systems | |
Create a new operating system -> | |
Name: Centos-Atomic | |
Major: 7 | |
Arch: x86_64 | |
Family: Redhat |
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
import itertools | |
def sargam(notes): | |
return ["".join(notes[index] for index in combi) for combi in itertools.permutations(range(len(notes)), len(notes))] | |
#usage | |
#print sargam("SRGM") | |
# ['SRGM', 'SRMG', 'SGRM', 'SGMR', 'SMRG', 'SMGR', 'RSGM', 'RSMG', 'RGSM', 'RGMS', 'RMSG', 'RMGS', 'GSRM', 'GSMR', 'GRSM', 'GRMS', 'GMSR', 'GMRS', 'MSRG', 'MSGR', 'MRSG', 'MRGS', 'MGSR', 'MGRS'] |
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
[atomic7-testing] | |
name=atomic7-testing | |
baseurl=http://buildlogs.centos.org/centos/7/atomic/x86_64/Packages/ | |
gpgcheck=0 | |
enabled=1 |
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
#!/usr/bin/env bash | |
for file in $@ | |
do | |
echo $file,`sha256sum $file | awk '{ print $1 }'`,`stat -c '%s' $file` | |
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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'fileutils' | |
CONTENTS = <<-EOS | |
Listen %{port} https | |
<VirtualHost *:%{port}> | |
ProxyPass / https://%{ip_address}/ | |
<Location /> | |
ProxyPassReverse https://%{ip_address}/ |
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
#!/usr/bin/env ruby | |
require 'libvirt' | |
conn = Libvirt::open("qemu:///system") | |
networks = conn.list_all_networks | |
puts networks.map {|net| net.dhcp_leases.first["ipaddr"] unless net.dhcp_leases.empty?}.compact |
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
mongo pulp_database --eval 'printjson(db.task_status.find({"start_time": {"$gt": "2017-06-27"}}).toArray())' > mongo.out |
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
require_relative '../test_helper' | |
require 'hammer_cli_katello/sync_plan' | |
require_relative 'sync_plan_helpers' | |
require_relative '../organization/organization_helpers' | |
module HammerCLIKatello | |
describe SyncPlan::InfoCommand do | |
include OrganizationHelpers | |
include SyncPlanHelpers | |
it 'by ID' do |
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
namespace :csv_dump do | |
desc "export db tables to csv used for debugging and exporting tables from production.\ | |
Run with tables=\"katello_repositories, taxonomies\" to export tables .\ | |
Note: you can use regexs like, tables='katelllo.*, dynflow.*, foreman_tas.*' | |
destination= /tmp/export.tgz, optional default =/tmp/tables.tgz\ | |
Note: foreman user should have the right permission to write files" | |
task :export=> :environment do | |
def dump_csv(table, dir = "/tmp") | |
system("/usr/bin/psql -c \"COPY #{table} to STDOUT DELIMITER ',' CSV HEADER;\" > '#{dir}/#{table}.csv'") | |
end |
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
def pulp_sorted_by_execution_plan(task) | |
pulp_steps(task).sort {|s1, s2| s2.execution_time <=> s1.execution_time} | |
end | |
def worst_pulp_sorted_by_execution_plan(task, limit = 10) | |
pulp_sorted_by_execution_plan(task)[0..limit].map {|step| step_metrics(step)} | |
end | |
def sorted_steps(task) | |
execplan = task.execution_plan |