User:Dvorapa/Toolforge for beginners/Daily basic tasks

From Wikitech

Once you have all the prerequisites necessary, you can finally use the tool.

Use the command line

To access its command line interface, open your command line and run:

$ ssh <username>@login.tools.wmflabs.org

The welcome message should appear. If you want to exit, you can simply use:

$ exit

Now you can directly use the command line for your account. Or you can switch to the tool account using:

$ become <my_tool>

From the tool account you can exit back to your account using exit command too.

Once in the command line, you can use all Debian commands you are used to and many more! See some of those in the following list:

ls, mkdir, cd, cat, cp, mv, rm, ln, head, tail, man, find, grep, sed, awk, nano, vi, python, python3, perl, ...

In your folder you can probably see some of the following basic files and directories:

  • .bash-history – typical command line history file
  • .kubewebservice configuration directory, do not remove
  • logs – logs directory (not much used)
  • replica.my.cnfdatabase configuration file, can't be removed
  • .ssh – ssh cache directory (not much used)

Use the file or FTP browser

File or FTP browser comes handy, when you want to upload multiple files as it is not an easy task for the command line.

Also it can be easier to maintain file and folder structure for your account or your tools, if you are not an experienced command line user.

First you will need to install an ssh compatible file or FTP browser. Popular browsers like WinSCP, FileZilla, or Nautilus will usually do. Once you have your browser ready, let's connect to your folder. Insert the following url into your browser address bar:

User account
sftp://<username>@login.tools.wmflabs.org/home/<username>
Tool account
sftp://<username>@login.tools.wmflabs.org/data/project/<my_tool>

and press Enter. Usually the browser can handle the url without any further prerequisites and settings, but always make sure you know, how to use ssh connection in your chosen browser.

Once you are connected, do your work and after you finished, close the connection in your browser properly using some button like unmount or disconnect.

You probably noticed we haven't used any become my_tool structure here for your tool. This is what can make troubles in the future, becuase the owner of files you changed using your browser is username and the owner of files you changed using your command line is my_tool.

After you finished your changes in your browser for your tool, always connect to your command line and unify the ownership of files:

$ ssh <username>@login.tools.wmflabs.org
$ become my_tool
$ take .

This makes sure all the files and folders in your tool are owned by your tool and avoids any troubles in the future.