User:Emijrp/Things I usually forget

WLM

 * sql p_erfgoed_p (WLM monuments database)

dispenser coordinates databases

 * mysql -h commonswiki-p.db.toolserver.org
 * use u_dispenser_p;
 * https://wiki.toolserver.org/view/Ghel#Access_and_query_examples

dumps

 * Para hacer un dump: mysqldump -u USER -pPASSWORD wikidb > wikidbbackup.sql
 * Para restaurar un dump: mysql -u USER -pPASSWORD wikidb < wikidbbackup.sql

svn merge (revertir versiones en svn)

 * svn merge -r 62:34 https://forja.rediris.es/svn/blablabla/trunk/
 * revierte de la 62 a la 34

_mysql vs mysqldb
Con estos dos módulos se pueden hacer consultas mysql en python. El primero no te trae todo el resultado a memoria, sino que lo va parseando poco a poco, el segundo te consume toda la RAM.

API
jeremyb: wikipedia.query.GetData({'action':'query', 'prop':'imageinfo', 'iiprop':'url|size', 'generator':'categorymembers', 'gcmtitle':'Category:Human', 'gcmprop':'title', 'gcmnamespace':'14|6', 'gcmlimit':'15'},site=wikipedia.Site('commons','commons'),useAPI=True)

free geoip
http://software77.net/faq.html

R

 * paquetes de mapas: install.packages('maps')
 * también apt-get install r-cran-map*^(4 paquetes salen)


 * guardar plots en R: http://www.stat.berkeley.edu/users/spector/s133/saving.html
 * mapdata package (web) mapa del mundo y países: http://bm2.genes.nig.ac.jp/RGM2/R_current/library/mapdata/man/worldHires.html


 * ejemplos con otros paquetes


 * maptools

Servidores de Toolserver
>	OK. [00:12:55]	But I always work on nightshade, when I need another server? [00:13:19]		How should we know where you work? :-) [00:13:38]	we have also willow, which runs solaris or cassini for the OSM-people [00:13:48]		(resolved) [TS-572] Install ZODB for Python  (DaB.) [00:13:50]		or wolfsbane for the web		(which runs also solaris)

Tutorial usuarios Toolserver

 * https://wiki.toolserver.org/view/Getting_started
 * https://wiki.toolserver.org/view/Logging_in

s1, s2, s3

 * https://wiki.toolserver.org/view/Database_access
 * http://noc.wikimedia.org/conf/
 * todas las bases de datos: http://noc.wikimedia.org/conf/all.dblist

consulta cualquiera desde consola
'mysql -h %swiki-p.db.toolserver.org -e "use %swiki_p;select user_name, user_editcount from user where user_editcount!=0 order by user_editcount desc limit 5000;" > /home/emijrp/...../file.data'

mysql fechas

 * rc_timestamp>=date_add(now, interval -1 day)

phpmyadmin
Conectarse al phpmyadmin de toolserver.org :
 * 1) https://phpmyadmin.toolserver.org/
 * 2) Meter pass asignada con setpass  (si se me olvida puedo volver a crearla con setpass desde la consola)
 * 3) Meter pass sql
 * 4) Ya estoy dentro, buscar las u_emijrp

Importar un .sql a una bbdd

 * 1) Conectarse al phpmyadmin
 * 2) Elegir la bbdd
 * 3) Importar el fichero (debe tener inserts)
 * 4) INSERT INTO `imagesforbio` (`id`, `language`, `article`, `image`, `url`, `done`) VALUES (NULL, 'es', 'b', 'b.jpg', 'ss', 0);

o también:
 * mysqldump -u root -p midb < midb.sql

password en user-config.py
Poco recomendable pero... # password_file = ".passwd" # A password file with default passwords. For more information, please # see LoginManager.readPassword in login.py. ok, thanks see config.py for all possible options in user-config.py

backups de base de datos
28/02/09
 * mysqldump --opt u_emijrp > DB_backups/u_emijrp
 * info: http://www.desarrolloweb.com/articulos/1202.php
 * hizo falta para:

first issue: sql-s1 change. we will shortly be changing s1 from yarrow to rosemary. if you have user databases on yarrow, these will *not* be copied over, and furthermore will be deleted when s3 is re-imported to yarrow. if you need to keep these databases, you need to dump them *now* using mysqldump, and either import them into the new s1 server after the change, or import them back into yarrow when s3 is reimported.

procesos

 * pstree emijrp -a

uso de espacio en disco disk usage, quota

 * du -h
 * du -h 2>/dev/null | sort -rn | head -10 (sin -h no desordena 233K y 100M)
 * arreglado por nessa_los

domas logs
[11:03:07]	 	domas: your visits logs, like pagecounts-20100402-030000.gz, it contains from 02:00:00 to 02:59:00 or from 03:00:00 to 03:59:59 ? [11:03:50]	 	02:00:00 to 02:59:00 [11:03:58]	 	ok, thanks [11:04:11]	a readme file in the directory would be nice : )

Special:Search mayúsculas, minúsculas
De includes/search/SearchEngine.php $title = Title::newFromText( $wgContLang->lc( $term ) ); if ( $title && $title->exists ) { return $title; } $title = Title::newFromText( $wgContLang->ucwords( $term ) ); if ( $title && $title->exists ) { return $title; }
 * 1) Now try all lower case (i.e. first letter capitalized)
 * 1) Now try capitalized string

... y algunas más ...

usa ucwords, ucwordbreaks y otras...