View gist:75b907583ecef3c46531
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
#Try 'REPAIR TABLE postparsed;' first. | |
DROP TABLE `postparsed`; | |
CREATE TABLE IF NOT EXISTS `postparsed` ( | |
`Postid` int (10) unsigned NOT NULL default '0', | |
`Dateline` int (10) unsigned NOT NULL default '0', | |
`Styleid` smallint (5) unsigned NOT NULL default '0', | |
`Languageid` smallint (5) unsigned NOT NULL default '0', | |
`Hasimages` smallint (6) NOT NULL default '0', | |
`Pagetext_html` medium text, |
View create_emails_from_txt.sh
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
#!/bin/bash | |
echo '[Create multiple email addresses in Plesk from a text file easily]' | |
echo | |
# ZARZA | A HEAD OF OUR TIME | |
# https://zarza.com | |
FILE='mails.txt' | |
if [ -f $FILE ]; then | |
while read p; do |
View checknstart_service_if_down.sh
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
#!/bin/bash | |
echo '[Start service if it is down]' | |
echo | |
# ZARZA | A HEAD OF OUR TIME | |
# https://zarza.com | |
service=nginx | |
if (( $(ps -ef | grep -v grep | grep $service | wc -l) > 0 )) | |
then | |
echo "$service is up!" |
View fastestRandomSelect.sql
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
# Ejemplo 1 | |
SELECT * FROM post AS r1 JOIN (SELECT (RAND() * (SELECT MAX(postid) FROM post)) AS postid) AS r2 WHERE r1.postid >= r2.postid ORDER BY r1.postid ASC LIMIT 10 | |
# Ejemplo 2 | |
SELECT * FROM (SELECT * FROM `comprobantes` WHERE `ind-estado` = 'procesando' OR (`ind-estado` = 'rechazado' AND `respuesta-xml` IS NULL)) AS r1 JOIN (SELECT (RAND() * (SELECT MAX(id) FROM comprobantes)) AS id) AS r2 WHERE r1.id >= r2.id ORDER BY r1.id ASC LIMIT 100 |
View ajax-cache-include.js
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
/** | |
* Cache AJAX-included scripts. | |
*/ | |
$.cachedScript = function (url, options) { | |
options = $.extend( | |
options || {}, { | |
dataType: "script", | |
cache: true, | |
url: url | |
} |
View gist:8a23ba480ff8b8642258bff74717ea42
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
mysql -u admin -p`cat /etc/psa/.psa.shadow` | |
CREATE USER 'root'@'localhost' IDENTIFIED BY ''; | |
GRANT ALL PRIVILEGES ON * . * TO 'root'@'localhost'; | |
FLUSH PRIVILEGES; | |
exit; | |
Y luego reboot. |
View gist:2ce099ba6130e7c9010b4d02408ea327
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
You can star on https://m.facebook.com/pages/?category=liked&ref=bookmarks | |
then from console: | |
const unlike_all = ()=> { | |
[].slice.call(document.querySelectorAll('a[role=button]')).filter(x=>x.innerText=='Unlike').map(x=>{x.click(); x.remove()}); | |
[].slice.call(document.querySelectorAll('a[role=button][action=cancel]')).map(x=>x.click()); | |
window.scrollTo(0,document.body.scrollHeight); | |
window.setTimeout(unlike_all, 3 * 1000) | |
}; |
View gist:efec7b74abe8733f742ead5226bd1511
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
iptables -t nat -A OUTPUT -p tcp --dport 25 -j DNAT --to-destination :587 |
View gist:5f64cdbc832651fddfcf5f2f97b379de
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
# Remember to setup your ssh-copy-id first | |
# https://www.ssh.com/academy/ssh/copy-id | |
# And then | |
ls --indicator-style=none /home/admin/web/ | xargs -n1 -P4 -I% rsync -avzhP % root@xx.21.xx.233:/root/OLD_CLOUDSTORAGE/ | |
# Just replace your SERVER_IP and setup the destination folder. |
View gist:335234deb37ec038c6957a8ea0d4efcd
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
# VESTA PORTS # | |
#<?php | |
#// Enter your code here, enjoy! | |
#$array = explode(',','21,22,25,53,80,443,110,143,465,783,993,995,3306,8083'); | |
#foreach( $array as $port ){ | |
#echo 'iptables -i eth0 -I FORWARD -d 10.7.0.2 -m comment --comment "Accept to forward ssh traffic" -m tcp -p tcp --dport '.$port.' -j ACCEPT' . PHP_EOL; | |
#echo 'iptables -i eth0 -I FORWARD -m comment --comment "Accept to forward ssh return traffic" -s 10.7.0.2 -m tcp -p tcp --sport '.$port.' -j ACCEPT' . PHP_EOL; | |
#echo 'iptables -i eth0 -t nat -I PREROUTING -m tcp -p tcp --dport '.$port.' -m comment --comment "redirect pkts to virtual machine" -j DNAT --to-destination 10.7.0.2:'.$port.'' . PHP_EOL; |
OlderNewer