Skip to content

Instantly share code, notes, and snippets.

View hvasconcelos's full-sized avatar

Hélder Vasconcelos hvasconcelos

View GitHub Profile
@hvasconcelos
hvasconcelos / mongod.conf
Last active August 29, 2015 14:02
Mongodb dev conf
fork = true
bind_ip = 127.0.0.1
port = 27017
quiet = true
dbpath = /var/lib/mongod
logpath = /var/log/mongodb/mongod.log
logappend = true
journal = false
#!/usr/bin/env bash
# Mongodb
sudo cp /shared/mongodb.repo /etc/yum.repos.d/mongodb.repo
sudo yum -y install update
sudo yum -y install mongodb-org
sudo yum -y install vim wget
sudo chkconfig mongod on
wget https://gist.githubusercontent.com/hvasconcelos/e514938043c7bab2aed4/raw/dc5b54aa1bd20dcde422a7f018477fccc6852b0b/mongod.conf /etc/mongod.conf
sudo service mongod stop
sudo service mongod start
@hvasconcelos
hvasconcelos / join_path
Created December 5, 2014 11:17
OS Independent Join Path
public static String joinPath(final String ... pathElements){
File path=File.listRoots()[0];
for(final String pathElement : pathElements)
path = new File(path, pathElement);
return path.getAbsolutePath();
}
@hvasconcelos
hvasconcelos / chef_solo_bootstrap_centos_6_4.sh
Created July 14, 2013 20:44
Chef Solo Bootstrap CentOS 6.4
#!/usr/bin/env bash
yum install -y gcc-c++ patch \
readline readline-devel \
zlib zlib-devel libyaml-devel \
libffi-devel openssl-devel make \
bzip2 autoconf automake libtool \
bison iconv-devel libyaml
cd /tmp
@hvasconcelos
hvasconcelos / go.bash
Created July 16, 2013 19:37
Go Tool aliases
#!/bin/bash
alias gob='go build'
alias goc='go clean'
alias gog='go get'
alias goi='go install'
alias gor='go run'
alias gotest='go test'
alias got='go tool'
alias govet='go vet'
@hvasconcelos
hvasconcelos / ifcfg-eth0
Created July 16, 2013 20:14
CentOS Configure Static IP Address
DEVICE=eth0
BOOTPROTO=static
HWADDR=XX:XX:XX:XX:XX:XX
IPADDR="<IP_ADDRESS>"
GATEWAY="<NETWORK_GATEWAY>"
NETMASK="<NETWORK_MASK>"
DNS1="<DNS_SERVER1>"
DNS2="<DNS_SERVER2>"
TYPE="Ethernet"
ONBOOT=yes
@hvasconcelos
hvasconcelos / twitter_rotator.rb
Last active December 20, 2015 01:39
Twitter Timeline Rotator
#!/usr/bin/env ruby
require "rubygems"
require "twitter"
require "colorize"
require "oauth"
require "yaml"
class TwitterRotator
attr_writer :tweet_func
@hvasconcelos
hvasconcelos / gitistage
Last active December 20, 2015 05:49
Interactive Git Staging
#!/bin/bash
files=`git status --porcelain | grep -e "^\sM" | cut -d " " -f 3`
for file in $files; do
echo "Differences in file"
git diff --color=always $file
read -p "Do you want to stage this file [y/n]" to_stage
if [ "$to_stage" == "y" -o "$to_stage" == "Y" ]; then
echo "Staging file -> $file"
git add $file
fi
@hvasconcelos
hvasconcelos / vboxad
Created October 4, 2013 19:01
Vbox Additions on Centos 6.4
yum update kernel*
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
@hvasconcelos
hvasconcelos / redis
Last active December 25, 2015 13:29
Redis Init Script for CentOS 6
#!/bin/sh
#
# redis - this script starts and stops the redis-server daemon
#
# chkconfig: - 85 15
# description: Redis is a persistent key-value database
# processname: redis-server
# config: /etc/redis/redis.conf
# config: /etc/sysconfig/redis
# pidfile: /var/run/redis.pid