Skip to content

Instantly share code, notes, and snippets.

View iBet7o's full-sized avatar
🏠
Working from home

iBet7o iBet7o

🏠
Working from home
View GitHub Profile
@iBet7o
iBet7o / gist:0f23a35b8b5c8cda057d
Created January 19, 2015 02:06
Asegurando ssh en CentOS 6

Cambiar puerto por default

Modificar la variable Port en el archivo sshd_config

#Ejemplo: Port 4568
vim +/Port /etc/ssh/sshd_config

# Reiniciar el servicio ssh
service sshd restart
@iBet7o
iBet7o / description.md
Created January 19, 2015 01:01
Script bash para renombrar directorios y archivos

Dependencias

  • Descargar archivo flash.sh.
  • Descargar archivo rename.sh que se encuentra mas abajo.

Instalación

Modificar los permisos del archivo rename.sh

@iBet7o
iBet7o / description.md
Created January 19, 2015 00:00
Color del texto en scripts bash

Código de colores

Black        0;30     Dark Gray     1;30
Blue         0;34     Light Blue    1;34
Green        0;32     Light Green   1;32
Cyan         0;36     Light Cyan    1;36
Red          0;31     Light Red     1;31
Purple       0;35     Light Purple  1;35
Brown/Orange 0;33     Yellow        1;33

Light Gray 0;37 White 1;37

@iBet7o
iBet7o / gist:841bbc654eb9dde70b97
Last active May 21, 2016 00:18
Generar CSR con OpenSSL

OpenSSL

Validar si ya esta instalado:

rpm -qa | grep -i openssl

De lo contrario para instalar ejecutar:

@iBet7o
iBet7o / 6.5.md
Last active September 23, 2016 07:44
Instalar wkhtmltopdf en CentOS

Instalación

Descargar e instalar el programa:

# wget http://iweb.dl.sourceforge.net/project/wkhtmltopdf/0.12.1/wkhtmltox-0.12.1_linux-centos6-amd64.rpm

# rpm -ivh wkhtmltox-0.12.1_linux-centos6-amd64.rpm
@iBet7o
iBet7o / gist:01debac637fd528f0817
Created November 17, 2014 12:01
Abrir un puerto en CentOS 6.5

Agregar la regla al archivo /etc/sysconfig/iptables:

-A INPUT -m state --state NEW -p tcp --dport 3000 -j ACCEPT

Cargar la nueva regla:

iptables -F
@iBet7o
iBet7o / gist:8a2fd82336fd8141aa19
Last active July 10, 2018 15:20
Crear un entorno virtual con Vagrant

##Instalar Dependencias

##Agregando un imágenes

Las imágenes pueden ser reutilizables por varios entornos, cada que se crea un entorno la imagen base es clonada.

@iBet7o
iBet7o / vhost.sh
Last active August 29, 2015 14:07
Script bash para generar VirtualHost

Dependencias

  • Descargar archivo flash.sh.
  • Descargar archivo vhost.sh que se encuentra mas abajo.

Instalación

Modificar los permisos del archivo vhost.sh

@iBet7o
iBet7o / gist:759e39df7aa6bb6953e2
Last active August 29, 2015 14:05
Instalar Ruby con RVM en CentosOS 6.5

Instalar las librerias dev tools y slqlite dev

yum groupinstall -y development  
yum install sqlite-devel

Descargar e instalar RVM:

@iBet7o
iBet7o / gist:ef662ea5cdd068393813
Created August 14, 2014 03:52
Ordenar los campos del checkout en woocommerce

Para poder ordenar los campos, del checkout en woocommerce, hay que hacer uso del hook "woocommerce_checkout_fields" en el archivo functions.php.

Ejemplo:

add_filter('woocommerce_checkout_fields', 'order_fields');
function order_fields($fields) 
{
    /* Order fields billing */
    $ordered_fields = array();