Skip to content

Instantly share code, notes, and snippets.

@DxTa
DxTa / README.md
Created July 15, 2014 14:10
Monitoring Scripts

Scripts for Dba

How to install?

Requirement

  • CentOS. Tested with CentOS 6.5 Final.
  • python and all required libarary is installed: paramiko, pyzabbix, cloudmonkey.
  • Zabbix server and zabbix agent is ready. See Zabbix Manual for more information.
  • MySQL Cluster installed.
@staltz
staltz / introrx.md
Last active June 4, 2025 06:30
The introduction to Reactive Programming you've been missing
global
log 127.0.0.1 local0 notice
maxconn 20000
user haproxy
group haproxy
defaults
log global
mode tcp
option dontlognull
@s-tajima
s-tajima / haproxy.cfg
Last active August 29, 2015 13:57
main config and rewrite script for HAproxy.
global
log 127.0.0.1 local2
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
maxconn 1000
user haproxy
group haproxy
daemon
stats socket /var/lib/haproxy/stats
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>${jetty.maven.plugin.version}</version>
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<webAppConfig>
<contextPath>/customerMgr</contextPath>
</webAppConfig>
</configuration>
@mpeteuil
mpeteuil / rubocop_pre_commit_hook
Created August 3, 2013 17:44
Ruby style guide git pre-commit hook using Rubocop as the style guide checker. Only runs on staged ruby files that have been added and/or modified.
#!/usr/bin/env ruby
require 'english'
require 'rubocop'
ADDED_OR_MODIFIED = /A|AM|^M/.freeze
changed_files = `git status --porcelain`.split(/\n/).
select { |file_name_with_status|
file_name_with_status =~ ADDED_OR_MODIFIED
@rickhanlonii
rickhanlonii / aamnotifs_ex.py
Last active December 20, 2015 07:09
As posted on HN. Example of adding more queues/consumers to andreimarcu/aamnoifs.
import notifs
def print_notification(title, message):
print "Notification received: {0}: {1}".format(title, message)
def web_app_notify(title, message):
print "Webapp notification received: {0}: {1}".format(title, message)
def iphone_app_notify(title, message):
print "iPhone App notification received: {0}: {1}".format(title, message)
@jakemmarsh
jakemmarsh / directives.js
Created June 26, 2013 14:18
AngularJS directive to create a functional "back" button
app.directive('backButton', function(){
return {
restrict: 'A',
link: function(scope, element, attrs) {
element.bind('click', goBack);
function goBack() {
history.back();
scope.$apply();
@jkuipers
jkuipers / formMacros.ftl
Last active June 21, 2022 13:43
FreeMarker macros for rendering Bootstrap horizontal form inputs in Spring-MVC applications
<#ftl strip_whitespace=true>
<#import "spring.ftl" as spring />
<#-- This file contains form-related macros for use in the other Freemarker template files.
The generated HTML is intended for use with Twitter Bootstrap based forms. -->
<#--
* radioButtons
*
* @param path the name of the field to bind to
<?php
require 'vendor/autoload.php';
use Sherlock\Sherlock;
function pprint($value) {
print_r($value);
echo "\r\n";