Skip to content

Instantly share code, notes, and snippets.

View fernandoaleman's full-sized avatar

Fernando Aleman fernandoaleman

View GitHub Profile
@fernandoaleman
fernandoaleman / node-0.10.48.rb
Last active September 11, 2018 16:21
Install Node 0.10.48 via Homebrew
class Node01048 < Formula
desc "Platform built on V8 to build network applications"
homepage "https://nodejs.org/"
url "https://nodejs.org/dist/v0.10.48/node-v0.10.48.tar.xz"
sha256 "365a93d9acc076a0d93f087d269f376abeebccad599a9dab72f2f6ed96c8ae6e"
revision 2
head "https://github.com/nodejs/node.git", :branch => "v0.10-staging"
bottle do
sha256 "0053425c1c78f3afc8c7b311d7808d4e0f9ff955ec5edcef972529eabdf05856" => :sierra
@fernandoaleman
fernandoaleman / updating-chef-node.md
Last active October 1, 2018 16:55
Updating Chef node

Problem

An existing chef node node-1 needs to be renamed node-01.

Solution

  1. knife node edit node-1
    • Change the node_name to node-01.
  2. knife node delete node-1
  3. knife client delete node-1
@fernandoaleman
fernandoaleman / .travis.yml
Last active November 9, 2018 13:39
Sample chef cookbook .travis.yml file
sudo: required
dist: trusty
addons:
apt:
sources:
- chef-current-trusty
packages:
- chefdk
@fernandoaleman
fernandoaleman / install-mongodb-ubuntu1604.md
Last active November 23, 2018 12:39
Install MongoDB on Ubuntu 16.06

Install MongoDB on Ubuntu 16.04

Import MongoDB GPG Key

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5

Add MongoDB apt repository

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
@fernandoaleman
fernandoaleman / nginx_init_script_centos
Created October 3, 2011 00:53
An Nginx init script for CentOS
#!/bin/sh
#
# nginx - this script starts and stops the nginx daemin
#
# chkconfig: - 85 15
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \
# proxy and IMAP/POP3 proxy server
# processname: nginx
# config: /opt/nginx/conf/nginx.conf
# pidfile: /opt/nginx/logs/nginx.pid
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>{{ page.title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="/stylesheets/bootstrap.css" rel="stylesheet" />
<style type="text/css">
body {
padding-top: 60px;
@fernandoaleman
fernandoaleman / already-initialized-constant-etc.md
Created April 29, 2020 21:53
Chef command warning: already initialized constant Etc::

Problem

Chef command warnings concerning already initialized constants

warning: already initialized constant Etc::SC_AIO_LISTIO_MAX
warning: already initialized constant Etc::SC_AIO_MAX
warning: already initialized constant Etc::SC_AIO_PRIO_DELTA_MAX
warning: already initialized constant Etc::SC_ARG_MAX
warning: already initialized constant Etc::SC_ATEXIT_MAX
@fernandoaleman
fernandoaleman / how-to-install-vsftpd-on-centos.txt
Created June 27, 2014 13:57
How To Install vsftpd on CentOS 6
Installing vsftpd on CentOS
yum install vsftpd
How to configure vsftpd:
Now that you’ve installed vsftpd, follow this procedure to configure it. These steps applies for both the linux variants.
Before you get started, stop the vsftpd by typing:
@fernandoaleman
fernandoaleman / .rubocop.yml
Last active July 29, 2020 18:33 — forked from jhass/.rubocop.yml
My preferred Rubocop config
---
# Commonly used screens these days easily fit more than 80 characters.
Layout/LineLength:
Max: 120
# Too short methods lead to extraction of single-use methods, which can make
# the code easier to read (by naming things), but can also clutter the class
Metrics/MethodLength:
Max: 20
@fernandoaleman
fernandoaleman / rabbitmqadmin
Created September 16, 2020 21:45
rabbitmqadmin - Install on Linux server under /usr/local/bin directory
#!/usr/bin/env python3
# The contents of this file are subject to the Mozilla Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# https://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations