View asd.rst
License: AGPL-3

mail_server_per_user

Este módulo permite definir un servidor de correo saliente por usuario. Cada vez que se envíe un correo por defecto se utilizará el servidor del usuario que lo envía.

View Ubuntu 18.04.sh
# Ubuntu 18.04 minimal installation
apt install openjdk-11-jdk
apt install python-pip
# eclipse: install javascript-oxygen in /opt/eclipse/javascript-oxygen
# pydev: http://dl.bintray.com/fabioz/pydev/6.3.2
# subclipse: http://dl.bintray.com/subclipse/releases/subclipse/latest
# egit: http://download.eclipse.org/egit/updates
# github mylyn: http://download.eclipse.org/egit/github/updates
# JavaHL
apt install libsvn-java
View random_nif.py
import random
print(
(lambda x: '%s%s' % (x, "TRWAGMYFPDXBNJZSQVHLCKE"[x % 23]))(
random.randint(10000000, 99999999)
)
)
View delete-git-recursively.sh
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf
View indent.py
# -*- coding: utf-8 -*-
def indent(elem, level=0):
tab_size = ' '
i = '\n' + level * tab_size
if len(elem):
if not elem.text or not elem.text.strip():
elem.text = i + tab_size
if not elem.tail or not elem.tail.strip():
elem.tail = i
for elem in elem:
View svn.keyring.sh
# /home/user
cd ~
# .eclipse folder
cd .eclipse/org.eclipse.platform_3.8_155965261/configuration/org.eclipse.core.runtime
# remove file .keyring
rm .keyring
# one-line
rm ~/.eclipse/org.eclipse.platform_3.8_155965261/configuration/org.eclipse.core.runtime/.keyring
View right_shift.py
#!/usr/bin/python
import math
# [255th decimal of the constant quantity that determines the area of a circle
# by multiplying it by the radius squared]
PI_255_DECIMAL = int((math.pi * 10 ** 255) % 10) # == 8
def is_prime(num):
View install-pip.sh
apt-get remove python-pip
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
pip --version
View encode_try.py
#! /usr/bin/env python
# -*- coding: utf-8 -*-
ecs = [
"ascii",
"big5",
"big5hkscs",
"cp037",
"cp424",
"cp437",
View latin-1-to-utf-8.py
u'Garc\xc3\xada'.encode('latin-1').decode('utf-8')