Skip to content

Instantly share code, notes, and snippets.

View pparidans's full-sized avatar
💭
I may be slow to respond.

Pierre Paridans pparidans

💭
I may be slow to respond.
View GitHub Profile
Via: http://lena.franken.de/nagios/hosts_without_ping.html
Some hosts are not pingable. There is a firewall in front of them preventing that. Although all services from this hosts are running, the host itself is assumed to be down.
The solution is to check the "host-alive-status" with another service.
Define a new nagios-command
echolon:/etc/nagios/echolon# cat checkcommands.cfg
# checkcommands.cfg - Nagios configuration file for local user changes
Via: http://serverfault.com/questions/48530/nagios-define-as-service-for-all-the-members-of-a-group-except-some-hosts
We're using nagios to check our ssh server is running. We have the check_ssh group defined for all members of a certain group. We have other services defined for that group as well. Everything is fine. However for 2 of the members of this group, they listen for ssh on a different port. Hence I have to make a new service for them. Which is fine, but then nagios complains that I'm defining the SSH service twice for the same host.
Can I change the original ssh service to include all the members of group A, but exclude hosts X and Y?
# Use the host_name directive in the service definition with an exclamation before the name of the host. For example:
define service{
@pparidans
pparidans / gist:896036
Created March 31, 2011 08:33
Deploying to a sub URI using Passenger and Rails 3

Symbolic link to the 'public' directory

ln -s /webapps/mycook/public /websites/phusion/rails

Into the apache config

RackBaseURI /rails                   # <-- These lines have
<Directory /websites/phusion/rails>   # <-- been added.
    Options -MultiViews               # <--

<--

@pparidans
pparidans / reset.css
Created August 3, 2011 08:36
Basic reset + base stylesheet
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
* {
margin: 0;
padding: 0;
}
html, body {
@pparidans
pparidans / example_ftp.rb
Created September 13, 2011 07:06
FTP in Ruby
require 'net/ftp'
ftp=Net::FTP.new
ftp.connect(URL,21)
ftp.login(username,passwd)
ftp.chdir(directory)
ftp.getbinaryfile(filename)
ftp.close
@pparidans
pparidans / rbenv-install-system-wide.sh
Last active October 7, 2015 06:38 — forked from v1nc3ntlaw/rbenv-install-system-wide.sh
rbenv install Ruby 2.0.0-p0 on Debian Wheezy
# Update, upgrade and install development tools:
apt-get update
apt-get -y upgrade
apt-get -y install build-essential git-core libssl-dev
# Install rbenv
RBENV_ROOT=/opt/rbenv
git clone https://github.com/sstephenson/rbenv.git $RBENV_ROOT
@pparidans
pparidans / tsql_md5.sql
Created February 21, 2013 14:06
Generate the MD5 sum from a key in Transact-SQL
SELECT SUBSTRING(master.dbo.fn_varbintohexstr(HashBytes('MD5', <key>)), 3, 32) FROM <table>
git log --numstat --pretty="%H" --author="Your Name" commit1..commit2 | awk 'NF==3 {plus+=$1; minus+=$2} END {printf("+%d, -%d\n", plus, minus)}'
info tables;
info columns for <table>;