lunes, 3 de julio de 2017

Code Highlighter vs JavaScript code prettifier vs codeformatter

#http://blog.cartercole.com/2009/10/awesome-syntax-highlighting-made-easy.html #https://github.com/google/code-prettify http://sites.google.com/site/itswadesh/ codehighlighter



codigo normal:
...Your html-escaped code goes here...
php:
    echo "I like PHP";
html:
... 소스코드 ...
aqui un problema:

   AddDefaultCharset UTF-8
   
     # Apache 2.4
     
       Require ip 127.0.0.1
       Require ip ::1
       Require all granted
     
   
   
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   


https://github.com/google/code-prettify prettyprint
class Voila {
public:
  // Voila
  static const string VOILA = "Voila";

  // will not interfere with embedded tags.
}
  The lang-* class specifies the language file extensions.
  File extensions supported by default include:
    "bsh", "c", "cc", "cpp", "cs", "csh", "cyc", "cv", "htm", "html", "java",
    "js", "m", "mxml", "perl", "pl", "pm", "py", "rb", "sh", "xhtml", "xml",
    "xsl".
otro error aca:

   AddDefaultCharset UTF-8
   
     # Apache 2.4
     
       Require ip 127.0.0.1
       Require ip ::1
       Require all granted
     
   
   
     # Apache 2.2
     Order Deny,Allow
     Deny from All
     Allow from 127.0.0.1
     Allow from ::1
   


En resumen el unico gran problema de Code highlighter/prettifier es que las rutas dentro de tags las deja con comillas. a excepcion de codeformatter: http://codeformatter.blogspot.cl/
 <Directory /usr/share/phpMyAdmin/>  
   AddDefaultCharset UTF-8  
   <IfModule mod_authz_core.c>  
    # Apache 2.4  
    <RequireAny>  
     Require ip 127.0.0.1  
     Require ip ::1  
     Require all granted  
    </RequireAny>  
   </IfModule>  
   <IfModule !mod_authz_core.c>  
    # Apache 2.2  
    Order Deny,Allow  
    Deny from All  
    Allow from 127.0.0.1  
    Allow from ::1  
   </IfModule>  
 </Directory>  

Centos 7 Basico

Mis pasos para la instalación minima de Centos 7

ifconfig
yum install net-tools

Básicos
yum install nano
yum install wget

Enable EPEL Repository in RHEL/CentOS 7/6/5
## RHEL/CentOS 7 64-Bit ##
# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# rpm -ivh epel-release-7-9.noarch.rpm

## RHEL/CentOS 6 32-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm
## RHEL/CentOS 6 64-Bit ##
# wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
# rpm -ivh epel-release-6-8.noarch.rpm

pure-ftpd
yum install pure-ftpd

nano /etc/pure-ftpd/pure-ftpd.conf
NoAnonymous       yes
systemctl enable pure-ftpd
systemctl start pure-ftpd
firewall-cmd --zone=public --add-port=21/tcp --permanent
firewall-cmd --reload

httpd: apache+php+mysql
yum install httpd
yum install php
systemctl enable httpd
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
yum install mysql
yum install mariadb-server
systemctl start mariadb.service
systemctl start mariadb
mysqladmin -u root password
systemctl enable mariadb

php
nano /etc/php.ini
date.timezone = America/Santiago
php-test
connect_error)
     die('Connect Error (' . mysqli_connect_errno() . ') '. mysqli_connect_error());
   return $mysqli;
}
$mysqli = getConnected('localhost','prueba','prueba','prueba');
$resultado = $mysqli->query("SELECT * FROM entries LIMIT 30");
if($resultado){
    while ($row = $resultado->fetch_object()){
        echo "
  • $row->word"; } $resultado->close(); } ?>

  • phpmyadmin
    yum install phpmyadmin
    nano /etc/httpd/conf.d/phpMyAdmin.conf
    
     <Directory /usr/share/phpMyAdmin/>  
       AddDefaultCharset UTF-8  
       <IfModule mod_authz_core.c>  
        # Apache 2.4  
        <RequireAny>  
         Require ip 127.0.0.1  
         Require ip ::1  
         Require all granted  
        </RequireAny>  
       </IfModule>  
       <IfModule !mod_authz_core.c>  
        # Apache 2.2  
        Order Deny,Allow  
        Deny from All  
        Allow from 127.0.0.1  
        Allow from ::1  
       </IfModule>  
     </Directory>  
    #http://codeformatter.blogspot.cl/
    

    detectar ping
    yum install tcpdump
    tcpdump -i enp0s3 icmp and icmp[icmptype]=icmp-echo