Skip to content

Instantly share code, notes, and snippets.


Marcos Matamala Fernández asterion

View GitHub Profile

Composer --ignore-platform-reqs

composer install --ignore-platform-reqs
asterion /
Created Feb 15, 2021
Rabbitmq torpedo

Crear usuarios

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

Inpeccionar SSL

openssl s_client -connect <url>:443

Leer información desde un archivo crt

openssl x509 -text -noout -in certificate.crt

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;

Contenedores corriendo

docker ps -a

No iniciar contenedores en el inicio del sistema

docker update --restart=no my-container
asterion /
Last active Sep 17, 2020
magento install
php bin/magento setup:install \
--admin-firstname=Marcos \
--admin-lastname=Matamala \ \
--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 = ''.$this->instagram_uid.'?access_token='.$this->instagram_token;
$text = file_get_contents($url);
$json = json_decode($text);
asterion / tiendas.txt
Last active Apr 26, 2018
Listado de tiendas online con productos relacionados a arduino/raspberry
View tiendas.txt
View groupby.sql
SELECT, SUM(detalle.cantidad*detalle.valor) FROM facturas, detalle WHERE = detalle.factura_id GROUP BY
asterion / functions.php
Created Oct 30, 2017
upload svg wordpress
View functions.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);