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
# Create sudo user | |
adduser <user> | |
usermod -a -G sudo <user> | |
logout | |
# Update and clean | |
sudo apt-get update | |
sudo apt-get upgrade | |
sudo apt-get dist-upgrade | |
sudo apt-get autoremove |
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
<!doctype html> | |
<html> | |
<head> | |
<style> | |
div { | |
width: 100px; | |
height: 100px; | |
float: left; | |
} | |
</style> |
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/sh | |
############################################################################### | |
############# CONFIGURADOR SERVER ESTANDAR LAMP UBUNTU 14.04 ################## | |
################################################################## v 0.1 ###### | |
##### ejecutar como root (sin sudo) ########################################### | |
##### requisitos: ############################################################# | |
##### *) ssh y ssh_keys instaladas ############################################ | |
##### *) particiones extras montadas (/home/mysql, swap) ###################### | |
##### *) resolv.conf contiene los dns validos (google o isp) ################## |
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
article, | |
aside, | |
details, | |
figcaption, | |
figure, | |
footer, | |
header, | |
hgroup, | |
main, | |
nav, |
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
$(window).scroll(function() { | |
if ($(".conciencia").offset().top>50) | |
$(".conciencia").addClass("complete"); | |
else | |
$(".conciencia").removeClass("complete"); | |
}); |
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
import urllib, urllib2, pytesseract, os | |
from PIL import Image | |
f = open('/tmp/captcha.jpg', 'wb') | |
f.write(urllib.urlopen('http://www.sunat.gob.pe/cl-ti-itmrconsruc/captcha?accion=image').read()) | |
f.close() | |
codigo = pytesseract.image_to_string(Image.open('/tmp/captcha.jpg')) | |
print codigo | |
os.remove('/tmp/captcha.jpg') | |
data = [('codigo', codigo), ('accion', 'consPorRuc'), ('nroRuc', '20549949232'),] |
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
# -*- coding: utf-8 -*- | |
from functools import partial | |
import datetime | |
from reportlab.lib.pagesizes import letter, A4 | |
from reportlab.platypus import SimpleDocTemplate, Paragraph, Table, TableStyle, Image, Spacer | |
from reportlab.platypus import PageTemplate, BaseDocTemplate, NextPageTemplate, PageBreak, Frame | |
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle | |
from reportlab.lib.enums import TA_CENTER, TA_RIGHT, TA_LEFT |
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
sudo apt-get install uwsgi uwsgi-plugin-python | |
cd /etc/uwsgi/apps-available | |
sudo vim site.ini | |
# View site.ini | |
cd .. | |
cd apps-enabled | |
ln -s ../apps-available/site.ini | |
sudo service uwsgi restart | |
cd /etc/nginx/sites-available | |
sudo vim site.conf |
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
function epsacrop_element_info_alter(&$type) { | |
$type['managed_file']['#process'][] = 'epsacrop_element_process'; | |
if (module_exists('multiupload_filefield_widget')) { | |
$type['mfw_managed_file']['#process'][] = 'epsacrop_element_process'; | |
} | |
if (module_exists('media')) { | |
$type['media']['#process'][] = 'epsacrop_element_process'; | |
} | |
} |
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
cd sites/all/default | |
mkdir files | |
su foreign | |
sudo chown -R www-data:www-data files | |
exit | |
cp default.settings.php settings.php | |
chmod 777 settings.php |