Skip to content

Instantly share code, notes, and snippets.

Fernando Aleman fernandoaleman

  • Dallas, TX
Block or report user

Report or block fernandoaleman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@fernandoaleman
fernandoaleman / nginx_init_script_centos
Created Oct 3, 2011
An Nginx init script for CentOS
View nginx_init_script_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
@fernandoaleman
fernandoaleman / ssh_keys_authentication.sh
Created Oct 3, 2011
How to install SSH Keys for authentication without password
View ssh_keys_authentication.sh
# Create ssh private and public keys on your local machine
ssh-keygen -t rsa
# Set permissions on your private key
chmod 700 ~/.ssh
chmod 600 ~/.ssh/id_rsa
# Copy the public key to the server
scp ~/.ssh/id_rsa.pub root@yourserver.com:~/.ssh/authorized_keys
@fernandoaleman
fernandoaleman / getversion
Created Oct 16, 2011
Show Mac OS Version
View getversion
#!/usr/bin/ruby
module Tty extend self
def blue; bold 34; end
def white; bold 39; end
def red; underline 31; end
def reset; escape 0; end
def bold n; escape "1;#{n}" end
def underline n; escape "4;#{n}" end
def escape n; "\033[#{n}m" if STDOUT.tty? end
@fernandoaleman
fernandoaleman / rpm-digital-signature.sh
Created Nov 18, 2011
How to sign your custom RPM package with GPG key
View rpm-digital-signature.sh
# How to sign your custom RPM package with GPG key
# Step: 1
# Generate gpg key pair (public key and private key)
#
# You will be prompted with a series of questions about encryption.
# Simply select the default values presented. You will also be asked
# to create a Real Name, Email Address and Comment (comment optional).
#
# If you get the following response:
@fernandoaleman
fernandoaleman / rpm-from-source.sh
Created Nov 18, 2011
How to create an RPM from source with spec file
View rpm-from-source.sh
# How to create an RPM from source with spec file
# This is for Redhat versions of linux. Sometimes when you search for an rpm package,
# it is either outdated or not available. The only thing available is the source code.
# You can create a custom RPM package from source.
#
# For this example, I'll be using the latest version of Git, currently v.1.7.7.3
# Step: 1
# Install rpmbuild
@fernandoaleman
fernandoaleman / create-repo-metadata.sh
Created Nov 18, 2011
Script to create rpm repository metadata
View create-repo-metadata.sh
#!/bin/sh
# This is for Redhat 64 bit versions of Linux with `createrepo` installed. If you
# do not have createrepo, you can install it with:
# yum install -y createrepo
# Change DESTDIR path to RPMS directory of your repo
DESTDIR="/var/www/repo/rhel/6"
for ARCH in x86_64
View how-to-create-an-rpm-repository.sh
# How to create an RPM repository
# This is for Redhat 64 bit versions of Linux. You can create your own RPM repository # to host your custom RPM packages.
#
# See "How to create an RPM from source with spec file" for more information.
# https://gist.github.com/1376973
# Step: 1
# Install createrepo
View default.html
<!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 / Linux Static IP
Created Mar 23, 2012
How To Configure Static IP On CentOS 6
View Linux Static IP
## Configure eth0
#
# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT=yes
HWADDR=A4:BA:DB:37:F1:04
TYPE=Ethernet
BOOTPROTO=static
@fernandoaleman
fernandoaleman / Gemfile
Created May 8, 2012 — forked from simi/Gemfile
Refinery + Twitter Bootstrap WIP
View Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
You can’t perform that action at this time.