== Python mode complete * emacs 24 * python * pip install pyflakes elpy jedi rope
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
# Solo cédulas | |
ids_ofertas = [int(o) for o in (raw_input('IDs de oferas: ').split())] | |
import pyutil | |
cedulas_docentes=session.query(Docente.cedula).join([HorarioSemana, Jornada, Paralelo]).join(OfertaAcademica).filter(OfertaAcademica.id.in_((ids_ofertas))).distinct().all() | |
f=open('/tmp/cedulas_docentes.csv', mode="wb") | |
w=pyutil.UnicodeWriter(f, encoding='ISO-8859-1', delimiter=';') | |
w.writerow(('Cedula',)) | |
w.writerows(cedulas_docentes) | |
f.close() |
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
# ===================================================================== | |
# Al instalar una nueva nueva versión de ipython, para que se actualicen | |
# correctamente los archivos de configuración de usuario se necesita: | |
ipython -upgrade | |
# Log de ejemplo: | |
#********************************************************************** | |
#I am going to upgrade your configuration in: | |
#/home/miltonlab/.ipython |
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
-- Thanks to : http://jamie.curle.io/blog/creating-a-read-only-user-in-postgres/ | |
CREATE USER read_user WITH ENCRYPTED PASSWORD 'password'; | |
GRANT CONNECT ON DATABASE production to read_user; | |
\c production | |
GRANT USAGE ON SCHEMA public to read_user; | |
GRANT SELECT ON ALL SEQUENCES IN SCHEMA public TO read_user; | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO read_user; |
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
Este snnipet debe permitir crear una copia de una base de datos de producción | |
para utilizarla en un ambiente de pruebas. Se supone el mismo servidor de Base | |
de datos y el mismo usuario. | |
# scritp crontab | |
# Todos los dias a las 03 de la madrugada | |
# 00 03 * * * root backup_db.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
print unicodedata.normalize('NFKD', unicode(e.apellidos)).encode('ascii', 'ignore') | |
print unicodedata.normalize('NFKD', unicode('áéíóú','UTF-8')).encode('ascii', 'ignore') |
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
for f in `ls *.PDF` | |
do | |
mv $f `echo $f|tr 'PDF' 'pdf'` | |
done |
- GNU Cash article http://www.linux-mag.com/id/6779/
- Trivia/Test about Python developer http://www.toptal.com/python/interview-questions?utm_source=Engineering+Blog+Subscribers&utm_campaign=d269c3635a-intv_q_python&utm_medium=email&utm_term=0_af8c2cde60-d269c3635a-111342025
- How to change LDAP password from python - OPenLDAP Book Chapter: http://www.packtpub.com/article/python-ldap-applications-ldap-opearations
- How can I add images in sale.oder.line or in treeview generally http://phamvphu.blogspot.com/2013/06/openerp-7-how-can-i-add-images-in.html
- Good Digital Ocean tutorials: https://plus.google.com/u/0/+Digitalocean/posts
- Great and Beautiful terminal emulators:
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
# --------------------------------------------------- | |
# Update LinuxMint to v17 | |
# --------------------------------------------------- | |
sudo sed -i 's/raring/trusty/' /etc/apt/sources.list | |
sudo sed -i 's/olivia/qiana/' /etc/apt/sources.list | |
sudo sed -i 's/raring/trusty/' /etc/apt/sources.list.d/official-package-repositories.list | |
sudo sed -i 's/olivia/qiana/' /etc/apt/sources.list.d/official-package-repositories.list | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get upgrade |
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
## dplyr package notes | |
# dplyr use plyr and haver relation with data.table | |
library(dplyr) | |
# Example | |
ddply(df, ~date, summarise, totalSteps=sum(steps)) | |
## *Complete dni ecuatorian numbers with '0'. If length == 9 | |
## Sometimes usefull when Spreadsheet cut that number at start | |
# ========================================================================================= | |
> head(reporte) |
OlderNewer