Skip to content

Instantly share code, notes, and snippets.

View larstobi's full-sized avatar

Lars Tobias Skjong-Børsting larstobi

  • Skylars AS
  • Oslo, Norway
View GitHub Profile
@larstobi
larstobi / etc_init.d_jbossas
Created November 15, 2011 15:56
JBoss AS init script
#!/bin/sh
#
# JBoss Control Script
#
### BEGIN INIT INFO
# Provides: jbossas
# Required-Start: $network $syslog
# Required-Stop: $network $syslog
# Default-Start:
# Default-Stop:
node "mymachine" {
include main
class {
"main::extra":
myparam => "variable";
}
}
class main {
file {
@larstobi
larstobi / selinux-create-policy
Created November 22, 2011 20:12 — forked from larsar/selinux-create-policy
Creating SELinux policy for failing stuff
For instance Puppet server will not start under RHEL SELinux. Try to start it, then run the following script. Continue this cycle until it starts. It will probably work for different SELinux challenges as well.
The script requires:
$yum install policycoreutils-python
cd /tmp && \
cat /var/log/audit/audit.log | audit2allow -m puppetmaster > puppetmaster.te && \
checkmodule -M -m puppetmaster.te -o puppetmaster.mod && \
semodule_package -m puppetmaster.mod -o puppetmaster.pp && \
semodule -i puppetmaster.pp
@larstobi
larstobi / yum.conf
Created November 24, 2011 11:37
Yum repo apache config
<VirtualHost *:80>
DocumentRoot /var/yum.example.net/htdocs
ServerName yum.example.net
Options -Indexes -FollowSymlinks
<Directory "/var/yum.example.net/htdocs/yum">
AllowOverride None
Options +Indexes
Order allow,deny
@larstobi
larstobi / update-repo.sh
Created November 24, 2011 11:41
Update repodata for Yum repo
#!/bin/bash
#
# Directory layout:
# 5Server/noarch
# 5Server/x86_64
# 6Server/noarch
# 6Server/x86_64
# Place the RPM packages in their respective arch folder, and run this script.
#
ROOT_DIR=`pwd`
@larstobi
larstobi / rspec.log
Created December 11, 2011 21:28
Typo rspec spec
/home/specs/.rvm/gems/ruby-1.9.3-p0/gems/RedCloth-4.2.8/lib/redcloth.rb:10: Use RbConfig instead of obsolete and deprecated Config.
You did not specify how you would like Rails to report deprecation notices for your production environment, please set config.active_support.deprecation to :notify at config/environments/production.rb
/home/specs/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.0.10/lib/active_support/dependencies.rb:239:in `block in require': iconv will be deprecated in the future, use String#encode instead.
.........FFFF..............FFFFF....FFFFF....FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF........................................................................FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF....FFF.........FFFFFFFFFFFFFFFFFFFFFFFF..FFFFFFF..............F...*...F......................*...............F...............FFFFF.....F.FFFFF.FF.FFFFFFF.......F......................F....FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFNot validating feed bec
@larstobi
larstobi / weblogin
Created January 6, 2012 13:00
Trapeze weblogin autologin
# cat /Users/larstobi/bin/weblogin
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
agent = Mechanize.new
page = agent.get('http://webportal.login/aaa/wba_login.html')
login_form = page.form('weblogin')
login_form.username = 'MYUSER'
@larstobi
larstobi / gist:1600265
Created January 12, 2012 12:38
Puppet qualified variables
class myrailsapp {
$railspath = '/usr/share'
}
class apache::vhost::myrailsapp inherits apache::vhost {
notify{"RAILSPATH: ${myrailsapp::railspath}":}
}
@larstobi
larstobi / puppetagent.log
Created January 31, 2012 12:47
Puppet dynamic environment - switching environment using branch
root@myhost ~]# puppet agent --test --noop
info: Retrieving plugin
notice: /File[/var/lib/puppet/lib]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/puppet]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/facter]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/puppet/parser]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/puppet/parser/functions]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/puppet/provider]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/puppet/provider/file_line]/mode: mode changed '775' to '755'
notice: /File[/var/lib/puppet/lib/puppet/provider/rhnchannel]/mode: mode changed '775' to '755'
@larstobi
larstobi / jboss-log4j.xml
Created February 7, 2012 11:40
Part of jboss-log4j.xml for mod_cluster
<!-- org.jboss.modcluster -->
<appender name="MODCLUSTER" class="org.jboss.logging.appender.DailyRollingFileAppender">
<errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
<param name="File" value="${jboss.server.log.dir}/modcluster.log"/>
<param name="Append" value="true"/>
<!-- Rollover at midnight each day -->
<param name="DatePattern" value="'.'yyyy-MM-dd"/>
<layout class="org.apache.log4j.PatternLayout">