This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin admin@admin.com | |
ServerName prueba.local | |
DocumentRoot /home/renzo/Proyectos/virtualhost/prueba/ | |
<Directory /home/renzo/Proyectos/virtualhost/prueba/> | |
Options Indexes FollowSymLinks MultiViews | |
AllowOverride all | |
Require all granted |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1.- vemos que hosts tenemos | |
/etc/apache2/sites-available$ cat /etc/hosts | |
2.- colocar esto en caso de que no levante el host virtual (no se habilitado el modo rewrite de apache) | |
sudo a2enmod rewrite | |
3.-Registramos el hosts que estamos haciendo y colocamos alli (127.0.0.1 virtualhost.local) | |
/etc/apache2/sites-available$ sudo geany /etc/hosts | |
4.- crear el archivo virtual host |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** Deshabilitado el cache en local del plugin W3 Total Cache */ | |
define('WP_CACHE', false); // Added by W3 Total Cache | |
// ** Ajustes de MySQL. Solicita estos datos a tu proveedor de alojamiento web. ** // | |
/** El nombre de tu base de datos de WordPress en mi LOCAL*/ | |
define('DB_NAME', 'MIBASEDEDATOS'); | |
/** Tu nombre de usuario de MySQL en mi local */ | |
define('DB_USER', 'root'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @package WordPress | |
* Condicional para verificar si existe el archivo wp-config-local.php. Sí en local exite entonces | |
* tomara las configuraciones de dicho archivo local. sino todo lo | |
*/ | |
if ( file_exists( dirname( __FILE__ ) . '/wp-config-local.php' ) ) { | |
include dirname( __FILE__ ) . '/wp-config-local.php'; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
remove_action('wp_head', 'wp_generator'); | |
/* Hide WP version strings from scripts and styles * @return {string} $src * @filter script_loader_src * @filter style_loader_src */ | |
function fjarrett_remove_wp_version_strings($src) { | |
global $wp_version; | |
parse_str(parse_url($src, PHP_URL_QUERY), $query); | |
if (!empty($query['ver']) ) { | |
$src = remove_query_arg('ver', $src); | |
} return $src; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Accediendo a mongo y creando usuario "admin" | |
use admin | |
db.createUser( { user: "admin", pwd: "admin", "roles" : [ { "role" : "root", "db" : "admin" } ] }); | |
Accedes como usuario "admin": | |
mongo 127.0.0.1/admin -u admin -p admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Pasos para crear un usuario ftp en linux: | |
0.- sudo apt-get install vsftpd | |
1.- ir al directorio | |
cd /home/ftp | |
2.- crear directorio "user" | |
mkdir user | |
3.- agregar el usuario user | |
sudo useradd user -d / -s /bin/ftp | |
4.- asignarle password | |
sudo passwd user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function bloqueo_images_pequenas($file) { | |
$type = explode('/', $file['type']); | |
if ($type[0] == 'image') { | |
list( $width, $height, $imagetype, $hwstring, $mime, $rgb_r_cmyk, $bit ) = getimagesize($file['tmp_name']); | |
if ($width < 600 && $height < 400) { | |
$file['error'] = __('ERROR: La imagen no cumple con las dimensiones minimas de 600x400- ancho act:' . $width . ' alto act:' . $height, 'textdomain'); | |
} | |
} | |
return $file; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Requerir imagen destacada | |
add_action('save_post', 'wpds_check_thumbnail'); | |
add_action('admin_notices', 'wpds_thumbnail_error'); | |
function wpds_check_thumbnail($post_id) { | |
// cambia esto para cualquier tipo de entrada personalizada | |
if (get_post_type($post_id) != 'post') | |
return; | |
if (!has_post_thumbnail($post_id)) { | |
// se muestra un mensaje a los usuarios |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cortarTexto($txt, $nr, $abrev = null) { | |
$tamano = $nr; | |
$contador = 0; | |
$texto = strip_tags($txt); | |
if ($texto != "") { // Cortamos la cadena por los espacios | |
//$arrayTexto = split(' ',$texto); | |
if ($tamano >= strlen($texto)) { | |
return $texto; | |
} else { | |
$arrayTexto = explode(' ', $texto); |
OlderNewer