Skip to content

Instantly share code, notes, and snippets.

View chris1984's full-sized avatar

Chris Roberts chris1984

View GitHub Profile

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@johnpmitsch
johnpmitsch / blah.md
Created July 31, 2018 15:17
restart services in katello dev environment

sudo systemctl restart postgresql rh-mongodb34-mongod qdrouterd qpidd squid pulp_resource_manager pulp_streamer foreman-proxy pulp_celerybeat pulp_workers tomcat httpd puppetserver

# EG : ALTER USER Postgres WITH PASSWORD '<newpassword>';
CP_PASS=`grep jpa.config.hibernate.connection.password /etc/candlepin/candlepin.conf | awk -F= '{print $2}'`
F_PASS=`grep password /etc/foreman/database.yml | awk -F: '{print $2}' | sed 's/"//g'`
echo "ALTER USER candlepin WITH PASSWORD '$CP_PASS';" | sudo -u postgres psql
echo "ALTER USER foreman WITH PASSWORD '$F_PASS';" | sudo -u postgres psql
- yum install docker
- in /etc/sysconfig/docker
OPTIONS='--selinux-enabled --log-driver=journald --signature-verification=false --debug=true -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock'
- service docker restart
- In satellite/katello create a new compute resource with the followiung settings
Provider Docker
URL http://0.0.0.0:2375
@johnpmitsch
johnpmitsch / workaround.md
Created May 31, 2017 14:08
Workaround for foreman/katello npm install error

error

node: error while loading shared libraries: libhttp_parser.so.2: cannot open shared object file: No such file or directory

workaround

yum remove -y nodejs* npm
yum clean all
rpm -qa 'node|npm' | grep -v nodesource #should return no packages 
curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -
@johnpmitsch
johnpmitsch / gist:1a53869c2fcacec357723e99707a51dd
Last active June 11, 2019 15:43
change notification interval in foreman
in foreman dir update:
webpack/assets/javascripts/react_app/redux/actions/notifications/index.js:const getNotificationsInterval
or
export NOTIFICATIONS_POLLING=99999999
export NOTIFICATIONS_POLLING=99999999; export TASKS_BULK_SEARCH_INTERVAL=99999999
foreman start

Cobbler on EL7

Installing the software

Install of the stuff you need, and maybe some of the stuff you don't.

yum install epel-release -y
yum install cobbler cobbler-web pykickstart fence-agents-all git nc dhcp xinetd
@gregjhogan
gregjhogan / random-string-generator.ps1
Last active June 20, 2026 08:43
Generate random string in powershell
#lowercase letters/numbers only
-join ((48..57) + (97..122) | Get-Random -Count 32 | % {[char]$_})
# all characters
-join ((33..126) | Get-Random -Count 32 | % {[char]$_})
@johnpmitsch
johnpmitsch / generate-hosts.rb
Last active June 25, 2018 14:47
proxy generate virt hosts apache
#!/usr/bin/env ruby
base=50000 #port
range="192.168.121."
contents = <<-EOS
Listen %{port} https
<VirtualHost *:%{port}>
ProxyPass / https://%{ip_address}/
<Location />
@zjhuntin
zjhuntin / pr.md
Created April 7, 2016 20:54 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: