Skip to content

Instantly share code, notes, and snippets.

View mauricio's full-sized avatar

Maurício Linhares mauricio

View GitHub Profile
#!/bin/sh
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
2012-12-13 15:55:45,102 - INFO [main:QuorumPeerConfig@90] - Reading configuration from: /etc/zookeeper/zoo.cfg
2012-12-13 15:55:45,111 - WARN [main:QuorumPeerConfig@263] - No server failure will be tolerated. You need at least 3 servers.
2012-12-13 15:55:45,112 - INFO [main:QuorumPeerConfig@310] - Defaulting to majority quorums
2012-12-13 15:55:45,128 - INFO [main:QuorumPeerMain@119] - Starting quorum peer
2012-12-13 15:55:45,156 - INFO [main:NIOServerCnxn$Factory@143] - binding to port 0.0.0.0/0.0.0.0:2181
2012-12-13 15:55:45,179 - INFO [main:QuorumPeer@819] - tickTime set to 2000
2012-12-13 15:55:45,179 - INFO [main:QuorumPeer@830] - minSessionTimeout set to -1
2012-12-13 15:55:45,180 - INFO [main:QuorumPeer@841] - maxSessionTimeout set to -1
2012-12-13 15:55:45,181 - INFO [main:QuorumPeer@856] - initLimit set to 10
2012-12-13 15:55:45,225 - INFO [Thread-1:QuorumCnxManager$Listener@473] - My election bind port: 3888
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>rules</key>
<dict>
<key>.*</key>
<true/>
<key>Info.plist</key>
<dict>
#! /bin/sh
### BEGIN INIT INFO
# Provides: redis-server
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: redis-server - Persistent key-value db
@mauricio
mauricio / Benchmark.scala
Created October 24, 2012 05:15 — forked from mattetti/collection.rb
quick comparison in processing collections in Ruby vs Scala
import scala.util.Random
import scala.collection.mutable.ArrayBuffer
import scala.annotation.tailrec
import scala.collection.immutable.Vector
object Benchmark {
@tailrec def repeat(n: Int)(f: => Unit) {
if (n > 0) { f; repeat(n - 1)(f) }
}
SELECT
nspname,relname,relkind,
round(100 * pg_relation_size(indexrelid) / pg_relation_size(indrelid)) / 100
AS index_ratio,
pg_size_pretty(pg_relation_size(indexrelid)) AS index_size,
pg_size_pretty(pg_relation_size(indrelid)) AS table_size
FROM pg_index I
LEFT JOIN pg_class C ON (C.oid = I.indexrelid)
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE
using System;
using System.Threading;
namespace Integration.Mac
{
public class CommonRunLoop
{
static IntPtr runLoopReference;
#! /bin/sh
### BEGIN INIT INFO
# Provides: unicorn
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the unicorn web server
# Description: starts unicorn
public static Model.ServerMessage Login(string username, string password)
{
return UserResource.Login( username, password ).Fold(
( message ) => {
EndSession();
return message;
},
( user) => {
require 'cgi'
require 'action_view/helpers/date_helper'
require 'action_view/helpers/tag_helper'
require 'action_view/helpers/form_tag_helper'
require 'action_view/helpers/active_model_helper'
require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/hash/slice'
require 'active_support/core_ext/module/method_names'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/string/output_safety'