You are browsing a read-only backup copy of Wikitech. The live site can be found at wikitech.wikimedia.org

User:Avicennasis/todo

From Wikitech-static
Jump to navigation Jump to search


Basic commands

(stolen from User:Emijrp)

Command Example Description
become become wmcounter Login as tool user (for exit write 'logout' or press Ctrl+D)
chmod chmod -R g+w /data/project/alicetools Make directory writable for group
jsub jsub -N enwiki1 -mem 1G /usr/bin/python /data/project/mytool/script.py enwiki-20140509-pages-meta-history1.xml.7z Submit a job named enwiki1 to a queue for running the script.py over a chunk of an English Wikipedia dump.
  • qstat: show status of jobs
  • qacct -j jobname: show info about job
  • qdel jobname: abort the job
  • qdel -u tools.toolname: abort all the jobs of this tool
pip pip install mediawiki-utilities Install the Python module mediawiki-utilities
scp scp wmcounter.py yourusername@tools-login.wmflabs.org:/data/project/wmcounter Upload a single file from your local to the target machine
scp -r lib/ yourusername@tools-login.wmflabs.org:/data/project/wmcharts Upload a directory recursively
sql sql enwiki Enter in MariaDB console
sql meta
SELECT * FROM wiki WHERE 1;
Display all available databases. You can filter by language (lang='xx'), family (family='wikibooks'), etc.
ssh ssh -A yourusername@tools-login.wmflabs.org Connect to tools-login.wmflabs.org
mosh -a yourusername@tools-login.wmflabs.org Recommended for connections from Europe when lag appears
virtualenv virtualenv -p python3 name Create a virtual environment with Python 3 with the name name
cd name;source bin/activate Move inside the virtualenv name and launch it
deactivate Exit of virtualenv
webservice webservice start Tool is reachable throught public URL (webservice stop to stop)