Skip to content

Instantly share code, notes, and snippets.

View dublado's full-sized avatar
📭
Send me a Telegram

Thiago Machado dublado

📭
Send me a Telegram
View GitHub Profile
@dublado
dublado / gist:57f47db48663a396039f
Created September 21, 2014 04:38
dialog at pv progress commands
(pv -n /dev/sda | dd of=/dev/sdb bs=128M conv=notrunc,noerror) 2>&1 | dialog --gauge "Running dd command (cloning), please wait..." 10 70 0
@dublado
dublado / gist:438a6a409e0fdcb302cd
Created October 9, 2014 20:45
change title and author id3 tag
import os
import sys
with open("names.txt", "r") as fp:
for file_num, line in enumerate(fp):
if line.strip() != 'id3tagger.py':
artist = line.strip().split('-')[0]
title = line.strip().split('-')[1]
line = line.strip()
@dublado
dublado / gist:b7e49bc8dc5ae079c9d1
Created October 13, 2014 00:13
what service is using specific port
sudo netstat -lpn |grep :8080
@dublado
dublado / gist:c78987a8913dfa1cf281
Created October 14, 2014 19:00
dockerize ssh docker
FROM ubuntu:14.04
MAINTAINER Dublado "thiago@dubla.do"
RUN apt-get update && apt-get install -y openssh-server
RUN mkdir /var/run/sshd
RUN echo 'root:screencast' | chpasswd
RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]
@dublado
dublado / gist:1605dcf8fe6ef0719c02
Created October 22, 2014 01:31
open services in a specific port netstat
sudo netstat -lpn | grep :8080
@dublado
dublado / gist:97b9a255c5797cc9910a
Created October 22, 2014 12:31
field search magento
select * from eav_attribute where frontend_label like '%price%'
select * from eav_entity_attribute where attribute_id=202;
select * from eav_attribute_option where attribute_id=202 ;
select * from eav_attribute_option_value where option_id = 95;
select * from catalog_eav_attribute where attribute_id=202;
select * from catalog_product_entity_int where attribute_id=202 and entity_id=18;
@dublado
dublado / gist:20503b2a55f7100817fc
Created October 22, 2014 12:32
url rewrite magento search
SELECT `m`.* FROM `enterprise_url_rewrite` AS `m` WHERE (m.request_path IN ('cadeira-uma-vermelha-1', 'cadeira-uma-vermelha-1') ) ORDER BY `m`.`store_id` DESC
@dublado
dublado / gist:965f7bf9598c05e5e3d8
Created October 22, 2014 12:39
update price magento to spreadsheets (excel)
/*preco de*/
="update catalog_product_entity_decimal set value = '"&E4&"' where entity_type_id = 4 and store_id = 0 and attribute_id = 191 and entity_id = "&A4&";"
/*preco por*/
="update catalog_product_entity_decimal set value = '"&E4&"' where entity_type_id = 4 and store_id = 0 and attribute_id = 67 and entity_id = "&A4&";"
/* Special Price Begin Date*/
="update catalog_product_entity_datetime set value = '2013-02-28' where entity_type_id = 4 and store_id = 0 and attribute_id = 69 and entity_id = "&A4&";"
@dublado
dublado / gist:fa141c9d6c1bb4784f0d
Created October 22, 2014 13:50
set magento new password to admin or else another user
UPDATE admin_user SET password=CONCAT(MD5('qXleadmin2012'), ':qX') WHERE username='admin';
@dublado
dublado / gist:bc6971b02b7b854246da
Created October 22, 2014 13:51
magento update price and special price
select * from catalog_product_entity_int
where entity_type_id = 4 and store_id = 0 and entity_id = 32
/*limit 10;*/
select * from catalog_product_entity limit 0,10;
update catalog_product_entity_decimal set value ='1099' where entity_type_id = 4 and store_id = 0 and attribute_id = 191 and entity_id = 12;
update catalog_product_entity_decimal set value ='899' where entity_type_id = 4 and store_id = 0 and attribute_id = 67 and entity_id = 12;
update catalog_product_entity_varchar set value = '' where entity_type_id and store_id = 0 and entity_id = 32 and attirbute_id=206
/*
191 - preco de