Jump to content

User:JackPotte

From Wikitech
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Babel user information
fr-N Cet utilisateur a pour langue maternelle le français.
en-4 This user has near native speaker knowledge of English.
de-2 Dieser Benutzer beherrscht Deutsch auf fortgeschrittenem Niveau.
es-2 Esta persona tiene un conocimiento intermedio del español.
pt-1 Este utilizador tem um nível básico de português.
it-1 Quest'utente può contribuire con un livello elementare in italiano.
ru-1 Этот участник владеет русским языком на начальном уровне.
ar-1 هذا المستخدم لديه معرفة أساسية بالعربية.
hi-1 इस सदस्य को हिन्दी का प्राथमिक ज्ञान है।
zh-1 这位用户的中文达到初级水平
ja-1 この利用者は初級日本語ができます。
la-1 Hic usor/Haec ustrix simplici lingua Latina conferre potest.
el-1 Αυτός ο χρήστης έχει βασικές γνώσεις Ελληνικών.
vi-0 Thành viên này hoàn toàn không biết tiếng Việt (hoặc rất khó khăn để hiểu).
id-0 Pengguna ini tidak memiliki pengetahuan bahasa Indonesia (atau memahaminya dengan sangat sulit).
ko-0 이 사용자는 한국어모르거나, 이해하는 데 어려움이 있습니다.
nl-0 Deze gebruiker heeft geen kennis van het Nederlands (of begrijpt het met grote moeite).

User UTC + 1 (Paris, France)

Own tools

Hosted tools

Other tools

Shell

Connect to the wikis replicas

$ mysql --defaults-file=replica.my.cnf -h enwiki.labsdb
MariaDB [(none)]> connect enwiki_p
...
$ mysql --defaults-file=~/replica.my.cnf -h enwiktionary.labsdb enwiktionary_p
MariaDB [(none)]> connect enwiktionary_p
...
$ mysql --defaults-file=replica.my.cnf -h frwiktionary.labsdb
connect frwiktionary_p

Create one's own database

mysql --defaults-file=replica.cnf -h tools-db
...
create database p48358730291690573246813765835736425432__mycooldb;
...


MySQL

Executable on https://quarry.wmflabs.org/.

See also https://meta.wikimedia.org/wiki/Research:GCI_Wiki_Study/2018.

Page content by title

SELECT CAST(pp_page AS CHAR(1000000) CHARACTER SET utf8) FROM page JOIN page_props ON page_id = pp_page WHERE page_namespace = 0 and page_title = 'jackpot';

Page name by content

USE frwiki_p;
SELECT p.page_title
FROM page p
JOIN page_props pp ON p.page_id = pp.pp_page
WHERE p.page_namespace = 0 AND pp.pp_page REGEXP '\n *titre *='

Pages modified by

SELECT page_title FROM pp_value JOIN page ON page_id = pp_page WHERE pp_value = 'JackPotte';

Edit count

select user_editcount from user where user_name='JackPotte';

Created pages

SELECT DISTINCT page_title FROM page JOIN revision ON page_id=rev_page WHERE rev_user_text='JackPotte' and page_namespace=0 AND page_is_redirect=0;

Hidden editions

SELECT DISTINCT page_title FROM page JOIN revision ON page_id=rev_page WHERE rev_user_text='JackPotte' and page_namespace=0 AND page_is_redirect=0 and rev_deleted=1;

Count the number of editions on a day

SELECT COUNT(*) FROM revision where rev_timestamp like '20150531%';

Crons

toolforge-jobs list -l

Deployment

tools.jackbot@tools-login:~$ cat updateGit.sh
cd JackBot
git stash
git pull

Git

apt-get remove git-review
pip install git-review
git review -s
git branch
git remote -v
ssh jackpotte@gerrit.wikimedia.org:29418/test/mediawiki/extensions/examples.git
git review -s
git config -l
git config --global user.name "jackpotte"
git clone https://gerrit.wikimedia.org/r/p/test/mediawiki/extensions/examples.git
git review -sgit pull origin master
git pull origin master
git checkout -b jackbot-1 master
git diff
git status
git add test1.php
git status
git diff --cached
git commit
git pull origin master
git rebase master
git review -R
cd .git
git fetch https://gerrit.wikimedia.org/r/mediawiki/core refs/changes/69/17069/1 && git checkout FETCH_HEAD

Git / Gerrit

Quiz

git clone ssh://jackpotte@gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz
cd Quiz
vim Quiz.class.php
git add Quiz.class.php
git commit
git fetch
git push ssh://jackpotte@gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz HEAD:refs/for/master
# Error with a change ID
git commit --amend
# Insertion of the change ID at the last line
git push ssh://jackpotte@gerrit.wikimedia.org:29418/mediawiki/extensions/Quiz HEAD:refs/for/master

Pywikibot

git clone https://gerrit.wikimedia.org/r/pywikibot/core.git
cd core

gitdir=$(git rev-parse --git-dir); scp -p -P 29418 jackpotte@gerrit.wikimedia.org:hooks/commit-msg ${gitdir}/hooks/
pip install -r requirements.txt

cd scripts
git clone https://gerrit.wikimedia.org/r/pywikibot/i18n.git

# Modification here
git add -A
git commit -m "Add a French translation for clean_sandbox"
git push origin HEAD:refs/for/master