Skip to content

Instantly share code, notes, and snippets.

View mv's full-sized avatar

Marcus Vinicius Ferreira mv

View GitHub Profile
@mv
mv / zookeeper-init.sh
Created December 3, 2013 19:02
Wip....
#!/bin/sh
#
# zookeeper
#
# Author: Marcus Vinicius Ferreira, <[email protected]>
#
# chkconfig: 2345 98 02
# description: Zookeeper is a high-performance coordination service for
# distributed applications
# processname: monit

============================================ System Operations Engineer @ Dinda.com.br/Baby.com.br

Manage an infrastructure that is impossible to outgrow!

Your responsibilities

Enjoy the DevOps lifestyle; automate everything. Have fun scripting as well as programming.

Keybase proof

I hereby claim:

  • I am mv on github.
  • I am mv (https://keybase.io/mv) on keybase.
  • I have a public key whose fingerprint is 90F3 F0C7 54DC B389 C044 D233 8588 A723 DE7E DC58

To claim this, I am signing this object:

#!/usr/bin/env python
import hashlib
import optparse
import paramiko
from Crypto.PublicKey import RSA
def insert_char_every_n_chars(string, char='\n', every=64):
return char.join(
@mv
mv / pipeline-schedule.rb
Last active August 29, 2015 13:58
GitHub webhook integrating to ThoughtWorks Go Server
#!/usr/bin/ruby
#
# A very simple CGI script to receive a Github webhook and
# send to a 'ThoughtWorks Go Server'
#
# Usage:
# Github Webhooks / Manage webhook
# Payload URL:
# http://your-url.example.com/go/pipeline-schedure.rb
#
# Use CDROM installation media
cdrom
# Network information
network --bootproto=dhcp --device=p2p1 --ipv6=auto --activate
network --hostname=fedora20.local
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
@mv
mv / etc-profile
Last active August 29, 2015 14:02
cat > /etc/profile <<'EOF'
# /etc/profile
# System wide environment and startup programs, for login setup
# (look for functions and aliases in /etc/bashrc)
##
## [email protected]:
##
## /etc/profile does only the following:
@mv
mv / etc-bashrc
Last active August 29, 2015 14:02
cat > /etc/bashrc <<'EOF'
# /etc/bashrc
# System wide functions and aliases
# (environment variables goes in /etc/profile)
##
## [email protected]:
##
## /etc/bashrc does the following:
cat > /etc/profile.d/ps1.sh <<'EOF'
#!/bin/bash
# Ref: http://tldp.org/HOWTO/Bash-Prompt-HOWTO/x329.html
# Attribute codes:
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
cat > /etc/profile.d/aliases.sh <<'EOF'
#!/bin/bash
#
# /etc/profile.d/aliases.sh
#
alias ls='ls -hAF --color=auto --time-style=long-iso'
alias ll='ls -l'
alias la='ls -a'
alias lr='ls -ltr'