The post “Handling Permissions with Docker Volumes” explains clearly the problem: when you run a docker container bound to a directory, all files are accessed/written with the UID of the docker user.
For instance, let us bind our
~/temp directory to the
/data directory inside the container, and create the file
/data/test inside the container with:
docker run -it -v ~/temp:/data ubuntu:16.04 "touch" "/home/test"
ls -lhF ~/temp gives:
-rw-r--r-- 1 root root 0 set 4 19:23 prova
because the command touch has been run with UID 0 inside the container. Usually, I want to run a container with my UID, so that running a container is undistinguishable from running any other program. The first element of the solution is the gosu package that must be installed via the Dockerfile command:
RUN apt-get update && apt-get install -y gosu.
The second element is a trivial script gosu.sh that computes the UID and GID of the owner of the /data directory inside the container and runs the program with that UID/GID. The
gosu.sh for our HapCHAT program is:
# Add local user
# with the same owner as /data
USER_ID=$(stat -c %u /data)
GROUP_ID=$(stat -c %g /data)
echo "Starting with UID:GID $USER_ID:$GROUP_ID"
groupadd -g "$GROUP_ID" group
useradd --shell /bin/bash -u "$USER_ID" -g group -o -c "" -m user
chown --recursive "$USER_ID":"$GROUP_ID" /HapCHAT
exec gosu user "[email protected]"
Copying and running that file is achieved with the following snippet of the Dockerfile
COPY gosu.sh /usr/local/bin/gosu.sh
We can run a docker container with the unprivileged permissions of our users with a simple script and a change to the Dockerfile. You can find the files at https://github.com/AlgoLab/HapCHAT/tree/master/docker
I used to love XEmacs, but it has been declared dead years ago.
I used it to write papers and several programs. I even used it to write my Ph.D. thesis. I have read and appreciated jwz tirade against GNU Emacs, and I think he’s right.
Anyway, some years ago (I think about 10 years ago) I switched back to GNU Emacs and I’ve never looked back. Still, up until now I have seen XEmacs as a nice project. But now the leader of XEmacs states that he would oppose any improvement to Emacs that “makes it even harder for XEmacs to catch up“. That only means that it is time to stop thinking about XEmacs and go on.
Il principale riferimento italiano per tutto ciò che riguarda LaTeX è il Gruppo Italiano di Utilizzatori TeX dove sono disponibili numerose guide. Nello stesso sito è anche disponibile uno stile per scrivere una tesi di laurea.
Per quanto riguarda la documentazione in inglese, il documento decisamente più utilizzato è The not so Short Introduction to LaTeX di cui esiste anche una traduzione in italiano che, purtroppo, non è stata aggiornata di recente.
Bisogna sempre ricordarsi che LaTeX è fondamentalmente un linguaggio di programmazione specializzato per la tipografia. Quindi si scrive un programma che viene poi tradotto, da un programma apposito, in un file che può essere stampato o visto su schermo.
Inizialmente questo file visualizzabile era in formato dvi, il quale poteva poi trasformato in un file Postscript per essere stampato. Più recentemente ci si è standardizzati sulla generazione di un file PDF direttamente dal file LaTeX, utilizzando il programma pdflatex.
Per scrivere un file LaTeX è sufficiente utilizzare un qualsiasi editor di testi. La pagina di Wikipedia Comparison of TeX editors riporta vari editor confrontando le loro caratteristiche legate a LaTeX. Per chi vuole un approccio più semplice possibile, consiglio Lyx, mentre chi desidera avere un controllo maggiore del file LaTeX è preferibile un editor di testi per programmatori con un plugin per LaTeX (ad esempio Emacs con AucTex oppure Eclipse con TeXlipse)
Siccome TeX è un linguaggio di programmazione, sono disponibili molte estensioni o pacchetti (package). I più importanti vengono inclusi nell’installazione di LaTeX: in ogni caso sono disponibili sul CTAN (Comprehensive TeX Archive Network). La Breve guida ai pacchetti più comuni ne descrive i principali. A questi vanno aggiunti sicuramente memoir (per controllare completamente gli aspetti tipografici di un libro o di una tesi), beamer (per le presentazioni), tikz/pgf (per i grafici) e Sweave (per integrare LaTeX e programmi in R).
TikZ and PGF examples. Disegnare figure con TikZ è piuttosto complicato, ma i risultati sono eccellenti. Alcuni esempi possono aiutare a capire come fare.
Tex.Sx. Il Forum su LaTeX più attivo.
LaTeX è un sistema di composizione tipografica ideato nel 1985 per automatizzare tutte le operazioni più comuni che coinvolgono la realizzazione di un documento. LaTeX permette di ottenere eccellenti risultati tipografici, in particolare quando si tratta di testi di carattere scientifico e matematico in particolare. Esistono implementazioni gratuite e libere per tutti i sistemi operativi.
Verrà tenuta una introduzione a LaTeX secondo il programma che segue. Ulteriori informazioni
||Introduzione e utilizzo basilare
||Formule matematiche ed equazioni
||Figure e grafici (Tikz)
||Risorse e approfondimenti
||Domande dei partecipanti
A causa del basso numero di iscritti, l’incotro di introduzione a LaTeX è rinviato a data da destinarsi.
I am a big fan of Unity 2D. Yes, I really like that, esr’s opinion notwithstanding. Compared to standard unity, it is much smoother and without annoying eye-candy animations. The only problem is the lack of a simple tool to configure Unity 2D.
The only option I really want is to change the hotkey for activating the Dash; the default is the Super key (that usually means the Win key), which is not ok with me, as I remapped the Win key to the Meta key (much more used inside Emacs).
After a bit of googling I reached a relevant Ask Ubuntu thread which, unfortunately, refers to an older version of Unity-2D. After some investigation I found that the new command that must be associated to the hotkey is
dubs-send --type=method_call --dest=com.canonical.Unity2d.Dash /Dash com.canonical.Unity2d.Dash.activateHome
To choose the hotkey you can follow the path System settings -> keyboard settings and finally set the desired shortcut.
For some reasons that are totally unkown to me, some websites keep linking to my older website for a text of the Clarified Artistic License, so I decided to report it here.
In 1998 I wrote the implementation of the Reduce-Expand algorithm for solving the LCS (Longest Common Subsequence) problem. At the time my understanding of free software licenses was pretty naive, so I settled for the Clarified Artistic License, which was the ncftp license with a few very minor rewordings.
Today I feel quite a pain when I see a new software license, as I think that the fragmentation of the various license is a small but totally unnecessary hurdle towards world domination. As a consequence, I support only GPL/LGPL/AGPL. I understand that somebody might prefer adoption to preserving software freedom and consequently chooses a BSD license, but that is not my choice. Especially after the JMRI trial I believe that copyleft licenses should really be the default option, so I changed the license of my implementation to the GPL.
Anyway, in case you find it useful, the text of the Clarified Artistic License is below.
The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications.
“Package” refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification.
“Standard Version” refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder as specified below.
“Copyright Holder” is whoever is named in the copyright or copyrights for the package.
“You” is you, if you’re thinking about copying or distributing this Package.
“Distribution fee” is a fee you charge for providing a copy of this Package to another party.
“Freely Available” means that no fee is charged for the right to use the item, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it.
- You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers.
- You may apply bug fixes, portability fixes and other modifications derived from the Public Domain, or those made Freely Available, or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version.
- You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following:
- place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major network archive site allowing unrestricted access to them, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package.
- use the modified Package only within your corporation or organization.
- rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version.
- make other distribution arrangements with the Copyright Holder.
- permit and encourge anyone who receives a copy of the modified Package permission to make your modifications Freely Available in some specific way.
- You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following:
- distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version.
- accompany the distribution with the machine-readable source of the Package with your modifications.
- give non-standard executables non-standard names, and clearly document the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version.
- make other distribution arrangements with the Copyright Holder.
- offer the machine-readable source of the Package, with your modifications, by mail order.
- You may charge a distribution fee for any distribution of this Package. If you offer support for this Package, you may charge any fee you choose for that support. You may not charge a license fee for the right to use this Package itself. You may distribute this Package in aggregate with other (possibly commercial and possibly nonfree) programs as part of a larger (possibly commercial and possibly nonfree) software distribution, and charge license fees for other parts of that software distribution, provided that you do not advertise this Package as a product of your own. If the Package includes an interpreter, You may embed this Package’s interpreter within an executable of yours (by linking); this shall be construed as a mere form of aggregation, provided that the complete Standard Version of the interpreter is so embedded.
- The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whoever generated them, and may be sold commercially, and may be aggregated with this Package. If such scripts or library files are aggregated with this Package via the so-called “undump” or “unexec” methods of producing a binary executable image, then distribution of such an image shall neither be construed as a distribution of this Package nor shall it fall under the restrictions of Paragraphs 3 and 4, provided that you do not represent such an executable image as a Standard Version of this Package.
- C subroutines (or comparably compiled subroutines in other languages) supplied by you and linked into this Package in order to emulate subroutines and variables of the language defined by this Package shall not be considered part of this Package, but are the equivalent of input as in Paragraph 6, provided these subroutines do not change the language in any way that would cause it to fail the regression tests for the language.
- Aggregation of the Standard Version of the Package with a commercial distribution is always permitted provided that the use of this Package is embedded; that is, when no overt attempt is made to make this Package’s interfaces visible to the end user of the commercial distribution. Such use shall not be construed as a distribution of this Package.
- The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission.
- THIS PACKAGE IS PROVIDED “AS IS” AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.