Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ksh
netstat -i|grep -e $(hostname) |grep en|awk '{print $1}'|while read line
do
echo "ibm_${line}_"$(lsattr -EHl ${line} -a netaddr -F attribute=value|tail -n 1)
done
keytool -import -alias foreman_cert -file /var/lib/puppet/ssl/certs/myforeman.localdomain.com.pem -keystore /etc/rundeck/ssl/truststore -storepass veryStroNG
keytool -import -alias foreman_ca_cert -file /var/lib/puppet/ssl/certs/ca.pem -keystore /etc/rundeck/ssl/truststore -storepass evenStronGer
===========================================================================================
https://thedude:rocks@myforeman.localdomain.com/hosts?rundeck=true&format=yaml
=>
2015-03-06 17:36:38,254 [qtp2012886994-54] ERROR com.dtolabs.rundeck.core.resources.ExceptionCatchingResourceModelSource - [ResourceModelSource: 1.url (URL Source), project: test]
service { 'ssh':
ensure => 'running',
subscribe => File['/etc/ssh/sshd_config'],
} ->
sshd_config { 'PasswordAuthentication':
ensure => present,
condition => 'User rundeck',
value => 'no',
} ->
Error: Could not apply complete catalog: Found 1 dependency cycle:
(Group[rundeck] => User[rundeck] => Ssh_authorized_key[rundeck_user] => Sshd_config[PasswordAuthentication] => Service[ssh] => Group[rundeck])
Try the '--graph' option and opening the resulting '.dot' file in OmniGraffle or GraphViz
# == Class: rundeck
#
# Full description of class rundeck here.
#
# === Parameters
#
# Document parameters here.
#
# [*sample_parameter*]
# Explanation of what this parameter affects and what it defaults to.
@rmueck
rmueck / gist:9ced4b1a5d4be4270ec1
Created August 11, 2015 17:44
generator mayhem
$login_groupsarray = hiera_array($portal_flavour)
$login_groups = shellquote($login_groupsarray)
$login_users = generate('/bin/bash', '-c', '/usr/local/bin/getusersfromgroups.sh', $login_groups)
this is working under Debian ...but not under RHEL 6.x
the script is simply:
@rmueck
rmueck / .gitconfig
Created October 19, 2015 05:33 — forked from pksunkara/config
Sample of git config file (Example .gitconfig)
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@rmueck
rmueck / README.md
Created January 12, 2017 12:04 — forked from wesee/README.md
Stock Quote & Chart Dashing Widget

Description

Stock Quote & Chart Dashing Dashboard consists of two widgets. While one displays a stock's current quote and other details; another displays its last 30-days closing stock prices.

Preview

Dependencies

@rmueck
rmueck / README.md
Created February 27, 2017 06:05 — forked from hdoedens/README.md
dashing foreman job

#Dashing job to retrieve Foreman data

This job executes a list of queries to the Foreman API so you can optionally filter out the interesting stuff.

Sample job to retrieve foreman data. Data can be send to any widget. The example widget below is a slight modification of the default List widget.

@rmueck
rmueck / default_if.rb
Created January 31, 2018 16:19
Custom fact for Puppet to choose right interface
Facter.add("default_if") do
confine :kernel => :linux
setcode do
return nil unless FileTest.exists?("/sbin/ip")
output = %x{/sbin/ip route list match 0.0.0.0}.split("\n")[0]
output.sub(/.*\s*dev\s+([^\s]+)\s*.*/, '\1')
end
end