[ Skip to the content ]

Institute of Formal and Applied Linguistics Wiki


[ Back to the navigation ]

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
it-tricks [2017/10/17 13:24]
popel
it-tricks [2024/03/05 18:04]
popel [LaTeX, pdf]
Line 7: Line 7:
  
   * **vim**: Ondřej Bojar, Ruda Rosa, Milan Straka (C++ completion, Python completion, asynchronous make), ...   * **vim**: Ondřej Bojar, Ruda Rosa, Milan Straka (C++ completion, Python completion, asynchronous make), ...
 +    * to start learning vim, run the ''vimtutor'' command
   * **emacs**: ?   * **emacs**: ?
   * **nano**:   * **nano**:
-  * **atom**: Martin Popel+  * **IntelliJ IDEA**: Jonáš Vidra
   * **Kate**: Jonáš Vidra   * **Kate**: Jonáš Vidra
-  * **PyCharm**: Petr Bělohlávek+  * **PyCharm**: 
 +  * **VS Code** (remote access, IDE - Python, C++, etc. completion, terminals): Peter Polák
  
 ===== Bash ===== ===== Bash =====
Line 85: Line 87:
  
 ===== LaTeX, pdf ===== ===== LaTeX, pdf =====
- * [[http://mg.readthedocs.io/latexmk.html|latexmk]] can be used with ''-pdf -pvc'', so whenever you save a ''tex'' file, the corresponding ''pdf'' will be regenerated (and your pdf viewer will refresh). Other useful options are ''-interaction=nonstopmode -synctex=1'', see e.g. [[https://tex.stackexchange.com/questions/118489/what-exactly-is-synctex|synctex]]+  * see also [[tex::triky]], [[internal:publikace#collaborative-writing]] and [[internal:thesis]] 
 +  * [[http://mg.readthedocs.io/latexmk.html|latexmk]] can be used with ''-pdf -pvc'', so whenever you save a ''tex'' file, the corresponding ''pdf'' will be regenerated (and your pdf viewer will refresh). Other useful options are ''-interaction=nonstopmode -synctex=1'', see e.g. [[https://tex.stackexchange.com/questions/118489/what-exactly-is-synctex|synctex]]
   * [[https://www.pdflabs.com/docs/pdftk-cli-examples/|pdftk]] for merging and splitting pdf files (and much more) from the command line   * [[https://www.pdflabs.com/docs/pdftk-cli-examples/|pdftk]] for merging and splitting pdf files (and much more) from the command line
   * use [[https://tex.stackexchange.com/questions/23104/using-and-interpreting-pdffonts|pdffonts]] to check if all fonts in your pdf are //embedded// (only the used subset).   * use [[https://tex.stackexchange.com/questions/23104/using-and-interpreting-pdffonts|pdffonts]] to check if all fonts in your pdf are //embedded// (only the used subset).
   * <code>gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=CompressedWithEmbeddedFonts.pdf Original.pdf</code>   * <code>gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=CompressedWithEmbeddedFonts.pdf Original.pdf</code>
   * http://ufal.mff.cuni.cz/~popel/latex.pdf other hints (mostly for newbies) in Czech   * http://ufal.mff.cuni.cz/~popel/latex.pdf other hints (mostly for newbies) in Czech
 +  * [[https://en.wikibooks.org/wiki/LaTeX/Presentations#The_Beamer_package|Beamer]] is a LaTeX package for creating presentations.
 +    * You can use it with [[https://pdfpc.github.io/|pdfpc]] to show slides on the overhead projector while reading your notes on your laptop's screen. Create the dual-screen PDF with ''\usepackage{pgfpages} \setbeameroption{show notes} \setbeameroption{show notes on second screen=left}'' and add notes using ''\note{Hello!}''. Then display your presentation with ''pdfpc --notes=left presentation.pdf''.
 +  * If you need a pdf-a validator (e.g. for your thesis), you can use  `/lnet/ms/projects/verapdf/checkpdf` in the ufal internal network, which is a wrapper for the verapdf tool. New versions of the specification of exact requirements for submitting theses at the Charles university (called a "profile") appear regularly at https://cuni.cz/UK-7987.html; by default, the tool uses version UK-7987-version1-custom8.xml .
 +
 +===== TAR archive mounting =====
 +If you work with data consisting of many small files, you **should** store them in tar archives to save inodes and use LUSTRE filesystem efficiently. There is a way to mount a tar archive to a specific directory in a similar way you would mount an ISO image. You can use this command to //mount// (read-only) ARCHIVE (possibly compressed) to DIRECTORY:
 +
 +  /opt/bin/tarmount ARCHIVE DIRECTORY
 +
 +and //umount// when you finish your work:
 +
 +  /opt/bin/tarmount -u DIRECTORY
 +
 +If you mount your data in this way, there is only one //open// operation instead of thousands or millions of such operations when opening each file separately. This will positively affect runtime when your data is stored on the LUSTRE filesystem.
 +
 +Run the command with //--help// option to see instructions for more advanced usage. The original tool can be obtained [[https://github.com/mxmlnkn/ratarmount | here]].
 +It can be installed as [[https://appimage.org | AppImage]].
 +
 +==== Practical usage notes ====
 +  - ''tarmount'' is based on FUSE. You need to do call the ''tarmount'' command on every node where you need to access the tarfile contents. If two jobs are running on the same node both of them will see the mounted content.
 +  - if you finish your work you should always call ''tarmount -u DIRECTORY''. If you don't the directory will not become blocked for any subsequent attempts to ''tarmount'' anything on them and may be in a weird state indicated by many '?'s in output of the ''ls -al'' command. This can be solved by calling simple ''umount DIRECTORY''
 +  - The ''tarmount'' command creates a database in the directory where the ''ARCHIVE'' is stored. The database is not automatically deleted by ''tarmount -u''. It is however reused by any subsequent ''tarmount'' command called on the same ''ARCHIVE''. This may speed up access for all jobs using the same ''tarmount''ed archive across the cluster.
 + 
 +
  
  
Line 98: Line 125:
   * See [[internal:remote access]], esp. for byobu and mosh.   * See [[internal:remote access]], esp. for byobu and mosh.
   * You **should not turn off** Linux workstations at ÚFAL, unless really needed (or agreed with it@ufal). In that case, try the standard ways, and if they do not work, try Ctrl+Alt+SysRq+[R,E,I,S,U,B] rather than plug out power cable. Mnemonics: "Reboot Even If System Utterly Broken", see http://en.wikipedia.org/wiki/Magic_SysRq_key#Uses   * You **should not turn off** Linux workstations at ÚFAL, unless really needed (or agreed with it@ufal). In that case, try the standard ways, and if they do not work, try Ctrl+Alt+SysRq+[R,E,I,S,U,B] rather than plug out power cable. Mnemonics: "Reboot Even If System Utterly Broken", see http://en.wikipedia.org/wiki/Magic_SysRq_key#Uses
 +    * SysRq has also other interesting uses: For example, if you manage to launch a program that exhausts all RAM, the system starts swapping and becomes unresponsive, you can recover by invoking the OOM-killer by pressing Ctrl+Alt+SysRq+F.
   * Ondřej Bojar has implemented many [[http://www1.cuni.cz/~obo/textutils/|Text utils]], which he likes to use in his scripts and advises his students to do so as well.   * Ondřej Bojar has implemented many [[http://www1.cuni.cz/~obo/textutils/|Text utils]], which he likes to use in his scripts and advises his students to do so as well.
     * The web versions of the text utils are often older than the ones in ''/home/bojar/tools/vimtext'' and ''/home/bojar/tools/shell''     * The web versions of the text utils are often older than the ones in ''/home/bojar/tools/vimtext'' and ''/home/bojar/tools/shell''
   * [[https://en.wikipedia.org/wiki/Shuf|shuf]] shuffle lines randomly (or in a given order with ''--random-source'')   * [[https://en.wikipedia.org/wiki/Shuf|shuf]] shuffle lines randomly (or in a given order with ''--random-source'')
 +  * Ondřej Plátek keeps some of the suggestions above in configs, and scripts stored in the git repository which you can just clone to your home dir. Feel free to check https://github.com/ufal/oplatek-clustershgit. Pull Requests are welcome!
  

[ Back to the navigation ] [ Back to the content ]