Skip to content

Instantly share code, notes, and snippets.

Avatar

Marcos Matamala Fernández asterion

View GitHub Profile
View composer.md

Composer --ignore-platform-reqs

composer install --ignore-platform-reqs
@asterion
asterion / rabbitmq.md
Created Feb 15, 2021
Rabbitmq torpedo
View rabbitmq.md

Crear usuarios

rabbitmqctl add_user test test
rabbitmqctl set_user_tags test administrator
rabbitmqctl set_permissions -p / test ".*" ".*" ".*"
View SSL.md

Inpeccionar SSL

openssl s_client -connect <url>:443

Leer información desde un archivo crt

openssl x509 -text -noout -in certificate.crt
View magento.md

Definir URL path al admin

bin/magento setup:config:set --backend-frontname=admin

Listar URL con caracteres especiales

SELECT p.sku, u.request_path FROM url_rewrite u, catalog_product_entity p WHERE u.entity_id = p.entity_id AND u.request_path REGEXP '[^a-zA-Z0-9\-\.\/\(\)]' ORDER BY p.sku, u.request_path;
View docker_torpedo.md

Contenedores corriendo

docker ps -a

No iniciar contenedores en el inicio del sistema

docker update --restart=no my-container
@asterion
asterion / magento.sh
Last active Sep 17, 2020
magento install
View magento.sh
php bin/magento setup:install \
--admin-firstname=Marcos \
--admin-lastname=Matamala \
--admin-email=mmatamala1982@gmail.com \
--admin-user=admin \
--admin-password='MMatamala123' \
--base-url=http://prueba.ecomsur.marcosmatamala \
--base-url-secure=https://prueba.ecomsur.marcosmatamala \
--backend-frontname=admin_demo \
--db-host=mysql-mmatamala \
View php
public function add_instagram_profile(){
$filename = sprintf('/tmp/profile.clapesuc.%s.json', date('Ymd'));
if (file_exists($filename)) {
$json = json_decode(file_get_contents($filename));
} else {
$url = 'https://api.instagram.com/v1/users/'.$this->instagram_uid.'?access_token='.$this->instagram_token;
$text = file_get_contents($url);
$json = json_decode($text);
@asterion
asterion / tiendas.txt
Last active Apr 26, 2018
Listado de tiendas online con productos relacionados a arduino/raspberry
View tiendas.txt
http://cycom.cl/
http://electronicadelsurltda.cl/
http://kowka.cl/
http://rambal.com/
http://www.electronica.cl/productos/
http://www.hmtechtronic.cl/
http://www.hubot.cl/
http://www.maxelectronica.cl/
http://www.mcielectronics.cl/
http://www.mundoreballing.cl/
View groupby.sql
SELECT facturas.id, SUM(detalle.cantidad*detalle.valor) FROM facturas, detalle WHERE facturas.id = detalle.factura_id GROUP BY facturas.id
@asterion
asterion / functions.php
Created Oct 30, 2017
upload svg wordpress
View functions.php
<?php
/* codigo ... */
function svg_mime_type($mime_types){
$mime_types['svg'] = 'image/svg+xml';
return $mime_types;
}
add_filter('upload_mimes', 'svg_mime_type', 1, 1);