Difference between revisions of "Linux"

From Sinfronteras
Jump to: navigation, search
(Cambiar la ruta del escritorio, Download, Documents, etc - How to set $HOME/Desktop)
(GnuPG)
 
(567 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{Sidebar}}
 
__NUMBEREDHEADINGS__
 
__NUMBEREDHEADINGS__
 
<div class="noFloat">__TOC__</div>
 
<div class="noFloat">__TOC__</div>
==Filesystem Hierarchy Standard==
 
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
 
  
{| class="wikitable" summary="A description of the hierarchy specified in the FHS."
 
|-
 
!Directory
 
!Description
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/}}'''</span>
 
|Primary hierarchy root and root directory of the entire file system hierarchy.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/bin}}'''</span>
 
|Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/boot}}'''</span>
 
|Boot loader files, e.g., kernels, initrd.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/dev}}'''</span>
 
|Essential device files, e.g., /dev/null.
 
|-
 
|
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/etc}}'''</span>
 
<!-- Please see the talk page before changing this -->
 
|Host-specific system-wide configuration files
 
  
There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".
+
* [[Media:Linux Configuration and Automation.pdf]]
|-
+
 
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/home}}'''</span>
+
<br />
|Users' home directories, containing saved files, personal settings, etc.
+
==Instalación==
|-
+
 
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/lib}}'''</span>
+
<br />
|Libraries essential for the binaries in /bin/ and /sbin/.
+
===Creating a bootable USB flash drive===
|-
+
 
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/media}}'''</span>
+
<br />
|Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
+
====Creating a bootable Linux USB flash drive desde el terminal usando dd====
|-
+
Siguiendo el siguiente procedimiento, creé uno de Ubuntu 15, '''18.04''', CentOs 7, Red Hat '''7.5''', desde Ubuntu 15 y todos funcionaron correctamente.
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/mnt}}'''</span>
+
* Antes de crear el bootable drive es apropiado [[Linux#Formatear una unidad Flash USB|formatear]] el dispositivo en Fat32 (vFat).
|Temporarily mounted filesystems.
+
* Debemos desmontar el dispositivos antes de ejecutar el comando dd:
|-
+
 
|
+
<blockquote>
:<span style="color:#FFF; background:#FF0000">'''{{big|/opt}}'''</span>
+
umount /dev/sdb*
|Optional application software packages.
+
</blockquote>
|-
+
 
|
+
* Creación del bootable USB flash a través de dd:
:<span style="color:#FFF; background:#FF0000">'''{{big|/proc}}'''</span>
+
 
|Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
+
<blockquote>
|-
+
<syntaxhighlight lang="bash">
|
+
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
:<span style="color:#FFF; background:#FF0000">'''{{big|/root}}'''</span>
+
</syntaxhighlight>
|Home directory for the root user.
+
</blockquote>
|-
+
 
|
+
<div id="Nota_sdb">Nota_sdb</div>Make sure you select as destination the device corresponding to the USB key (/dev/sdb in the above example) and not a partition (such as /dev/sdb1). Esta advertencia creo que depende de en que dev se encuentre montado el usb  drive. Generalmente mis USB drives se montaban en /dev/sdb1. En este caso creo que se tendría que poner sdb1 en el comando (no estoy seguro). Sin embargo luego de la última vez que formateé mi USB drive, éste se monta en en /dev/sdb (sin ningún número). En este caso por supuesto habría que colocar sdb en el comando dd como se suguiere arriba. Algo parecido se presenta al formatear el USB drive.
:<span style="color:#FFF; background:#FF0000">'''{{big|/run}}'''</span>
+
 
|Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
+
Con este método el bootable CentOS se creó correctamente. En el USB drive se crearon dos particiones:
|-
+
 
|
+
sdb    iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
:<span style="color:#FFF; background:#FF0000">'''{{big|/sbin}}'''</span>
+
├─sdb1 iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
|Essential system binaries, e.g., fsck, init, route.
+
└─sdb2 vfat    ANACONDA        C522-73DA
|-
+
 
|
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/srv}}'''</span>
+
<br />
|Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
+
====How can I create a Windows bootable USB stick with Ubuntu:====
|-
+
https://www.cyberciti.biz/faq/create-a-bootable-windows-10-usb-in-linux/
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/sys}}'''</span>
+
 
|Contains information about the devices connected to the computer.
+
<br />
|-
+
=====WoeUSB=====
|
+
https://www.cyberciti.biz/faq/create-a-bootable-windows-10-usb-in-linux/
:<span style="color:#FFF; background:#FF0000">'''{{big|/tmp}}'''</span>
+
 
|Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
+
En la página anterior se describen varios métodos. A través del primer método descrito en dicho link (WoeUSB) creé un bootable-windows-10-usb correctamente en Ubuntu 18.04. A continuación se describe el método.
|-
+
 
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/usr}}'''</span>
+
<br />
|Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
+
======Installing WoeUSB======
|-
+
'''Clone WoeUSB:'''
|
+
 
:<span style="color:#FFF; background:#FF0000">'''{{big|/var}}'''</span>
+
git clone https://github.com/slacka/WoeUSB.git
|Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.
+
 
|-
+
Set the application version string:
|}
+
cd WoeUSB/
 +
./setup-development-environment.bash
 +
 
 +
'''Install WoeUSB’s build dependencies on a Debian or Ubuntu Linux:'''
 +
sudo apt-get install devscripts equivs gdebi-core
 +
mk-build-deps
 +
sudo gdebi woeusb-build-deps_*.deb
 +
dpkg-buildpackage -uc -b
 +
sudo gdebi ../woeusb*.deb
 +
 
 +
 +
<br />
 +
======Make a Bootable Windows 10 USB from Linux======
 +
sudo woeusb --device win_10.iso /dev/sdc
 +
 
 +
Not a fan of the CLI? Try gui version:
 +
woeusbgui
 +
 
 +
 +
<br />
 +
=====winusb=====
 +
http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
 +
 
 +
http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu
 +
 
 +
Esto lo había realizado con éxito a través del comando '''winusb''' en Ubuntu 14; instalándolo a partir de los repositorios:
 +
sudo add-apt-repository ppa:colingille/freshlight
 +
sudo apt-get update
 +
sudo apt-get install winusb
  
==Ronctionnalités notoires du shell==
+
Sin embargo, en Ubuntu 16, no pude instalar winusb de dicha manera.
  
===Historique===
+
En este post se indica cómo instalarlo manualmente: http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
* '''Flecha hacia arriba:''' remonter,
 
  
*'''Flecha hacia abajo:''' redescendre dans l’historique;
+
'''Install WinUSB in Ubuntu 16.04'''
  
*'''Ctrl + R <chaine>:''' Chercher une commande dans l’historique contenant <chaine> ;
+
Although WinUSB hasn’t been updated for Ubuntu 16.04 Systems, users can install WinUSB on Ubuntu 16.04 by compiling the WinUSB source code.
** '''A nouveau Ctrl + R:''' cherche la commande précédente ;
 
  
'''Ctrl + G:''' interrompt la recherche.
+
Before you begin to install WinUSB, run the command given below to install the dependencies:
  
==Las distribuciones de Linux más usadas==
+
sudo apt-get install gcc build-essential libwxbase3.0-dev libwxgtk3.0-dev
http://www.howtogeek.com/191207/10-of-the-most-popular-linux-distributions-compared/
 
  
* [https://www.centos.org/  CentOS] [https://access.redhat.com/products/red-hat-enterprise-linux/evaluation Redhad]
+
Once the dependencies are installed, run the command below to download the WinUSB package and extract it accordingly:
  
==Cursos de Linux online==
+
wget ftp://ftp.ru.debian.org/gentoo-distfiles/distfiles/winusb-1.0.11.tar.gz
 +
tar zxf winusb-1.0.11.tar.gz
 +
cd winusb*/src
 +
sed -i -- 's#wxStandardPaths().GetInstallPrefix()#wxStandardPaths::Get().GetInstallPrefix()#g' findFile.cpp
 +
sed -i -- 's#wxStandardPaths().GetDataDir()#wxStandardPaths::Get().GetDataDir()#g' findFile.cpp
  
https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server
+
Now it’s time to compile winusb-1.0.11 bu running the commands given below:
  
Red Hat Enterprise Linux 7 System Administrator's Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/pdf/System_Administrators_Guide/Red_Hat_Enterprise_Linux-7-System_Administrators_Guide-en-US.pdf
+
cd ..
 +
./configure
 +
make
 +
sudo make install
 +
cd ..
 +
rm -rf winusb-1.0.11
  
http://www.learnlinux.org.za
+
'''Luego de realizar la instalación manual como se indica arriba, tampoco fui capaz de crear el Windows USB bootable debido a que se producían ciertos errores cuando intentaba hacerlo. Luego de varios intentos lo logré. Sin embargo no estoy seguro de cual fue la solución. Creo que a la hora de seleccionar el dispositivo donde será creado el USB bootable, tenemos que utilizar la opciones del programa que nos permiten seleccionar (haciendo clic) el dispositivo exacto en donde lo queremos crear (/dev/sdb1, por ejemplo); y no seleccionar el dispositivo propuesto a penas abrimos el programa (generalmente /dev/sdb, sin el número de partición).'''
  
The Linux System Administrator's Guide:
+
'''Lo otro importante es que el dispositivo USB debe ser formateado en NTFS.'''
http://www.tldp.org/LDP/sag/html/index.html
 
  
13 Linux Network Configuration and Troubleshooting Commands:
+
Sólo a través de este programa (winusb) he logrado crear con éxito un Windows USB bootable.
http://www.tecmint.com/linux-network-configuration-and-troubleshooting-commands/
 
  
Linux Internet Web Server and Domain Configuration Tutorial: http://www.yolinux.com/TUTORIALS/LinuxTutorialWebSiteConfig.html
 
  
https://en.wikiversity.org/wiki/Linux_server_administration#A_curriculum_for_the_first_6_months_of_using_Linux
+
<br />
 +
=====A través de dd=====
 +
Lo intenté hacer desde la línea de comando a través del comando ''dd'' y no resultó.
  
http://brajeshwar.com/2008/top-free-linux-online-courses/
 
  
https://www.edx.org/course/introduction-linux-linuxfoundationx-lfs101x-0
+
<br />
 +
===Proceso de instalación===
 +
Antes de instalar Ubuntu es apropiado chequear si Windows ha sido configurado con un BitLocker Drive Encryption recovery key (Podría estar configurado de esta forma de fábrica). Si es el caso, luego de reaizar cambios en el disco durante el proceso de instalación de Ubuntu, Windows nos pedirá esta key durante el boot. Ver https://www.youtube.com/watch?v=exz3R6icsNk
  
http://study.com/articles/10_Sites_Offering_Free_Linux_Courses_Online.html
 
  
==Red Hat==
+
<br />
He creado una cuenta for the Red Hat Developer Program (email y clave habitual), lo cual me permite descargar una versión gratis de Red Hat:
+
====Algunos notas sobre el instalador de Ubuntu====
 +
* En el proceso de instalación de Ubuntu se propone de una vez la instalación de «Third-party sortwares» (algunos de estos son propietarios). Así, el sistema fue capaz de habilitar directamente el WiFi en mi computadora.
  
http://developers.redhat.com/
+
[[File:Ubuntu_third_party_sortwares.png|800px|thumb|center|]]
  
http://developers.redhat.com/products/rhel/download/
+
* Cuando elegimos la partición en donde será instalado Ubuntu y tenemos, por supuesto, que asignarle un «Mount point», el instalador no da la opción de asignar el «Moint point» hasta que seleccionemos «Format the partition» e indiquemos, por supuesto, el «File System». Por tamto, así le hayamos dado un formato a la partición antes de iniciar el intalador de Ubuntu (a través de Gparted), tendremos que realizar el formateo de la partición en cuestión durante el proceso de instalación.
  
http://developers.redhat.com/products/rhel/get-started/
+
* Si hemos creado la partición '''swap''' previamente con Gparted, el instalador no marca la selección de la partición '''swap''' (ver las imágenes abajo). Lo que quiero decir es que el instalador no es claro (al momento de la selección de las particiones) en indicar que hemos seleccionado una partición '''swap''' para la instalación. Sin embargo, luego de hacer click en «Install Now», una ventana de warning se abre e indica las particiones que hemos elegido para la instalación del SO. Ahí sí podemos corroborar con claridad las particiones que han sido configuradas para la instalación de Ubuntu.
  
%%%%%%%%
+
[[File:Formatear_la_particion_durante_instalacion.jpg|700px|thumb|center|]]
  
Al crear la cuenta Red Hat Developer Program me han enviado el siguiente correo:
+
[[File:seleccion_de_la_particion_swap_en_Ubuntu1.jpg|700px|thumb|center|]]
  
Hi Adelo,
+
[[File:seleccion_de_la_particion_swap_en_Ubuntu2.jpg|700px|thumb|center|]]
  
I saw that you joined Red Hat Developers and I have the privilege of welcoming you on behalf of the Red Hat Developers team. So, welcome! We are happy to have you join us and to get you started we thought some quick highlights would be helpful:
 
  
* Product downloads: Many of Red Hat’s solutions including JBoss EAP and Red Hat Enterprise Linux for developers are available free to you as a member and can be found [http://developers.redhat.com/products here].
+
<br />
* Highlighted and new content: For ease we will have that on our [http://developers.redhat.com homepage] and will be adding material multiple times a week.
+
====Creating and selecting the partition where the SO will be installed====
* You can contribute: We welcome content contributions from our members around the globe. Three easy ways to contribute can be found [http://developers.redhat.com/community/contributor/ here]. And did I mention contributing gets you swag?
 
  
Again, welcome to Red Hat Developers.
+
<span style="color:#FF0000">Notes about the last installation:</span>
  
Andréa
+
<span style="color:#FF0000">Tradicionalmente, los disco duros permiten un máximo de cuatro (4) particiones primarias (o 3 más una extendida). Sólo puede haber una (1) Extendida y dentro de ésta última pueden haber un máximo de 23 particiones lógicas (https://es.wikipedia.org/wiki/Partici%C3%B3n_de_disco). However, the last time I configured partitions, I did it for a GPT disc. In this kind of discs, no extended or logic partition can be created. You can created as many primary partitions as you want (well! I'm not sure what is the maximum):</span> https://askubuntu.com/questions/927927/why-cant-i-create-an-extended-partition
  
%%%%%%%%
+
<span style="color:#FF0000">The other important detail about the last installation was that when I first try to reduce space in the Default "C:" Windows partition using Gparted, I was NOT allowed to do it. The solution that I found was to do it from Windows in a very easy way even with the partition mounted was possible to do it as it is explained here:</span> https://www.easeus.com/partition-master/resize-partitions-windows-11.html . After reducing space that way, I was able to normally manage the partitions using Gparted.
  
Si no se crea una cuenta en Red Hat Developer Program, se puede descargar una versión de prueba gratis de 30días de Red Hat  https://access.redhat.com/products/red-hat-enterprise-linux/evaluation
 
  
Para crear el bootable usb: https://access.redhat.com/articles/142303
+
'''Resize a partition from Windows''':
 +
: Step 1. Press Win+R keys to open the Command box on your Windows 11.
  
===All certifications and exams===
+
: Step 2. Type diskmgmt.msc and then click "OK".
https://www.redhat.com/en/services/all-certifications-exams
 
  
https://en.wikipedia.org/wiki/Red_Hat_Certification_Program#Examination_required_for_each_certification
+
: Step 3. Once you are in Disk Management on Windows 11, Select the partition you want to resize and right-click it choosing "Shrink Volume".
  
====Red Hat Certified System Administrator (RHCSA) exam====
+
: Step 4.  A new Shrink dialog box will open as shown below. The minimum amount of space to shrink the partition is specified in MB or GB (1GB = 1024MB) and you have the option to specify a maximum value for how much space you can take away.
https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam
 
  
===All training courses and exams===
 
https://www.redhat.com/en/services/training/all-courses-exams
 
  
====Red Hat System Administration I====
 
https://www.redhat.com/en/services/training/rh124-red-hat-system-administration-i
 
  
====Red Hat System Administration II with RHCSA exam====
+
Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
https://www.redhat.com/en/services/training/rh135-red-hat-system-administration-ii-rhcsa-exam
 
  
====Combines Red Hat System Administration I and II at a rapid pace====
 
https://www.redhat.com/en/services/training/rh200-rhcsa-rapid-track-course-rhcsa-exam
 
  
===Documentación gratis===
+
La parte más delicada es cuando debemos crear (si no existe ya) y seleccionar la partición en la que se instalará el SO.
Creo que esta guía para RedHad está bastante buena:
 
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/
 
  
En esta página se encuentra una excelente documentación de Red Hat. Parte del contenido está basado en los putos a evaluar en los exámenes de certifiación Red Hat. Everything you need to pass your RHCSA, RHCE, LFCS, LFCE and much more:
 
https://www.certdepot.net/
 
  
===Instalación===
+
Para el particionamiento se pueden usar las opciones propuestas por el instalador o podemos también hacer el particionamiento antes de iniciar el instalador a través del programa [[Linux#GParted|GParted]]
Short guide: https://developers.redhat.com/products/rhel/hello-world/
 
  
Instalation guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/index.html
+
<span style="background:#00FF00">'''GParted se puede utilizar desde Ubuntu Live (Running Ubuntu directly from either a USB stick or a DVD). Recomiendo hacerlo de esta forma para esquemas de particiones complejos</span>
  
====System Requirements====
+
Si se hace a través del instalador, la única confución que se presetan es que este programa no detalla el tipo de partición «Extendida». De hecho, cuando se va a crear una partición, el programa sólo propone como tipos de particiones: «Primaria» o «Lógica». Sin embargo, no es coherente crear una partición lógica antes que una Extendida. Es por ello que cuando creamos la primera partición Lógica el programa automáticamente crea la partición extendida donde, por supuesto, se encontrará la partición Lógica que estamos creando. De ahí en adelante toda partición Lógica que creemos se incluirá dentro de dicha partición Extendida (puesto que sólo puede haber una partición Extendida en el disco). Además, si por equivocación ejecutamos la creacion de una quinta partición Primaria, el programa no dará ningún error y creará la partición sin ningún problema, sólo que ésta no será Primaria sino que el programa aútomáticamente la creará de tipo Lógica.
  
The requirements for your physical system are:
+
GParted es un poco mejor puesto que es un programa hecho exclusivamente para particionamiento. Este programa si detalla adecuadamente el tipo de partición Extendida.
  
a 64-bit x86 machine.
+
Para instalar Linux tenemos que crear por lo menos dos particiones '''(Indispensables)''':
  
4 GB of RAM
+
'''La partición Swap :''' Puede ser Primaria o Lógica -- [[Linux#Donde colocar la partición Swap|Se puede crear en cualquier posición]] -- Filesystem: Swap -- [[Linux#Que tamaño debe tener la partición swap|Tamaño]] -- [[Linux#Utilidad|Utilidad]].
  
20 GB of available disk space.
+
'''La particion root / :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) -- Tamaño: Minimum 8Go. Pour une question de confort au moins 15Go.  
  
For more detailed minimum hardware requirements and compatibility information, see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-planning-x86.html
 
  
 +
En muchos forums se propone también la creación de las siguientes particiones '''(Opcionales)''':
  
====Software selection====
+
'''/boot :''' [[Linux#Utilidad de la partición boot|Ésta podría ser indispensable]] -- Creo que debe ser primaria -- [[Linux#Utilidad de la partición boot|Se debe crear al inicio del disco]] -- Filesystem: Linux (généralement EXT4) -- Tamaño: 250Mo~1Go -- [[Linux#Utilidad de la partición boot|Utilidad]] -- Punto de montaje: /boot https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
The Red Hat Enterprise Linux Server .iso can be used to install a system with a full graphical desktop. You will select Server with a GUI under Software Selection during installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.
+
'''/home :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) (Remarque: d'autres systèmes de fichiers sont disponibles) -- Tamaño: Selon votre usage -- [[Linux#Utilidad de la partición home|Utilidad]] -- Punto de montaje: /home https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 +
 +
También he visto que podría ser ventajoso crear particiones para:
 +
/tmp
 +
/var
 +
/usr
 +
 +
Sin embargo, después de consultar distintas páginas llegué a la conclusión de que no es ventajosa la creación de las particiones opcionales sino en casos particulares.
  
Click Software selection.
+
En la siguiente página se exponen las útilidades (pro y contras) de algunas de las particiones opcionales
 +
https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
On the next screen, under Software selection, in the Base environment list on the left, select '''Server with GUI'''.
 
  
In the list Add-ons for selected environment on the right, select Development tools.
+
<br />
  
 +
====La partición swap====
 +
What is swap?
  
====Installation destination====
+
Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. https://help.ubuntu.com/community/SwapFaq
to specify which disk or partition(s) to use for Red Hat Enterprise Linux. Note: It is important that you understand the choices that you are making in this section to avoid accidental data loss. It is strongly recommended that you read the Installation Destination section of the the Red Hat Enterprise Linux Installation Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html
 
  
  
=====Particionamiento=====
+
<br />
Para seleccionar o realizar cambios en las particiones donde será instalado el SO debemos seleccionar la opción "I will configure particioning". Lo cual nos llevará a la ventana "Manual Particioning"
+
=====Utilidad=====
 +
Utilité : L'espace d'échange (en anglais, swap space) est une extension de la mémoire vive (RAM) de votre ordinateur. Afin d'éviter un blocage de votre ordinateur lorsque sa RAM est pleine, Ubuntu se sert de cette partition pour décharger temporairement la RAM. Son utilisation à cet effet est plutôt rare dans les ordinateurs modernes, disposant d'au moins 1 Go de RAM. Cependant, elle sert aussi de décharge de la RAM lors de la mise en hibernation, c'est pour cette raison que la taille de la partition swap doit être d'au moins la taille de votre RAM si vous souhaitez utiliser cette fonction. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
El programa de instalación de Red Hat permite intalar el SO una partición previamente creada o crear una nueva partición a partir de espacio libre en el disco.
 
  
Para crear una nueva partición debemos especificar el tipo de partición en "New mount points will use the following partitioning scheme":
+
<br />
* LVM (Logical Volume Manager).
+
=====Que tamaño debe tener la partición swap=====
* ,
+
How much swap do I need?
y luego hacer clic en + para crear la partición.
 
  
Sin embargo, el programa de particionamiento no es muy amigable, y no permite especificar la posición de la partición y creo que tampoco permite general un esquema complejo de particiones. Por ejemplo, crear una partición extendida y dentro un conjunto de particiones lógicas en las posiciones deseadas.
+
For less then 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to the amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM
  
Por tanto, me parece mucho más apropiado crear las particiones (con Gparted) antes de iniciar la instalación de Red Had.
+
For more modern systems (>1GB), your swap space should be at a minimum minimum be equal to your physical memory (RAM) size "if you use hibernation", otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. https://help.ubuntu.com/community/SwapFaq
  
==Instalación de Ubuntu==
+
'''I have 16GB RAM. Do I need 32GB swap?'''
  
===Creating a bootable USB flash drive===
+
It entirely depends on what you plan to do with the machine. For example if it were a Sap server then yes, I would add 32gb swap (we have boxes at work with 128gb ram and 32gb swap). If you were manipulating massive pictures and video then it makes sense to have a little swap. 32gb is probably overkill. http://askubuntu.com/questions/49109/i-have-16gb-ram-do-i-need-32gb-swap
  
====Creating a bootable Ubuntu USB flash drive from Ubuntu a través de usb-creator====
+
Here's a very good recommendation from RedHat:
<span style="color:#FFFFFF; background:#483D8B">
 
'''Me ha generado muchos problemas últimamente. Recomiendo usar el método por terminal a través del comando dd; método que además parece funcionar en otras distribuciones.'''
 
</span>
 
  
https://help.ubuntu.com/community/Installation/FromUSBStick
+
In years past, the recommended amount of swap space increased linearly with the amount of RAM in the system. But because the amount of memory in modern systems has increased into the hundreds of gigabytes, it is now recognized that the amount of swap space that a system needs is a function of the memory workload running on that system. However, given that swap space is usually designated at install time, and that it can be difficult to determine beforehand the memory workload of a system, we recommend determining system swap using the following table.  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007
  
Startup Disk Creator alias usb-creator viene instalado por defecto. Para iniciarlo desde el terminal:
+
Amount of RAM in the system  Recommended swap space        Recommended swap space
  usb-creator-gtk
+
                                                              if allowing for hibernation
  usb-creator-kde
+
  ---------------------------  ----------------------------  ---------------------------
 +
2GB of RAM or less            2 times the amount of RAM      3 times the amount of RAM
 +
2GB to 8GB of RAM            Equal to the amount of RAM    2 times the amount of RAM
 +
  8GB to 64GB of RAM            0.5 times the amount of RAM    1.5 times the amount of RAM
 +
64GB of RAM or more          At least 4 GB                  No extra space needed
  
Luego:
+
# Insert and mount the USB drive.
+
<br />
# Start usb-creator.
+
=====Donde colocar la partición Swap=====
 +
Estuve leyendo y al parecer no importa donde la colocamos en el disco duro: al principio, en el medio o al final.
 +
It doesn’t matter where on the hard drive the swap partition is located (beginning, middle or the end).
  
El sistema de archivos del USB drive debe ser FAT o creo que también EXT. No puede ser ntfs. Si el pendrive está en ntfs u otro filesystem inadecuado, el programa usb-creator dirá que no hay suficiente espacio en el dispositivo. Podemos en este caso utilizar la opción «Erase Disk» que formatea el dispositivo en FAT32. Luego de esto el dispositivo debería de estar disponible y habilitada la opción «Make Startup Disk» que permite iniciar la creación del bootable USB. También podemos formatear el dispositivo en FAT32 antes de iniciar el programa usb-creator. [[Linux#Formatear una unidad Flash USB|Formatear una unidad Flash USB]]
 
  
Cuando intenté crear el USB bootable en Ubuntu 14.04, el programa daba un error al final del proceso. Decía que no podía instalar el arranque. Luego intenté hacerlo en una versión antigua de Ubuntu que tenía instalada y el programa usb-creator ejecutaba el proceso de creación con éxito; sin embargo cuando intentaba bootear desde el dispositivo USB creado, se detenía el arranque y se mostraba un mensaje que decía:
+
<br />
 +
=====Utilizar la misma partición Swap para distintas instalaciones de Linux=====
 +
https://forum.ubuntu-fr.org/viewtopic.php?id=762271
  
Missing parameter in configuration file.
+
Por ejemplo, si en mi computadora instalo Ubuntu y Red Hat... puedo emplear la misma partición Swap para ambos sistemas?
  
Luego encontré en un forum que dicho problema se solucionaba haciendo Tab, escribiendo live y Enter. Esto funcionó perfectamente y Ubuntu inició normalmente desde la memoria USB. http://askubuntu.com/questions/544414/missing-parameter-in-configuration-file-keyword-path
+
Si tu n'utilises pas la fonction d'hibernation, tu peux utiliser la même swap pour les deux. Il peut y avoir souci si la 2ème install formate la partition swap, changeant ainsi son UUID (la 1ère distrib ne la trouvera donc plus). Ça se règle en corrigeant le UUID dans le fichier /etc/fstab de la 1ère distrib
  
Al parecer también se puede crear a bootable Ubuntu USB flash drive usando: UnetBootin, LiliUSB or Universal USB Installer
+
Et oui, tu peux partager la même partition swap, puisque elle n'est censée contenir quelque chose qu'entre le démarrage et l'extinction, et être vide à l'arrêt du PC (sauf si tu utilises l'hibernation, qui met le contenu de la RAM dans la swap pour le prochain démarrage)
https://help.ubuntu.com/community/Boot-Repair
 
  
En la siguiente página se explica como podemos crear el bootable Ubuntu USB flash drive desde la línea de comandos. Sin embargo, no pude crearlo con éxito. Cuando arranqué desde el disco USB que creé, el SO no cargó correctamente.
+
Pour savoir si la swap est utilisée par les 2, ouvre le fichier /etc/fstab des deux distribs, elles doivent comporter la même ligne concernant swap.
Cuando intenté crear el bootable USB encontré el siguiente error:
 
  
cp: no se puede crear el enlace simbólico «/media/adelo/D853-0856/./dists/stable»: Operación no permitida
+
Un doute subsiste quand à la partition "swap", comment être certain que cette dernière est utilisée pas Fedora et Ubuntu ?
  
http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
+
Pour savoir si la swap est utilisée par les 2, ouvre le fichier /etc/fstab des deux distribs, elles doivent comporter la même ligne concernant swap.
  
====Creating a bootable CentOS-Ubuntu USB flash drive desde el terminal a través de dd====
 
  
Creo que la forma de crearlo para/en Ubuntu o CentOS es la misma. Sin embargo aquí hay dos forums:
+
<br />
 +
====Utilidad de la partición boot====
 +
Certains ordinateurs n'arrivent pas à lire les fichiers de démarrage s'ils sont situés trop loin (>100Go) du début du disque. Dans ce cas, il est généralement nécessaire de créer une partition /boot en début de disque5). Mais cette partition /boot séparée n'est généralement pas utile sur un ordi récent (achat après 2007) et elle peut même générer des [http://forum.ubuntu-fr.org/viewtopic.php?pid=13576521#p13576521 problèmes], aussi il vaut mieux ne créer cette partition /boot que sur avis des experts du forum en cas où elle est réellement indispensable. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
'''Estos son para CentOS:'''
 
  
Starting with CentOS 6.5, one can install from USB keys by simply transferring the desired ISO using dd https://wiki.centos.org/HowTos/InstallFromUSBkey
+
<br />
 +
====Utilidad de la partición home====
 +
Lorsque vous disposez d'un disque dur suffisamment grand, un dossier home séparé permet d'isoler les paramètres personnels et les dossiers personnels des utilisateurs du reste du système. Par défaut, ce dossier fait partie de la partition racine. Un /home séparé est généralement superflu, voire gênant (notamment sur de petits disques) si vous débutez avec Ubuntu. Consulter [https://doc.ubuntu-fr.org/tutoriel/deplacer_home#public ce comparatif] pour savoir si un home séparé peut vous être utile. Important: un /home séparé ne sert pas à partager des données avec Windows ou MacOS (voir le paragraphe précédent). https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
  
https://wiki.centos.org/HowTos/InstallFromUSBkey
+
Es infinitamente más cómodo tener el /home en una partición separada a la hora de actualizar la versión de ubunto desde un disco o pendrive y ante emergencias que requieran una reinstalación del sistema. Si todo está en la partición “/” antes de reinstalar o actualizar hay que hacer una backup de la carpeta /home donde están nuestros ficheros y preferencias. Ahora bien, si /home está en una partición no será necesario realizar un respaldo. Durante el proceso de instalación debemos marcar la partición / para formateo y /home sin formateo. Despúes se crean los mismos usuarios con el mismo nombre y ya tenemos todos los datos. Es así por experiencia mucho más sencillo y rápido.
  
http://askubuntu.com/questions/372607/how-to-create-a-bootable-ubuntu-usb-flash-drive-from-terminal
+
http://elblogdeliher.com/mi-recomendacion-para-hacer-las-particiones-para-instalar-ubuntu/
  
https://www.centos.org/forums/viewtopic.php?t=56578
 
  
'''En este se trata el caso de Linux en general:'''
+
<br />
 +
====Partición para los datos====
 +
Es apropiado crear una partición para todos los datos. Esto resulta de especial interés al momento de formatear y reinstalar los sistemas operativos. De esta manera no es necesario realizar un respaldo de los datos pues esta partición no se tocaría al momento de formatear y reinstalar los SO.
  
http://superuser.com/questions/591234/how-to-create-a-bootable-usb-from-a-bootable-iso-with-the-command-line-on-linux
+
Ahora bien, si queremos compartir los datos entre Linux y Windows, la partición de almacenamiento debe entonces tener formato NTFS. Lo anterior porque bien sabemos que Linux es compatible con este sistema de archivos. Windows, por el contrario, no podría acceder a un sistema de archivos Linux como EXT4.
  
  
Como se puede ver, parece ser el mismo procedimiento. Siguiendo el siguiente procedimiento, creé uno de Ubuntu 15 desde Ubuntu 15, otro de CentOS 7 desde Ubuntu 15, y ambos funcionaron correctamente.
+
<br />
 +
====Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?====
  
* Antes de crear el bootable drive es apropiado [[Linux#Formatear una unidad Flash USB|formatear]] el dispositivo en Fat32 (vFat).
 
  
* Debemos desmontar el dispositivos antes de ejecutar el comando dd:
+
<br />
 +
=====[[Linux#chmod y chown en particiones ntfs|Chmod and chown en particiones ntfs]]=====
  
umount /dev/sdb*
 
  
* Creación del bootable USB flash a través de dd:
+
<br />
 +
=====Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu=====
 +
https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
  
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
+
http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
  
<div id="Nota_sdb">Nota_sdb</div>Make sure you select as destination the device corresponding to the USB key (/dev/sdb in the above example) and not a partition (such as /dev/sdb1). Esta advertencia creo que depende de en que dev se encuentre montado el usb  drive. Generalmente mis USB drives se montaban en /dev/sdb1. En este caso creo que se tendría que poner sdb1 en el comando (no estoy seguro). Sin embargo luego de la última vez que formateé mi USB drive, éste se monta en en /dev/sdb (sin ningún número). En este caso por supuesto habría que colocar sdb en el comando dd como se suguiere arriba. Algo parecido se presenta al formatear el USB drive.
+
Cuando inicio el SO se produce un error que interrumpe el booting. El error es producido porque Ubuntu no puede montar la partición NTFS a la cual he accedido en Windows.
  
Con este método el bootable CentOS se creó correctamente. En el USB drive se crearon dos particiones:
+
Si inicio Ubuntu en modo Upstart, el SO inicia sin montar dicha partición.
  
sdb    iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
+
Luego si intento montar la partición, se produce el siguiente error:
├─sdb1 iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
 
└─sdb2 vfat    ANACONDA        C522-73DA
 
  
====How can I create a Windows bootable USB stick with Ubuntu:====
+
adelo@adelo-laptop:~$ sudo mount /dev/sda2 1-disco_local/
=====winusb=====
+
[sudo] password for adelo:
http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
+
The disk contains an unclean file system (0, 0).
 +
Metadata kept in Windows cache, refused to mount.
 +
Failed to mount '/dev/sda2': Operation not permitted
 +
The NTFS partition is in an unsafe state. Please resume and shutdown
 +
Windows fully (no hibernation or fast restarting), or mount the volume
 +
read-only with the 'ro' mount option.
  
http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu
+
El error es debido a que Microsoft introduced a new feature in Windows 8 and 10 to reduce the boot time in otherwise slow Windows OS. This feature is called '''Fast Startup'''
  
Esto lo había realizado con éxito a través del comando '''winusb''' en Ubuntu 14; instalándolo a partir de los repositorios:
+
In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.
sudo add-apt-repository ppa:colingille/freshlight
 
sudo apt-get update
 
sudo apt-get install winusb
 
  
Sin embargo, en Ubuntu 16, no pude instalar winusb de dicha manera.
+
Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root). https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
  
En este post se indica cómo instalarlo manualmente: http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/
 
  
'''Install WinUSB in Ubuntu 16.04'''
+
'''El problema se puede resuelver haciendo:''' http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
  
Although WinUSB hasn’t been updated for Ubuntu 16.04 Systems, users can install WinUSB on Ubuntu 16.04 by compiling the WinUSB source code.
+
sudo ntfsfix /dev/sda2
  
Before you begin to install WinUSB, run the command given below to install the dependencies:
+
Sin embargo, habría que ejecutar dicho comando cada vez que queramos iniciar Ubuntu.
  
sudo apt-get install gcc build-essential libwxbase3.0-dev libwxgtk3.0-dev
 
  
Once the dependencies are installed, run the command below to download the WinUSB package and extract it accordingly:
+
'''Permanent Solution:''' Disable Fast Startup in Windows 8 and Windows 10.
  
wget ftp://ftp.ru.debian.org/gentoo-distfiles/distfiles/winusb-1.0.11.tar.gz
+
Use the following path to disable fast startup:
tar zxf winusb-1.0.11.tar.gz
 
cd winusb*/src
 
sed -i -- 's#wxStandardPaths().GetInstallPrefix()#wxStandardPaths::Get().GetInstallPrefix()#g' findFile.cpp
 
sed -i -- 's#wxStandardPaths().GetDataDir()#wxStandardPaths::Get().GetDataDir()#g' findFile.cpp
 
  
Now it’s time to compile winusb-1.0.11 bu running the commands given below:
+
Go to Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do and uncheck the Turn on fast startup box. https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
  
cd ..
 
./configure
 
make
 
sudo make install
 
cd ..
 
rm -rf winusb-1.0.11
 
  
'''Luego de realizar la instalación manual como se indica arriba, tampoco fui capaz de crear el Windows USB bootable debido a que se producían ciertos errores cuando intentaba hacerlo. Luego de varios intentos lo logré. Sin embargo no estoy seguro de cual fue la solución. Creo que a la hora de seleccionar el dispositivo donde será creado el USB bootable, tenemos que utilizar la opciones del programa que nos permiten seleccionar (haciendo clic) el dispositivo exacto en donde lo queremos crear (/dev/sdb1, por ejemplo); y no seleccionar el dispositivo propuesto a penas abrimos el programa (generalmente /dev/sdb, sin el número de partición).'''
+
<span style="background:#D8BFD8">El error descrito arriba se generó en Ubuntu 15. Ubuntu 18.04 no presentó dicho problema. Sin embargo, sí noté que luego de ingrasar a las particiones (1-disco_local, etc) desde Windows, al apagar la computadora, Windows tomaba mucho tiempo en apagar el sistema. Luego de varias pruebas pude corroborar que esto se producía sólo cuando se ingresaba a las particiones. Este problema está relacionado con el error descrito arriba y fue solucionado de la misma forma: '''«Disable Fast Startup»'''.</span>
  
'''Lo otro importante es que el dispositivo USB debe ser formateado en NTFS.'''
 
  
Sólo a través de este programa (winusb) he logrado crear con éxito un Windows USB bootable.
+
<br />
 +
=====Can't be put in the trash. Do you want to delete it immediately?=====
 +
<span style="background:#00FF00">Este problema se solucionó sólo. Me imagino que luego de alguna actualización del sistema.</span>
  
=====A través de dd=====
+
Luego de realizar algunos cambios en el particionamiento para instalar otros sistemas Linux (RedHat, CentOS) surgió el siguiente error: Cuando quería borrar un archivo directamente desde el escritorio (con la tecla delete) (Gnome - Nautilus) el archivo no podía ser enviado a la papelara. Se desplegaba entonces el mensaje referido arriba en el título de esta sección.
Lo intenté hacer desde la línea de comando a través del comando ''dd'' y no resultó.
 
  
=====unetbootin=====
+
El problema que estoy teniendo es exáctamente el descrito en este Forum:
También utilicé otro programa creado para este fin: '''unetbootin''', y no pude crearlo correctamente.
 
  
https://www.youtube.com/watch?v=uivN0yLxir8
+
Impossible to trash files from a folder which is a symbolic link to a NTFS partition folder
  
http://askubuntu.com/questions/707159/how-can-i-create-a-windows-10-boot-usb-from-ubuntu
+
http://askubuntu.com/questions/616092/impossible-to-trash-files-from-a-folder-which-is-a-symbolic-link-to-a-ntfs-parti
  
===Proceso de instalación===
+
Since a few days, I cannot send files to trash anymore from some folders.
En el proceso de instalación de Ubuntu 15.10 se propone de una vez la instalación de "Third-party sortwares" (algunos de estos son propietarios). Así, el sistema fue capaz de habilitar directamente el WiFi en mi computadora.
 
  
====Creación y elección de la partición donde será instalado el SO====
+
That worked perfectly for years :(
Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
 
  
La parte más delicada es cuando debemos crear (si no existe ya) y seleccionar la partición en la que se instalará el SO.
+
In my home folder, I have several symbolic links to folders on the NTFS partitions, like this one:
  
Los disco duros permiten un máximo de cuatro (4) particiones primarias (o 3 más una extendida). Sólo puede haber una (1) Extendida y dentro de ésta última pueden haber un máximo de 23 particiones lógicas. https://es.wikipedia.org/wiki/Partici%C3%B3n_de_disco
+
Desktop -> 1-disco_local/1-mis_archivos/.stockage/desktop-dis/
  
Para el particionamiento se pueden usar las opciones propuestas por el instalador o podemos también hacer el particionamiento antes de iniciar el instalador a través del programa [[Linux#GParted|GParted]]
+
Si intento borrar desde: ~/Desktop, el archivo no puede ser enviado a la papelera, but in the original folder 1-disco_local/1-mis_archivos/.stockage/downloads-dis/, funciona perfecto.
  
Si se hace a través del instalador, la única confución que se presetan es que este programa no detalla el tipo de partición «Extendida». De hecho, cuando se va a crear una partición, el programa sólo propone como tipos de particiones: «Primaria» o «Lógica». Sin embargo, no es coherente crear una partición lógica antes que una Extendida. Es por ello que cuando creamos la primera partición Lógica el programa automáticamente crea la partición extendida donde, por supuesto, se encontrará la partición Lógica que estamos creando. De ahí en adelante toda partición Lógica que creemos se incluirá dentro de dicha partición Extendida (puesto que sólo puede haber una partición Extendida en el disco). Además, si por equivocación ejecutamos la creacion de una quinta partición Primaria, el programa no dará ningún error y creará la partición sin ningún problema, sólo que ésta no será Primaria sino que el programa aútomáticamente la creará de tipo Lógica.
 
  
GParted es un poco mejor puesto que es un programa hecho exclusivamente para particionamiento. Este programa si detalla adecuadamente el tipo de partición Extendida.
+
Este problema es también tratado en este Forum, en donde al parecer se ha encontrado una solución para Ubuntu 16.~
  
Para instalar Linux tenemos que crear por lo menos dos particiones '''(Indispensables)''':
+
https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1495781
  
'''La partición Swap :''' Puede ser Primaria o Lógica -- [[Linux#Donde colocar la partición Swap|Se puede crear en cualquier posición]] -- Filesystem: Swap -- [[Linux#Que tamaño debe tener la partición swap|Tamaño]] -- [[Linux#Utilidad|Utilidad]].
+
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1449112
  
'''La particion root / :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) -- Tamaño: Minimum 8Go. Pour une question de confort au moins 15Go.
 
  
 +
<br />
 +
====Esquema de particionamiento====
 +
Después de investigar y reflexionar llegué a la conclusión de que, en mi caso, lo mejor es crear sólo las particiones linux indispensables.
  
En muchos forums se propone también la creación de las siguientes particiones '''(Opcionales)''':
+
Mi disco es supuestamente de 320G. Sin embargo, al sumar los tamaños de las distintas particiones, da un total de Aprox. 300G (298,08G). Al parecer esta diferencia tiene que ver con que el tamaño de la partición depende del FileSystem. Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
  
'''/boot :''' [[Linux#Utilidad de la partición boot|Ésta podría ser indispensable]] -- Creo que debe ser primaria -- [[Linux#Utilidad de la partición boot|Se debe crear al inicio del disco]] -- Filesystem: Linux (généralement EXT4) -- Tamaño: 250Mo~1Go -- [[Linux#Utilidad de la partición boot|Utilidad]] -- Punto de montaje: /boot https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
+
* Me ha parecido apropiado instalar todos mis Sistemas Linux dentro de la partición Extendida y los otros SO (Windows) en particiones Primarias.
 +
* Todos los datos serán guardados en una partición destinada únicamente a este fin, aparte de todos los sistemas operativos intalados.
 +
** Esto es particularmente ventajoso a la hora de formatear un SO, pues no será necesario realizar un respaldo de los datos.
 +
** Como la partición de datos es ntfs, podemos entonces acceder a ella desde Linux y Windows.
 +
** Esta partición la he colocado al inicio del disco. Así, resulta más fácil redimencionarla porque la redimención nunca será al inicio del la partición. Aunque al parecer podemos también redimensionar al inicio de la partición, según algunas fuentes que he leído es menos seguro y toma más tiempo. La otra ventaja de colocarla al inicio del disco es que a la hora de cambiar el esquema de las particiones en donde se encuentran los SO no tendremos que tocar (formatear) la partición de datos. La única operación que podría ser necesario sería la redimención al final de la partición.
  
'''/home :''' Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) (Remarque: d'autres systèmes de fichiers sont disponibles) -- Tamaño: Selon votre usage -- [[Linux#Utilidad de la partición home|Utilidad]] -- Punto de montaje: /home https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
 
También he visto que podría ser ventajoso crear particiones para:
 
/tmp
 
/var
 
/usr
 
 
Sin embargo, después de consultar distintas páginas llegué a la conclusión de que no es ventajosa la creación de las particiones opcionales sino en casos particulares.
 
  
En la siguiente página se exponen las útilidades (pro y contras) de algunas de las particiones opcionales
+
[[File:Mis_particiones.png|900px|thumb|center|]]
https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
  
====La partición swap====
 
What is swap?
 
  
Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. https://help.ubuntu.com/community/SwapFaq
+
<br />
  
=====Utilidad=====
+
==Mis configuraciones==
Utilité : L'espace d'échange (en anglais, swap space) est une extension de la mémoire vive (RAM) de votre ordinateur. Afin d'éviter un blocage de votre ordinateur lorsque sa RAM est pleine, Ubuntu se sert de cette partition pour décharger temporairement la RAM. Son utilisation à cet effet est plutôt rare dans les ordinateurs modernes, disposant d'au moins 1 Go de RAM. Cependant, elle sert aussi de décharge de la RAM lors de la mise en hibernation, c'est pour cette raison que la taille de la partition swap doit être d'au moins la taille de votre RAM si vous souhaitez utiliser cette fonction. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
  
=====Que tamaño debe tener la partición swap=====
 
How much swap do I need?
 
  
For less then 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to the amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM
+
<br />
 +
===user-dirs.dirs: Cambiar la ruta de Desktop - Download - Pictures===
 +
Cambiar la ruta de Desktop y Download y eliminar los directorios innecesarios from the Nautilus sidebar.
  
For more modern systems (>1GB), your swap space should be at a minimum minimum be equal to your physical memory (RAM) size "if you use hibernation", otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. https://help.ubuntu.com/community/SwapFaq
+
https://askubuntu.com/questions/79150/how-to-remove-bookmarks-from-the-nautilus-sidebar
  
 +
/home/adelo/.config/user-dirs.dirs
  
'''I have 16GB RAM. Do I need 32GB swap?'''
+
* Editamos el archivo de estamanera:
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
# This file is written by xdg-user-dirs-update
 +
# If you want to change or add directories, just edit the line you're
 +
# interested in. All local changes will be retained on the next run.
 +
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
 +
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
 +
# absolute path. No other format is supported.
 +
#
  
It entirely depends on what you plan to do with the machine. For example if it were a Sap server then yes, I would add 32gb swap (we have boxes at work with 128gb ram and 32gb swap). If you were manipulating massive pictures and video then it makes sense to have a little swap. 32gb is probably overkill. http://askubuntu.com/questions/49109/i-have-16gb-ram-do-i-need-32gb-swap
 
  
Here's a very good recommendation from RedHat:
+
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
 +
# usados por el sistema
 +
# /usr/share/icons/Humanity/places/128/user-desktop.svg
 +
# /usr/share/icons/Humanity/places/64/folder-download.svg
  
In years past, the recommended amount of swap space increased linearly with the amount of RAM in the system. But because the amount of memory in modern systems has increased into the hundreds of gigabytes, it is now recognized that the amount of swap space that a system needs is a function of the memory workload running on that system. However, given that swap space is usually designated at install time, and that it can be difficult to determine beforehand the memory workload of a system, we recommend determining system swap using the following table.  https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007
 
  
Amount of RAM in the system  Recommended swap space        Recommended swap space
+
XDG_DESKTOP_DIR="$HOME/desktop"
                                                              if allowing for hibernation
+
XDG_DOWNLOAD_DIR="$HOME/desktop/downloads"
---------------------------  ----------------------------  ---------------------------
+
XDG_PICTURES_DIR="$HOME/desktop/screenshots"
2GB of RAM or less            2 times the amount of RAM      3 times the amount of RAM
 
2GB to 8GB of RAM            Equal to the amount of RAM    2 times the amount of RAM
 
8GB to 64GB of RAM            0.5 times the amount of RAM    1.5 times the amount of RAM
 
64GB of RAM or more          4GB of swap space              No extra space needed
 
  
=====Donde colocar la partición Swap=====
+
# XDG_DESKTOP_DIR="$HOME/Desktop"
Estuve leyendo y al parecer no importa donde la colocamos en el disco duro: al principio, en el medio o al final.
+
# XDG_DOWNLOAD_DIR="$HOME/Downloads"
It doesn’t matter where on the hard drive the swap partition is located (beginning, middle or the end).
+
# XDG_TEMPLATES_DIR="$HOME/"
 +
# XDG_PUBLICSHARE_DIR="$HOME/"
 +
# XDG_DOCUMENTS_DIR="$HOME/"
 +
# XDG_MUSIC_DIR="$HOME/"
 +
# XDG_PICTURES_DIR="$HOME/"
 +
# XDG_VIDEOS_DIR="$HOME/"
 +
</syntaxhighlight>
 +
</blockquote>
  
====Utilidad de la partición boot====
 
Certains ordinateurs n'arrivent pas à lire les fichiers de démarrage s'ils sont situés trop loin (>100Go) du début du disque. Dans ce cas, il est généralement nécessaire de créer une partition /boot en début de disque5). Mais cette partition /boot séparée n'est généralement pas utile sur un ordi récent (achat après 2007) et elle peut même générer des [http://forum.ubuntu-fr.org/viewtopic.php?pid=13576521#p13576521 problèmes], aussi il vaut mieux ne créer cette partition /boot que sur avis des experts du forum en cas où elle est réellement indispensable. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
 
  
====Utilidad de la partición home====
+
* After login the file '''~/.config/user-dirs.dirs''' gets reverted to the original set by '''/etc/xdg/user-dirs.defaults'''. To prevent that make the file "read-only" and set the option «enabled» to «False» in '''/etc/xdg/user-dirs.conf'''
Lorsque vous disposez d'un disque dur suffisamment grand, un dossier home séparé permet d'isoler les paramètres personnels et les dossiers personnels des utilisateurs du reste du système. Par défaut, ce dossier fait partie de la partition racine. Un /home séparé est généralement superflu, voire gênant (notamment sur de petits disques) si vous débutez avec Ubuntu. Consulter [https://doc.ubuntu-fr.org/tutoriel/deplacer_home#public ce comparatif] pour savoir si un home séparé peut vous être utile. Important: un /home séparé ne sert pas à partager des données avec Windows ou MacOS (voir le paragraphe précédent). https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
+
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
chmod -w ~/.config/user-dirs.dirs
 +
gedit /etc/xdg/user-dirs.conf  :  '''enabled=false'''
 +
</syntaxhighlight>
 +
</blockquote>
  
Es infinitamente más cómodo tener el /home en una partición separada a la hora de actualizar la versión de ubunto desde un disco o pendrive y ante emergencias que requieran una reinstalación del sistema. Si todo está en la partición “/” antes de reinstalar o actualizar hay que hacer una backup de la carpeta /home donde están nuestros ficheros y preferencias. Ahora bien, si /home está en una partición no será necesario realizar un respaldo. Durante el proceso de instalación debemos marcar la partición / para formateo y /home sin formateo. Despúes se crean los mismos usuarios con el mismo nombre y ya tenemos todos los datos. Es así por experiencia mucho más sencillo y rápido.
 
  
http://elblogdeliher.com/mi-recomendacion-para-hacer-las-particiones-para-instalar-ubuntu/
+
* XDG_PICTURES_DIR es el directorio en donde se guardan por defecto los screenshots tomados con la correspondiente shortcut key.
  
====Partición para los datos====
 
Es apropiado crear una partición para todos los datos. Esto resulta de especial interés al momento de formatear y reinstalar los sistemas operativos. De esta manera no es necesario realizar un respaldo de los datos pues esta partición no se tocaría al momento de formatear y reinstalar los SO.
 
  
Ahora bien, si queremos compartir los datos entre Linux y Windows, la partición de almacenamiento debe entonces tener formato NTFS. Lo anterior porque bien sabemos que Linux es compatible con este sistema de archivos. Windows, por el contrario, no podría acceder a un sistema de archivos Linux como EXT4.
+
* Luego podemos eliminar los directorios innecesarios from the Nautilus sidebar haciendo click derecho en el diretorio (en el Nautilus sidebar) > Remove.
  
====Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?====
+
* Podemos también agregar new locations to the Nautilus sidebar. Cuando agregamos un nuevo directorio, lógicamente el numbre que se muestra en la sidebar será el nombre del directorio. Sin embargo, podemos luego renombrar el nombre que se muestra en la sidebar (click derecho > Rename). Ésto último no afecta el numbre del directorio al que hace referencia. Yo he realizado este rename simplemente para que el nombre se vea con la primera letra en mayúscula, ya que los directories los he creado con la primera letra en minúscula.
  
=====chmod y chown en particiones ntfs=====
 
Al iniciar la recherche sobre la permisología (chmod) en particiones ntfs, encontré muchos foros en los que se afirmaba que no se podían cambiar los permisos en particiones ntfs. Se planteaba como única solución, la asignación de los permisos deseados al punto de montaje de la partición; lo cual hacía que todos los archivos dentro de la partición tuvieran los mismos permisos que fueron asignados al punto de montaje. A continuación muestro algunas de las páginas en donde encontré dicha información:
 
  
* https://forum.ubuntu-fr.org/viewtopic.php?id=370751
+
* Luego creé los siguientes soft links:
: Tu ne peux pas changer les droits sur les fichiers d'une partition NTFS pour la bonne raison qu'ils ne sont pas gérés commes sous UNIX. En revanche tu peux changer les droits ou attribuer la propriété sur toute la partition. Pour cela il te suffit de changer les options de montage, soit en option de mount soit directement dans le fstab. Pour plus d'infos sur la procédure voir la documentation [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
+
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
ln -s /home/adelo/asystem/archivo/desk    /home/adelo/desktop
 +
</syntaxhighlight>
 +
</blockquote>
  
* http://ubuntuforums.org/showthread.php?t=1446788
 
  
 +
* Luego cabié las imágenes de los íconos:
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
/usr/share/icons/Humanity/places/128/user-desktop.svg
 +
/usr/share/icons/Humanity/places/64/folder-download.svg
 +
</syntaxhighlight>
 +
</blockquote>
  
Sin embargo, al final encontré que actualmente sí existe una solución para modificar la permisología de archivos en particiones ntfs.
 
  
En los siguientes posts, aunque al inicio de la conversación se decía que no era posible por las mismas razones antes explicadas, al final se encuentra una solución para poder cambiar los permisos en particiones ntfs:
+
<br />
* http://askubuntu.com/questions/342791/file-permissions-wont-change/343154#343154
 
* http://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/91054#91054
 
  
Lo único que tuve que hacer fue adicionar la siguiente línea al archivo /etc/fstab:
+
===Custom Shortcuts===
  
Para particiones internas:
 
<pre>
 
# <file system>          <mount point>                <type>    <options>                          <dump>  <pass>
 
UUID=0B8D61386C315368    /home/adelo/1-mis_archivos    ntfs      auto,users,exec,permissions        0      0
 
</pre>
 
  
=====Can't be put in the trash. Do you want to delete it immediately?=====
+
<br />
Luego de realizar algunos cambios en el particionamiento para instalar otros sistemas Linux (RedHat, CentOS) surgió el siguiente error. Cuando quería borrar un archivo desde directamente desde el escritorio (con la tecla delete) (Gnome - Nautilus), el archivo no podíaser enviado a la papelara. Se desplegaba entonces el mensaje referido arriba.
+
====Shortcut to launch the gnome-terminal in a custom position====
  
El problema que estoy teniendo es exáctamente el descrito en este Forum:
+
/home/adelo/1-system/.1-conf-system/open_terminal_at_position.sh
 +
<syntaxhighlight lang="bash">
 +
#!/bin/sh
  
Impossible to trash files from a folder which is a symbolic link to a NTFS partition folder
+
# Este script permite iniciar el gnome-terminal en una posicion deseada «Launch terminal»
  
http://askubuntu.com/questions/616092/impossible-to-trash-files-from-a-folder-which-is-a-symbolic-link-to-a-ntfs-parti
+
# https://unix.stackexchange.com/questions/48984/how-can-i-set-the-position-that-terminal-opens-at
 +
# - La configuración en este file:  « ~/.local/share/applications/gnome-terminal.desktop » funciona when launching the terminal a través del link (ícono) del terminal, pero  no funciono utilizando el shortcut to launch the terminal (Ctrl+Alt+T). Ésto último tampoco funcionó configurando « /usr/share/applications/gnome-terminal.desktop ».
 +
# - The command «xwininfo» display information about the current geometry of a window. Solo tenemos que ejecutar «xwininfo» en el terminal y luego hacer click en la window.
  
Since a few days, I cannot send files to trash anymore from some folders.
+
# También traté otro método ampliamente descrito en muchos forums que usa «CompizConfig Settings Manager». Tampoco pude realizar la configuración deseada con «Compiz».
  
That worked perfectly for years :(
+
# Por lo tanto, la solución que encontré fue definir un «Custom Shortcuts» usando la interfaz gráfica en «Settings > Devices > Keyboard» que ejecuta este script; de forma similar a como habia definido los shortcuts to «hide_dock» and «hide_icons_on_desktop».
 +
# Definí el shortcut que ejecuta este script igual al shortcut que por defecto ubuntu asigna a «Launch terminal» (Ctrl+Alt+T). Por tanto, tuve que redefinir el shortcut de «Launch terminal» a «Alt T»
  
In my home folder, I have several symbolic links to folders on the NTFS partitions, like this one:
 
  
Desktop -> 1-disco_local/1-mis_archivos/.stockage/desktop-dis/
+
# gnome-terminal --geometry=175x17+0+613
 +
gnome-terminal --geometry=175x17+0+4000
 +
</syntaxhighlight>
  
Si intento borrar desde: ~/Desktop, el archivo no puede ser enviado a la papelera, but in the original folder 1-disco_local/1-mis_archivos/.stockage/downloads-dis/, funciona perfecto.
 
  
 +
<br />
 +
====Shortcut to hide the desktop icons in GNOME 3====
 +
https://askubuntu.com/questions/1072337/shortcut-to-hide-the-desktop-icons-in-gnome-3
  
 +
La aplicación «gnome-tweaks» permite realizar algunas configuraciones en «Gnome». Entra ellas, la posibilidad de ocultar los ícones del escritorio.
 +
sudo apt-get install gnome-tweaks
  
Este problema es también tratado en este Forum, en donde al parecer se ha encontrado una solución para Ubuntu 16.~
+
Así, usando el GUI de «gnome-tweaks», configuramos el desktop de forma tal que no mostrara los icons por defecto.
  
https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1495781
+
Ahora, el siguiente Script (el cual emplea gnome-tweaks) permite ocultar y mostrar los ícones del Desktop:
  
https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1449112
+
/home/adelo/1-system/.1-conf-system/hide_icons_on_desktop.sh
 +
<syntaxhighlight lang="bash">
 +
#!/bin/sh
  
=====Para discos externos=====
 
http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
 
  
https://wiki.archlinux.org/index.php/Fstab#External_devices
+
# https://askubuntu.com/questions/1072337/shortcut-to-hide-the-desktop-icons-in-gnome-3
  
En disco duros externos debemos utilizar la opción <nofail>. Esto porque cuando el disco no está conectado al iniciar la computadora (boot), si no se usa <nofail>, el sistema buscará la partición, al no encontrarla generará un error y el sitema no iniciará correctamente. Con <nofail> el sistema monta la partición durante el boot si el disco se encuentra conectado, y omite este proceso cuando el disco no está conectado. En este caso, el disco será montado luego de conectarlo mientras la computadora está funcionando.
+
# La siguiente l'inea la tuve que adicionar porque el script no estaba funcionando. Esta soluci'on la encontr'e aqu'i:
 +
# https://stackoverflow.com/questions/44934641/glib-gio-message-using-the-memory-gsettings-backend-your-settings-will-not-b
 +
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
  
The only inconvenience with <nofail> is that if you connect the device while the system is running, depending on configuration (too many variables to test), the device may not mount immediately. This can be remedied with a simple mount -a or mount /specific_device or a reboot. http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
+
if $(gsettings get org.gnome.desktop.background show-desktop-icons);
 +
then new="false";
 +
else new="true";
 +
fi
 +
gsettings set org.gnome.desktop.background show-desktop-icons $new
  
En mi caso, aunque no lo monta inmediatamente, el ínoco de la unidad es desplegado en el Launcher, y haciendo clic en él, el disco se monta normalmente. A través de "sudo mount -a" también se monta correctamente; pero cuando queramos desmontarlo habrá que hacerlo como root porque fue montado como root.
+
gsettings set org.gnome.shell.extensions.dash-to-dock show-running $new
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-favorites $new
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-show-apps-button $new
 +
</syntaxhighlight>
  
<pre>
+
Luego adicionamos el Script al «keyboardsettings» an entry:
UUID=3C9A5D379A5CEF40    /home/adelo/toshiba_ext      ntfs      auto,nofail,users,exec,permissions 0      0
 
</pre>
 
  
Para saber el '''UUID''' de la partición: sudo blkid
+
[[File:Adding_custom_shortcut.png|800px|thumb|center|Settings > Devices > Keyboard]]
  
'''auto:''' will automatically mount the partition when you boot.
+
https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux
  
'''users:''' allows users to mount and umount.
+
https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd
  
'''exec:''' permite ejecutar archivos. Esta opción se debe colocar luego de la opción <users>. Si no se usa esta opción, podremos modificar los derechos y pertenencias de los archivos. Sin embargo, aún dándole permisos de ejecución a un archivo, éste no podrá ser ejecutado. Ver http://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition
+
https://opensource.com/life/16/11/running-commands-shutdown-linux
  
'''nofail:''' external devices that are to be mounted when present but ignored if absent. https://wiki.archlinux.org/index.php/Fstab#External_devices
+
https://unix.stackexchange.com/questions/48973/execute-a-command-before-shutdown
  
'''permissions:''' es justamente la opción que permite la modificación de los permisos y pertenencia de los archivos.
 
  
'''dump''' est utilisé pour les sauvegardes. (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
+
<br />
 +
====Shortcut to hide the dock====
 +
De forma similar a como se hizo con los desktop icons. Utilizando el siguiente script. Le dimos el shortcut Ctrl+Alt+B
  
'''pass''' pour l'ordre de vérification au démarrage: (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
+
/home/adelo/1-system/.1-conf-system/hide_dock.sh
* 1 pour la racine
+
<syntaxhighlight lang="bash">
* 2 pour les autres partitions Linux
+
#!/bin/sh
* 0 pour le swap et les partitions windows: Une valeur de <pass> à 0 signifie qu'il n'y aura pas de vérification au démarrage (Déconseillé dans la plupart des cas).
 
  
Otras opciones y una explicación más detallada del uso del archivo etc/fstab se encuentra en [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
 
  
No hay ni siquiera que crear antes el directorio /home/adelo/1-mis_archivos. Éste se creará y la partición será montada automáticamente luego de reiniciar la computadora; y podremos modificar la permisología (chmod) de la pertenencia (chown) de los archivos que se encuentre en tal partición ntfs.
+
# https://askubuntu.com/questions/1072337/shortcut-to-hide-the-desktop-icons-in-gnome-3
  
Ahora bien, para modificar la pertenencia y los derechos de la partición y de todos los archivos que se encuentran en ella:
+
# La siguiente l'inea la tuve que adicionar porque el script no estaba funcionando. Esta soluci'on la encontr'e aqu'i:
 +
# https://stackoverflow.com/questions/44934641/glib-gio-message-using-the-memory-gsettings-backend-your-settings-will-not-b
 +
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
  
chown -R adelo:adelo /home/adelo/1-mis_archivos
+
if $(gsettings get org.gnome.shell.extensions.dash-to-dock show-running);
 +
then new="false";
 +
else new="true";
 +
fi
  
Para modificar los permisos de todos los archivos en la partición ver [[Linux#A través del comando find|aquí]]
+
gsettings set org.gnome.shell.extensions.dash-to-dock show-running $new
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-favorites $new
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-show-apps-button $new
 +
</syntaxhighlight>
  
  
En el siguiente post también se encuentra una vía similar (haciendo uso de otras opciones en el archivo /etc/fstab) para poder cambiar los permisos en particiones ntfs. Sin embargo este método no lo he corroborado:
+
<br />
* http://www.lunaticgeek.com/2011/08/como-conseguir-permisos-en-particiones.html
 
  
====Esquemas de particionamiento====
+
===Permisologia de archivos y directorios===
Después de investigar y reflexionar llegué a la conclusión de que, en mi caso, lo mejor es crear sólo las particiones linux indispensables.
 
  
Mi disco es supuestamente de 320G. Sin embargo, al sumar los tamaños de las distintas particiones, da un total de Aprox. 300G (298,08G). Al parecer esta diferencia tiene que ver con que el tamaño de la partición depende del FileSystem. Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]].
 
  
'''En mi disco de 300G'''
+
<br />
 +
====Ajustar la permisologia de todos los archivos y directorios====
 +
<span style="color:#FFF;background:#FF0000">No es para nada apropiado, reajustar la permisología de los directorios/archivos de programas. Esto podría generar problemas en la ejecución de archivos. Por tanto; si queremos reajustar la permisología de archivos, sólo se podría hacer en nuestros archivos personales. '''NUNCA EN ARCHIVOS DE PROGRAMAS'''.</span>
  
'''Opción 1:'''
+
Ver:
* Partición extendida de 200G al inicio del disco
 
** Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
 
** Particion Lógica ext4 de 196G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
 
* Partición Primaria de 100G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.
 
  
De Manera que me ha parecido apropiado instalar todos mis Sistemas Linux dentro de la partición Extendida y los otros SO (Windows) en particiones Primarias.
+
[[Linux#Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers]]
  
 +
[[Linux#A través del comando find]]
  
'''Opción 2:'''
+
permisologia.sh
* Partición extendida de 60G al inicio del disco
+
<syntaxhighlight lang="bash">
** Partición Lógica Swap de 4G al inicio del disco (igual a la memoria RAM de mi computadora).
+
#! /bin/bash
** Particion Lógica ext4 de 56G al inicio del espacio restante: Ésta es la partición / para mi sistema Linux. Podría eventualmente reducirla para tener espacio para otro sistema Linux.
 
* Partición Primaria ntfs de 200G al inicio del espacio restante. Esta será la partición de almacenamiento de todos mis archivos.
 
* Partición Primaria de 40G (todo el espacio restante) al final del disco: Aquí se instalará Windows y podría también eventualmente reducirce para instalar otra versión de Windows.
 
  
En este esquema de particiones, todos los datos serán guardados en una partición destinada únicamente a este fin, aparte de todos los sistemas operativos intalados. Esto es particularmente ventajoso a la hora de formatear un SO, pues no será necesario realizar un respaldo de los datos. Como la partición de datos es ntfs, podemos entonces acceder a ella desde Linux y Windows.
+
# Para los directorios:
 +
find 1-system -type d -exec chmod 755 {} +
  
<span style="color:#FFFFFF; background:#483D8B">
+
# Para los archivos:
'''Nota: Me parece que la próxima vez debería dejar más espacio a la partición de Linux, porque en la distribución que voy a usar día a día debe estar en una partición de al menos 30G; por tanto, no me quedaría mucho espacio para instalar todas las distribuciones de Linux que necesito probar: Debian, RedHad, Centos, etc. Creo que cada distribución de prueba debe estar en una partición de al menos 10G.'''
+
find 1-system -type f -exec chmod 644 {} +
</span>
+
</syntaxhighlight>
  
==Grub2==
 
The main GRUB 2 folder locations include /boot/grub/ and /etc/grub.d/. User preferences are stored in the /etc/default/grub file. The GRUB 2 menu is built by information contained in /boot/grub/grub.cfg.
 
  
En este video se explica como configurar grub2: https://www.youtube.com/watch?v=bIH-1hDvZb0
+
<br />
 +
====Ajustar la permisologia por defecto al crear un archivo o directorio====
 +
<span style="color:#FFF;background:#FF0000">También es muy importante resaltar que no se debemos reajustar la permisología por defecto de nuevos archivos/directorios creados por la misma razón explicada arriba. Cuando los programas se instalan, crean directoris y archivos que serán entonces creados con la permisología que hayamos ajustado. Esto no es para nada apropiado. Hacer esto me trajo problemas con el programa LibreOffice por ejemmplo. Dicho programa no abría cuando se ejecutaba en la sesión de ususario porque una de las carpetas de configuraciones en /usr/lib/libreoffice/.... se había creado con permisos que impedían que un usuario accediera a ella y por tanto el probrama no funcionaba. Espero que este error no me traiga más problemas con los programas que instalé luego de modificar la permisología por defecto de nuevos directorios/archivos creados.</span>
  
===Installing - Reinstalling Grub2===
+
Ver [[Linux#Permisología por defecto]]
https://help.ubuntu.com/community/Grub2/Installing
 
  
====Reinstalling GRUB 2 from a Working System====
+
Añadir la siguiente línea a .bashrc
  
If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal.
+
umask u=rwx,g=rx,o=rx
  
  X is the drive (letter) on which you want GRUB to write the boot information. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition.
+
Debido a que la mayoría de los sistemas Unix no permiten que nuevos archivos (directorios sí) sean creados con permisos de ejecución activados, independientemente de la máscara; con la «umask» anterior los directorios y archivos serán creados con permisología:
 +
drwxr-xr-x  (755)
 +
-rw-r--r-- (644)
  
  sudo grub-install /dev/sdX  # Example: sudo grub-install /dev/sda
+
   
 
+
<br />
This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running
+
===fstab: Montar discos automáticamete===
 +
/etc/fstab
 +
<syntaxhighlight lang="bash">
 +
#===========================
 +
# Cambios realizados por mi
 +
#===========================
 +
# Disco_local:
 +
UUID=761657CB1CD1E939 /home/adelo/1-system/1-disco_local ntfs auto,users,exec,permissions 0 0
  
sudo update-grub after the install will ensure GRUB 2's menu is up-to-date.  
+
# Disco_externo - TOSHIBA EXT:
 +
UUID=3C9A5D379A5CEF40    /home/adelo/asystem/.mount/disco_ext    ntfs    auto,nofail,users,permissions  0      0
 +
</syntaxhighlight>
  
====If a system has become unbootable====
+
'''Para saber el UUID de la partición:'''
There are various methods for reinstalling GRUB 2. The simplest is listed first, followed by more complicated methods.
+
sudo blkid
  
=====Via Boot-Repair Graphical Tool=====
+
Ver [[Linux#Para discos externos]]
https://help.ubuntu.com/community/Boot-Repair
 
  
=====Via GRUB2 Rescue mode=====
 
GRUB 2 provides a rescue mode which allows the user to attempt to repair GRUB 2 from a special GRUB terminal during boot.
 
https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode
 
  
=====Via the LiveCD terminal=====
+
<br />
Este método se encuentra explicado aquí: https://help.ubuntu.com/community/Grub2/Installing
 
  
y aquí: http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
+
===.bashrc (home)===
 +
/home/adelo/.bashrc
  
Creo que en el segundo link se encuentra una mejor explicación, la cual resumo a continuación:
+
<syntaxhighlight lang="bash">
 +
#===========================
 +
# Cambios realizados por mi
 +
#===========================
  
======How to Repair, Restore, or Reinstall Grub 2 with a Ubuntu Live CD or USB======
+
# Ajustar la permisología por defecto (base) de los archivos y directorios creados.
Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.
+
# Debido a que la mayoría de los sistemas Unix no permiten que nuevos archivos (directorios sí) sean creados con permisos de ejecución activados, independientemente de la máscara; con la siguiente «umask» los directorios y archivos serán creados con permisología:
 +
# -rw-r--r-- (644)
 +
# drwxr-xr-x (755)
 +
# He llegado a la conclusión de que esto no es para nada apropiado. Ver explicación en http://perso.sinfronteras.ws/index.php/Linux#Permisologia_de_archivos_y_directorios
 +
# umask u=rwx,g=rx,o=rx
  
Warning
 
Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands. When pasting into the Terminal, use Ctrl+Shift+V, NOT Ctrl+V.
 
  
Terminal Commands
+
# -X : sort alphabetically by entry extension
 +
# -A : do not list implied . and ..
 +
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 +
alias la='ls -AX'
  
Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the XY with the drive letter, and partition number, for example: sudo mount /dev/sda1 /mnt.
 
  
  sudo mount /dev/sdXY /mnt
+
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
 +
# alias ls='ls -v  --color=auto'
 +
# Quiero también que «ls» ignore los archivos listados en .hidden:
 +
function ls_ignore_hidden() {                                  # $* or $@ represent all the arguemnts. Ver https://stackoverflow.com/questions/12314451/accessing-bash-command-line-args-vs
 +
  if [[ $@ == *"a"* ]]  ||  [[ $@ == *"A"* ]]  ||  [[ ! -f "./.hidden" ]] ; then    # Ver https://linuxize.com/post/how-to-check-if-string-contains-substring-in-bash
 +
      ls  -v  --color=auto  $@
 +
  else
 +
      ls  -v  --color=auto  `perl -pe 's/(.*)/--ignore $1/' ./.hidden`  $@
 +
  fi
 +
}
 +
alias ls=ls_ignore_hidden
  
Now bind the directories that grub needs access to to detect other operating systems, like so.
 
  
sudo mount --bind /dev /mnt/dev &&
+
# He hecho el siguiente alias para crear el comando "del", ya que escribir «gio trash» cada vez que vamos a mover un archivo a la papelera resulta tedioso.
sudo mount --bind /dev/pts /mnt/dev/pts &&
+
alias del="gio trash"
sudo mount --bind /proc /mnt/proc &&
 
sudo mount --bind /sys /mnt/sys
 
  
Now we jump into that using chroot.
 
  
sudo chroot /mnt
+
# He creado los comandos cds y cdp para facilitar el acceso a 1-system y 1-pe:
 +
function cds() {
 +
  cd ~/1-system
 +
}
  
  
Now install, check, and update grub.
+
# Para cambiar el nombre desplegado en la esquina superior derecha del la gnome-ventana del terminal:
 
+
# La siguiente función is to rename terminal tab title in gnome-terminal:
This time you only need to add the drive letter (usually a) to replace X, for example: grub-install /dev/sda, grub-install –recheck /dev/sda.
+
# Si queremos cambiar el title in gnome-germinal ejecutamos esta funci'on en el terminal de la siguiente forma:
 
+
# # set-title my new tab title
grub-install /dev/sdX
+
function set-title() {
 +
  if [[ -z "$ORIG" ]]; then
 +
    ORIG=$PS1
 +
  fi
 +
  TITLE="\[\e]2;$*\a\]"
 +
  PS1=${ORIG}${TITLE}
 +
}
  
grub-install --recheck /dev/sdX
 
  
update-grub
+
## Instalacion de JDK Oracle Java 8
 +
# export JAVA_HOME=/usr/java/jdk1.8.0_221
 +
# export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
 +
# export JRE_HOME
  
Now grub is back, all that is left is to exit the chrooted system and unmount everything.
 
  
exit &&
+
# Después de la instalación de Eclipse, para adicionar el ejecutable a la lista de comandos:
sudo umount /mnt/sys &&
+
PATH=$PATH:/home/adelo/.eclipse/java-2019-09/eclipse:
sudo umount /mnt/proc &&
 
sudo umount /mnt/dev/pts &&
 
sudo umount /mnt/dev &&
 
sudo umount /mnt
 
  
Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
 
  
You may want to update grub or re-install burg however you like it.
+
# Después de la instalación de NetBeans, para adicionar el ejecutable a la lista de comandos:
Congratulations, you have just Repaired/Restored/Reinstalled Grub 2 with a Ubuntu Live CD!
+
PATH=$PATH:/home/adelo/.netbeans-dir/netbeans/bin:
 +
# Otra forma de hacerlo es a trav'es de un soft link
 +
# ln -s /home/adelo/.netbeans-dir/netbeans/bin/netbeans /usr/local/bin/netbeans
  
You can now reboot your computer.
 
  
===Notas===
+
# Installacion de Android Studio
Instalé Red Hat cuando ya se encontraban Ubuntu y Windows instalados en mi disco. Como era de esperarse, Red Hat reinstaló el grub. Sin embargo, al reiniciar, el menú del grub sólo mostraba Ubuntu y Red Hat, dejando inbootable a Windows. Esto lo resolví reinstalando grub2 desde Ubuntu como se muestra en [[Linux#Reinstalling GRUB 2 from a Working System]]
+
PATH=$PATH:/home/adelo/.androidStudio/android-studio/bin
  
==Cosas que hacer después de instalar Ubuntu 15.10==
 
  
===Ajustar la permisología por defecto (base) de los archivos y directorios creados===
+
export ANDROID_HOME=/home/adelo/.androidStudio/androidSDK
Ver [[Linux#Permisología por defecto|Permisología por defecto]]
+
export ANDROID_SDK_ROOT=/home/adelo/.androidStudio/androidSDK
 +
# export ANDROID_SDK_HOME=/home/adelo/.android
  
Añadir la siguiente línea a .bashrc
 
  
umask u=rwx,g=rx,o=rx
+
export PATH=$PATH:$ANDROID_HOME/tools
 +
export PATH=$PATH:$ANDROID_HOME/tools/bin
 +
export PATH=$PATH:$ANDROID_HOME/platform-tools
  
para que los directorios y archivos sean creados con permisología:
 
drwxr-xr-x  (755)
 
-rw-r--r--  (644)
 
  
===GIMP===
+
# export PATH=${PATH}:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/android-sdk/platform-tools
  
====How can I put multiple images side by side to make one image====
 
https://gimper.net/threads/re-how-can-i-put-multiple-pics-side-by-side-to-make-one-picture.1042/
 
  
Unir/Conbinar varias imágenes:
+
# He dos comandos para facilitar la apertura de Jupyter-notebook en los directorios que más uso
* Open one of the pictures in GIMP
+
function jdata() {
* Go to File > Open As Layers and select the other two pictures
+
  jupyter notebook --browser='firefox' /home/adelo/1-system/1-disco_local/1-mis_archivos/1-formal_pure_and_applied_sciences/1-computer_science_an_IT/2-data_science/0data_science_codes/01data_science_expert &
* Go to Image > Canvas Size and make the canvas a lot bigger, it doesn't have to be exact, just big enough to fit the three pictures
+
}
* Select the different layers one at a time and move them to where you want:
 
: Crl PgUp / PgDn to change layer.
 
* Finally go to Image > Fit Canvas to Layers
 
  
===vim===
+
function jdb() {
« vi » puede ser muy complicado de utilizar. Vale la pena, por lo tanto, instalar « vim »
+
  jupyter notebook --browser='firefox'  /home/adelo/1-system/1-disco_local/1-mis_archivos/1-formal_pure_and_applied_sciences/1-computer_science_an_IT/others/3-database/0database_expert &
 +
}
  
Guardar y cerrar:
 
:qw
 
  
Cerrar sin guardar los cambios:
+
# ...
:q!
+
# alias gnome-terminal='gnome-terminal --geometry=175x17+0+4000'
 +
</syntaxhighlight>
  
===KATE===
+
Ver [[Linux#Mover archivos a la papelera desde el terminal|Mover archivos a la papelera desde el terminal]] para más detalles del por qué se ha realizado la siguiente configuración: alias del=gvfs-trash
kate color scheme
 
  
===Sublime Text===
 
Sublime Text is a sophisticated text editor for code, markup and prose.
 
  
https://www.sublimetext.com/
+
<br />
  
====Instalación====
+
===.bashrc (root)===
Install Sublime Text 3 en Ubuntu: https://tecadmin.net/install-sublime-text-editor-on-ubuntu/
+
/root/.bashrc
  
$ sudo add-apt-repository ppa:webupd8team/sublime-text-3
+
<syntaxhighlight lang="bash">
$ sudo apt-get update
+
#===========================
$ sudo apt-get install sublime-text-installer
+
# Cambios realizados por mi
 +
#===========================
  
====Keyboard shortcut to comment lines in Sublime Text 3====
+
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: ---------- (000) d--------- (000)
http://stackoverflow.com/questions/17742781/keyboard-shortcut-to-comment-lines-in-sublime-text-3
+
# He llegado a la conclusión de que esto no es para nada apropiado. Ver explicación en http://perso.sinfronteras.ws/index.php/Linux#Permisologia_de_archivos_y_directorios
 +
# umask u=,g=,o=
  
https://forum.sublimetext.com/t/st3-3012-toggle-comments-broken/8930/8
 
  
As a workaround, go to Preferences->Key Bindings - User and add these keybindings (if you're using Linux):
+
# -X : sort alphabetically by entry extension
 +
# -A : do not list implied . and ..
 +
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 +
alias la='ls -AX'
  
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
 
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
 
  
====Indentation====
+
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
https://stackoverflow.com/questions/9474090/how-do-i-force-sublime-text-to-indent-two-spaces-per-tab
+
alias ls='ls -v --color=auto'
  
If you want it for all files, go to Preferences -> Settings - Default/User. But as several comments below indicate, Syntax Specific settings can limit it to just the languages you choose.
 
  
To limit this configuration to Ruby files, first open up a Ruby file in the editor, and then go to Preferences -> Settings -> More -> Syntax Specific -> User. This should open a settings window named Ruby.sublime-settings
+
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 +
alias del="gio trash"
 +
</syntaxhighlight>
  
Save these settings:
 
  
<syntaxhighlight lang="php">
+
/etc/bash.bashrc
{
+
<syntaxhighlight lang="bash">
  "tab_size": 2,
+
#===========================
  "translate_tabs_to_spaces": true,
+
# Cambios realizados por mi
  "detect_indentation": false
+
#===========================
}
+
 
 +
# -X : sort alphabetically by entry extension
 +
# -A : do not list implied . and ..
 +
# He realizado este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 +
alias 'la=ls -AX'
 
</syntaxhighlight>
 
</syntaxhighlight>
  
====Crear un proyecto en Sublime Text====
 
# Abrimos una nueva ventana: File > New Window
 
# Add folder to project
 
# Save project as: es apropiado guardarlo en el mismo directorio en donde fue creado el proyecto.
 
  
Esto creará dos archivos:
+
<br />
* nombre-111.sublime-project
+
===.profile===
* nombre-111.sublime-workspace : Este es el que debemos abrir para ingresar al proyecto.
+
/home/adelo/.profile
 +
 
 +
<syntaxhighlight lang="bash">
 +
#===========================
 +
# Cambios realizados por mi
 +
#===========================
  
===GParted===
 
A la hora de redimensionar una partición, el programa GParted permite reducir tanto al inicio como al final de la partición. Ahora, es seguro redimensionar al inicio del disco? http://unix.stackexchange.com/questions/63258/can-i-safely-resize-my-partition-from-its-beginning
 
  
Cuando el programa GParted carga la tabla de particiones, la partición Swap se activa (o montar: no sé si se unsa este término en este caso) automáticamente. Es por ello que a primera instancia la opción de redimensionar editar (redimensionar, borrar, etc.) esta partición estará desactivada. También, si dicha partición Swap se encuentra dentro de una partición Extendida, tampoco podremos editar la partición Extendida. Para poder realizar cambios en estas particiones debemos desactivar la partición Swap. Para esto tenemos que seleccionar la partición Swap y luego usar la opción "Swapoff" en el menú "Partition" para desactivarla.
+
# hide icons on desktop and dock
 +
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
 +
gsettings set org.gnome.desktop.background show-desktop-icons false
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-running false
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-favorites false
 +
gsettings set org.gnome.shell.extensions.dash-to-dock show-show-apps-button false
 +
</syntaxhighlight>
  
A través del programa de particionamiento prupuesto durante la instalación de Ubuntu, no se pueden realizar redimensiones al inicio de la partición. Tampoco se pueden rediminsionar particiones Extendidas o Swap.
 
  
Ahora bien, la redimensión es un proceso que puede tomar mucho tiempo.
+
<br />
 +
===.megaignore===
 +
sudo chown adelo:adelo .megaignore
 +
sudo chmod 600 .megaignore
 +
sudo chattr +i .megaignore  (immutable)
  
===Latex===
 
sudo apt-get install texlive-full (texlive-full ocupa casi 5G de memoria)
 
 
====Kile====
 
  
===Instalar corrector ortográfico y gramatical en LibreOffice/OpenOffice===
+
.megaignore
http://blog.desdelinux.net/instalar-corrector-ortografico-y-gramatical-en-libreofficeopenoffice/
+
<syntaxhighlight lang="bash">
 +
# No se pueden colocar comments al lado de la orden
 +
# -p se usa para path
 +
# -d:1-mis_archivos/1-pure_sciences/*
 +
# -s:* se crea automaticamente. Creo que esta excluyendo los symbolic links
 +
-:venv
 +
-:.venv
 +
-:env
 +
-:.env
 +
-:__pycache__
 +
-:node_modules
 +
-:.next
 +
-:Thumbs.db
 +
-:desktop.ini
 +
-:*.crdownload
 +
-:*.sb-????????-??????
 +
-:.respaldo_shadow*
 +
-:*tr4sh*
 +
-:*.tmp
 +
-:.~*
 +
-:~.*
 +
-:.*~
 +
-:*d4t4*
 +
-:*n0b4*
 +
-p:.mount
 +
-s:*
 +
</syntaxhighlight>
  
sudo apt-get install myspell-es
 
sudo apt-get install myspell-fr myspell-fr-gut
 
sudo apt-get install myspell-*
 
  
===Adobe Reader (Acroread)===
+
.megaignore (linux work-laptop)
Adobe has recently removed the Linux support from its official download page. Therefore Adobe Reader for Linux is no longer available for download from Adobe website.
+
<syntaxhighlight lang="bash">
 +
# No se pueden colocar comments al lado de la orden
 +
# -p se usa para path
 +
# -d:1-mis_archivos/1-pure_sciences/*
 +
# -s:* se crea automaticamente. Creo que esta excluyendo los symbolic links
 +
-:venv
 +
-:.venv
 +
-:env
 +
-:.env
 +
-:__pycache__
 +
-:node_modules
 +
-:.next
 +
-:Thumbs.db
 +
-:desktop.ini
 +
-:*.crdownload
 +
-:*.sb-????????-??????
 +
-:.respaldo_shadow*
 +
-:*tr4sh*
 +
-:*.tmp
 +
-:.~*
 +
-:~.*
 +
-:.*~
 +
-:*d4t4*
 +
-:*n0b4*
 +
-:2-social_sciences
 +
-:3-musica
 +
-:4-carrera
 +
-:5-multimedia
 +
-p:.mount
 +
-s:*
 +
</syntaxhighlight>
  
Antes, la versión para Linux podía encontrarse en la página oficial de Adobe:
 
https://get.adobe.com/fr/reader/otherversions/
 
  
Todavía se puede instalar de dos formas:
+
.megaignore (windows)
 +
<syntaxhighlight lang="bash">
 +
# No se pueden colocar comments al lado de la orden
 +
# -p se usa para path
 +
# -d:1-mis_archivos/1-pure_sciences/*
 +
# -s:* se crea automaticamente. Creo que esta excluyendo los symbolic links
 +
-:venv
 +
-:.venv
 +
-:env
 +
-:.env
 +
-:__pycache__
 +
-:node_modules
 +
-:.next
 +
-:Thumbs.db
 +
-:desktop.ini
 +
-:*.crdownload
 +
-:*.sb-????????-??????
 +
-:.respaldo_shadow*
 +
-:*tr4sh*
 +
-:*.tmp
 +
-:.~*
 +
-:~.*
 +
-:.*~
 +
-:*d4t4*
 +
-:*n0b4*
 +
-p:.mount
 +
-p:.asystem-conf
 +
-p:archivo/*
 +
+p:archivo/desk
 +
-p:archivo/desk/*
 +
+p:archivo/desk/windows
 +
+p:archivo/desk/windows/*
 +
-s:*
 +
</syntaxhighlight>
  
====From the old Canonical Partners repository====
 
http://ubuntuhandbook.org/index.php/2014/10/install-adobe-reader-ubuntu-14-10/
 
  
We can still install Adobe Reader (Acroread) 9 in Ubuntu 14.10 through the old Canonical Partners repository.
+
<br />
  
sudo add-apt-repository "deb http://archive.canonical.com/ precise partner"
+
==Things to do after installing Ubuntu 18.04==
sudo apt-get update
+
https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
sudo apt-get install acroread
 
  
After properly installed Adobe Reader, don’t forget to remove the Canonical Partners repository for Precise:
 
  
sudo add-apt-repository -r "deb http://archive.canonical.com/ precise partner"
+
<br />
sudo apt-get update
+
===[[Linux#Update the system|Update]]===
  
====From the latest official package for Linux, que Adobe incluyó en su sitio de descargas====
 
Actually the latest official package (AdbeRdr9.5.5-1_i386linux_enu.deb) is still available en algunos sitios, but it might be removed in near future.
 
  
wget -c http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
+
<br />
 +
===[[Linux#Enable additional repositories for more software|Enable additional repositories]]===
  
Install Gdebi to handle the DEB package:
 
  
sudo apt-get install gdebi
+
<br />
 +
===[[Linux#Gnome and Nautilus|Algunas configuraciones en Gnome and Nautilus]]===
  
Now install the package via Gdebi. It’ll also install the dependencies:
 
  
sudo gdebi AdbeRdr9.5.5-1_i386linux_enu.deb
+
<br />
 +
===[[Linux#xfs File System Support|Instalar paquetes para xfs support]]===
  
If Adobe Reader is still missing libraries after installation. Run the command below to install them:
 
  
  sudo apt-get install libgtk2.0-0:i386 libnss3-1d:i386 libnspr4-0d:i386 lib32nss-mdns* libxml2:i386 libxslt1.1:i386 libstdc++6:i386
+
<br />
 +
===Install media codecs===
 +
Permite reproducir videos en el web browser (en facebook por ejemplo):
 +
  sudo apt install ubuntu-restricted-extras
  
====How to Set Adobe Reader as default PDF reader====
+
'''Método 1:'''
+
<br />
 +
===Si se instala Windows===
 +
* Para montar y poder acceder a la partición de datos desde Window: [[Windows#Mount a partition]]
 +
* [[Linux#Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu]]
  
sudo gedit /etc/gnome/defaults.list
 
  
When the file opens, do:
+
<br />
 +
===Instalar===
 +
* apache2
 +
* nginx
 +
* MySQL
 +
* mycli
 +
* PostgreSQL
 +
* PHP
 +
* nodejs
 +
* typescript
 +
* Oracle JDK
 +
* Eclipse
 +
* NetBeans
 +
* Sublime Text
 +
* VirtualBox
 +
* PacketTracer
 +
* Virtual Paradigm
 +
* ------
 +
* imagemagick
 +
:: Contiene «convert» which is required by MediaWiki
 +
* sshfs
 +
* gvfs-bin
 +
* Google Cloud SDK
 +
* Gparted
 +
* Google Chrome
 +
* LaTeX
 +
** kile
 +
* kate
 +
* gimp
 +
* shutter
 +
* [[Linux#pdftk|pdftk]]
 +
* gnome-tweaks
  
*Find out and change the line
+
* Para el respaldo:
 +
** rsync (debería estar by default)
 +
** sshpass
 +
** pv
  
application/pdf=evince.desktop
+
* LVM and xfs support for Ubuntu:
 +
** lvm2
 +
** xfsprogs
 +
** xfsdump
  
into:
 
  
application/pdf=acroread.desktop
+
<br />
 +
==Red Hat==
 +
<span style="background:#D8BFD8">'''Mi página de estudio para la certificación RHCSA: [[Study points for the RHCSA exam]]'''</span>
  
*Add below line into the end:
+
He creado una cuenta for the Red Hat Developer Program (email y clave habitual) lo cual me permite descargar una versión gratis de Red Hat:
  
application/fdf=acroread.desktop
+
http://developers.redhat.com/
application/xdp=acroread.desktop
 
application/xfdf=acroread.desktop
 
application/pdx=acroread.desktop
 
  
Finally save the file and restart nautilus (run command nautilus -q in terminal) to apply changes.
+
http://developers.redhat.com/products/rhel/download/
  
 +
http://developers.redhat.com/products/rhel/get-started/
  
'''Método 2:'''
+
%%%%%%%%
  
mimeopen -d *.pdf
+
Al crear la cuenta Red Hat Developer Program me han enviado el siguiente correo:
  
====To remove Adobe Reader====
+
Hi Adelo,
sudo apt-get remove acroread; sudo apt-get autoremove
 
  
====Ver también====
+
I saw that you joined Red Hat Developers and I have the privilege of welcoming you on behalf of the Red Hat Developers team. So, welcome! We are happy to have you join us and to get you started we thought some quick highlights would be helpful:
En el siguiente post también se encuentra buena información sobre como instalar Adobe Reader:
 
http://askubuntu.com/questions/455135/how-do-i-install-adobe-acrobat-reader-from-the-repository
 
  
===Skype===
+
* Product downloads: Many of Red Hat’s solutions including JBoss EAP and Red Hat Enterprise Linux for developers are available free to you as a member and can be found [http://developers.redhat.com/products here].
sudo apt-get install skype
+
* Highlighted and new content: For ease we will have that on our [http://developers.redhat.com homepage] and will be adding material multiple times a week.
 +
* You can contribute: We welcome content contributions from our members around the globe. Three easy ways to contribute can be found [http://developers.redhat.com/community/contributor/ here]. And did I mention contributing gets you swag?
  
===Seismic Unix===
+
Again, welcome to Red Hat Developers.
Instalación del SU
 
  
===Scilab===
+
Andréa
sudo apt-get install scilab
 
  
==Crear y borrar usuarios==
+
%%%%%%%%
How to Add (create) and Delete Users on Ubuntu 16.04
 
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04
 
  
  adduser newuser
+
Si no se crea una cuenta en Red Hat Developer Program, se puede descargar una versión de prueba gratis de 30días de Red Hat https://access.redhat.com/products/red-hat-enterprise-linux/evaluation
  
You can delete the user itself, without deleting any of their files, by typing this as root:
+
Para crear el bootable usb: https://access.redhat.com/articles/142303
deluser newuser
 
  
If, instead, you want to delete the user's home directory when the user is deleted, you can issue the following command as root:
 
deluser --remove-home newuser
 
  
==Comandos Linux==
+
<br />
 +
===All certifications and exams===
 +
https://www.redhat.com/en/services/all-certifications-exams
  
===apt-get===
+
https://en.wikipedia.org/wiki/Red_Hat_Certification_Program#Examination_required_for_each_certification
  
Desinstalar un programa:
 
  
Uninstall the program and all configuration files:
+
<br />
sudo apt-get --purge remove <programa> (podría ser necesario colocar <programa>*)
+
====Red Hat Certified System Administrator (RHCSA) exam====
 +
https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam
  
  
También se podría:
+
<br />
sudo apt-get autoremove eclipse*
+
===All training courses and exams===
+
https://www.redhat.com/en/services/training/all-courses-exams
Lo anterior will uninstall the dependencies and related packages that were installed along with eclipse. This should do the trick.
 
  
  
También podría ser necesario:
+
<br />
rm -r ~/.<programa>/ (en caso de que el programa instale una carpeta en el directorio ~)
+
====Red Hat System Administration I====
 +
https://www.redhat.com/en/services/training/rh124-red-hat-system-administration-i
  
  
Uninstall just the program. If you’d like to remove the program but keep the configuration files, enter the following command:
+
<br />
sudo apt-get remove <programname>
+
====Red Hat System Administration II with RHCSA exam====
 +
https://www.redhat.com/en/services/training/rh135-red-hat-system-administration-ii-rhcsa-exam
  
===Which===
 
Retorna la ruta de un ejecutable. Por ejemplo si queremos saber donde se encuentra el ejecutable para el comando python, ejecutamos:
 
adelo@adelo-laptop:~$ which python
 
/usr/bin/python
 
 
===source===
 
The source command can be used to load any functions file into the current shell script or a command prompt.
 
  
The source command can be abbreviated as just a dot (.) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared.
+
<br />
 +
====Combines Red Hat System Administration I and II at a rapid pace====
 +
https://www.redhat.com/en/services/training/rh200-rhcsa-rapid-track-course-rhcsa-exam
  
Uno de los usos más comunes es para reload your .bashrc without re-login or restart.
 
source .bashrc
 
. .bashrc
 
  
===ls===
+
<br />
 +
===Documentación gratis===
 +
Creo que esta guía para RedHad está bastante buena:
 +
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/
  
====Listar sólo archivos o sólo directorios====
+
En esta página se encuentra una excelente documentación de Red Hat. Parte del contenido está basado en los putos a evaluar en los exámenes de certifiación Red Hat. Everything you need to pass your RHCSA, RHCE, LFCS, LFCE and much more:
Listar solo directorios:
+
https://www.certdepot.net/
ls -lah | grep -v "^-"
 
  
Listar solo archivos:
 
ls -lah | grep -v "^d"
 
  
===Listar archivos con su ruta absoluta===
+
<br />
List files with their absolute path in linux:  
+
===Instalación===
 +
Short guide: https://developers.redhat.com/products/rhel/hello-world/
  
readlink -f *
+
Instalation guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/index.html
  
===Listar archivos modificados antes, después, o en una cierta fecha===
+
[[File:Red_hat-installation_summary.jpg|800px|thumb|center|]]
https://techjourney.net/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix-linux/
 
  
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:
 
  
find . -mtime -1 -print
+
<br />
 +
====System Requirements====
 +
The requirements for your physical system are:
  
To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:
+
a 64-bit x86 machine.
  
find /directory_path -type f -mtime -1 -print
+
4 GB of RAM
  
To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:
+
20 GB of available disk space.
  
touch -t `date +%m%d0000` /tmp/$$
+
For more detailed minimum hardware requirements and compatibility information, see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-planning-x86.html
find /tmefndr/oravl01 -type f -newer /tmp/$$
 
rm /tmp/$$
 
  
===Contar archivos en un directorio===
 
https://www.pedroventura.com/linux/contar-todos-los-archivos-existente-en-un-directorio-en-linux/
 
  
'''Con find'''
+
<br />
 +
====Software selection====
 +
The Red Hat Enterprise Linux Server .iso can be used to install a system with a full graphical desktop. You will select Server with a GUI under Software Selection during installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.
 +
* Click Software selection.
 +
* On the next screen, under Software selection, in the Base environment list on the left, select '''Server with GUI'''.
 +
* In the list Add-ons for selected environment on the right, select Development tools.
  
'''La cuenta es mas exacta con find, por ejemplo:'''
+
[[File:Red_hat_instalation-software_selection1.jpg|700px|thumb|center|Configuración que elegí en la última instalación de RHEL 7.5]]
  
find . -maxdepth 2 -type f | wc -l #Contar los archivos pero solo en carpetas dos niveles por debajo
+
[[File:Red_hat_instalation-software_selection2.jpg|700px|thumb|center|Configuración que elegí en la última instalación de RHEL 7.5]]
  
find . -type f | wc -l # Contar archivos de forma recursiva ilimitada
 
  
find . -type d | wc -l # Contar directorios de forma recursiva ilimitada
+
<br />
 +
====Installation destination====
 +
Installation Destination section of the the Red Hat Enterprise Linux Installation Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html
  
find . -type l | wc -l # Contar enlaces de forma recursiva ilimitada
+
En la guía de instalación de Red hat se encuentra la siguiente nota:
 +
«An installation of Red Hat Enterprise Linux requires a minimum of one partition but Red Hat recommends using at least the following partitions or volumes:
 +
* /
 +
* /home
 +
* /boot
 +
* swap»,
  
find . | wc -l #Contar archivos y carpetas de forma recursiva
+
Sin embargo, más adelante veremos que el instalador de Red hat presenta una opción que genera las particiones automáticamente a partir de espacio «unallocated» en el disco. Esta opción genera sólo particiones para '''/''', '''/boot''' y '''swap''' (no genera la partición '''/home'''). Creo que la partición '''/home''' no es necesaria en mi caso, así que seguiré dicho esquema de particiones sin incluir la '''/home'''.
  
find . -type f -iname “*.php” | wc -l # Contar archivos con una extensión determinada
 
  
 +
<br />
 +
=====Particionamiento=====
 +
Para seleccionar o realizar cambios en las particiones donde será instalado el SO debemos:
 +
From the Installation Summary:
 +
* Installation destination > Seleccionar la option «I will configure particioning». Lo cual nos llevará a la ventana «Manual Particioning»
 +
* El programa de instalación de Red Hat permite intalar el SO en particiones previamente creadas, o crear nuevas particiones a partir de espacio «unallocated» en el disco.
 +
 +
:* '''Crear nuevas particiones a partir de espacio «unallocated». Hay dos posibilidades:'''
 +
 +
::* 1- Click here to create them automatically: Crea automáticamete el esquema de particiones recomendado a partir de todo el espacio «unallocated» restante. Por ejemplo, si en nuestro disco quedan 40G de espacio «unallocated», esta opción creará el siguiente esquema:
  
'''Con ls'''
+
:::* '''/boot'''
 +
::::* 1024 MB
 +
::::* Device type: Standar Partition (esta partición no puede ser LVM)
 +
::::* File System: xfs
  
Con ls es también apropiado para contar los archivos en un sólo directorio. Sin embargo, la forma recursiva (ls -R) no resulta muy apropiada porque se incluye una línea en blanco al finalizar el directorio; además que no se puede diferenciar entre archivos y directorios.
+
:::* '''/'''
 +
::::* 35.12 Gb
 +
::::* Device type: LVM
 +
::::* File System: xfs
  
ls | wc -l
+
:::* '''/swap'''
 +
::::* 3968 Mb
 +
::::* Device type: LVM
 +
::::* File System: swap
  
Para incluir los archivos ocultos:
+
::* 2- Crear cada partición por separado haciendo click en el ícono «+» que se encuentra en la parte de abajo del menú. Si no queremos tomar todo el espacio «unallocated» restante, debemos usar esta opción.
  
ls -A | wc -l
+
:* '''Asignar «Mount points» a particiones previamente creadas antes de iniciar el instalador de Red Hat (creadas a través de Gparted por ejemplo).'''
 +
:: El problema de esta opción es que Red hat propone como estadart, la creación de todos las particiones que queramos implementar «/ /swap /home etc» (excepto la /boot) dentro de una partición (o Device type) LVM. Ahora, el problema es que Gparted (que es el programa que he venido usando para la creación de esquemas de particiones complejos) no propone la opción para cración de LVM. Además, si lo hacemos a través de particiones previamente creadas, el instalador de Red Hat no permite formatear la partición sino sólo asignarle un «Mount point»; y me ha parecido que es apropiado (no sólo surante la intalación de Red Had, sino durante la instalación de cualquier SO) que el programa de instalación formetee la partición antes de realizar la instalación.
  
El parámetro -A lista todos los archivos excepto la ruta de carpetas . y ..
+
* <span style="background:#D8BFD8">Recomiendo la creación de particiones manuales a partir de espacio «unallocated». Construir el esquema de particionamiento propuesto por «Click here to create them automatically».</span>
  
===du===
+
[[File:Red_hat_particionamiento1.jpg|500px|thumb|center|Click here to create them automatically.]]
Para incluir archivos ocultos:
 
  
* La opción -a incluye los archivos ocultos, pero no se puede utilizar con la opción -s, --summarize. La cual permite desplegar el tamaño de un directorio y no de cada archivo por separado. Entonces para poder utilizar la opción --sumarize y desplegar también los archivos ocultos, debemos:
+
[[File:Red_hat_particionamiento2.jpg|500px|thumb|center|Esquema de particiones generado automáticamente a partir de todo el espacio «unallocated» restante en el disco.]]
  
* Para listar sólo los archivos ocultos:
+
[[File:Red_hat_particionamiento3.jpg|500px|thumb|center|Particiones creadas manualmente haciendo click en «+»]]
du -hs .[^.]*
 
  
* Si queremos listar ocultos y normales:
+
[[File:Red_hat_particionamiento4.jpg|500px|thumb|center|Particiones creadas manualmente haciendo click en «+»]]
du -hs $(ls -A)
 
  
* Si queremos ordenar los archivos por tamaño:
+
[[File:Red_hat_particionamiento5.jpg|500px|thumb|center|Particiones creadas manualmente haciendo click en «+»]]
du -s $(ls -A) | sort -rn 
 
  
Note que en el caso anterior, no se debe usar la opción -h para así asegurarse de que la unidad de tamaño sea siempre la misma. Porque el comando sort no distingue entre tamaños sino sólo por los números. Es decir, si colocamos la opción -h, sort colocará un archivo de 50M antes de un archivo de 5G porque 50 es mayor que 5 y no hará distinción de la unidad.
 
  
* Ahora si queremos listar en una unidad en particular:
+
<br />
sudo du -csh --block-size=1M $(ls -A) | sort -rn  (--block-size=1G)
+
=====LVM and xfs=====
Note que en este caso, un archivo cuyo tamaño sea menor al block-size será listado con un tamaño igual al block-size. Por ejemplo si colocamos --block-size=1G, un archivo de 1k será listado con tamaño 1, que en este caso se refiere a 1G.
+
https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-disk-partitioning-setup-x86
  
* Si queremos excluir algún archivo o directorio:
+
LVM (Logical Volume Management): https://wiki.ubuntu.com/Lvm
du -s --exclude=Directorio $(ls -A) | sort -rn
 
  
===chown===
+
Por lo que he leido, LVM (Logical Volume Management) es similar a crear una partición extendida y dentro de ella particiones lógicas.
chown command changes the user and/or group ownership of for given file. The syntax is:
 
  
chown owner-user file
+
'''What is LVM:'''
chown options owner-user:owner-group file
+
LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem.
  
chown adelo:adelo prueba.txt
+
'''Why use LVM?'''
chown -R adelo:adelo directorio
+
For a long time I wondered why anyone would want to use LVM when you can use gparted to resize and move partitions just fine. The answer is that lvm can do these things better, and some nifty new things that you just can't do otherwise. I will explain several tasks that lvm can do and why it does so better than other tools, then how to do them. First you should understand the basics of lvm.
  
===chmod===
+
'''XFS''' is a highly scalable, high-performance file system that supports file systems up to 16 EiB (approximately 16 billion GiB), files up to 8 EiB (approximately 8 billion GiB), and directory structures containing tens of millions of entries. XFS supports metadata journaling, which facilitates quicker crash recovery.
https://doc.ubuntu-fr.org/permissions
 
  
====En gérant chaque droit séparément====
 
À qui s'applique le changement:
 
* u (user, utilisateur) représente la catégorie "propriétaire" ;
 
* g (group, groupe) représente la catégorie "groupe propriétaire" ;
 
* o (others, autres) représente la catégorie "reste du monde" ;
 
* a (all, tous) représente l'ensemble des trois catégories.
 
   
 
La modification que l'on veut faire:
 
* + : ajouter
 
* - : supprimer
 
* = : affectation
 
  
Le droit que l'on veut modifier
+
<br />
* r : read ⇒ lecture
+
======LVM and xfs support for Ubuntu======
* w : write ⇒ écriture
+
Para poder leer particiones LVM y xfs en Utuntu (y para que sean detectadas correctametne por Gparted) debemos instalar algunos paquetes.
* x : execute ⇒ exécution
 
* X : eXecute ⇒ exécution, concerne uniquement les répertoires (qu'ils aient déjà une autorisation d'exécution ou pas) et les fichiers qui ont déjà une autorisation d'exécution pour l'une des catégories d'utilisateurs. Nous allons voir [[Linux#Exemple d'application en traitant de façon différentiée les répertoires et les fichiers (récursivement)|plus bas]] dans la partie des traitements récursifs l'intérêt du X.
 
  
  chmod <options> u+rwx,g+rx-w,o+r-wx fichier3
+
  sudo apt-get install lvm2
chmod <options> ug+rw fichier3
+
  sudo apt-get install xfsprogs xfsdump
  chmod <options> a-rx fichier3
 
chmod -R a-rX directorio
 
  
====En octal====
+
[[File:Lvm_file_system_suport.png|600px|thumb|center|Advertencia generada en Gparted when LVM suport for Ubuntu is missing]]
* r = 4
 
* w = 2
 
* x = 1
 
* - = 0
 
  
Par exemple:
+
[[File:Xfs_file_system_support.png|600px|thumb|center|Advertencia generada en Gparted  when XFS file system suppor for Ubuntu is missing]]
* Pour rwx, on aura : 4+2+1 = 7
 
* Pour rw-, on aura : 4+2+0 = 6
 
* Pour r--, on aura : 4+0+0 = 4
 
  
  rwx        r-x        ---
 
7(4+2+1)  5(4+0+1)  0(0+0+0)
 
  
chmod -R 750 Documents
+
<br />
 +
==CentOS==
 +
https://www.centos.org/
  
====Exemple d'application en traitant de façon différentiée les répertoires et les fichiers (récursivement)====
+
https://en.wikipedia.org/wiki/CentOS
  
=====A través del permiso X=====
+
CentOS (Community Enterprise Operating System) is a Linux distribution that provides a free, enterprise-class, community-supported computing platform functionally compatible with its upstream source, Red Hat Enterprise Linux (RHEL). In January 2014, CentOS announced the official joining with Red Hat while staying independent from RHEL, under a new CentOS governing board.
X representa el permiso de ejecución en repertorios y en fichiers qui ont un x quelque part. Esto permite tratar separadamente el permiso de ejecución en directorios y en archivos. Veamos algunos ejemplos:
 
  
'''Application 1 :'''
+
* Parece ser que no hay versiones separadas para '''Desktop''' o '''Server''':
  
Soit un répertoire monrep, contenant des sous-répertoires et des fichiers. Les droits sont drwx------ (700) pour les répertoires et -rw------- (600) pour les fichiers.
+
:* CentOS es en esencia a Server distribution, aunque también puede ser usado en Desktop or Workstations.  
  
On veut ajouter récursivement les mêmes droits (resp. rwx et rw) pour le groupe. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.
+
:* https://www.reddit.com/r/linuxquestions/comments/1nq1h8/centos_server_vs_desktop/
 +
::* Most distros don't have Server or Desktop versions. Centos is generally used as Server. There are no roles. Everything depends on what packages you install, how you configure it, which repos you use.
 +
::* Agreed. I would say that CentOS is the open source version of Red Hat Enterprise Linux thus they are both a server distro. The desktop version would essentially be '''Fedora'''.
 +
::* '''Fedora''' is not the Desktop version... although it's often viewed that way. It's more the development/unstable version -- it races years ahead of a stabilized rhel/cent, which brings in the latest and ostensibly greatest features of whatever desktop environment you're following.
  
Si on lance chmod -R 770 monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(
+
:* https://serverfault.com/questions/325155/are-there-separate-desktop-and-server-versions-of-centos
  
Si on lance chmod -R 660 monrep : les répertoires n'auront plus les droits d'exécution → catastrophique :-(
+
:* <span style="background:#D8BFD8">Sin embargo, there is a «minimal» version that's command line only and great for servers.</span>
  
Si on lance chmod -R g+rwx monrep : les fichiers vont avoir les droits d'exécution → mauvais :-(
 
  
Si on lance '''chmod -R g+rwX monrep''' : seuls les répertoires (et les fichiers déjà exécutables) auront les droits d'exécution → bon :-)
+
<br />
 +
===Install Gnome GUI on CentOS 7 or RHEL 7===
 +
https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-gnome-gui-on-centos-7-rhel-7.html
  
  
'''Application 2 :'''
+
<br />
 +
==Filesystem Hierarchy Standard==
 +
https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
  
Imaginons que précédemment on ait lancé la commande chmod -R 770 monrep. La situation est la suivante : les droits sont drwxrwx--- (770) pour les répertoires et -rwxrwx--- (770) pour les fichiers.
+
{| class="wikitable" summary="A description of the hierarchy specified in the FHS."
 +
|-
 +
!Directory
 +
!Description
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/}}'''</span>
 +
|Primary hierarchy root and root directory of the entire file system hierarchy.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/bin}}'''</span>
 +
|Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/boot}}'''</span>
 +
|Boot loader files, e.g., kernels, initrd.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/dev}}'''</span>
 +
|Essential device files, e.g., /dev/null.
 +
|-
 +
|
 +
:<span style="color:#FFF; background:#FF0000">'''{{big|/etc}}'''</span>
 +
<!-- Please see the talk page before changing this -->
 +
|Host-specific system-wide configuration files
  
On désire supprimer les droits d'exécution uniquement sur les fichiers. C'est à dire que veut aboutir à la situation suivante : drwxrwx--- (770) pour les répertoires et -rw-rw---- (660) pour les fichiers.
+
There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".
 
+
|-
Comme chmod s'applique à la fois aux fichiers et répertoires, nous allons jongler avec x et X. Il faut enlever x puis ajouter X.
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/home}}'''</span>
Si on lance chmod -R u-x+X,g-x+X monrep cela n'aura aucun effet car X concerne à la fois les répertoires ET les fichiers qui ont un x quelque part. Donc si u-x enlève le premier x (ce qui donne -rw-rwx---), la suite +X va aussitôt remettre un x car il reste un x (celui du groupe !).
+
|Users' home directories, containing saved files, personal settings, etc.
 
+
|-
Donc il faut d'abord enlever tous les x : u-x,g-x avant de les remettre (sera fait uniquement pour les répertoires cette fois) ce qui donne finalement :  
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/lib}}'''</span>
chmod -R u-x,g-x,u+X,g+X monrep
+
|Libraries essential for the binaries in /bin/ and /sbin/.
 
+
|-
=====A través del comando find=====
+
|
Como vimos, X permite tratar separadamente el permiso de ejecución en directorios y en archivos. Ahora, si queremos asignar una configuración de derechos a los directorios y otra muy distinta a los archivos, lo podemos hacer a través del comando find de la siguiente forma:
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/media}}'''</span>
 
+
|Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
http://askubuntu.com/questions/58467/chmod-files-only-in-all-subdirectories/58470
+
|-
 
+
|
Para los directorios:
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/mnt}}'''</span>
find <directorio> -type d -exec chmod 755 {} +
+
|Temporarily mounted filesystems.
 
+
|-
Para los archivos:
+
|
find <directorio> -type f -exec chmod 664 {} +
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/opt}}'''</span>
 
+
|Optional application software packages.
====Permisología por defecto====
+
|-
En Ubuntu, al crear un directorio, la configuración de los permisos por defecto será:
+
|
'''drwxrwxr-x  (775)'''
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/proc}}'''</span>
Me parece mejor la permisología:
+
|Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
<span style="background:DarkKhaki">'''drwxr-xr-x  (755)'''   (umask u=rwx,g=rx,o=rx) (Ver [[Linux#Cambiar la permisología base/por defecto (umask)|aquí]])</span>
+
|-
Grupo y otros podrán acceder (x) a los directorio y ver (r) su contenido (listar todos los archivos que en él se encuentran); pero no podrán realizar cambios en el directorio (w) (no se podrán crear archivos en el directorio).
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/root}}'''</span>
Y para los archivos:
+
|Home directory for the root user.
'''-rw-rw-r--  (664)'''
+
|-
Para los archivos podría ser más conveniente de esta forma:
+
|
<span style="background:DarkKhaki">'''-rw-r--r--  (644)'''   (umask u=rwx,g=rx,o=rx) (Ver [[Linux#Cambiar la permisología base/por defecto (umask)|aquí]])</span>
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/run}}'''</span>
O incluso así:
+
|Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
'''-rw-r-----  (640)'''
+
|-
 
+
|
=====Cambiar la permisología base/por defecto (umask)=====
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/sbin}}'''</span>
https://es.wikipedia.org/wiki/Umask
+
|Essential system binaries, e.g., fsck, init, route.
 
+
|-
umask (abreviatura de user mask, máscara de usuario) es una orden y una función en entornos POSIX que establece los permisos por defecto para los nuevos archivos y directorios creados por el proceso actual.
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/srv}}'''</span>
Los sistemas Unix modernos permiten que las máscaras se especifiquen de dos modos:
+
|Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
* Un permiso por defecto, también llamado máscara simbólica. Por ejemplo, u=rwx,g=rwx,o=
+
|-
* Un número en octal que controla qué permisos se enmascararán (no se establecerán) para cualquier nuevo archivo, por ejemplo, 007.
+
|
 
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/sys}}'''</span>
En ambos casos debe tenerse en cuenta que la mayoría de los sistemas Unix no permiten que nuevos archivos sean creados con permisos de ejecución activados, independientemente de la máscara.
+
|Contains information about the devices connected to the computer.
 
+
|-
Ejemplo de máscara simbólica:
+
|
  $ umask u=rwx,g=rwx,o=
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/tmp}}'''</span>
  $ mkdir foo
+
|Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
  $ touch bar
+
|-
  $ ls -l
+
|
  drwxrwx--- 2 dave 512 Sep  1 20:59 foo
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/usr}}'''</span>
  -rw-rw---- 1 dave  0 Sep  1 20:59 bar
+
|Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
 
+
|-
 
+
|
Ejemplos de máscara en octal:
+
:<span style="color:#FFF; background:#FF0000">'''{{big|/var}}'''</span>
  $ umask 0174
+
|Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.
  $ mkdir foo
+
|-
  $ touch bar
+
|}
  $ ls -l
 
  drw-----wx 2 dave 512 Sep  1 20:59 foo
 
  -rw-----w- 1 dave  0 Sep  1 20:59 bar
 
 
 
'''Configurar el valor de umask permanentemente:''' para un usuario en concreto hay que añadir en el fichero ''.bashrc'' el comando '''umask u=rwx,g=rx,o=rx'''. También se puede modificar el valor de umask en el fichero global ''/etc/profile'' para que el cambio sea efectivo para todos los usuarios. http://www.websecurity.es/como-utilizar-umask-establecer-los-permisos-predeterminados
 
 
 
 
 
Ahora, a través del umask no se pueden ajustar separadamente los permisos de los directorios y de los archivos, debido a que umash afecta tanto a los archivos como a los directorio. No he encontrado una orden que permita hacer distinción entre los permisos bases de los directorios y los de los archivos. Sin embargo, en el siguiente post se propone una forma de hacer esto:
 
 
 
http://stackoverflow.com/questions/12445527/set-different-umask-for-files-and-folders
 
 
 
Interesting requirement. Currently (at least in bash), umask is a global setting and you cannot set it based on object type.
 
 
 
One solution that comes to mind would be to set the umask to the file variant and then intercept calls to mkdir (such as with a user-created mkdir script earlier in the path) to do:
 
 
 
umask 0701 ; /path/to/real/mkdir $1 ; umask 0604
 
 
 
That way, assuming all your directory creations are done with mkdir, you can ensure they use a different umask setting.
 
 
 
Note that the script should probably be a little more robust such as restoring the previous umask rather than forcing it to 0604, and adding some better error checking and possibly the ability to handle multiple arguments.
 
 
 
But that's all detail, the framework above should be enough to get you started.
 
 
 
===fdisk===
 
n => Create new Partition (Then create what you need)
 
  
t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)
 
  
w => Write the changes to disk and exit
+
<br />
 +
==Upgrade the system==
 +
https://docs.ovh.com/gb/en/dedicated/updating-kernel-dedicated-server
  
====Crear una partición con fdisk====
+
https://tutorials.ubuntu.com/tutorial/tutorial-upgrading-ubuntu-desktop#0
sudo fdisk /dev/sdb
 
Welcome to fdisk (util-linux 2.27.1).
 
Changes will remain in memory only, until you decide to write them.
 
Be careful before using the write command.
 
  
Command (m for help): n
+
https://help.ubuntu.com/community/UpgradeNotes?_ga=2.166774206.1403639924.1537856764-959153226.1536526077
Partition type
 
  p  primary (0 primary, 0 extended, 4 free)
 
  e  extended (container for logical partitions)
 
Select (default p): p
 
Partition number (1-4, default 1): 1
 
First sector (2048-4028415, default 2048):
 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4028415, default 4028415):
 
  
Created a new partition 1 of type 'Linux' and of size 1,9 GiB.
+
An upgrade is the process of going from an earlier version of Ubuntu to a newer version of Ubuntu with an installed system. An example of this would be going from Ubuntu 17.10 to Ubuntu 18.04 LTS. To avoid damaging your running system, upgrading should only be done from one release to the next release (e.g. Ubuntu 16.04 to Ubuntu 16.10) or from one LTS release to the next (e.g. Ubuntu 16.04 LTS to Ubuntu 18.04 LTS). If you wish to 'skip' a version, you can back up your data and do a fresh installation, or progressively upgrade to each successive version. For example, to upgrade from Ubuntu 16.10 to Ubuntu 17.10, first upgrade to 17.04, then upgrade 17.04 to 17.10.
  
Command (m for help): w
 
The partition table has been altered.
 
Calling ioctl() to re-read partition table.
 
Syncing disks.
 
  
===Mostrar barra de progreso al Copiar, mover y borrar archivos ===
+
<br />
 +
==Update the system==
 +
To update Ubuntu 18.04, press Super Key (Windows Key) to launch the Activity Overview and look for Software Updater. Run it to check for updates.
  
====gcp====
+
Alternatively:
Comando para copiar mostrando una barra de progreso y velocidad.
+
sudo apt update && sudo apt upgrade
  
  gcp -r origen/archivo /destino
+
   
 +
<br />
 +
==Enable additional repositories for more software==
 +
https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
  
===Hard and symbolic (soft) links===
+
Ubuntu has several repositories from where it provides software for your system. Enabling all these repositories will give you access to more software and proprietary drivers.
http://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link
 
  
Underneath the file system files are represented by inodes (or is it multiple inodes not sure)
+
Go to Activity Overview by pressing Super Key (Windows key), and search for Software & Updates:
 +
* Under the Ubuntu Software tab, make sure you have checked all of the Main, Universe, Restricted and Multiverse repository checked.
 +
* Now move to the Other Software tab, check the option of Canonical Partners.
  
A file in the file system is basically a link to an inode.
+
Once it completes, you’ll find more applications to install in the Software Center.
A hard link then just creates another file with a link to the same underlying inode.
 
  
When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.
 
  
A symbolic link is a link to another name in the file system. The soft link points to the name of a file, and not to the contents.
+
<br />
 +
==Apt-get==
  
Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
 
  
Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.
+
<br />
 +
===Update System Packages===
 +
The «update» command is used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version.
  
 +
sudo apt-get update
  
'''Let's create hard and soft links:'''
+
 +
<br />
 +
===Upgrade Software Packages===
 +
The «upgrade» command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies.
  
Al crear links es apropiado colocar las rutas absolutas de la fuente y la destinación:
+
  sudo apt-get upgrade
  ln blah1 blah1-hard  (hard link not allowed for directory)
 
  
  ln -s blah2 blah2-soft
+
   
 +
<br />
 +
===How to check the version of a package using apt===
 +
Verificar la version de un paquete instalado o disponible en los repositorios
  
Si blah2 es renombrado, the contents of the file blah2-soft could not be found because the soft link points to the name of the other file (that was changed) and not to the contents.
+
https://stackoverflow.com/questions/18885820/how-to-check-the-version-before-install-packages-using-apt-get
  
If blah1 is deleted, blah1-hard still holds the contents.
+
apt-cache policy <package name> will show the version details.
  
If blah2 is deleted, blah2-soft is just a link to a non-existing file.
+
It also shows which version is currently installed and which versions are available to install.
  
====What's the difference between a hard link and a copy?====
+
For example:
https://bbs.archlinux.org/viewtopic.php?id=53484
+
apt-cache policy hylafax+
  
Hay que internalizar que si se edita un archivo hardlink (siendo éste otro nombre para un mismo archivo) el cambio será reflejado en el archivo original (pues en realidad es el mismo archivo).
+
También:
 +
apt-cache show <package name>
  
Si se hace una copia de un hard link, la copia no será un hard link sino un archivo normal. Es decir, es idéntico hacer una copia del archivo original o del hard link.
 
  
No se puede crear un hard link entre dos particiones; sólo soft links son posibles en este caso.
+
Por ejemplo, podemos ver las versiones disponibles de r-base con:
  
Aunque no se pude hacer un hardlink de un directorio, a través de la orden "cp -rlp", el comand cp copia todo el arbol de directorios y crea hardlinks de todos los archivos en el directorio:
+
sudo apt policy r-base
cp -rlp : copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)
+
r-base:
 +
  Installed: 3.5.2-1bionic
 +
  Candidate: 3.6.0-2bionic
 +
  Version table:
 +
    3.6.0-2bionic 500
 +
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
 +
    3.6.0-1bionic 500
 +
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
 +
    3.5.3-1bionic 500
 +
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
 +
*** 3.5.2-1bionic 500
 +
        500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
 +
        100 /var/lib/dpkg/status
 +
    3.5.1-2bionic 500
 +
      500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
 +
    3.5.1-1bionic 500
  
Si se quieren preservar los softlinks debemos entonces usar también la opción -d
+
<br />
  cp -rlpd
+
Si queremos listar solo paquetes instalados y no todos los paquetes «disponibles y instalados», podemos usar: https://askubuntu.com/questions/17823/how-to-list-all-installed-packages
  
===tar and zip===
+
apt list --installed openjdk*
====tar====
 
De esta forma el archivo tar.gz se creará en el mismo lugar donde se ejecuta el comando y dentro del tar.gz se creará el full-path del directorio que se está comprimiendo. Es decir, cuando descomprimamos el archivo obtendremos el directorio /var/www/sinfronteras_ws/perso/
 
tar cvzf archivo.tar.gz /var/www/sinfronteras_ws/perso/1-archivos
 
  
De esta forma el full-path no es generado en el .tar.gz. Cuando descomprimamos el .tar.gz obtendremos sólo los archivos que están en 1-archivos (sin la ruta completa /var/www/sinfronteras_ws/perso/)
 
tar -czpvf ruta/destino/archivo.tar.gz -C /var/www/sinfronteras_ws/perso/1-archivos .
 
  
====zip====
+
<br />
unzip file.zip -d destination_folder
+
===Installing a specific Version of a package===
 +
<span style="color:#FF0000">En general, si queremos installar una versión específica de un paquete:</span>
 +
sudo apt install r-base=3.5.1-2bionic
  
===Buscar una cadena de caracteres archivos recursivamente - Convinación de find y grep===
+
<span style="color:#FF0000">Sin embargo, en muchos casos no es tan fácil así. Cuando los paquetes tienen dependencias, la ejecución del comando anterior no resuelve las dependencias automáticamente. Si el paquete tiene muchas dependencia (como es el caso de r-base) la instalación se torna un poco complicada.
find . -type f -print | xargs grep "palabra"
+
</span>
  
 +
<span style="color:#FF0000">Al tratar de instalar «r-base» veremos que la única dependencia es el paquete «r-recommended». Entonces, antes de instalar la «r-base» tenemos que instalar «r-recommended=3.5.1-2bionic». Sin embargo, «r-recommended» tiene muchas dependencias; y aunque la ejecución de «sudo apt install r-recommended=3.5.1-2bionic» resulve las dependencias e instala el paquete, luego se presentan problemas. Lo que pasó cuando lo hice de esta forma fue que aparentemente se había instalado la versión deseada; pero cuando desplegaba la versión del R con «sudo R --version» o en el terminal del R «version» se mostraba la versión más reciente disponible en la Version table. Esto pasa porque al ejecutar «sudo apt install r-recommended=3.5.1-2bionic» se instala la versión deseada de «r-recommended=3.5.1-2bionic» pero con respecto a las dependencias, podría instalarse la versión más reciente disponible en la Version table.</span>
  
'''Y para buscar una linea que contenga dos palabras especificas:'''
+
<span style="color:#FF0000">Fui capaz de instalar una versión específica de la siguiente forma:</span>
  
  find . -type f -print | xargs grep "palabra1" | grep "palabra2"
+
  sudo apt-get install r-recommended=3.5.3-1bionic r-base-core=3.5.3-1bionic r-base-core-dbg=3.5.3-1bionic r-base-dev=3.5.3-1bionic r-cran-mgcv r-doc-html=3.5.3-1bionic r-cran-nlme=3.1.137-1cranBionic0
  
 +
sudo apt-get install r-base=3.5.3-1bionic r-base-html=3.5.3-1bionic
  
'''O también:'''
+
<span style="color:#FF0000">Se debe notar que se debe ejecutar el comando apt-get con todas las dependencias en una sóla orden, sino se hace de esta manera, apt-get podría resolver dependencias e instalar versiones incorrectas de algunos paquetes.</span>
find . -exec egrep palagra '{}' +
 
  
 +
<span style="background:#D8BFD8">Note que hemos especificado la versión «=3.5.3-1bionic» para todos los paquetes excepto para «r-cran-nlme=3.1.137-1cranBionic0». Las versiones de «r-cran-nlme» no siguen el mismo orden que «r-base» pero tuvimos también que indicar una versión específica de «r-cran-nlme» porque la versión más reciente de este paquete dependía de versiones más reciente de «r-base».</span>
  
'''Otra forma:'''
 
  
egrep -r palabra *
+
<br />
 +
===Desinstalar un programa===
  
===Alias===
+
Uninstall the program and all configuration files:
http://www.computerhope.com/unix/ualias.htm
+
sudo apt-get --purge remove <programa> (podría ser necesario colocar <programa>*)
  
Aliases are used to customize the shell session interface:
+
También se podría:
  alias ls='ls --color=auto'
+
  sudo apt-get autoremove eclipse*
 +
 +
Lo anterior will uninstall the dependencies and related packages that were installed along with eclipse. This should do the trick.
  
  alias ll='ls -la'
+
También podría ser necesario:
 +
  rm -r ~/.<programa>/ (en caso de que el programa instale una carpeta en el directorio ~)
  
  alias .....='cd ../../../../'
+
Uninstall just the program. If you’d like to remove the program but keep the configuration files, enter the following command:
 +
  sudo apt-get remove <programname>
  
  Éste lo he adicionado a mi .bashrc:
+
   
alias 'la=ls -AX'
+
<br />
 +
===Repositorios - List and Remove Repositories===
  
===Para saber las características del hardware y del SO===
+
List repositories:
 +
apt policy
  
====Caracteristicas del harware (marcas/fabricantes, modelos, etc)====
+
Si agregamos un repositorio incorrecto (que no existe o lo que sea), al ejecutar «apt update» se generará un error como el siguiente:
{{#lst:Mi_computadora|product_name}}
 
=====Startup Menu=====
 
Al iniciar la computadora podemos ver todas estas características en el Startup Menu. En mi caso F1 me lleva a System Information en donde se despliega esta información. También se puede verificar en el BIOS Setup.
 
  
=====dmidecode=====
+
<syntaxhighlight lang="bash">
  sudo dmidecode | more
+
Err:14 http://ppa.launchpad.net/webupd8team/gnome3/ubuntu bionic Release
 +
  404 Not Found [IP: 91.189.95.83 80]
  
Este comando despliega las características detalladas de todos los componentes del hardware:
+
E: The repository 'http://ppa.launchpad.net/webupd8team/gnome3/ubuntu bionic Release' does not have a Release file.
* System Information,
+
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
* BIOS Information,
+
N: See apt-secure(8) manpage for repository creation and user configuration details.
* Processor Information, etc.
+
</syntaxhighlight>
  
Por ejemplo si se quieren saber las carecterísticas de la computadora (Modelo, Fabricante, Serial etc):
+
esto trae algunos probleminas. Por ejemplo, al abrir el GUI «Software Updater» (tecla SO: escribir "software updater"), la aplicacion generará el error: https://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/
 +
Failed to download repository information. Check your internet connection.
  
sudo dmidecode | grep -A 9 "System Information"
+
La solución es eliminar el repositorio incorrecto. Esto lo podemos hacer en línea de comando por supuesto. También puede realizarse fácilmente (como se muestra aquí: https://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/) a través del GUI «Software & Updates» > go to «other Software» and look for the software source that is causing this problem. Uncheck the box before it to exclude it from future updates.
  
También se puede utilizar este comando empleando ciertos String a través de la opción -s:
 
  
sudo dmidecode -s String_keyword
+
'''How to list and remove PPA repository by command line:'''
  
sudo dmidecode -s system-product-name
+
https://www.powercms.in/blog/how-remove-ppas-ubuntu-1404141015041510-and-linux-mint
sudo dmidecode -s bios-release-date
 
sudo dmidecode -s baseboard-product-name
 
sudo dmidecode -s baseboard-manufacturer
 
  
=====sysinfo/lshw=====
+
https://linuxconfig.org/how-to-list-and-remove-ppa-repository-on-ubuntu-18-04-bionic-beaver-linux
sudo apt-get install sysinfo
 
  
'''Para crear un archivo html con todas las características del hardware:'''
+
https://askubuntu.com/questions/307/how-can-ppas-be-removed
  
  sudo lshw -html > mySpecs.html
+
En los links anteriores se esplica como eliminar PPA. Sin embargo ese método me ha funcionado sólo cuando el repositorio inicia con 'ppa'. Por ejemplo:
 +
  500 http://ppa.launchpad.net/videolan/master-daily/ubuntu bionic/main
  
then check the html file.
+
puede ser eliminado con:
 +
sudo add-apt-repository --remove ppa:PPA_REPOSITORY_NAME/PPA
 +
$ sudo add-apt-repository --remove ppa:videolan/master-daily
  
====Desplegar el SO instalado (detallando la versión)====
+
Sin embargo, con un repositorio que no inicia con 'ppa' el comando no puede ser ejecutado de dicha forma. Por ejemplo:
  lsb_release -a
+
  500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
  
http://askubuntu.com/questions/55609/how-do-i-check-system-specifications
+
El repositorio anterior pudo ser borrado a través del siguiente comando:
 +
sudo add-apt-repository --remove 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
  
====Para saber si el SO instalado es 32 o 64bit====
+
En dicha ocasión fue ejecutado con el «deb» porque dicho repositorio fue incluido de la siguiente forma:
  uname -a
+
  sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'
  
Result for 32-bit Ubuntu:
 
  
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
+
Sin embargo, luego intenté eliminar este repositorio:
 +
500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages
  
whereas the 64-bit Ubuntu will show:
+
y no pude hacerlo a través de ninguno de los siguientes comandos:
 +
sudo add-apt-repository 'deb http://cran.rstudio.com/bin/linux/ubuntu xenial/'
 +
sudo add-apt-repository 'http://cran.rstudio.com/bin/linux/ubuntu xenial/'
  
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
+
No encontré forma de eliminar dicho repositorio...
  
  
O a través del comando:
+
<br />
 +
==Para saber las características del hardware y del SO==
  
getconf LONG_BIT
 
  
====Para ver las particiones y dispositivos montados====
+
<br />
Muestra las particiones o dispositivos montados en el orden en el que se encuentran en el disco duro. Es el único comando que conozco que las muestra en el orden correcto. Además da muestra el tamaño exacto de la partición (el tamaño ajustado al momento del particionamiento. Los otros comandos no muestran este tamaño exacto; claro no sé cual es el tamaño correcto) Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]]. Tambíen dice si la partición es de tipo Primaria, extendida o lógica y el File system. Muestra también las características del disco duro (tamaño, fabricante, modelo):
+
===Procesador - nucleos - velocidad - fabricante - arquitectura - 32 o 64bit===
  sudo parted /dev/sda then type print
+
  lscpu
sudo parted -l
 
  
  
Muestra todas las particiones en el disco y los dispositivos montados. Muestra también el tamaño de la partición y el File system:
+
The next file display las características de cada procesador:
  lsblk -fm
+
  more /proc/cpuinfo
  
 +
Si queremos, por ejemplo contar el número de CPUs / Cores:
 +
cat /proc/cpuinfo | grep processor | wc -l
 +
cat /proc/cpuinfo | grep 'core id'
 +
nproc
  
Muestra todas las particiones en el disco y los dispositivos montados. Da información, aunque no tan precisa, del filesystem type de cada partición o dispositivo. Muestra también algunas características del disco duro (tamaño, modelo):
+
 
  sudo fdisk -l
+
<br />
 +
===Para saber la memoria RAM y Swap - total y en uso===
 +
free -m
 +
 
 +
O graficamente en System > Administration > System monitor
 +
 
 +
Hay también otros comandos detallados aquí http://www.cyberciti.biz/faq/check-ram-in-ubuntu/
 +
 
 +
 
 +
<br />
 +
===Para ver las particiones y dispositivos montados===
 +
Muestra las particiones o dispositivos montados en el orden en el que se encuentran en el disco duro. Es el único comando que conozco que las muestra en el orden correcto. Además da muestra el tamaño exacto de la partición (el tamaño ajustado al momento del particionamiento. Los otros comandos no muestran este tamaño exacto; claro no sé cual es el tamaño correcto) Ver nota sobre el [[Linux#Tamaños de la partición: Different partition sizes reported by df and parted|Tamaño de la partición]]. Tambíen dice si la partición es de tipo Primaria, extendida o lógica y el File system. Muestra también las características del disco duro (tamaño, fabricante, modelo):
 +
 
 +
sudo gparted
 +
 
 +
 
 +
sudo parted /dev/sda then type print
 +
sudo parted -l
 +
 
 +
 
 +
Muestra todas las particiones en el disco y los dispositivos montados. Muestra también el tamaño de la partición y el File system:
 +
lsblk -fm
 +
lsblk -fm /dev/sda
 +
 
 +
 
 +
Muestra todas las particiones en el disco y los dispositivos montados. Da información, aunque no tan precisa, del filesystem type de cada partición o dispositivo. Muestra también algunas características del disco duro (tamaño, modelo):
 +
  sudo fdisk -l
  
  
Line 1,366: Line 1,560:
 
  df -h
 
  df -h
  
=====Tamaños de la partición: Different partition sizes reported by df and parted=====
+
 
 +
<br />
 +
====Partition size - Different partition sizes reported by df and parted====
 
http://ubuntuforums.org/showthread.php?t=1575190
 
http://ubuntuforums.org/showthread.php?t=1575190
  
 
http://linux.derkeiler.com/Mailing-Lists/Fedora/2009-04/msg01901.html
 
http://linux.derkeiler.com/Mailing-Lists/Fedora/2009-04/msg01901.html
  
====Para saber la memoria RAM y Swap (total y en uso)====
 
free -m
 
  
O graficamente en System > Administration > System monitor
+
<br />
  
Hay también otros comandos detallados aquí http://www.cyberciti.biz/faq/check-ram-in-ubuntu/
+
===Desplegar el SO instalado - detallando la version===
 +
lsb_release -a
  
====Información del procesador del sistema: núcleos, velocidad, fabricante, arquitectura, 32 o 64bit====
+
http://askubuntu.com/questions/55609/how-do-i-check-system-specifications
lscpu
 
  
===Formatear una unidad Flash USB===
 
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
 
  
====Usando el terminal====
+
<br />
Para mostrar los distintos dispositivos y particiones en el sistema:
+
===Para saber si el SO instalado es 32 o 64bit===
  lsblk -fm
+
  uname -a
  
Antes de formatear una device debemos desmontarla:
+
Result for 32-bit Ubuntu:
  
umount /dev/sdb*
+
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux
  
Par usar el comando mkfs.* sobre una entire device (sdb por ejemplo) y no sobre una partición dentro de esta (sdb1 por ejemplo), debemos usar la opción -I. Ver [[Linux#Nota_sdb|Nota sdb]]
+
whereas the 64-bit Ubuntu will show:
  
$ sudo mkfs.vfat -I /dev/sdb
+
    Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux
  
http://tecadmin.net/format-usb-in-linux/#
 
  
https://ksearch.wordpress.com/2010/09/29/format-usb-in-linux/
+
O a través del comando:
  
  $ sudo umount /dev/sdc1
+
  getconf LONG_BIT
  
$ sudo umount /dev/sdb*
 
  
Format with vFat FileSystem
+
<br />
 +
===dmidecode===
 +
sudo dmidecode | more
  
$ sudo mkfs.vfat /dev/sdc1
+
Este comando despliega las características detalladas de todos los componentes del hardware:
 +
* System Information,
 +
* BIOS Information,
 +
* Processor Information, etc.
  
Format with NTFS FileSystem. En este caso la opción -I no me ha funcionado. Cuando intento formatear en formato NTFS sobre la entire device, obtengo un error:
+
Por ejemplo si se quieren saber las carecterísticas de la computadora (Modelo, Fabricante, Serial etc):
  
  /dev/sdb is entire device, not just one partition.
+
  sudo dmidecode | grep -A 9 "System Information"
Refusing to make a filesystem here!
 
  
Por eso tuve que crear una partición en la device antes de formatear --> [[Linux#Crear una partición con fdisk|Crear una partición con fdisk]]
+
También se puede utilizar este comando empleando ciertos String a través de la opción -s:
  
  $ sudo mkfs.ntfs /dev/sdc1
+
  sudo dmidecode -s String_keyword
  
Format with EXT4 FileSystem
+
sudo dmidecode -s system-product-name
 +
sudo dmidecode -s bios-release-date
 +
sudo dmidecode -s baseboard-product-name
 +
sudo dmidecode -s baseboard-manufacturer
  
$ sudo mkfs.ext4 /dev/sdc1
 
  
====Interfaz gráfica====
+
<br />
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
+
===sysinfo - lshw===
 +
sudo apt-get install sysinfo
  
===Screenshot Tool in Ubuntu===
+
'''Para crear un archivo html con todas las características del hardware:'''
Aplicación para imprimir pantalla
 
  
====Gnome Screenshot====
+
sudo lshw -html > mySpecs.html
https://doc.ubuntu-fr.org/gnome-screenshot
 
  
Gnome Screenshot est déjà installé par défaut sur Ubuntu
+
then check the html file.
  
Lancer l'interface depuis le tableau de bord d'Unity à l'aide des mots-clés "capture d'écran" ou pour les menus classiques, Applications → Accessoires → Capture d'écran.
 
Ou encore depuis un terminal avec la commande suivante:
 
  
gnome-screenshot -i
+
<br />
 +
===Startup Menu===
 +
Al iniciar la computadora podemos ver todas estas características en el Startup Menu. En mi caso F1 me lleva a System Information en donde se despliega esta información. También se puede verificar en el BIOS Setup.
  
À l'aide de raccourcis:
 
La convinación de tecla normal no me funciona, la siguiente sí:
 
  
[ALT]+[IMPR] → Capturer la fenêtre active.
+
<br />
 +
==Algunas funciones del shell - terminal==
  
En la página Web se pueden ver las otras convinaciones de tecla disponibles
 
  
====Shutter====
+
<br />
https://askubuntu.com/questions/3578/tool-to-add-shapes-annotations-and-text-using-templates-to-images
+
===Historique===
 +
* '''Flecha hacia arriba:''' remonter,
  
Shutter es un buen programa para imprimir pantallas.
+
*'''Flecha hacia abajo:''' redescendre dans l'historique;
  
También permite editar imágenes: crear flechas y etiquetas de una forma fácil.
 
  
===Programas para realizar respaldos (Backup)===
+
*'''Ctrl + R <chaine>:''' Chercher une commande dans l'historique contenant <chaine> ;
 +
** '''A nouveau Ctrl + R:''' cherche la commande précédente ;
  
====rsync====
 
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
 
  
http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/
+
'''Ctrl + G:''' interrompt la recherche.
  
'''<span style="background:Thistle">One of the main feature of rsync is that it transfers only the changed block to the destination, instead of sending the whole file.</span> <span style="background:PaleGoldenrod">De hecho, si jamás se ha realizado un proceso rsync entre dos directorios, rsync comprobará las diferencias entre los dos directorios antes de transferir cualquier archivo. Por tanto (aún durante la primera sincronización entre dos directorios) serán transferidos sólo los bloques distintos.</span>'''
 
  
  rsync -azvu --delete --progress Source/ Destination/
+
*'''Delete/borror the history''' https://askubuntu.com/questions/191999/how-to-clear-bash-history-completely
 +
  history -c && history -w
 +
history -c && history -w && clear && clear
  
Si colocamos "Source/" (con el slash al final) todo el contenido del directorio Source será copiado dentro del directorio Destination. Si destination no existe, éste será creado. Ahora bien, si colocamos "Source" (sin el slash) será copiado el directorio "Source" como tal dentro del directorio Destination.
 
  
rsync -azvu --delete --progress --exclude 'Figuras' --exclude 'ejercicios' --exclude 'TP_Processus/processus_files' Source/ Destination/
+
<br />
  
: '''-a''', --archive, archive mode; equals '''-rlptgoD''' (no -H,-A,-X). This option does the following:
+
==Some networking commands==
:: '''-l''', --links copy symlinks as symlinks (Preserves symbolic links)
+
https://askubuntu.com/questions/461825/how-to-connect-to-wifi-from-the-command-line
:: '''-p''', --perms preserve permissions
 
:: '''-t''', --times preserve modification times (Preserves timestamp)
 
:: '''-g''', --group preserve group
 
:: '''-o''', --owner preserve owner (super-user only)
 
:: '''-D''' same as --devices --specials
 
::: '''--devices''' preserve device files (super-user only)
 
::: '''--specials''' preserve special files
 
::; -r, --recursive (ayuda from man rsync):
 
::: This tells rsync to copy directories recursively.  See also --dirs (-d).
 
  
::: Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed.  This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer.  It is also only possible when both ends of the transfer are at least version 3.0.0.
+
'''To see list of saved connections, use (<SavedWiFiConn>):'''
 +
  nmcli c
  
::: Some  options  require  rsync  to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and  --delay-updates.  Because  of this,  the default  delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0  (use  --del  or  --delete-during  to  request  this  improved  deletion  mode explicitly).  See also  the --delete-delay option that is a better choice than using --delete-after.
+
'''To see list of available WiFi hotspots (<WiFiSSID>):'''
 +
  nmcli d wifi list
  
::: Incremental recursion can be disabled using the '''--no-inc-recursive''' option or its shorter --no-i-r alias.
+
or:
 +
sudo iwlist wlan0 scanning
  
: '''-z''' is to enable compression
+
'''Para conectarse a una red:'''
 +
nmcli c up <SavedWiFiConn>
 +
nmcli c up iptime
  
: '''-v''' verbose
+
'''Para conectarse'''
 +
nmcli c down <SavedWiFiConn>
  
: '''-u :''' Do not overwrite the modified files at the destination (desde la última sincronización). In a typical sync situation, if a file is modified at the destination, we might not want to overwrite the file with the old file from the source.
 
  
: '''--delete''' it to delete the Files Created at the Target: If a file is not present at the source, but present at the target, you might want to delete the file at the target during rsync. Si el archivo fue modificado en la destinación, éste no será sobre-escrito. Ahora bien, en la siguiente sincronización, si el archivo no vuelto a ser modificado, será sobre-escrito.
+
<br />
 +
==Grub2==
 +
The main GRUB 2 folder locations include /boot/grub/ and /etc/grub.d/. User preferences are stored in the /etc/default/grub file. The GRUB 2 menu is built by information contained in /boot/grub/grub.cfg.  
  
: '''--progress :''' View the rsync Progress during Transfer. Displays detailed progress, i.e how many files are copies, at what rate it is copying the file, etc)
+
En este video se explica como configurar grub2: https://www.youtube.com/watch?v=bIH-1hDvZb0
  
: '''--exclude''' is to exclude files or directories while doing synchronization. Ver [http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/ 6 rsync Examples to Exclude Multiple Files and Directories]
 
  
:'''--delete-after :''' No entiendo bien cual podría ser la ventaja de borrar después y no antes. Pero he visto en varios foros que usan esta opción en lugar de --delete. En este foro explican cual es la razón, aunque no entendí: Par défaut rsync avec l'option --delete supprime les fichiers qui ont disparus de la source avant tout transfert. Lorsque le fichier a été tout simplement supprimé de la source ça ne pose pas de problème. Par contre si le fichier a été déplacé à un autre endroit c'est plus embêtant car il y a un moment où le fichier n'est plus dupliqué sur le serveur de backup. Pour éviter ce petit soucis il faut ajouter l'option --delete-after pour que les fichiers soit supprimés après la copie et plus avant. http://raphastronome.astro5000.com/?post/Option-delete-after-de-rsync
+
<br />
 +
===Installing - Reinstalling Grub2===
 +
https://help.ubuntu.com/community/Grub2/Installing
  
:; -H, --hard-links (ayuda from man rsync):
 
:: This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.
 
  
:: This  option  does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source.  Cases in which the destination may end up with extra hard links include the following:
+
<br />
 +
====Reinstalling GRUB 2 from a Working System====
 +
If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal:
  
::* If the destination contains extraneous hard-links (more linking than what is  present  in  the  source  file list), the copying algorithm will not break them explicitly.  However, if one or more of the paths have content differences, the normal file-update process will break those extra links  (unless  you  are  using  the --inplace option).
+
'''«a»''' is the drive (letter) on which you want GRUB to write the boot information. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition.
  
::* If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the destination to become linked together due  to the --link-dest associations.
+
<syntaxhighlight lang="bash">
 +
sudo grub-install /dev/sda
 +
sudo grub-install --recheck /dev/sda  (éste no es indispensable.. no sé realmente la utilidad)
 +
sudo update-grub
 +
</syntaxhighlight>
 +
 +
This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running «sudo update-grub» after the install will ensure GRUB 2's menu is up-to-date.
  
:: Note that rsync can only detect hard links between files that are inside the transfer set.  If rsync updates a file that has extra hard-link connections to files outside the transfer, that  linkage  will  be  broken.  If  you  are tempted  to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes  happen  due  to  lingering  hard  links  (and  see  the --inplace option for more caveats).
 
  
:: If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy.  This does not affect the  accuracy  of  the transfer  (i.e.  which files are hard-linked together), just its efficiency (i.e. copying the data for a new, early copy of a hard-linked file that could have been found later in the transfer in another member  of  the  hard-linked set of files).  One way to avoid this inefficiency is to disable incremental recursion using the '''--no-inc-recursive''' option.
+
<br />
 +
====If a system has become unbootable====
 +
There are various methods for reinstalling GRUB 2:
  
:; --partial (ayuda from man rsync):
 
:: By default, rsync will delete any partially transferred file if the transfer is interrupted. In some  circumstances it  is  more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
 
  
::; --partial-dir=DIR
+
<br />
::: A better way to keep partial files than the --partial option is to specify a DIR that will be used to hold the partial  data  (instead of writing it out to the destination file). On the next transfer, rsync will use a file found in this dir as data to speed up the resumption of the transfer and then delete it after it has served its purpose.
+
=====Restore or Reinstall Grub 2 from a Ubuntu Live CD or USB=====
 +
https://help.ubuntu.com/community/Grub2/Installing
  
::: Note that if --whole-file is specified (or implied), any partial-dir file that is found for a file  that  is  being updated will simply be removed (since rsync is sending files without using rsync’s delta-transfer algorithm).
+
http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd
  
::: Rsync  will create the DIR if it is missing (just the last dir -- not the whole path).  This makes it easy to use a relative path (such as "--partial-dir=.rsync-partial") to have rsync create the partial-directory in  the  destination file’s directory when needed, and then remove it again when the partial file is deleted.
+
Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.
  
::: If  the partial-dir  value is not an absolute path, rsync will add an exclude rule at the end of all your existing excludes. This will prevent the sending of any partial-dir files that may exist on the sending side, and will also prevent  the  untimely  deletion  of  partial-dir items on the receiving side.  An example: the above --partial-dir option would add the equivalent of "-f '-p .rsync-partial/'" at the end of any other filter rules.
+
'''Warning:'''
 +
Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands.
  
::: If you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule  for  the  partial-dir  because (1) the auto-added rule may be ineffective at the end of your other rules, or (2) you may wish to override rsync’s exclude choice.  For instance, if you want to make rsync clean-up any left-over partial-dirs  that may  be lying around, you should specify --delete-after and add a "risk" filter rule, e.g.  -f 'R .rsync-partial/'. (Avoid using --delete-before or --delete-during unless you don’t need rsync to use any of the left-over partial-dir data during the current run.)
 
  
::: IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk.  E.g. AVOID "/tmp".
+
* Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the '''«a6»''' with your drive letter, and partition number:
  
::: You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable.  Setting this in the environment does not force --partial to be enabled, but rather it affects where partial files go when --partial  is  specified. For  instance,  instead  of  using  --partial-dir=.rsync-tmp  along  with  --progress,  you  could  set  RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to turn on the use of  the  .rsync-tmp  dirfor  partial  transfers.  The only times that the --partial option does not look for this environment value are (1)when --inplace was specified (since --inplace conflicts with --partial-dir), and (2) when --delay-updates was specified (see below).
+
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
sudo mount /dev/sda6 /mnt
 +
</syntaxhighlight>
 +
</blockquote>
  
::: For  the purposes of the daemon-config’s "refuse options" setting, --partial-dir does not imply --partial.  This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files with a  partial transfer, while still allowing the safer idiom provided by --partial-dir.
 
  
: '''-P :''' same as --partial --progress.
+
* Now bind the directories that grub needs access to to detect other operating systems, like so:
  
: '''--no-inc-recursive :''' Ver comentarios en las opciones '''-r''' y '''-H'''.
+
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
sudo mount --bind /dev /mnt/dev &&
 +
sudo mount --bind /dev/pts /mnt/dev/pts &&
 +
sudo mount --bind /proc /mnt/proc &&
 +
sudo mount --bind /sys /mnt/sys
 +
</syntaxhighlight>
 +
</blockquote>
  
  
Hasta ahora lo único que no he podido solucionar es que cuando muevo un archivo en la Source, la sincronización no entiende que éste ha sido movido y así moverlo también en la destinación (lo cual disminuiría bastante el tiempo de sincronización). Por el contrario, cuando el...
+
* Now we jump into that using chroot:
Al parecer, la solución a este problema se encuentra explicada aquí:
 
https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/
 
  
http://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html
+
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
sudo chroot /mnt
 +
</syntaxhighlight>
 +
</blockquote>
  
http://javier.io/blog/en/2014/08/06/rsync-rename-move.html
 
  
* Me gustaría que le comando imprimiera en pantalla durante la ejecución, los archivos que no fueron sincronizados porque fueron modificados en la destinación (esto por usar la opción -u). Es decir me gustaría saber cuales fueron los archivos modificados en la destinación.
+
* Now install, check, and update grub. This time you only need to add the drive letter (usually a):
  
=====Mis sincronizaciones=====
+
<blockquote>
rsync -azvu --delete-after --progress /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos-dde/
+
<syntaxhighlight lang="bash">
 +
grub-install /dev/sda
 +
grub-install --recheck /dev/sda
 +
update-grub
 +
</syntaxhighlight>
 +
</blockquote>
  
rsync -azvu --delete --progress --exclude '/home/adelo/toshiba_ext/1-mis_archivos/stockage' /home/adelo/1-mis_archivos/ /home/adelo/toshiba_ext/1-mis_archivos/
 
  
==== ====
+
* Now grub is back, all that is left is to exit the chrooted system and unmount everything:
http://askubuntu.com/questions/2596/comparison-of-backup-tools
 
  
http://www.thegeekstuff.com/2012/05/backup-ubuntu-desktop/
+
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
exit &&
 +
sudo umount /mnt/sys &&
 +
sudo umount /mnt/proc &&
 +
sudo umount /mnt/dev/pts &&
 +
sudo umount /mnt/dev &&
 +
sudo umount /mnt
 +
</syntaxhighlight>
 +
</blockquote>
  
deja-dup
 
  
===Nautilus===
+
* Shut down and turn your computer back on, and you will be met with the default Grub2 screen.
  
====Cambiar el icono de una carpeta====
 
https://ubuntulife.wordpress.com/2010/02/10/tip-cambiar-el-icono-de-una-carpeta/
 
  
====Folder color: cambia el color de todas tus carpetas en Ubuntu====
+
<br />
https://hipertextual.com/archivo/2014/04/cambiar-color-carpetas-ubuntu/
+
=====Via Boot-Repair Graphical Tool=====
 +
https://help.ubuntu.com/community/Boot-Repair
  
Folder Color Folder Color es una aplicación muy sencilla que podemos instalar en Ubuntu para cambiar el color de los iconos de las carpetas en Nautilus.
 
  
sudo add-apt-repository ppa:costales/folder-color
+
<br />
sudo apt-get update
+
=====Via GRUB2 Rescue mode=====
sudo apt-get install folder-color
+
GRUB 2 provides a rescue mode which allows the user to attempt to repair GRUB 2 from a special GRUB terminal during boot.
 +
https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode
 +
 
  
===Convert===
+
<br />
====Convinar o unir imágenes====
+
===Grub no detecta alguno de los SO instalados===
http://imagemagick.org/Usage/layers/#append
+
La última vez instalé Red Hat cuando ya se encontraban Ubuntu y Windows instalados en mi disco. Como era de esperarse, Red Hat reinstaló el grub. Sin embargo, al reiniciar la computadora, el menú del grub sólo mostraba Ubuntu y Red Hat, dejando inbootable a Windows. Lo mismo pasó al instalé CentOS cuando ya se encontraban Ubuntu, Red Hat y Windows instalados. El grub que instaló CentOS dejó unbootable a Windows.
  
Horizontal:
+
Esto ya me había pasado en una ocasión anterior y lo había resolvido reinstalando grub2 desde Ubuntu como se muestra en [[Linux#Reinstalling GRUB 2 from a Working System]]
convert seleccion_categoria1.png +append seleccion_categoria2.png +append -background none -append seleccion_categoria.png
 
  
Vertical:
+
Sin embargo, la última vez que formetée la computadora, al tratar de solucionar este problema reinstalando GRUB 2 from Ubuntu, no funcionó, el grub se reinstalaba e incluía a Windows pero esta vez dejaba por fuera a Red Hat.
convert seleccion_categoria1.png seleccion_categoria2.png -background none -append seleccion_categoria.png
 
  
convert  -background none -append .png
+
From my researches, al parecer este problema está relacionado con la configuración de particiones que realicé en Red Hat. En dicha configuración incluí una partición para el '''/boot''' (XFS) y dentro de un LVM, la partición '''/''' y '''swap'''. Entonces, como se ha dicho en otras secciones, es necesario instalar algunos paquetes que adicionan soporte para este tipo de particinoes.
  
==Three ways to hide Files and Directories in Linux==
+
Para solucionar este problema, en Ubuntu: https://askubuntu.com/questions/351002/triple-boot-ubuntu-windows-showing-up-but-not-red-hat
http://www.dailygyan.com/2008/01/3-ways-to-hide-files-and-directories-in.html
+
# Instalé los paquetes de soporte para particiones: [[Linux#LVM and xfs support for Ubuntu]]
 +
# Monté la partición /boot de Red Hat (NO tuve que montar la partición LVM de Red Hat, solo la /boot que es standard (xfs) partition)
 +
# Reinstalé grub2 como se muestra en [[Linux#Reinstalling GRUB 2 from a Working System]]
  
# Make a file named .hidden: We add the name of the file/directory to be hidden into the .hidden file, one name in each line.
+
* Luego de eso, el comando «update-grub» detectó la instalación de Red Hat, y éste fue incluido en el Grub.
# Just rename the file/directory and prefix the name with a ' . ' (a dot). Files starting with a ' . ' are considered to be hidden files by linux.
 
# Rename the file/directory and add a '~' to the end. Linux considers files ending in ~ as backup files and hence hides them. En Ubuntu este método funciona sólo en el administrador de archivos (en nautilus por ejemplo) y con archivos normales, no con directorios.
 
  
==Cambiar la ruta del escritorio, Download, Documents, etc - How to set $HOME/Desktop==
 
http://askubuntu.com/questions/116276/how-to-set-the-desktop-to-home-desktop
 
  
Edit the file ~/.config/user-dirs.dirs
+
<br />
 +
==SSH==
 +
La instalación base de SSH se hace a través de dos paquetes:
 +
openssh-client  permite conectarse a otra computadora
 +
openssh-server  permite que otra computadora se conecte
  
<syntaxhighlight lang="sh">
 
# This file is written by xdg-user-dirs-update
 
# If you want to change or add directories, just edit the line you're
 
# interested in. All local changes will be retained on the next run
 
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
 
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
 
# absolute path. No other format is supported.
 
#
 
 
# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
 
# usados por el sistema
 
# /usr/share/icons/Humanity/places/128/user-desktop.svg
 
# /usr/share/icons/Humanity/places/64/folder-download.svg
 
  
XDG_DESKTOP_DIR="$HOME/1-system/desktop"
+
Hay dos approach para la autentificación al usar SSH:
XDG_DOWNLOAD_DIR="$HOME/1-system/desktop/downloads"
+
* Using the password de la «cuenta linux»
XDG_TEMPLATES_DIR="$HOME/"
+
* SSH Keys
XDG_PUBLICSHARE_DIR="$HOME/"
 
XDG_DOCUMENTS_DIR="$HOME/"
 
XDG_MUSIC_DIR="$HOME/"
 
XDG_PICTURES_DIR="$HOME/"
 
XDG_VIDEOS_DIR="$HOME/"
 
</syntaxhighlight>
 
  
==Recording scren - Screencast==
+
When using a password, ssh pedirá el password de la «cuenta linux» a la que nos estemos conectando al momento de realizar la conexión.
Hacer un video de la pantalla.
 
  
En esta página se muestran varias opciones. Byzanz permite hacer gif:
 
https://wiki.ubuntu.com/CreatingScreencasts
 
  
sudo add-apt-repository ppa:fossfreedom/byzanz
+
<br />
sudo apt-get update && sudo apt-get install byzanz
+
===SSH Keys===
 +
https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2
  
Para hacer un video .avi podemos usar:
+
Al usar este método, debemos crear un par de keys: a public and a private key (SSH puede comprobar cuando estas dos keys (public and private) match. La «private key» estará siempre en la computadora a la cual corresponda (donde fue creada) y la «public key» será copiada en las computadoras a las que nos queremos conectar. De esta forma, al momento de realizar la conección, SSH verifica si la «public key» de la computadora que trata de acceder a la otra, se encuentra el la computadora a la cual se quiere acceder. Esta verificación se hace verificando que la «private key» corresponda con algunas de las «public key» que se encuentran en la computadora a la cual se quiere acceder.
avconv -f alsa -i pulse -f x11grab -r 10 -s 1024x800 -i :0.0 -vcodec wmv1 -acodec pcm_s16le -q 7 b4.avi
 
Si queremos desactivar el audio agregamos la opción: -an
 
  
==Gnome==
+
A través de este método no es necesario que SSH solicite un password al momento de realizar la conexión. SSH keys provide a more secure way of logging into a server with SSH than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone.
===How to Move the Unity Desktop’s Launcher===
 
https://www.howtogeek.com/251616/how-to-move-the-unity-desktops-launcher-to-the-bottom-of-your-screen-on-ubuntu-16.04/
 
Para cambiar la posición de la sidebar donde se encuentran los programas en el escritorio por defecto de Ubuntu:
 
  
How to Move the Unity Desktop’s Launcher to the Bottom of Your Screen on Ubuntu 16.04:
 
gsettings set com.canonical.Unity.Launcher launcher-position Bottom
 
gsettings set com.canonical.Unity.Launcher launcher-position Left
 
  
==Redimensionar imagen - PDF==
+
<br />
[redimensionar / resize | comprimir / compress]
+
====Create the RSA Key Pair====
 +
The first step is to create the key pair on the client machine:
 +
ssh-keygen -t rsa
 +
This generates an RSA key pair. RSA (Rivest-Shamir-Adleman) is a widely used asymmetric encryption algorithm. When you use -t rsa, ssh-keygen will create an RSA key pair with a default key length of 2048 bits unless specified otherwise.
  
sudo apt-get install imagemagick
 
  
Si queremos por ejemplo reducir todas las imágenes en un 50% ejecutamos:
+
ssh-keygen -t ed25519 -b 4096
  mogrify -resize 50% *.jpg
+
This generates an Ed25519 key pair, a newer and more modern cryptographic algorithm. Ed25519 is an elliptic curve algorithm that offers high security with relatively smaller key sizes. By using -t ed25519, ssh-keygen will create an Ed25519 key pair, and the -b 4096 option sets the key length to 4096 bits.
 +
 
 +
 
 +
ssh-keygen -t rsa -C "adeloaleman@gmail.com"
 +
By default, creo que la key sera asociada al hostname, lo que ya es muy adecuado para identificar la key
 +
 
 +
 
 +
Once you have entered the Gen Key command, you will get a few more questions:
 +
Enter file in which to save the key (/home/adelo/.ssh/id_rsa):
 +
 
 +
Enter passphrase (empty for no passphrase):
 +
 
 +
It's up to you whether you want to use a passphrase. Entering a passphrase does have its benefits: the security of a key, no matter how encrypted, still depends on the fact that it is not visible to anyone else. Should a passphrase-protected private key fall into an unauthorized users possession, they will be unable to log in to its associated accounts until they figure out the passphrase, buying the hacked user some extra time. The only downside, of course, to having a passphrase, is then having to type it in each time you use the key pair.
 +
 
 +
Luego de ejecutar el comando ssh-keygen, the private and public keys will be located in:
 +
/home/demo/.ssh/id_rsa
 +
/home/demo/.ssh/id_rsa.pub
 +
 
 +
 
 +
Una «public key» es algo así:
 +
ssh-rsa
 +
AAAAB3NzaC1yc2EAAAADAQABAAABAQC7eJzkbD+DdE9X8qk/GRD7dhYF8KVTpjNzRg5qCU5NkpeBiIKMZh8UTY41DWKPGTxh0KhMGYQ+
 +
LKxMluQGGrOKJE1uEcgnyI2ljbCDZEbpJWvVVngctmJfrm8gubt1djMPRZkwXJK8OaOHsX4UYbrxAW2R3u4gkez13uB0EJAF6l/SifYZz
 +
ZbdySKoOWoXrtDsuNtQ1OxSMOsdc1PPmQh2lHNtdUiHkEA/PBiwo9lRBFjeVzBsc7EEMITOK1VGDKTtAoOkxJnvpXbm6FjOuTME3j2cEX
 +
lWWcyeX9jtkrRDVcDge8G+HpY+5Le4gQBrNYRIVh9ohs72+dOU8n+6CV  adeloaleman@gmail.com
 +
 
 +
 
 +
note que la key está asociada al email «adeloaleman@gmail.com» ya que fue creada a través de:
 +
ssh-keygen -t rsa -C "adeloaleman@gmail.com"
 +
 
 +
Si ejecutamos el comando sin palabra asociada:
 +
  ssh-keygen -t rsa -C
 +
 
 +
la «public key» será asociada a: user@computerName. En mi caso «adelo@adelo-laptop»
 +
 
 +
 
 +
<br />
  
Si queremos darle un tamaño determinado:
+
====Copy the Public Key en la computadora a la cual nos vamos a conectar====
mogrify -resize 1024x768 imagen.jpg
+
Once the key pair is generated, it's time to place the public key on the server that we want to use.
  
===Comprimir un PDF===
+
La «public key» se debe copiar into the «authorized_keys» file de la computadora a la cual nos vamos a conectar:
Paso 1: Trasformar pdf a ps
+
  ~/.ssh/authorized_keys
  pdf2ps Original.pdf Medio.ps
 
  
Paso 2: Trasformar ps a pdf
+
You can copy the public key into the «authorized_keys» file with the ssh-copy-id command:
  ps2pdf Medio.ps Salida.pdf
+
  ssh-copy-id -i ~/.ssh/my_key.pub demo@198.51.100.0
 +
ssh-copy-id demo@198.51.100.0
  
==Cortar pdf==
+
Se debe notar que para poder ejecutar el comando anterior debemos ser capaces de autentificar la conexión (ssh trafic hacia la computadora a la cual nos queremos conectar). Lo anterior es más que lógico porque si no fuera así, seríamos entonces capaces de copiar nuestra «public key» en cualquier computadora y conectarnos luego a ella; lo cual no tiene sentido. Por tanto, cuando ejecutemos el comando anterior, SSH debe solicitar el password de la cuenta@computadora a la que nos estemos conectando. Luego de que la «public key» sea copiada en la computadora a la cual vamos a acceder, podremos realizar la conección «ssh adelo@159.20.10.1» sin necesidad de ingresar el password de la cuenta@computadora.
https://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files
 
  
  pdfcrop --margins '0 0 0 0' input.pdf output.pdf
+
Generalmente la opción de «solicitar el password de la cuenta@computadora» está activada en uno de los archivos de configuraciones de SSH:
 +
  /etc/ssh/sshd_config
 +
    PasswordAuthentication yes
  
Con 0 0 0 0 debería cortar la imagen a margen cero. También se pueden usar valores negativos
+
'''«PasswordAuthentication yes»''' permite que SSH solicite el password de la cuenta@computadora al momento de realizar la conexión.
  
pdfcrop --margins '-5 -5 -5 -5' input.pdf output.pdf
+
'''«PasswordAuthentication no»''' impide que la autentificación se realice a través del password de la cuenta@computadora. Así, la utentificación debe ajuro realizarse con SSH Keys.
  
  
El siguiente script toma un archivo pdf con varias páginas, extrae cada página en un archivo separado y recorta cada página a márgenes cero:
+
<span style="background:DarkKhaki">Por tanto, si intentamos compiar nuestra «public key» a través de «ssh-copy-id demo@198.51.100.0» en una computadora que impide la autentificación a través del password de la cuenta@computadora ('''«PasswordAuthentication no»''') la autentificación no podrá realizarse y no podremos por tanto copiar la «public key» en la computadora destino.</span> <span style="color:#FFF;background:#FF0000">Éste es el caso de VM Instance creadas en la Google Cloud Platform.</span> <span style="background:DarkKhaki">Entonces, para ser capaces de estableser la conexión con SSH, debemos primero conectarnos a la computadora destino (con algún otro método pues con SSH no hemos todavía sido capaces de autentificar y estableser la conexion) y:</span> https://www.digitalocean.com/community/questions/ssh-copy-id-not-working-permission-denied-publickey
 +
 
 +
Edit ssh config:
 +
sudo nano /etc/ssh/sshd_config
 +
 
 +
Change this line:
 +
«PasswordAuthentication no»  to  «PasswordAuthentication yes»
 +
 
 +
Restart daemon:
 +
sudo systemctl restart sshd
 +
 
 +
 
 +
<br />
 +
 
 +
===SSH timeout due to inactivity===
 +
http://cdb.systems/blog-in-neque-arcu-vulputate/214-amazon-ec2-ssh-timeout-due-inactivity.html
 +
 
 +
'''1 way: you local computer:''' Esta es la solución que he implementado y funciona perfectametne. Es general para todas las instance a las que te conectes.
 +
 
 +
You can set a keep alive option in your ~/.ssh/config file on your computer's home dir:
 +
 
 +
ServerAliveInterval 50
 +
 
 +
Amazon AWS usually drops your connection after only 60 seconds of inactivity, so this option will ping the server every 50 seconds and keep you connected indefinitely.
 +
 
 +
 
 +
'''2 way: your instance settings:'''
 +
 
 +
http://cdb.systems/blog-in-neque-arcu-vulputate/214-amazon-ec2-ssh-timeout-due-inactivity.html
 +
 
 +
 
 +
<br />
 +
===SSH troubleshooting===
 +
If you have copied your keys to your host:
 +
~/.ssh/adelo_ssh 
 +
~/.ssh/adelo_ssh.pub
 +
 
 +
and the content of «~/.ssh/adelo_ssh.pub» is in the «~/.ssh/authorized_keys» file on your remote server,
 +
 
 +
but the SSH connection is still NOT working, you might want to try the following on your host server:
 +
 
 +
vi ~/.ssh/config
 +
Host sinfronteras.ws
 +
    User root
 +
    IdentityFile ~/.ssh/adelo_ssh
 +
 
 +
If the above doesn't work, you can also try this:
 +
eval $(ssh-agent -s)
 +
ssh-add ~/.ssh/adelo_ssh
 +
 
 +
 
 +
<br />
 +
 
 +
==Mount discs==
 +
 
 +
<br />
 +
===Mounting windows partition===
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo mount /dev/nvme0n1p3 /home/adelo/1-system/4-windows/
 +
sudo umount /dev/nvme0n1p3
 +
</syntaxhighlight>
 +
 
 +
 
 +
<br />
 +
'''BitLocker:'''
 +
 
 +
Nuevas particiones windows vienen con una encryption option called BitLocker
 +
 
 +
 
 +
Es posible que la clave se encuentre en:
 +
* https://account.microsoft.com/devices/recoverykey
 +
 
 +
 
 +
Sino encontramos la clave, para desactivarla se pueden seguir estas indicaciones:
 +
* http://users.isr.ist.utl.pt/~mbayat/hacks/how-to-remove-bitlocker-encryption-in-windows-10/
 +
* https://www.youtube.com/watch?v=lY0Iz0NpAoU
 +
 
 +
 
 +
If bitlocker: https://itsfoss.com/mount-encrypted-windows-partition-linux/
 +
<syntaxhighlight lang="bash">
 +
sudo apt install dislocker
 +
sudo mkdir /mnt/bitlocker
 +
sudo dislocker  /dev/nvme0n1p3 -p238051-178***********************66-465377 -- /mnt/bitlocker
 +
sudo mount -t ntfs-3g -o loop /mnt/bitlocker/dislocker-file /home/adelo/1-system/4-windows
 +
</syntaxhighlight>
 +
 
 +
 
 +
You can unmount the mounted partition from the file manager. Just click the unmount symbol beside the partition named windows-mount.
 +
Otherwise, unmount command is always there for you:
 +
<syntaxhighlight lang="bash">
 +
sudo umount /mnt/bitlocker
 +
sudo umount /home/adelo/1-system/4-windows
 +
</syntaxhighlight>
 +
 
 +
 
 +
<br />
 +
===Montar discos permanentemente===
 +
http://doc.ubuntu-fr.org/mount_fstab
 +
 
 +
Para montar permanentemente mi disco_local y mi disco_ext, tuve que agregar las siguientes líneas en el archivo /etc/fstab
 +
 
 +
<syntaxhighlight lang="bash">
 +
# Disco_local:
 +
# Actualmente *(Ver notas abajo)
 +
UUID=2368f4a6-993f-4cfa-8ed4-de39f3b35c7c  /home/adelo/1-system/1-disco_local  ext4  defaults                    0  0
 +
# Configuracion en mi previa computadora:
 +
# UUID=0B8D61386C315368                    /home/adelo/1-system/1-disco_local  ntfs  auto,users,exec,permissions  0  0
 +
 
 +
# Disco externo - TOSHIBA EXT:
 +
UUID=3C9A5D379A5CEF40                      /home/adelo/1-system/2-disco_ext    ntfs  auto,nofail,users,permissions  0  0
 +
</syntaxhighlight>
 +
 
 +
<span style="color:#FF0000">*La configuración que tenía en mi previa computadora no funcionó; se generaba un error al momento del booting. De hecho, la primera vez que intenté montar el disco a través de la configuración del antigua, se generaron errores que no pude solucionar al cambiar las opciones a «defaults». Cuando intentaba montar la partición con «mount /dev/nvme0n1p5 /home/adelo/1-system/», y se generaba el error «Structure Needs Cleaning». No pude solucionar esos problemas y lo que hice fue volver a formatear la partición; luego de eso fui capaz de montarla normalmente con un «mount ..» y a través de «defaults» en el fstab. El único detalle fue que luego de montar la partición con «defaults» tuve que hacer un «chown adelo:adelo 1-disco_local».</span>
 +
 
 +
 
 +
<br />
 +
====chmod y chown en particiones ntfs====
 +
Al iniciar la recherche sobre la permisología (chmod) en particiones ntfs, encontré muchos foros en los que se afirmaba que no se podían cambiar los permisos en particiones ntfs. Se planteaba como única solución, la asignación de los permisos deseados al punto de montaje de la partición; lo cual hacía que todos los archivos dentro de la partición tuvieran los mismos permisos que fueron asignados al punto de montaje. A continuación muestro algunas de las páginas en donde encontré dicha información:
 +
 
 +
* https://forum.ubuntu-fr.org/viewtopic.php?id=370751
 +
: Tu ne peux pas changer les droits sur les fichiers d'une partition NTFS pour la bonne raison qu'ils ne sont pas gérés commes sous UNIX. En revanche tu peux changer les droits ou attribuer la propriété sur toute la partition. Pour cela il te suffit de changer les options de montage, soit en option de mount soit directement dans le fstab. Pour plus d'infos sur la procédure voir la documentation [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
 +
 
 +
* http://ubuntuforums.org/showthread.php?t=1446788
 +
 
 +
 
 +
Sin embargo, al final encontré que actualmente sí existe una solución para modificar la permisología de archivos en particiones ntfs.
 +
 
 +
En los siguientes posts, aunque al inicio de la conversación se decía que no era posible por las mismas razones antes explicadas, al final se encuentra una solución para poder cambiar los permisos en particiones ntfs:
 +
* http://askubuntu.com/questions/342791/file-permissions-wont-change/343154#343154
 +
* http://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition/91054#91054
 +
 
 +
Lo único que tuve que hacer fue adicionar la siguiente línea al archivo /etc/fstab:
 +
 
 +
Para particiones internas:
 +
<pre>
 +
# <file system>          <mount point>                <type>    <options>                          <dump>  <pass>
 +
UUID=0B8D61386C315368    /home/adelo/1-mis_archivos    ntfs      auto,users,exec,permissions        0      0
 +
</pre>
 +
 
 +
 
 +
<br />
 +
=====Para discos externos=====
 +
http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
 +
 
 +
https://wiki.archlinux.org/index.php/Fstab#External_devices
 +
 
 +
En disco duros externos debemos utilizar la opción <nofail>. Esto porque cuando el disco no está conectado al iniciar la computadora (boot), el sistema buscará la partición (si no se usa <nofail>), al no encontrarla generará un error y el sitema no iniciará correctamente. Con <nofail> el sistema monta la partición durante el boot si el disco se encuentra conectado, y omite este proceso cuando el disco no está conectado. En este caso, el disco será montado luego de conectarlo mientras la computadora está funcionando.
 +
 
 +
The only inconvenience with <nofail> is that if you connect the device while the system is running, depending on configuration (too many variables to test), the device may not mount immediately. This can be remedied with a simple mount -a or mount /specific_device or a reboot. http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in
 +
 
 +
En mi caso, aunque no lo monta inmediatamente, el ínoco de la unidad es desplegado en el Launcher, y haciendo clic en él, el disco se monta normalmente. A través de "sudo mount -a" también se monta correctamente; pero cuando queramos desmontarlo habrá que hacerlo como root porque fue montado como root.
 +
 
 +
<pre>
 +
UUID=3C9A5D379A5CEF40    /home/adelo/toshiba_ext      ntfs      auto,nofail,users,exec,permissions 0      0
 +
</pre>
 +
 
 +
Para saber el '''UUID''' de la partición: sudo blkid
 +
 
 +
'''auto:''' will automatically mount the partition when you boot.
 +
 
 +
'''users:''' allows users to mount and umount.
 +
 
 +
'''exec:''' permite ejecutar archivos. Esta opción se debe colocar luego de la opción <users>. Si no se usa esta opción, podremos modificar los derechos y pertenencias de los archivos. Sin embargo, aún dándole permisos de ejecución a un archivo, éste no podrá ser ejecutado. Ver http://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition
 +
 
 +
'''nofail:''' external devices that are to be mounted when present but ignored if absent. https://wiki.archlinux.org/index.php/Fstab#External_devices
 +
 
 +
'''permissions:''' es justamente la opción que permite la modificación de los permisos y pertenencia de los archivos.
 +
 
 +
'''dump''' est utilisé pour les sauvegardes. (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
 +
 
 +
'''pass''' pour l'ordre de vérification au démarrage: (Ver [http://doc.ubuntu-fr.org/mount_fstab mount_fstab])
 +
* 1 pour la racine
 +
* 2 pour les autres partitions Linux
 +
* 0 pour le swap et les partitions windows: Une valeur de <pass> à 0 signifie qu'il n'y aura pas de vérification au démarrage (Déconseillé dans la plupart des cas).
 +
 
 +
Otras opciones y una explicación más detallada del uso del archivo etc/fstab se encuentra en [http://doc.ubuntu-fr.org/mount_fstab mount_fstab]
 +
 
 +
No hay ni siquiera que crear antes el directorio /home/adelo/1-mis_archivos. Éste se creará y la partición será montada automáticamente luego de reiniciar la computadora; y podremos modificar la permisología (chmod) de la pertenencia (chown) de los archivos que se encuentre en tal partición ntfs.
 +
 
 +
Ahora bien, para modificar la pertenencia y los derechos de la partición y de todos los archivos que se encuentran en ella:
 +
 
 +
chown -R adelo:adelo /home/adelo/1-mis_archivos
 +
 
 +
Para modificar los permisos de todos los archivos en la partición ver [[Linux#A través del comando find|aquí]]
 +
 
 +
 
 +
En el siguiente post también se encuentra una vía similar (haciendo uso de otras opciones en el archivo /etc/fstab) para poder cambiar los permisos en particiones ntfs. Sin embargo este método no lo he corroborado:
 +
* http://www.lunaticgeek.com/2011/08/como-conseguir-permisos-en-particiones.html
 +
 
 +
 
 +
<br />
 +
===Mount a remote filesystem in your local machine===
 +
Conozco dos formas:
 +
* Using the SSH File Transfer Protocol: Método seguro ya que la transferencia se realiza encriptada
 +
* Using the Network File System protocol: Los datos no se encriptan, lo que supone problemas de seguridad. La transferencia es más rápida, sin embargo. https://superuser.com/questions/344255/faster-way-to-mount-a-remote-file-system-than-sshfs
 +
 
 +
 
 +
<br />
 +
====Using the SSH File Transfer Protocol====
 +
https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh
 +
 
 +
Debemos instalar el paquete sshfs:
 +
sudo apt-get install sshfs
 +
 
 +
Luego, para montar el remote filesystem:
 +
sshfs root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
 +
 
 +
Ahora, de la forma anterior, se presenta un problema cuando se pierde la conexión por instantes. Se presentan los problemas explicados en estos forums:
 +
 
 +
https://serverfault.com/questions/306796/sshfs-problem-when-losing-connection:
 +
sshfs problem when losing connection: «When I lost the connection the shell become frozen, if I open another shell and I try to access to the mounting point also this new shell froze»
 +
 
 +
https://askubuntu.com/questions/358906/sshfs-messes-up-everything-if-i-lose-connection:
 +
SSHFS messes up everything if i lose connection: «When I say everything is messe up i mean: My console stops working if i do something as simple as 'ls'. I can't unmount either through the console or the File Browser. Consequently, i can't mount it again, therefore i can't work.
 +
 
 +
Como se sugiere en los dos forums anteriores, la solución es utilizar la opción '''«reconnect»''' del comando sshfs. El siguiente forum explica bien como utilizar esta opción: https://askubuntu.com/questions/716612/sshfs-auto-reconnect
 +
 
 +
Por tanto, debemos usar el comando sshfs de la siguiente forma:
 +
<syntaxhighlight lang="bash">
 +
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud
 +
 
 +
sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 visitor@sinfronteras.ws:/root/1-system-cloud/2-mis_archivos_cloud/remote_projects /home/adelo/1-system/3-cloud
 +
</syntaxhighlight>
 +
 
 +
The ServerAliveInterval=15 option asked sshfs to check if the server is alive every 15 seconds. ServerAliveCountMax=3 allows the server to not respond for up to three alive checks. The result is that if the server is unavailable for 1 minute, sshfs will reconnect to the server.
 +
 
 +
 
 +
<br />
 +
====Using the Network File System protocol NFS====
 +
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04
 +
 
 +
En este link se encuentra la página de Google Cloud que explica como Mounting Fileshares on Compute Engine Clients a través de NFS: https://cloud.google.com/filestore/docs/mounting-fileshares
 +
 
 +
Como ya mencionamos, NFS no encripta los datos, lo cual supone problemas de seguridad, pero por la misma razón es más rápido que SSH: https://superuser.com/questions/344255/faster-way-to-mount-a-remote-file-system-than-sshfs
 +
 
 +
<span style="background:DarkKhaki">No he podido montar un remote filesystem con NFS entre dististas networks (a través the Internet). Al parecer, por las razones de seguridad que ya hemos explicado, NFS mount se usa dentro de la misma Network; debería, sin embargo, ser posible establecer la conexión entre distintas Networs, pero no he podido hacerlo.</span>
 +
 
 +
<span style="background:DarkKhaki">De la única forma que he logrado montar un remote filesystem con NFS fue entre dos Google Cloud VM Instances creadas en el mismo proyecto (se encuentran la misma direct Network). Para hacerlo tuve que usar los Internal IP's. Con los External IP's no pude realizar la conexión. Cuando traté de realizar la conexión con los External IP's, al ejecutar el «mount» se generaba el error «NFS mount timeout» luego de varios minutos.</span> A continuación muestro algunos links que utilicé para trata de solventar este error:
 +
https://serverfault.com/questions/894881/mounting-nfs-server-running-in-vm-connection-timed-out
 +
https://access.redhat.com/solutions/1751813
 +
 
 +
 
 +
https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04:
 +
 
 +
<span style="background:#D8BFD8">'''Instalación:'''</span>
 +
<blockquote>
 +
 
 +
On the Host:
 +
<syntaxhighlight lang="bash">
 +
sudo apt install nfs-kernel-server
 +
</syntaxhighlight>
 +
 
 +
On the Client:
 +
<syntaxhighlight lang="bash">
 +
udo apt install nfs-common
 +
</syntaxhighlight>
 +
 
 +
</blockquote>
 +
 
 +
 
 +
<span style="background:#D8BFD8">'''Creating the Share Directories on the Host:'''</span>
 +
<blockquote>
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo mkdir /var/nfs/general -p
 +
</syntaxhighlight>
 +
 
 +
Since we’re creating it with sudo, the directory is owned by the root user on the host.
 +
NFS will translate any root operations on the client to the nobody:nogroup credentials as a security measure. Therefore, we need to change the directory ownership to match those credentials:
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo chown nobody:nogroup /var/nfs/general
 +
</syntaxhighlight>
 +
 
 +
</blockquote>
 +
 
 +
 
 +
<span style="background:#D8BFD8">'''Configuring the NFS Exports on the Host Server:'''</span>
 +
<blockquote>
 +
 
 +
Next, we’ll dive into the NFS configuration file to set up the sharing of these resources.
 +
 
 +
Open the /etc/exports file in your text editor with root privileges:
 +
 
 +
/etc/exports:
 +
<syntaxhighlight lang="bash">
 +
directory_to_share    client(share_option1,...,share_optionN)
 +
</syntaxhighlight>
 +
 
 +
We’ll need to create a line for each of the directories that we plan to share. Since our example client has an IP of 203.0.113.24, our lines will look like the following. Be sure to change the IP address shown here to that of your client:
 +
 
 +
/etc/exports:
 +
<syntaxhighlight lang="bash">
 +
/var/nfs/general    203.0.113.24(rw,sync,no_subtree_check)
 +
/home              203.0.113.24(rw,sync,no_root_squash,no_subtree_check)
 +
</syntaxhighlight>
 +
 
 +
When you are finished making your changes, save and close the file. Then, to make the shares available to the clients that you configured, restart the NFS server with the following command:
 +
 
 +
<syntaxhighlight lang="bash">
 +
sudo systemctl restart nfs-kernel-server
 +
</syntaxhighlight>
 +
 
 +
<span style="color:#FFF;background:#FF0000">También es necesario:</span> https://unix.stackexchange.com/questions/106122/mount-nfs-access-denied-by-server-while-mounting-on-ubuntu-machines
 +
<syntaxhighlight lang="bash">
 +
sudo exportfs -a
 +
</syntaxhighlight>
 +
Sin «exportfs -a» he encontrado el error: «mount.nfs: access denied by server while mounting on Ubuntu machines»
 +
 
 +
</blockquote>
 +
 
 +
 
 +
<span style="background:#D8BFD8">'''Adjusting the Firewall on the Host:'''</span>
 +
<blockquote>
 +
 
 +
Si hemos ajustado reglas en el firewall, puede también ser necesario realizar las configuraciones necesarias para permitir el tráfico NFS. Ver https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04
 +
 
 +
</blockquote>
 +
 
 +
 
 +
<span style="background:#D8BFD8">'''Creating Mount Points and Mounting Directories on the Client:'''</span>
 +
<blockquote>
 +
 
 +
Now that the host server is configured and serving its shares, we'll prepare our client.
 +
 
 +
We'll create a directories for our mount:
 +
<syntaxhighlight lang="java">
 +
sudo mkdir -p /nfs/general
 +
</syntaxhighlight>
 +
 
 +
Finally, to mount the remote filesystem:
 +
<syntaxhighlight lang="java">
 +
sudo mount 203.0.113.0:/var/nfs/general /nfs/general
 +
</syntaxhighlight>
 +
 
 +
</blockquote>
 +
 
 +
 
 +
<br />
 +
====Mount a remote filesystem in Windows 10====
 +
https://stackoverflow.com/questions/443732/how-do-i-mount-a-remote-linux-folder-in-windows-through-ssh
 +
 
 +
https://www.nsoftware.com/sftp/netdrive/
 +
 
 +
 
 +
<br />
 +
===Mount an URL===
 +
Montar, por ejemplo: http://www.es.sinfronteras.ws
 +
 
 +
https://blog.amarkulo.com/mount-web-dav-folder/
 +
 
 +
https://github.com/maxogden/mount-url
 +
 
 +
https://superuser.com/questions/181351/can-i-use-fstab-to-mount-http-shares
 +
 
 +
 
 +
<br />
 +
===Mount LVK partitions===
 +
https://askubuntu.com/questions/766048/mount-unknown-filesystem-type-lvm2-member
 +
 
 +
 
 +
<br />
 +
 
 +
==MEGAsync==
 +
https://mega.nz
 +
 
 +
 
 +
'''Desktop app installation:''' https://mega.io/desktop#download
 +
 
 +
 
 +
'''File ignores''': Ver [[Linux#.megaignore]]
 +
 
 +
 
 +
'''Hay excelente medidas de seguridad para no perde la data por errores:'''
 +
 
 +
* Cuando un directory está synced:
 +
:* Si se borra algo en https://mega.nz, el archivo se guarda en <code>https://mega.nz/Rubbish_bin</code> y en <code>local_dir/.debris</code>
 +
:* Si se borra algo en el <code>local_dir</code>, el archivo se guarda, por supuesto, en la <code>local_trash</code> y en <code>https://mega.nz/Rubbish_bin/SyncDebris</code>
 +
 
 +
 
 +
<br />
 +
 
 +
==Google Drive sync==
 +
<span style="color:green">'''IMPORTANTE!!''' Falta documentar este proceso...</span>
 +
 
 +
 
 +
<span style="color:red">'''IMPORTANTE!!''' Ver cual es el proceso a llevar a cabo cuando algún archivo es no tomado en cuenta por la sync. Podemos hacerlo con el archivo '''/home/adelo/desktop/atm/IDG/inventario.txt''' que está faltando en la 2da laptop.</span>
 +
 
 +
 
 +
 
 +
<br />
 +
Google Drive for desktop offers two-way sync by what they call Computers syncing. Google Drive  for desktop works on Window and macOS but not in Linux :(
 +
 
 +
https://drive.google.com/drive/computers
 +
 
 +
https://support.google.com/drive/answer/10838124?visit_id=638293670466682722-426317989&p=empty_state_computers_web&rd=1
 +
 
 +
 
 +
'''On Ubuntu''':
 +
<blockquote>
 +
I haven't found something that support two-way sync on linux. There are services like '''rclone''' that offers one way sync (Destination is updated to match source : https://rclone.org/commands/rclone_sync/).
 +
 
 +
 
 +
This paid service apparently offers 2-way sync in Linux, but I wasn't able to make it work: https://www.goodsync.com/
 +
 
 +
 
 +
The way I've found so far to implement two-way sync is as follows:
 +
 
 +
 
 +
* '''Mount Google Drive using''' https://rclone.org/  https://blog.galt.me/how-to-mount-gdrive-in-nextcloud/
 +
: Google Drive can also be mounted using https://linuxconfig.org/sync-google-drive-on-ubuntu-20-04-focal-fossa-gnome-desktop. However, the path where Google Drive is mounted is google-drive://adeloaleman@gmail.com/ , and I found it hard to access the mounted partition as a normal directory.
 +
 
 +
 
 +
:<syntaxhighlight lang="bash">
 +
rclone config
 +
rclone mount remote_name: ~/google-drive  # remote_name (gdrive in our case) is create it during «rclone config»
 +
</syntaxhighlight>
 +
: Above process won't keep the drive mounted. To keep your Google Drive always mounted with Rclone, you can set it up as a systemd service on your Linux system:
 +
 
 +
 
 +
* '''Use unison to sync Google Drive with the folder you want''':
 +
 
 +
</blockquote>
 +
 
 +
 
 +
'''On Windows:
 +
<blockquote>
 +
 
 +
As mentioned, there is Google Drive for desktops for Windows and Mac that allows two-way sync. It must be installed from https://support.google.com/drive/answer/10838124?visit_id=638460278672489341-2663509460&p=empty_state_computers_web&rd=1
 +
 
 +
However, because I'm not really using Windows, I'm not going to implement any complex two-way sync in Windows:
 +
 
 +
* So, on Google Drive for desktop, I haven't chosen any folders to sync from my computer to Google Drive.
 +
 
 +
* The only thing I'm gonna do is to mount Google Drive on Windows (This is automatically done when installing Google Drive for desktop).
 +
 
 +
* Then, I'm creating a link to '''Google Drive > desk-w''' on the Windows Desktop.
 +
 
 +
* Everything done on Windows that we need to keep must be saved on '''Google Drive > desk-w'''; that's it!
 +
 
 +
</blockquote>
 +
 
 +
<br />
 +
 
 +
==Chown==
 +
chown command changes the user and/or group ownership of for given file. The syntax is:
 +
 
 +
chown owner-user file
 +
chown options owner-user:owner-group file
 +
 
 +
chown adelo:adelo prueba.txt
 +
chown -R adelo:adelo directorio
 +
 
 +
 +
<br />
 +
 
 +
==Chmod==
 +
https://doc.ubuntu-fr.org/permissions
 +
 
 +
 
 +
<br />
 +
===En gerant chaque droit separement===
 +
À qui s'applique le changement:
 +
* u (user, utilisateur) représente la catégorie "propriétaire" ;
 +
* g (group, groupe) représente la catégorie "groupe propriétaire" ;
 +
* o (others, autres) représente la catégorie "reste du monde" ;
 +
* a (all, tous) représente l'ensemble des trois catégories.
 +
   
 +
La modification que l'on veut faire:
 +
* + : ajouter
 +
* - : supprimer
 +
* = : affectation
 +
 
 +
Le droit que l'on veut modifier
 +
* r : read ⇒ lecture
 +
* w : write ⇒ écriture
 +
* x : execute ⇒ exécution
 +
* X : eXecute ⇒ exécution, concerne uniquement les répertoires (qu'ils aient déjà une autorisation d'exécution ou pas) et les fichiers qui ont déjà une autorisation d'exécution pour l'une des catégories d'utilisateurs. Nous allons voir [[Linux#Exemple d'application en traitant de façon différentiée les répertoires et les fichiers (récursivement)|plus bas]] dans la partie des traitements récursifs l'intérêt du X.
 +
 
 +
chmod <options> u+rwx,g+rx-w,o+r-wx fichier3
 +
chmod <options> ug+rw fichier3
 +
chmod <options> a-rx fichier3
 +
chmod -R a-rX directorio
 +
 
 +
 +
<br />
 +
===En octal===
 +
* r = 4
 +
* w = 2
 +
* x = 1
 +
* - = 0
 +
 
 +
Par exemple:
 +
* Pour rwx, on aura : 4+2+1 = 7
 +
* Pour rw-, on aura : 4+2+0 = 6
 +
* Pour r--, on aura : 4+0+0 = 4
 +
 
 +
  rwx        r-x        ---
 +
7(4+2+1)  5(4+0+1)  0(0+0+0)
 +
 
 +
 +
<br />
 +
===Ajustar permisología recursivamente===
 +
chmod -R 750 Documents
 +
 
 +
 
 +
 
 +
<br />
 +
==File immutable==
 +
An immutable file cannot be modified, deleted, or renamed, and no links can be created to this file. This is often used to protect critical system files or configuration files from accidental changes.
 +
 
 +
 
 +
sudo chattr +i filename
 +
 
 +
 
 +
'''To verify if the file has been made immutable, you can use the lsattr command:'''
 +
lsattr filename
 +
 
 +
This should display something like:
 +
----i-------- filename
 +
The i in the attribute list indicates that the file is immutable.
 +
 
 +
 
 +
'''Removing the immutable Attribute:'''
 +
sudo chattr -i filename
 +
 
 +
 
 +
<br />
 +
 
 +
==Hard and symbolic (soft) links==
 +
http://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link
 +
 
 +
Underneath the file system files are represented by inodes (or is it multiple inodes not sure)
 +
 
 +
A file in the file system is basically a link to an inode.
 +
A hard link then just creates another file with a link to the same underlying inode.
 +
 
 +
When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.
 +
 
 +
A symbolic link is a link to another name in the file system. The soft link points to the name of a file, and not to the contents.
 +
 
 +
Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.
 +
 
 +
Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.
 +
 
 +
 
 +
'''Let's create hard and soft links:'''
 +
 
 +
Al crear links es apropiado colocar las rutas absolutas de la fuente y la destinación:
 +
ln blah1 blah1-hard  (hard link not allowed for directory)
 +
 
 +
ln -s blah2 blah2-soft
 +
 
 +
Si blah2 es renombrado, the contents of the file blah2-soft could not be found because the soft link points to the name of the other file (that was changed) and not to the contents.
 +
 
 +
If blah1 is deleted, blah1-hard still holds the contents.
 +
 
 +
If blah2 is deleted, blah2-soft is just a link to a non-existing file.
 +
 
 +
 
 +
<br />
 +
===What's the difference between a hard link and a copy?===
 +
https://bbs.archlinux.org/viewtopic.php?id=53484
 +
 
 +
Hay que internalizar que si se edita un archivo hardlink (siendo éste otro nombre para un mismo archivo) el cambio será reflejado en el archivo original (pues en realidad es el mismo archivo).
 +
 
 +
Si se hace una copia de un hard link, la copia no será un hard link sino un archivo normal. Es decir, es idéntico hacer una copia del archivo original o del hard link.
 +
 
 +
No se puede crear un hard link entre dos particiones; sólo soft links son posibles en este caso.
 +
 
 +
Aunque no se pude hacer un hardlink de un directorio, a través de la orden "cp -rlp", el comand cp copia todo el arbol de directorios y crea hardlinks de todos los archivos en el directorio:
 +
cp -rlp : copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)
 +
 
 +
Si se quieren preservar los softlinks debemos entonces usar también la opción -d
 +
  cp -rlpd
 +
 
 +
 
 +
<br />
 +
==Buscar una cadena de caracteres archivos recursivamente - Convinación de find y grep==
 +
find . -type f -print | xargs grep "palabra"
 +
 
 +
 
 +
'''Y para buscar una linea que contenga dos palabras especificas:'''
 +
 
 +
find . -type f -print | xargs grep "palabra1" | grep "palabra2"
 +
 
 +
 
 +
'''O también:'''
 +
find . -exec egrep palagra '{}' +
 +
 
 +
 
 +
'''Otra forma:'''
 +
 
 +
egrep -r palabra *
 +
 
 +
 +
<br />
 +
==ls==
 +
 
 +
 
 +
<br />
 +
===Listar sólo archivos o sólo directorios===
 +
Listar solo directorios:
 +
ls -lah | grep -v "^-"
 +
 
 +
Listar solo archivos:
 +
ls -lah | grep -v "^d"
 +
 
 +
 +
<br />
 +
==Listar archivos con su ruta absoluta==
 +
List files with their absolute path in linux:
 +
 
 +
readlink -f *
 +
 
 +
 +
<br />
 +
==Listar archivos modificados antes, después, o en una cierta fecha==
 +
https://techjourney.net/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix-linux/
 +
 
 +
To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:
 +
 
 +
find . -mtime -1 -print
 +
 
 +
To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:
 +
 
 +
find /directory_path -type f -mtime -1 -print
 +
 
 +
To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:
 +
 
 +
touch -t `date +%m%d0000` /tmp/$$
 +
find /tmefndr/oravl01 -type f -newer /tmp/$$
 +
rm /tmp/$$
 +
 
 +
 +
<br />
 +
==Contar archivos en un directorio==
 +
https://www.pedroventura.com/linux/contar-todos-los-archivos-existente-en-un-directorio-en-linux/
 +
 
 +
'''Con find'''
 +
 
 +
'''La cuenta es mas exacta con find, por ejemplo:'''
 +
 
 +
find . -maxdepth 2 -type f | wc -l #Contar los archivos pero solo en carpetas dos niveles por debajo
 +
 
 +
find . -type f | wc -l # Contar archivos de forma recursiva ilimitada
 +
 
 +
find . -type d | wc -l # Contar directorios de forma recursiva ilimitada
 +
 
 +
find . -type l | wc -l # Contar enlaces de forma recursiva ilimitada
 +
 
 +
find . | wc -l #Contar archivos y carpetas de forma recursiva
 +
 
 +
find . -type f -iname “*.php” | wc -l # Contar archivos con una extensión determinada
 +
 
 +
 
 +
'''Con ls'''
 +
 
 +
Con ls es también apropiado para contar los archivos en un sólo directorio. Sin embargo, la forma recursiva (ls -R) no resulta muy apropiada porque se incluye una línea en blanco al finalizar el directorio; además que no se puede diferenciar entre archivos y directorios.
 +
 
 +
ls | wc -l
 +
 
 +
Para incluir los archivos ocultos:
 +
 
 +
ls -A | wc -l
 +
 
 +
El parámetro -A lista todos los archivos excepto la ruta de carpetas . y ..
 +
 
 +
 
 +
<br />
 +
==Crear y borrar usuarios==
 +
How to Add (create) and Delete Users on Ubuntu 16.04
 +
https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04
 +
 
 +
adduser newuser
 +
 
 +
You can delete the user itself, without deleting any of their files, by typing this as root:
 +
deluser newuser
 +
 
 +
If, instead, you want to delete the user's home directory when the user is deleted, you can issue the following command as root:
 +
deluser --remove-home newuser
 +
 
 +
 +
<br />
 +
==Which==
 +
Retorna la ruta de un ejecutable. Por ejemplo si queremos saber donde se encuentra el ejecutable para el comando python, ejecutamos:
 +
adelo@adelo-laptop:~$ which python
 +
/usr/bin/python
 +
 +
 +
<br />
 +
==Source==
 +
The source command can be used to load any functions file into the current shell script or a command prompt.
 +
 
 +
The source command can be abbreviated as just a dot (.) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared.
 +
 
 +
Uno de los usos más comunes es para reload your .bashrc without re-login or restart.
 +
source .bashrc
 +
. .bashrc
 +
 
 +
 +
<br />
 +
==Kill process in port==
 +
Matar proceso en puerto
 +
 
 +
https://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu
 +
 
 +
You want to use backtick not regular tick:
 +
 
 +
sudo kill -9 `sudo lsof -t -i:9001`
 +
 
 +
If that doesn't work you could also use $() for command interpolation:
 +
 
 +
sudo kill -9 $(sudo lsof -t -i:9001)
 +
 
 +
 +
<br />
 +
==du==
 +
Para incluir archivos ocultos:
 +
 
 +
* La opción -a incluye los archivos ocultos, pero no se puede utilizar con la opción -s, --summarize. La cual permite desplegar el tamaño de un directorio y no de cada archivo por separado. Entonces para poder utilizar la opción --sumarize y desplegar también los archivos ocultos, debemos:
 +
 
 +
* Para listar sólo los archivos ocultos:
 +
du -hs .[^.]*
 +
 
 +
* Si queremos listar ocultos y normales:
 +
du -hs $(ls -A)
 +
 
 +
* Si queremos ordenar los archivos por tamaño:
 +
du -s $(ls -A) | sort -rn 
 +
 
 +
Note que en el caso anterior, no se debe usar la opción -h para así asegurarse de que la unidad de tamaño sea siempre la misma. Porque el comando sort no distingue entre tamaños sino sólo por los números. Es decir, si colocamos la opción -h, sort colocará un archivo de 50M antes de un archivo de 5G porque 50 es mayor que 5 y no hará distinción de la unidad.
 +
 
 +
* Ahora si queremos listar en una unidad en particular:
 +
sudo du -csh --block-size=1M $(ls -A) | sort -rn  (--block-size=1G)
 +
Note que en este caso, un archivo cuyo tamaño sea menor al block-size será listado con un tamaño igual al block-size. Por ejemplo si colocamos --block-size=1G, un archivo de 1k será listado con tamaño 1, que en este caso se refiere a 1G.
 +
 
 +
* Si queremos excluir algún archivo o directorio:
 +
du -s --exclude=Directorio $(ls -A) | sort -rn
 +
 
 +
 
 +
<br />
 +
==setxkbmap and loadkeys==
 +
https://ubuntuforums.org/archive/index.php/t-1551403.html
 +
 
 +
'''setxkbmap'''  works when you have a graphical interface. So, when you run Ubuntu server that only works through the terminal, '''setxkbmap''' won't work.
 +
 
 +
 
 +
'''loadkeys''' is to be used when you only have a terminal.
 +
 
 +
The syntax is the same
 +
setxkbmap es
 +
 
 +
 
 +
<br />
 +
==Tar and Zip==
 +
 
 +
 
 +
<br />
 +
===tar===
 +
De esta forma el archivo tar.gz se creará en el mismo lugar donde se ejecuta el comando y dentro del tar.gz se creará el full-path del directorio que se está comprimiendo. Es decir, cuando descomprimamos el archivo obtendremos el directorio /var/www/sinfronteras_ws/perso/
 +
tar cvzf archivo.tar.gz /var/www/sinfronteras_ws/perso/1-archivos
 +
 
 +
De esta forma el full-path no es generado en el .tar.gz. Cuando descomprimamos el .tar.gz obtendremos sólo los archivos que están en 1-archivos (sin la ruta completa /var/www/sinfronteras_ws/perso/)
 +
tar -czpvf ruta/destino/archivo.tar.gz -C /var/www/sinfronteras_ws/perso/1-archivos .
 +
 
 +
 +
<br />
 +
===zip===
 +
Syntax for  Creating a zip file:
 +
zip myfile.zip filename.txt
 +
 
 +
unzip file.zi
 +
unzip file.zip -d destination_folder
 +
 
 +
 +
<br />
 +
==GnuPG==
 +
'''gpg'''
 +
 
 +
 
 +
Para desplegar el contenido en el terminal:
 +
gpg -d filename
 +
 
 +
 
 +
GnuPG (gpg) decryption not asking for passphrase: https://security.stackexchange.com/questions/103034/gnupg-decryption-not-asking-for-passphrase
 +
 
 +
 
 +
<br />
 +
 
 +
==La papelera - Trash==
 +
En ubuntu 15 el directorio Trash se localiza en la ruta: ~/.local/share/Trash
 +
 
 +
 
 +
<br />
 +
===Mover archivos a la papelera desde el terminal===
 +
http://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal
 +
 
 +
You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Si no está instalado:
 +
sudo apt-get install gvfs-bin
 +
 
 +
Move file to trash:
 +
 
 +
gio trash
 +
gvfs-trash filename
 +
According to man gvfs-trash it is deprecated in favour of «gio trash», see man gio: https://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal
 +
 
 +
See the content of the trash:
 +
 
 +
gvfs-ls trash://
 +
 
 +
Empty the trash:
 +
 
 +
gvfs-trash --empty
 +
 
 +
 
 +
http://unix.stackexchange.com/questions/42757/make-rm-move-to-trash
 +
 
 +
As far as using any program as replacement/alias for rm is concerned, there are good reasons not to do that. Most important for me are:
 +
 
 +
* The program would need to understand/handle all of rm's options and act accordingly
 +
* It has the risk of getting used to the semantics of your "new rm" and performing commands with fatal consequences when working on other people's systems
 +
 
 +
<section begin=alias_gvfs-trash />
 +
<syntaxhighlight lang="bash">
 +
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 +
alias del=gvfs-trash
 +
</syntaxhighlight>
 +
<section end=alias_gvfs-trash />
 +
 
 +
 
 +
<br />
 +
==Free Up Space On Ubuntu==
 +
Liberar espacio
 +
 
 +
 
 +
<br />
 +
===Clean up APT cache in Ubuntu===
 +
You can see the size of this cache with the command below:
 +
sudo du -sh /var/cache/apt
 +
 
 +
Now, you have two options to handle the cache. Either remove only the outdated packages, like those superseded by a recent update, making them completely unnecessary.
 +
sudo apt-get autoclean
 +
 
 +
Or clean out the cache in its entirety (frees more disk space):
 +
sudo apt-get clean
 +
 
 +
 +
<br />
 +
===Clean the thumbnail cache===
 +
As user and root:
 +
du -sh ~/.cache/thumbnails
 +
rm -rf ~/.cache/thumbnails/*
 +
 
 +
 +
<br />
 +
===Empty the Trash===
 +
Vaciar papeleras
 +
 
 +
Los directorios Trash* pueden ser borrados sin ningún problemas puesto que se crean automáticamente.
 +
 
 +
* '''Papeleras en la partición donde se encuentra instalado Ubuntu:'''
 +
<blockquote>
 +
 
 +
<syntaxhighlight lang="bash">
 +
 
 +
/home/adelo/.local/share/Trash  (Estas rutas creo que deben ser comprobada como usuario y como root. Ver nota abajo)
 +
/home/adelo/.Trash-*
 +
/root/.local/share/Trash
 +
link del ícono de la papelera
 +
 
 +
</syntaxhighlight>
 +
 
 +
'''Nota:''' Por alguna razón que aún desconozco, al comparar los archivos en las dos rutas mostradas arriba con los archivos que se encueentran en la papelera al abrila a través del link del ícono de la papelera, se encuentran discrepancias. Es decir, hay archivos que se observan a través del link de la papelera que no se encuentran en las dos rutas mostradas arriba y viceversa. Por esta razón, debo también vaciar la papelera a través del link de la papelera.
 +
 
 +
</blockquote>
 +
 
 +
* '''Papeleras en disco_local''' (comprobar como usuario y como '''root'''):
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
 
 +
/home/adelo/1-system/1-disco_local/.Trash-0
 +
/home/adelo/1-system/1-disco_local/.Trash-1000
 +
 
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
* '''Papeleras en disco_ext''' (comprobar como usuario y como '''root'''):
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
 
 +
/home/adelo/1-system/2-disco_ext/.Trash-0
 +
/home/adelo/1-system/2-disco_ext/.Trash-1000
 +
 
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
* '''Papeleras en el cloud''':
 +
<blockquote>
 +
<syntaxhighlight lang="bash">
 +
 
 +
/root/.local/share/Trash
 +
/root/.Trash-*
 +
 
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
<br />
 +
==GParted==
 +
A la hora de redimensionar una partición, el programa GParted permite reducir tanto al inicio como al final de la partición. Ahora, es seguro redimensionar al inicio del disco? http://unix.stackexchange.com/questions/63258/can-i-safely-resize-my-partition-from-its-beginning
 +
 
 +
Cuando el programa GParted carga la tabla de particiones, la partición Swap se activa (o monta: no sé si se usa este término en este caso) automáticamente. Es por ello que a primera instancia la opción de redimensionar editar (redimensionar, borrar, etc.) esta partición estará desactivada. También, si dicha partición Swap se encuentra dentro de una partición Extendida, tampoco podremos editar la partición Extendida. Para poder realizar cambios en estas particiones debemos desactivar la partición Swap. Para esto tenemos que seleccionar la partición Swap y luego usar la opción "Swapoff" en el menú "Partition" para desactivarla.
 +
 
 +
A través del programa de particionamiento prupuesto durante la instalación de Ubuntu, no se pueden realizar redimensiones al inicio de la partición. Tampoco se pueden rediminsionar particiones Extendidas o Swap.
 +
 
 +
Ahora bien, la redimensión es un proceso que puede tomar mucho tiempo.
 +
 
 +
 
 +
<br />
 +
==Fdisk==
 +
n => Create new Partition (Then create what you need)
 +
 
 +
t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)
 +
 
 +
w => Write the changes to disk and exit
 +
 
 +
 
 +
<br />
 +
===Crear una partición con fdisk===
 +
sudo fdisk /dev/sdb
 +
Welcome to fdisk (util-linux 2.27.1).
 +
Changes will remain in memory only, until you decide to write them.
 +
Be careful before using the write command.
 +
 
 +
Command (m for help): n
 +
Partition type
 +
  p  primary (0 primary, 0 extended, 4 free)
 +
  e  extended (container for logical partitions)
 +
Select (default p): p
 +
Partition number (1-4, default 1): 1
 +
First sector (2048-4028415, default 2048):
 +
Last sector, +sectors or +size{K,M,G,T,P} (2048-4028415, default 4028415):
 +
 
 +
Created a new partition 1 of type 'Linux' and of size 1,9 GiB.
 +
 
 +
Command (m for help): w
 +
The partition table has been altered.
 +
Calling ioctl() to re-read partition table.
 +
Syncing disks.
 +
 
 +
 +
<br />
 +
==Mostrar barra de progreso al Copiar, mover y borrar archivos==
 +
 
 +
 
 +
<br />
 +
===gcp===
 +
Comando para copiar mostrando una barra de progreso y velocidad.
 +
 
 +
gcp -r origen/archivo /destino
 +
 
 +
 +
<br />
 +
==Alias==
 +
http://www.computerhope.com/unix/ualias.htm
 +
 
 +
Aliases are used to customize the shell session interface:
 +
alias ls='ls --color=auto'
 +
 
 +
alias ll='ls -la'
 +
 
 +
alias .....='cd ../../../../'
 +
 
 +
Éste lo he adicionado a mi .bashrc:
 +
alias 'la=ls -AX'
 +
 
 +
 +
<br />
 +
==Formatear una unidad Flash USB==
 +
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
 +
 
 +
 
 +
<br />
 +
===Usando el terminal===
 +
Para mostrar los distintos dispositivos y particiones en el sistema:
 +
lsblk -fm
 +
 
 +
Antes de formatear una device debemos desmontarla:
 +
 
 +
umount /dev/sdb*
 +
 
 +
Par usar el comando mkfs.* sobre una entire device (sdb por ejemplo) y no sobre una partición dentro de esta (sdb1 por ejemplo), debemos usar la opción -I. Ver [[Linux#Nota_sdb|Nota sdb]]
 +
 
 +
$ sudo mkfs.vfat -I /dev/sdb
 +
 
 +
http://tecadmin.net/format-usb-in-linux/#
 +
 
 +
https://ksearch.wordpress.com/2010/09/29/format-usb-in-linux/
 +
 
 +
$ sudo umount /dev/sdc1
 +
 
 +
$ sudo umount /dev/sdb*
 +
 
 +
Format with vFat FileSystem
 +
 
 +
$ sudo mkfs.vfat /dev/sdc1
 +
 
 +
Format with NTFS FileSystem. En este caso la opción -I no me ha funcionado. Cuando intento formatear en formato NTFS sobre la entire device, obtengo un error:
 +
 
 +
/dev/sdb is entire device, not just one partition.
 +
Refusing to make a filesystem here!
 +
 
 +
Por eso tuve que crear una partición en la device antes de formatear --> [[Linux#Crear una partición con fdisk|Crear una partición con fdisk]]
 +
 
 +
$ sudo mkfs.ntfs /dev/sdc1
 +
 
 +
Format with EXT4 FileSystem
 +
 
 +
$ sudo mkfs.ext4 /dev/sdc1
 +
 
 +
 +
<br />
 +
===Interfaz gráfica===
 +
https://askubuntu.com/questions/198065/how-to-format-a-usb-drive
 +
 
 +
 
 +
<br />
 +
==Programas para realizar respaldos (Backup)==
 +
 
 +
 
 +
<br />
 +
===rsync===
 +
http://www.thegeekstuff.com/2010/09/rsync-command-examples/
 +
 
 +
http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/
 +
 
 +
'''<span style="background:Thistle">One of the main feature of rsync is that it transfers only the changed block to the destination, instead of sending the whole file.</span> <span style="background:PaleGoldenrod">De hecho, si jamás se ha realizado un proceso rsync entre dos directorios, rsync comprobará las diferencias entre los dos directorios antes de transferir cualquier archivo. Por tanto (aún durante la primera sincronización entre dos directorios) serán transferidos sólo los bloques distintos.</span>'''
 +
 
 +
rsync -azvu --delete --progress Source/ Destination/
 +
 
 +
Si colocamos "Source/" (con el slash al final) todo el contenido del directorio Source será copiado dentro del directorio Destination. Si destination no existe, éste será creado. Ahora bien, si colocamos "Source" (sin el slash) será copiado el directorio "Source" como tal dentro del directorio Destination.
 +
 
 +
rsync -azvu --delete --progress --exclude 'Figuras' --exclude 'ejercicios' --exclude 'TP_Processus/processus_files' Source/ Destination/
 +
 
 +
: '''-a''', --archive, archive mode; equals '''-rlptgoD''' (no -H,-A,-X). This option does the following:
 +
:: '''-l''', --links copy symlinks as symlinks (Preserves symbolic links)
 +
:: '''-p''', --perms preserve permissions
 +
:: '''-t''', --times preserve modification times (Preserves timestamp)
 +
:: '''-g''', --group preserve group
 +
:: '''-o''', --owner preserve owner (super-user only)
 +
:: '''-D''' same as --devices --specials
 +
::: '''--devices''' preserve device files (super-user only)
 +
::: '''--specials''' preserve special files
 +
::; -r, --recursive (ayuda from man rsync):
 +
::: This tells rsync to copy directories recursively.  See also --dirs (-d).
 +
 
 +
::: Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed.  This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer.  It is also only  possible when both ends of the transfer are at least version 3.0.0.
 +
 
 +
::: Some  options  require  rsync  to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and  --delay-updates.  Because  of  this,  the default  delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0  (use  --del  or  --delete-during  to  request  this  improved  deletion  mode explicitly).  See  also  the --delete-delay option that is a better choice than using --delete-after.
 +
 
 +
::: Incremental recursion can be disabled using the '''--no-inc-recursive''' option or its shorter --no-i-r alias.
 +
 
 +
: '''-z''' is to enable compression
 +
 
 +
: '''-v''' verbose
 +
 
 +
: '''-u :''' Do not overwrite the modified files at the destination (desde la última sincronización). In a typical sync situation, if a file is modified at the destination, we might not want to overwrite the file with the old file from the source.
 +
 
 +
: '''--delete''' it to delete the Files Created at the Target: If a file is not present at the source, but present at the target, you might want to delete the file at the target during rsync. Si el archivo fue modificado en la destinación, éste no será sobre-escrito. Ahora bien, en la siguiente sincronización, si el archivo no vuelto a ser modificado, será sobre-escrito.
 +
 
 +
: '''--progress :''' View the rsync Progress during Transfer. Displays detailed progress, i.e how many files are copies, at what rate it is copying the file, etc)
 +
 
 +
: '''--exclude''' is to exclude files or directories while doing synchronization. Ver [http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/ 6 rsync Examples to Exclude Multiple Files and Directories]
 +
 
 +
:'''--delete-after :''' No entiendo bien cual podría ser la ventaja de borrar después y no antes. Pero he visto en varios foros que usan esta opción en lugar de --delete. En este foro explican cual es la razón, aunque no entendí: Par défaut rsync avec l'option --delete supprime les fichiers qui ont disparus de la source avant tout transfert. Lorsque le fichier a été tout simplement supprimé de la source ça ne pose pas de problème. Par contre si le fichier a été déplacé à un autre endroit c'est plus embêtant car il y a un moment où le fichier n'est plus dupliqué sur le serveur de backup. Pour éviter ce petit soucis il faut ajouter l'option --delete-after pour que les fichiers soit supprimés après la copie et plus avant. http://raphastronome.astro5000.com/?post/Option-delete-after-de-rsync
 +
 
 +
:; -H, --hard-links (ayuda from man rsync):
 +
:: This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.
 +
 
 +
:: This  option  does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source.  Cases in which the destination may end up with extra hard links include the following:
 +
 
 +
::* If the destination contains extraneous hard-links (more linking than what is  present  in  the  source  file list), the copying algorithm will not break them explicitly.  However, if one or more of the paths have content differences, the normal file-update process will break those extra links  (unless  you  are  using  the --inplace option).
 +
 
 +
::* If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the destination to become linked together due  to  the --link-dest associations.
 +
 
 +
:: Note that rsync can only detect hard links between files that are inside the transfer set.  If rsync updates a file that has extra hard-link connections to files outside the transfer, that  linkage  will  be  broken.  If  you  are tempted  to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes  happen  due  to  lingering  hard  links  (and  see  the --inplace option for more caveats).
 +
 
 +
:: If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy.  This does not affect the  accuracy  of  the transfer  (i.e.  which files are hard-linked together), just its efficiency (i.e. copying the data for a new, early copy of a hard-linked file that could have been found later in the transfer in another member  of  the  hard-linked set of files).  One way to avoid this inefficiency is to disable incremental recursion using the '''--no-inc-recursive''' option.
 +
 
 +
:; --partial (ayuda from man rsync):
 +
:: By default, rsync will delete any partially transferred file if the transfer is interrupted. In some  circumstances it  is  more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
 +
 
 +
::; --partial-dir=DIR
 +
::: A better way to keep partial files than the --partial option is to specify a DIR that will be used to hold the partial  data  (instead of writing it out to the destination file).  On the next transfer, rsync will use a file found in this dir as data to speed up the resumption of the transfer and then delete it after it has served its purpose.
 +
 
 +
::: Note that if --whole-file is specified (or implied), any partial-dir file that is found for a file  that  is  being updated will simply be removed (since rsync is sending files without using rsync’s delta-transfer algorithm).
 +
 
 +
::: Rsync  will create the DIR if it is missing (just the last dir -- not the whole path).  This makes it easy to use a relative path (such as "--partial-dir=.rsync-partial") to have rsync create the partial-directory in  the  destination file’s directory when needed, and then remove it again when the partial file is deleted.
 +
 
 +
::: If  the  partial-dir  value is not an absolute path, rsync will add an exclude rule at the end of all your existing excludes.  This will prevent the sending of any partial-dir files that may exist on the sending side, and will also prevent  the  untimely  deletion  of  partial-dir items on the receiving side.  An example: the above --partial-dir option would add the equivalent of "-f '-p .rsync-partial/'" at the end of any other filter rules.
 +
 
 +
::: If you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule  for  the  partial-dir  because (1) the auto-added rule may be ineffective at the end of your other rules, or (2) you may wish to override rsync’s exclude choice.  For instance, if you want to make rsync clean-up any left-over partial-dirs  that may  be lying around, you should specify --delete-after and add a "risk" filter rule, e.g.  -f 'R .rsync-partial/'. (Avoid using --delete-before or --delete-during unless you don’t need rsync to use any of the left-over partial-dir data during the current run.)
 +
 
 +
::: IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk.  E.g. AVOID "/tmp".
 +
 
 +
::: You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable.  Setting this in the environment does not force --partial to be enabled, but rather it affects where partial files go when --partial  is  specified. For  instance,  instead  of  using  --partial-dir=.rsync-tmp  along  with  --progress,  you  could  set  RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to turn on the use of  the  .rsync-tmp  dirfor  partial  transfers.  The only times that the --partial option does not look for this environment value are (1)when --inplace was specified (since --inplace conflicts with --partial-dir), and (2) when --delay-updates was specified (see below).
 +
 
 +
::: For  the purposes of the daemon-config’s "refuse options" setting, --partial-dir does not imply --partial.  This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files with a  partial transfer, while still allowing the safer idiom provided by --partial-dir.
 +
 
 +
: '''-P :''' same as --partial --progress.
 +
 
 +
: '''--no-inc-recursive :''' Ver comentarios en las opciones '''-r''' y '''-H'''.
 +
 
 +
 
 +
Hasta ahora lo único que no he podido solucionar es que cuando muevo un archivo en la Source, la sincronización no entiende que éste ha sido movido y así moverlo también en la destinación (lo cual disminuiría bastante el tiempo de sincronización). Por el contrario, cuando el...
 +
Al parecer, la solución a este problema se encuentra explicada aquí:
 +
https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/
 +
 
 +
http://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html
 +
 
 +
http://javier.io/blog/en/2014/08/06/rsync-rename-move.html
 +
 
 +
* Me gustaría que le comando imprimiera en pantalla durante la ejecución, los archivos que no fueron sincronizados porque fueron modificados en la destinación (esto por usar la opción -u). Es decir me gustaría saber cuales fueron los archivos modificados en la destinación.
 +
 
 +
 
 +
<br />
 +
==Three ways to hide Files and Directories in Linux==
 +
Archivos ocultos
 +
 
 +
http://www.dailygyan.com/2008/01/3-ways-to-hide-files-and-directories-in.html
 +
 
 +
# Make a file named .hidden: We add the name of the file/directory to be hidden into the .hidden file, one name in each line.
 +
# Just rename the file/directory and prefix the name with a ' . ' (a dot). Files starting with a ' . ' are considered to be hidden files by linux.
 +
# Rename the file and add a '~' to the end. Linux considers files ending in ~ as backup files and hence hides them. En Ubuntu este método funciona sólo en el administrador de archivos (en nautilus por ejemplo) y con archivos normales, no con directorios.
 +
 
 +
 
 +
<br />
 +
==Convert==
 +
 
 +
 
 +
<br />
 +
===Combinar o unir imágenes===
 +
http://imagemagick.org/Usage/layers/#append
 +
 
 +
Horizontal:
 +
convert seleccion_categoria1.png +append seleccion_categoria2.png +append -background none -append seleccion_categoria.png
 +
 
 +
Vertical:
 +
convert seleccion_categoria1.png seleccion_categoria2.png -background none -append seleccion_categoria.png
 +
convert 1.png 2.png -background none -append .png
 +
 
 +
convert  -background none -append .png
 +
 
 +
 +
<br />
 +
==Search in a pdf from the command line==
 +
https://stackoverflow.com/questions/4643438/how-to-search-contents-of-multiple-pdf-files
 +
 
 +
find . -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep --with-filename --label="{}" --color "your pattern"' \;
 +
find . -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep -i --with-filename --label="{}" --color "your pattern"' \;
 +
 
 +
 
 +
<br />
 +
==Convertir pdf en svg==
 +
http://manpages.ubuntu.com/manpages/cosmic/man1/pdf2svg.1.html
 +
 
 +
pdf2svg pdffile svgfile [page number]
 +
 
 +
 
 +
<br />
 +
==Redimensionar imagen - PDF==
 +
[redimensionar / resize | comprimir / compress]
 +
 
 +
sudo apt-get install imagemagick
 +
 
 +
Si queremos por ejemplo reducir todas las imágenes en un 50% ejecutamos:
 +
mogrify -resize 50% *.jpg
 +
 
 +
Si queremos darle un tamaño determinado:
 +
mogrify -resize 1024x768 imagen.jpg
 +
 
 +
 +
<br />
 +
===Comprimir un PDF===
 +
Paso 1: Trasformar pdf a ps
 +
pdf2ps Original.pdf Medio.ps
 +
 
 +
Paso 2: Trasformar ps a pdf
 +
ps2pdf Medio.ps Salida.pdf
 +
 
 +
 +
<br />
 +
==Cortar pdf==
 +
https://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files
 +
 
 +
pdfcrop --margins '0 0 0 0' input.pdf output.pdf
 +
 
 +
Con 0 0 0 0 debería cortar la imagen a margen cero. También se pueden usar valores negativos
 +
 
 +
pdfcrop --margins '-5 -5 -5 -5' input.pdf output.pdf
 +
 
 +
 
 +
El siguiente script toma un archivo pdf con varias páginas, extrae cada página en un archivo separado y recorta cada página a márgenes cero:
 +
 
 +
<syntaxhighlight lang="sh">
 +
#!/bin/bash
 +
 
 +
for i in {1..11}
 +
do
 +
        pdftk library.pdf cat $i output pag$i.pdf
 +
        pdfcrop --margins '-3 -3 -3 0' pag$i.pdf pag$i.pdf
 +
        echo "$i "
 +
done
 +
</syntaxhighlight>
 +
Este ejemplo se puede probar con este archivo: [[Media:Library.pdf]]
 +
 
 +
 
 +
<br />
 +
==Best way to convert svg to png==
 +
https://stackoverflow.com/questions/9853325/how-to-convert-a-svg-to-a-png-with-image-magick
 +
 
 +
inkscape -z -e test.png -w 3000 test.svg
 +
 +
inkscape -z -e test.png -w 1024 -h 1024 test.svg
 +
 
 +
 
 +
<br />
 +
==Convert image to grayscale - black and white==
 +
https://linuxconfig.org/convert-image-to-grayscale-with-imagemagick
 +
 
 +
convert linuxcareer-color.png -colorspace gray linuxcareer-color-grayscale.png
 +
 
 +
 +
<br />
 +
==Gnome and Nautilus==
 +
 
 +
 
 +
<br />
 +
===Save your eyes with Nightlight===
 +
https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
 +
 
 +
Nightlight is my favorite feature in GNOME desktop. Keeping your eyes safe at night from the computer screen is very important. Reducing blue light helps reducing eye strain at night.
 +
 
 +
GNOME provides a built-in Night Light option, which you can activate in the System Settings.
 +
 
 +
* Settings-> Devices-> Displays: and turn on the «Night Light» option.
 +
 
 +
 
 +
<br />
 +
===Configurar el touchpad===
 +
* Settings > Devices > Mouse & Touchpad
 +
** Edge scrolling
 +
** Touchpad speed
 +
** etc...
 +
 
 +
 
 +
<br />
 +
===How to Move the Unity Desktop’s Launcher===
 +
https://www.howtogeek.com/349697/how-to-move-ubuntu%E2%80%99s-launcher-bar-to-the-bottom-or-right/
 +
 
 +
Cambiar la posición de la barra en donde se encuentran los programas:
 +
* Settings > Dock
 +
 
 +
 
 +
<br />
 +
===Choose or disable the alert sound===
 +
Desactivar los sonidos de alerta.
 +
 
 +
https://help.ubuntu.com/stable/ubuntu-help/sound-alert.html.en
 +
 
 +
* Settings > Sound > Sound Effects: Alert Volume - Off
 +
 
 +
 
 +
<br />
 +
===Cambiar el icono de una carpeta===
 +
https://ubuntulife.wordpress.com/2010/02/10/tip-cambiar-el-icono-de-una-carpeta/
 +
 
 +
 
 +
<br />
 +
===Folder color: cambia el color de todas tus carpetas en Ubuntu===
 +
https://hipertextual.com/archivo/2014/04/cambiar-color-carpetas-ubuntu/
 +
 
 +
Folder Color Folder Color es una aplicación muy sencilla que podemos instalar en Ubuntu para cambiar el color de los iconos de las carpetas en Nautilus.
 +
 
 +
sudo add-apt-repository ppa:costales/folder-color
 +
sudo apt-get update
 +
sudo apt-get install folder-color
 +
 
 +
 
 +
<br />
 +
===How can I create launchers for an application===
 +
Para crear un icon que permita ejecutar la aplicación:
 +
 
 +
https://askubuntu.com/questions/64222/how-can-i-create-launchers-on-my-desktop
 +
 
 +
gnome-desktop-item-edit --create-new ~/Desktop
 +
 
 +
https://www.linuxquestions.org/questions/linux-desktop-74/adding-a-custom-desktop-icon-to-the-dock-panel-in-ubuntu-18-04-a-4175641299/
 +
* Para adicionar el ícono (icon) a las aplicaciones (que se liste cuando buscamos las aplicaciones en Activities (Windows Tecla), tenemos que colocar el ícono creado en /home/anapaula/.local/share/applications
 +
 
 +
* Si luego queremos colocar el ícono (icon) en el Dock (side bar / favorites) lo único que hay que hacer es listar el ícono en Activities y desde ahí hacer right-click > Add to Favorities
 +
 
 +
 
 +
<br />
 +
===Extension to hide the top bar===
 +
Existe una Gnome extension llamada «hide top bar»
 +
 
 +
 
 +
<br />
 +
===Extension to hide specific icons in the top bar===
 +
Por ejemplo, si se desea ocultar un icono específico en la topbar (the date for example)
 +
 
 +
https://extensions.gnome.org/extension/351/icon-hider/
 +
 
 +
La instalación se realiza directamente desde el google chrome browser haciendo clic en «ON» en la parte superior derecha de la página de la extensión indicada arriba. Para que la página del google chrome browser nos de la opción de instalar Gnome extensions, debemos primero instalar el «GNOME Shell integration for Chrome», como se muestra aquí: https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation
 +
 
 +
sudo apt-get install chrome-gnome-shell
 +
 
 +
 
 +
<br />
 +
Esta extensión tiene un problema. Adiciona un appnotification a la lista de los icon cada vez que se inicia la applicación. Por tanto, luego de un tiempo la lista de icons contiene muchos icons innecesarios. La lista se hace tan larga que no es posible desplegar en la ventana los últimos icons. Para limpiar esta lista podemos seguir las indicaciones de este forum: https://github.com/ikalnytskyi/gnome-shell-extension-icon-hider/issues/29
 +
 
 +
dconf-editor /org/gnome/shell/extensions/icon-hider/
 +
 
 +
 
 +
<br />
 +
==Screensho and Screen recording tools==
 +
Aplicación para imprimir pantalla
 +
 
 +
 
 +
<br />
 +
===Gnome Screenshot===
 +
https://doc.ubuntu-fr.org/gnome-screenshot
 +
 
 +
Gnome Screenshot est déjà installé par défaut sur Ubuntu
 +
 
 +
Lancer l'interface depuis le tableau de bord d'Unity à l'aide des mots-clés "capture d'écran" ou pour les menus classiques, Applications → Accessoires → Capture d'écran.
 +
Ou encore depuis un terminal avec la commande suivante:
 +
 
 +
gnome-screenshot -i
 +
 
 +
À l'aide de raccourcis:
 +
La convinación de tecla normal no me funciona, la siguiente sí:
 +
 
 +
[ALT]+[FN]+[IMPR] → Capturer la fenêtre active.
 +
 
 +
En la página Web se pueden ver las otras convinaciones de tecla disponibles
 +
 
 +
 
 +
<br />
 +
===Shutter===
 +
https://askubuntu.com/questions/3578/tool-to-add-shapes-annotations-and-text-using-templates-to-images
 +
 
 +
Shutter es un buen programa para imprimir pantallas.
 +
 
 +
También permite editar imágenes: crear flechas y etiquetas de una forma fácil.
 +
 
 +
 
 +
<br />
 +
===Screen recording - Screencast===
 +
Hacer un video de la pantalla.
 +
 
 +
https://tipsonubuntu.com/2018/06/09/record-gnome-desktop-ubuntu-18-04/
 +
 
 +
* Gnome’s built-in screen recorder: Ctrl+Alt+Shift+R  (No me ha funcionado para grabar el sonido, solo el video)
 +
 
 +
 
 +
* https://linuxhint.com/best_ubuntu_screen_recorders/
 +
 
 +
 
 +
* '''Kazam:''' https://itsfoss.com/kazam-screen-recorder/ (este funciona bien)
 +
 
 +
: https://askubuntu.com/questions/766440/how-to-install-kazam-1-5-3
 +
 
 +
 
 +
<br />
 +
==Latex==
 +
sudo apt-get install texlive-full (texlive-full ocupa casi 5G de memoria)
 +
 +
 
 +
<br />
 +
===Kile===
 +
 
 +
 
 +
<br />
 +
===Latex documentation===
 +
The Comprehensive LATEX Symbol List: https://ftp.heanet.ie/mirrors/ctan.org/tex/info/symbols/comprehensive/symbols-letter.pdf
 +
 
 +
 
 +
<br />
 +
 
 +
==LibreOffice/OpenOffice==
 +
 
 +
 
 +
<br />
 +
===Instalar corrector ortográfico y gramatical en LibreOffice/OpenOffice===
 +
http://blog.desdelinux.net/instalar-corrector-ortografico-y-gramatical-en-libreofficeopenoffice/
 +
 
 +
sudo apt-get install myspell-es
 +
sudo apt-get install myspell-fr myspell-fr-gut
 +
sudo apt-get install myspell-*
 +
 
 +
 
 +
<br />
 +
===No mostrar número de página y nombre de la página en Excel LibreOffice===
 +
How NOT to print sheet name and page number in OpenOffice.org Calc: https://superuser.com/questions/200056/how-not-to-print-sheet-name-and-page-number-in-openoffice-org-calc
 +
 
 +
Go to: Format > Page: Header/Footer y desactivar ambos
 +
 
 +
 
 +
<br />
 +
==Adobe Reader (Acroread)==
 +
https://linuxconfig.org/how-to-install-adobe-acrobat-reader-on-ubuntu-18-04-bionic-beaver-linux
 +
 
 +
<span style="background:#00FF00">'''Please note that Adobe no longer supports Acrobat Reader for Linux. The latest native Linux version is 9.5.5 dated from 26/04/2013. From this reason you should refrain using/installing Adobe Acrobat Reader if possible to avoid potential vulnerabilities and hacker exploits.'''</span>
 +
 
 +
apt install libxml2:i386 gdebi-core
 +
wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
 +
sudo gdebi AdbeRdr9.5.5-1_i386linux_enu.deb
 +
acroread
 +
 
 +
 +
<br />
 +
==pdftk==
 +
https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-bionic
 +
 
 +
The pdftk package in Ubuntu (and its upstream Debian package) was dropped due to its dependency on the now deprecated GCJ runtime. I found a fork that depends on OpenJDK or similar instead.
 +
 
 +
'''Install from PPA:'''
 +
 
 +
I built a Deb package (for Bionic only) with suitable dependencies:
 +
sudo add-apt-repository ppa:malteworld/ppa
 +
sudo apt update
 +
sudo apt install pdftk
 +
 
 +
The package contains a wrapper script placed in /usr/bin, so you can invoke it as normally:
 +
pdftk <arguments> ...
 +
 
 +
 +
<br />
 +
==Vim==
 +
«vi» puede ser muy complicado de utilizar. Vale la pena, por lo tanto, instalar «vim»
 +
sudo apt-get install vim
 +
 
 +
Guardar y cerrar:
 +
:qw
 +
 
 +
Cerrar sin guardar los cambios:
 +
:q!
 +
 
 +
Undo:
 +
u
 +
 
 +
 +
<br />
 +
==GIMP==
 +
 
 +
 
 +
<br />
 +
===How can I put multiple images side by side to make one image===
 +
https://gimper.net/threads/re-how-can-i-put-multiple-pics-side-by-side-to-make-one-picture.1042/
 +
 
 +
Unir/Conbinar varias imágenes:
 +
* Open one of the pictures in GIMP
 +
* Go to File > Open As Layers and select the other two pictures
 +
* Go to Image > Canvas Size and make the canvas a lot bigger, it doesn't have to be exact, just big enough to fit the three pictures
 +
* Select the different layers one at a time and move them to where you want:
 +
: Crl PgUp / PgDn to change layer.
 +
* Finally go to Image > Fit Canvas to Layers
 +
 
 +
 
 +
<br />
 +
==Scilab==
 +
sudo apt-get install scilab
 +
 
 +
 +
<br />
 +
==Skype==
 +
sudo apt-get install skype
 +
 
 +
 +
<br />
 +
==Instalar emulador de Android en Ubuntu / ejecutar aplicaciones de Android en Ubuntu==
 +
 
 +
 
 +
<br />
 +
===Install Genymotion Android Emulator in Ubuntu 14.04===
 +
https://www.youtube.com/watch?v=MHmMDEzsJEY
 +
 
 +
 
 +
<br />
 +
====Instalar VirtualBox====
 +
Ver [[Virtualization#Instalación de VirtualBox]]
 +
 
 +
 
 +
<br />
 +
====Instalar GenyMotion====
 +
* Crear una cuenta y descargarlo en la página oficial https://www.genymotion.com/
 +
* Ejecutamos:
 +
bash genymotion-2.2...bin
 +
 
 +
* Luego entramos en el directorio genymotion e iniciamos el programa:
 +
./genymotion
 +
 
 +
* Agregamos una Virtual device:
 +
** Connect to Genymotion Cloud y agregar un usuario y su contraseña y creamos la Virtual Divice que querramos seleccionando entre las que se encuentran disponibles.
 +
** Iniciamos la Virtual device creada: en este punto se presentó un problema. Error: Unable to start the virtual device.  The virtual device got no IP adress. En el forum http://askubuntu.com/questions/545687/genymotion-virtual-device-got-no-ip-adress alguien publicó: I'm using Ubuntu 14.04 and I got the same error. I reduced the memory below 50% of the total memory. And now it works.
 +
 
 +
:: Para hacer esto, ejecuté VirtualBox desde la terminal (como root) y en Settings > System reduje la Memoria. Luego de hacer este cambio genymotion inició correctamente. Sin embargo, en ocasiones se sigue presentando el mismo error.
 +
 
 +
 
 +
<br />
 +
====Instalar WhatsApp====
 +
Iniciamos el navegador Web, descargamos WhatsApp de la página oficial y lo instalamos: https://www.whatsapp.com/android/
 +
 
 +
Si no se inicia el instalador luego de la descarga, nos vamos al directorio de descarga y lo iniciamos desde allí. Cuando el instalador se inicie aparecerá un mensaje diciendo: For security, your tablet is set to block installations of apps obtained from unknown sources. Debemos entoces permitirlo y esto se hace en Settings. Luego de hacer este ajuste en Setting la instalación debería poder completarse
 +
 
 +
 
 +
<br />
 +
===Las aplicaciones Android llegan a Chrome vía extensión===
 +
 
 +
 
 +
<br />
 +
==Linux System and network administration==
 +
 
 +
 
 +
<br />
 +
===How To Configure an IP Address In Ubuntu===
 +
Ubuntu 18.04 LTS
 +
 
 +
 
 +
* '''Temporary IP Address configuration using ifconfig''': (this configuration will desapear after a reboot)
 +
: https://danielmiessler.com/study/manually-set-ip-linux/
 +
 
 +
:<syntaxhighlight lang="shell">
 +
ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up
 +
</syntaxhighlight>
 +
 
 +
 
 +
 
 +
* '''Permanent IP Address configuration:'''
 +
: https://www.ostechnix.com/how-to-configure-ip-address-in-ubuntu-18-04-lts/
 +
: https://danielmiessler.com/study/manually-set-ip-linux/
 +
 
 +
 
 +
: We need to modify this file:
 +
:<syntaxhighlight lang="shell">
 +
/etc/netplan/
 +
</syntaxhighlight>
 +
 
 +
 
 +
: And then to apply the configuration, you run:
 +
:<syntaxhighlight lang="shell">
 +
netplan apply
 +
</syntaxhighlight>
 +
 
 +
 
 +
: You could also restart networking service:
 +
:<syntaxhighlight lang="shell">
 +
systemctl restart netwroking.service
 +
</syntaxhighlight>
 +
 
 +
 
 +
<br />
 +
===Automating tasks using the cronschedular - crontab===
 +
On Unix-like operating systems, the '''crontab''' command opens the '''cron table''' for editing. The cron table is the list of tasks scheduled to run at regular time intervals on the system. The '''daemon''' which reads the '''crontab''' and executes the commands at the right time is called '''cron'''. It is named after Kronos, the Greek god of time.
 +
 
 +
 
 +
* To start crontab:
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
crontab  -e
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
* The '''schedule component''' of the syntax is broken down into 5 different fields, which are written in the following order:
 +
:* m = minute 0-59
 +
:* h = hour 0-23
 +
:* dom = Day of the month 1-31
 +
:* mon = month 1-12 or JAN-DEC
 +
:* dow = Day of the week 0-6 or SUN-SAT
 +
 
 +
 
 +
* Together, tasks scheduled in a '''crontab''' are structured like this:
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
m  h  dom  mon  dow  command
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
* The command can be virtually any command you would normally run on the command line. This lets us automate tasks to run on a schedule
 +
 
 +
 
 +
 
 +
* '''Examples:'''
 +
<blockquote>
 +
 
 +
:* So, to run a command every Monday at 5:30 in the afternoon:
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
30 17 * * 1 /path/to/command
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
:* Or every 15 minutes
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
*/15 * * * * /path/to/command
 +
</syntaxhighlight>
 +
</blockquote>
 +
 +
 
 +
:* What if we wanted to have Linux write Hello World! to a text file called hello.txt once at 16:00 on Wednesday 24th March?
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
0  16  24  3  3  echo "Hello World!" >> hello.txt
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
:* At the end of every workweek at one minute to midnight (to run every Friday at 23:59)
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
59  23  *  *  5  echo "Hello World!" >> hello.txt
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
:* This would echo Hello World into hello.txt every minute and write a calendar into calendar .txt
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
*  *  *  *  * cal > calendar .txt
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
 
 +
:* Write to date.txt every minute
 +
<blockquote>
 +
<syntaxhighlight lang="shell">
 +
*  *  *  *  * date >> date.txt
 +
</syntaxhighlight>
 +
</blockquote>
 +
 
 +
</blockquote>
 +
 
 +
 
 +
<br />
 +
===Firewall Configuration===
 +
 
 +
 
 +
<br />
 +
====How can I see what ports are open====
 +
https://askubuntu.com/questions/9368/how-can-i-see-what-ports-are-open-on-my-machine
 +
 
 +
sudo apt install nmap
 +
nmap localhost
 +
nmap the_ip_address
 +
 
 +
 
 +
<br />
 +
====UFW - Uncomplicated Firewall====
 +
https://wiki.ubuntu.com/UncomplicatedFirewall
 +
 
 +
https://help.ubuntu.com/community/UFW
 +
 
 +
 
 +
<br />
 +
 
 +
===Basic configurations===
 +
 
 +
 
 +
<br />
 +
====Set the Hostname====
 +
Please follow our instructions for [https://www.linode.com/docs/getting-started#setting-the-hostname setting your hostname]. You can use the following commands to make sure it is set properly:
 +
 
 +
hostname
 +
hostname -f
 +
 
 +
The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN). https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server
 +
 
 +
 
 +
<br />
 +
====Set the Time Zone====
 +
https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server
  
<syntaxhighlight lang="sh">
+
When setting the time zone of your server, it may be best to use the time zone of the majority of your users. If you’re not sure which time zone would be best, consider using Universal Coordinated Time or UTC (i.e., Greenwich Mean Time).
#!/bin/bash
 
  
for i in {1..11}
+
By default, Linodes are set to UTC. Many operating systems provide built-in, interactive methods for changing time zones:
do
 
        pdftk library.pdf cat $i output pag$i.pdf
 
        pdfcrop --margins '-3 -3 -3 0' pag$i.pdf pag$i.pdf
 
        echo "$i "
 
done
 
</syntaxhighlight>
 
Este ejemplo se puede probar con este archivo: [[Media:Library.pdf]]
 
  
==La papelera - Trash==
 
En ubuntu 15 el directorio Trash se localiza en la ruta: ~/.local/share/Trash
 
 
===Mover archivos a la papelera desde el terminal===
 
http://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal
 
 
You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Si no está instalado:
 
sudo apt-get install gvfs-bin
 
 
Move file to trash:
 
 
gvfs-trash filename
 
 
See the content of the trash:
 
 
gvfs-ls trash://
 
 
Empty the trash:
 
  
gvfs-trash --empty
+
<br />
 +
=====Set the Time Zone in Debian or Ubuntu=====
 +
Issue the following command and answer the questions as prompted on the screen:
  
 +
dpkg-reconfigure tzdata
  
http://unix.stackexchange.com/questions/42757/make-rm-move-to-trash
 
  
As far as using any program as replacement/alias for rm is concerned, there are good reasons not to do that. Most important for me are:
+
<br />
 +
=====Set the Time Zone in CentOS 7 or Arch Linux=====
 +
View the list of available time zones:
  
* The program would need to understand/handle all of rm's options and act accordingly
+
timedatectl list-timezones
* It has the risk of getting used to the semantics of your "new rm" and performing commands with fatal consequences when working on other people's systems
 
  
<section begin=alias_gvfs-trash />
+
Use the Up, Down, Page Up and Page Down keys to navigate to the correct zone. Remember it, write it down or copy it as a mouse selection. Then press q to exit the list.
<syntaxhighlight lang="bash">
 
# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
 
alias del=gvfs-trash
 
</syntaxhighlight>
 
<section end=alias_gvfs-trash />
 
  
==Virtual Machines==
+
Set the time zone (change America/New_York to the correct zone):
  
===Popular virtual machine applications===
+
timedatectl set-timezone 'America/New_York'
https://help.ubuntu.com/community/VirtualMachines
 
  
====Xen====
 
Xen is a popular, open-source virtual machine application that is officially supported by Ubuntu. It provides high performance, but only supports a small number of host and guest operating systems. Ubuntu is supported as both a host and guest operating system, and Xen is available in the universe software channel.
 
  
====VirtualBox====
+
<br />
VirtualBox - Open-source virtual machine from Oracle. Easy to install and use and not to mention very popular.
+
=====Set the Time Zone Manually on a Linux System=====
 +
Find the appropriate zone file in /usr/share/zoneinfo/ and link that file to /etc/localtime. See the examples below for possibilities:
  
====VMWare====
+
Universal Coordinated Time:
VMware is a non-free virtual machine application, which supports Ubuntu as both a host and guest operating system. Several versions of VMware are available at no cost and can be installed on Ubuntu. One, vmware-player, is available from the multiverse software channel in Ubuntu. VMWare is the virtual machine solution that has been in use the longest and is the most widely used.
 
  
====Qemu====
+
ln -sf /usr/share/zoneinfo/UTC /etc/localtime
Qemu is a processor emulator and virtual machine. Qemu supports Ubuntu as both a host and guest operating system, and is capable of emulating arm, powerpc, sparc and x86 processors. Qemu is available from the universe software channel in Ubuntu as the package qemu.
 
  
====Microsoft Virtual PC====
+
Eastern Standard Time:
Microsoft Virtual PC is a proprietary virtual machine application for Microsoft Windows. It is capable of running Ubuntu as a guest operating system.
 
  
====Parallels====
+
ln -sf /usr/share/zoneinfo/EST /etc/localtime
Parallels - Commercial virtual machine for Macintosh computers.
 
  
==Instalar emulador de Android en Ubuntu / ejecutar aplicaciones de Android en Ubuntu==
+
American Central Time (including Daylight Savings Time):
  
===Install Genymotion Android Emulator in Ubuntu 14.04===
+
ln -sf /usr/share/zoneinfo/US/Central /etc/localtime
https://www.youtube.com/watch?v=MHmMDEzsJEY
 
  
====Instalar VirtualBox====
+
American Eastern Time (including Daylight Savings Time):
* Se puede descargar de la página e instalar manualmente:
 
** Descargargamos el archivo en https://www.virtualbox.org/wiki/Linux_Downloads
 
** Ejecutamos:
 
dpkg -i ./virtualbox-4.3...deb
 
  
* O a partir de los repositorios:
+
  ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime
  sudo apt-get install virtualbox
 
  
====Instalar GenyMotion====
 
* Crear una cuenta y descargarlo en la página oficial https://www.genymotion.com/
 
* Ejecutamos:
 
bash genymotion-2.2...bin
 
  
* Luego entramos en el directorio genymotion e iniciamos el programa:
+
<br />
./genymotion
+
===System Diagnostics===
  
* Agregamos una Virtual device:
 
** Connect to Genymotion Cloud y agregar un usuario y su contraseña y creamos la Virtual Divice que querramos seleccionando entre las que se encuentran disponibles.
 
** Iniciamos la Virtual device creada: en este punto se presentó un problema. Error: Unable to start the virtual device.  The virtual device got no IP adress. En el forum http://askubuntu.com/questions/545687/genymotion-virtual-device-got-no-ip-adress alguien publicó: I'm using Ubuntu 14.04 and I got the same error. I reduced the memory below 50% of the total memory. And now it works.
 
  
:: Para hacer esto, ejecuté VirtualBox desde la terminal (como root) y en Settings > System reduje la Memoria. Luego de hacer este cambio genymotion inició correctamente. Sin embargo, en ocasiones se sigue presentando el mismo error.
+
<br />
 +
====Check Current Memory Usage====
  
====Instalar WhatsApp====
 
Iniciamos el navegador Web, descargamos WhatsApp de la página oficial y lo instalamos: https://www.whatsapp.com/android/
 
  
Si no se inicia el instalador luego de la descarga, nos vamos al directorio de descarga y lo iniciamos desde allí. Cuando el instalador se inicie aparecerá un mensaje diciendo: For security, your tablet is set to block installations of apps obtained from unknown sources. Debemos entoces permitirlo y esto se hace en Settings. Luego de hacer este ajuste en Setting la instalación debería poder completarse
+
<br />
 +
====Monitor I/O Usage with vmstat====
  
===Las aplicaciones Android llegan a Chrome vía extensión===
 
  
==Importar música a un Ipod==
+
<br />
https://help.ubuntu.com/community/PortableDevices/iPod
+
====Monitor Processes, Memory, and CPU Usage with htop====
  
For this you can use Rhythmbox, Banshee, Amarok or gtkpod. Banshee and Amarok are full music management applications that work with the iPod (much like iTunes), whereas gtkpod is a simpler application used only to sync with the iPod.
 
  
==Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu==
+
<br />
https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
+
===Restart the WiFi-Wireless Network Adapter===
 +
service network-manager stop
 +
service network-manager start
 +
service network-manager restart
  
http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
 
  
Cuando inicio el SO se produce un error que interrumpe el booting. El error es producido porque Ubuntu no puede montar la partición NTFS a la cual he accedido en Windows.
+
<br />
 +
===Connect to a particular WiFi Network===
 +
https://askubuntu.com/questions/833905/how-can-i-connect-to-a-specific-bssid
  
Si inicio Ubuntu en modo Upstart, el SO inicia sin montar dicha partición.
+
The command nmcli allows to display the WiFi networks with all their details
 +
nmcli c
 +
nmcli d wifi
 +
nmcli -f in-use,ssid,bssid,chan,rate,mode,signal,bars  dev wifi
  
Luego si intento montar la partición, se produce el siguiente error:
+
To connect to a particular network we can spedify the SSID:
 +
nmcli d wifi connect «the_SSID» password «the_password»
  
adelo@adelo-laptop:~$ sudo mount /dev/sda2 1-disco_local/
+
Now, if we want to connect to a particular Access Point, we must specify the Access Point ID (bssid) istead:
[sudo] password for adelo:
+
  nmcli d wifi connect «the_BSSID» password «the_password»
The disk contains an unclean file system (0, 0).
 
Metadata kept in Windows cache, refused to mount.
 
Failed to mount '/dev/sda2': Operation not permitted
 
The NTFS partition is in an unsafe state. Please resume and shutdown
 
Windows fully (no hibernation or fast restarting), or mount the volume
 
  read-only with the 'ro' mount option.
 
  
El error es debido a que Microsoft introduced a new feature in Windows 8 and 10 to reduce the boot time in otherwise slow Windows OS. This feature is called '''Fast Startup'''
+
<span style="color:#FF0000">When I tried to run this command as root I got an error, so we have to do it as a standard user.</span>
  
In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.
+
<span style="color:#FF0000">If we don't find the network or Access Point we are looking for, a good idea is to restart the WiFi-wireless Network Adapter:</span>
 +
service network-manager stop
 +
service network-manager start
 +
service network-manager restart
  
Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root). https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
+
Then, with «nmcli» we can check if we can see the Network or Access Point we are looking for.
  
  
'''El problema se puede resuelver haciendo:''' http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation
+
<span style="color:#FF0000">The problem that I got in CCT for a long time that avoid me to successfully connect to the CCT network was that CCT has many access points that use different channels. For some reason, my network adaptor wasn't working well in some chanels (I was able to connect to these chanels but the internet connection was too sllow, sometime it doesn't work at all). Actually, I just was able to sucessfully connect using chanel 11. So when I choose an Access Point that was using chanell 11, I was able to get a fast internet connection.</span>
  
sudo ntfsfix /dev/sda2
 
  
Sin embargo, habría que ejecutar dicho comando cada vez que queramos iniciar Ubuntu.
+
<br />
 +
===Request - Renew the IP address from DHCP===
 +
Release the current lease and stop the running DHCP client:
 +
dhclient -r
  
'''Permanent Solution:''' Disable Fast Startup in Windows 8 and Windows 10.
 
  
Use the following path to disable fast startup:
+
Request a new IP address:
 +
dhclient
  
Go to Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do and uncheck the Turn on fast startup box. https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/
 
  
==Mis configuraciones==
+
<br >
He creado el directorio:
+
===Network Diagnostics===
'''~/1-disco_local/.1-conf''' : donde pienso guardar todos mis archivos relacionados con configuraciones o archivos ocultos.
+
https://www.linode.com/docs/tools-reference/linux-system-administration-basics#network-diagnostics
  
He creado los directorios:
 
'''~/1-disco_local/.archivos_programas''' : donde pienso guardar algunos archivos de programas. Más que todo archivos que quiera guardar aún después de la desinstalación de un programa. Ej: eclipse-workspace.
 
'''~/1-disco_local/.archivos_programas/windows''' :
 
  
'''~/.archivos_programas-ubuntu''' : donde pienso guardar los archivos de programas que demandan la creación de un directorio en ~ durante el proceso de instalación.
+
<br />
 +
====The ping Command====
 +
The ping command tests the connection between the local machine and a remote address or machine. The following commands "ping" google.com and 216.58.217.110:
  
===Configuraciones hechas en el .bashrc - /root/.bashrc - /etc/bash.bashrc===
+
ping google.com
'''~/.bashrc:'''
+
ping 216.58.217.110
  
<syntaxhighlight lang="bash">
+
These commands send a small amount of data (an ICMP packet) to the remote host and wait for a response. If the system is able to make a connection, it will report on the “round trip time” for every packet. Here is the sample output of four pings to google.com:
#===========================
 
# Cambios realizados por mi
 
#===========================
 
  
# Para la instalación del Seismic Unix:
+
PING google.com (216.58.217.110): 56 data bytes
export CWPROOT=/home/adelo/1-disco_local/1-mis_archivos/1-pe/1-ciencia/1-geofisica-procesamiento-modelado_sismico/seismic_unix/instalacion_seismic_unix
+
64 bytes from 216.58.217.110: icmp_seq=0 ttl=54 time=14.852 ms
 +
64 bytes from 216.58.217.110: icmp_seq=1 ttl=54 time=16.574 ms
 +
64 bytes from 216.58.217.110: icmp_seq=2 ttl=54 time=16.558 ms
  
 +
The time field specifies in milliseconds the duration of the round trip for an individual packet.
  
PATH=$PATH:$CWPROOT/bin
+
You’ll be presented with some statistics once the process is stopped. This will resemble:
export PATH
 
  
 +
--- google.com ping statistics ---
 +
4 packets transmitted, 4 received, 0% packet loss, time 3007ms
 +
rtt min/avg/max/mdev = 33.890/40.175/53.280/7.679 ms
  
# Después de la instalación de Eclipse, para adicionar el ejecutable a la lista de comandos:
+
There are several important data points to notice:
PATH=$PATH:/home/adelo/.archivos_programas-ubuntu/eclipse/eclipse:
 
  
 +
    Packet Loss, or the discrepancy between the number of packets sent and the number of packets that return successfully. This number shows the percentage of packets that are dropped.
 +
    Round Trip Time (rtt) statistics on the final line report information about all the ping responses. For this ping we see that the fastest packet round trip (min) took 33.89 milliseconds. The average round trip (avg) took 40.175 milliseconds. The longest packet (max) took 53.28 milliseconds. A single standard deviation unit (mdev) for these four packets is 7.67 milliseconds.
  
# Ajustar la permisología por defecto (base) de los archivos y directorios creados: drwxr-xr-x (755)  -rw-r--r-- (644)
+
The ping command is useful as an informal diagnostic tool to measure point-to-point network latency, and as a tool to simply ensure you are able to make a connection to a remote server.
umask u=rwx,g=rx,o=rx
 
  
  
# -X : sort alphabetically by entry extension
+
<br />
# -A : do not list implied . and ..
+
====The traceroute Command====
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
+
The traceroute command expands on the functionality of the ping command. It provides a report on the path that the packets take to get from the local machine to the remote machine. Each step (intermediate server) in the path is called a hop. Route information is useful when troubleshooting a networking issue: if there is packet loss in one of the first few hops the problem is often related to the user’s local area network (LAN) or Internet service provider (ISP). By contrast, if there is packet loss near the end of the route, the problem may be caused by an issue with the server’s connection.
# alias la='ls -AX'
 
  
 +
Here is an example of output from a traceroute command:
 +
$ traceroute 216.58.217.110
 +
traceroute to 216.58.217.110 (216.58.217.110), 30 hops max, 60 byte packets
 +
1  192.168.10.5 (192.168.10.5)  1.355 ms  1.936 ms  3.195 ms
 +
2  192.168.1.1 (192.168.1.1)  3.858 ms  10.273 ms  13.211 ms
 +
3  * * *
 +
4  109.255.255.254 (109.255.255.254)  18.469 ms  20.636 ms  22.270 ms
 +
5  ie-dub01a-ra4-ae31-0.aorta.net (84.116.238.42)  22.525 ms  22.865 ms  22.922 ms
 +
6  ie-dub01a-ri1-ae52-0.aorta.net (84.116.130.117)  22.550 ms  6.635 ms  15.125 ms
 +
7  213.46.165.18 (213.46.165.18)  15.287 ms  16.058 ms  19.209 ms
 +
8  209.85.252.198 (209.85.252.198)  19.466 ms  19.886 ms 209.85.252.196 (209.85.252.196)  18.892 ms
 +
9  209.85.255.221 (209.85.255.221)  28.838 ms  29.073 ms  31.281 ms
 +
10  209.85.254.245 (209.85.254.245)  126.529 ms 209.85.254.251 (209.85.254.251)  109.405 ms  109.747 ms
 +
11  209.85.143.211 (209.85.143.211)  94.186 ms 72.14.236.99 (72.14.236.99)  96.027 ms  96.982 ms
 +
12  209.85.143.255 (209.85.143.255)  94.640 ms  95.372 ms  98.093 ms
 +
13  iad23s42-in-f14.1e100.net (216.58.217.110)  97.375 ms  94.635 ms  94.856 ms
  
# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
+
Often the hostnames and IP addresses on either side of a failed jump are useful in determining who operates the machine where the routing error occurs. Failed jumps are designated by lines with three asterisks (* * *).
alias ls='ls -v'
 
  
 +
Adding traceroute output to Linode support tickets is sometimes useful when trying to diagnose network issues. You may also want to forward traceroute information to your Internet Service Provider (ISP) if you suspect that the connectivity issue is with your ISP’s network. Recording traceroute information is particularly useful if you are experiencing an intermittent issue.
  
# He creado los comandos cdd y cdp para facilitar el acceso a 1-system y 1-pe:
 
function cds() {
 
  cd ~/1-system
 
}
 
cds
 
  
function cdp() {
+
<br />
  cd ~/1-system
+
====The mtr Command====
}
+
The mtr command, like the traceroute tool, provides information about the route that internet traffic takes between the local system and a remote host. However, mtr provides additional information about the round trip time for the packet. In a way, you can think of mtr as a combination of traceroute and ping.
  
 +
Here is an example of output from an mtr command:
  
# Para cambiar el nombre desplegado en la esquina superior derecha del la gnome-ventana del terminal:
+
$ mtr -r 216.58.217.110
# La siguiente función is to rename terminal tab title in gnome-terminal:
+
Start: Tue Nov 15 03:27:45 2016
# Si queremos cambiar el title in gnome-germinal ejecutamos esta funci'on en el terminal de la siguiente forma:
+
HOST: adelo-laptop                Loss%  Snt  Last  Avg  Best  Wrst StDev
# # set-title my new tab title
+
  1.|-- 192.168.10.5              0.0%    10    1.0  1.3  0.9  2.8  0.3
function set-title() {
+
  2.|-- 192.168.1.1              10.0%    10    1.5  1.7  1.0  3.5  0.6
   if [[ -z "$ORIG" ]]; then
+
  3.|-- 10.253.152.1              0.0%    10  10.1  8.9  7.3  10.7  1.2
    ORIG=$PS1
+
  4.|-- 109.255.255.254          10.0%    10    8.6  7.7  5.7  9.8  1.1
   fi
+
   5.|-- ie-dub01a-ra4-ae31-0.aort 30.0%    10    8.4  9.2  7.6  11.0  1.2
   TITLE="\[\e]2;$*\a\]"
+
  6.|-- de-fra01a-ri2-xe-4-1-0.ao 30.0%    10  12.5  8.9  6.6  12.5  2.4
   PS1=${ORIG}${TITLE}
+
   7.|-- 213.46.165.18              0.0%    10    7.5  11.8  6.5  41.0  10.3
}
+
   8.|-- 209.85.252.198            20.0%    10  11.0  8.6  6.2 11.0  1.8
</syntaxhighlight>
+
   9.|-- 209.85.248.57              0.0%    10  17.0  20.8  16.9  26.6  3.8
Ver [[Linux#Mover archivos a la papelera desde el terminal|Mover archivos a la papelera desde el terminal]] para más detalles del por qué se ha creado el siguiente alias:
+
10.|-- 209.85.254.245            10.0%    10  105.5  96.8  93.0 105.5  4.6
{{#lst:Linux|alias_gvfs-trash}}
+
11.|-- 72.14.236.99              10.0%    10  91.8  97.6  91.8 106.9  5.2
 +
12.|-- 209.85.143.255            30.0%    10  93.1  94.2  93.1  96.1  0.8
 +
13.|-- iad23s42-in-f14.1e100.net 30.0%    10  94.9  93.7  92.7  95.2  0.7
  
 +
Like the ping command, mtr tracks the speed of the connection in real time until you exit the program with CONTROL+C. To have mtr stop automatically and generate a report after ten packets, use the --report flag:
  
'''/root/.bashrc:''' configuraciones para el root
+
mtr --report
  
<pre>
+
Be aware that mtr will pause for a few moments while generating output. For more information regarding mtr consider our [https://www.linode.com/docs/networking/diagnostics/diagnosing-network-issues-with-mtr/ diagnosing network issues with mtr] guide.
#===========================
 
# Cambios realizados por mi
 
#===========================
 
  
# -X : sort alphabetically by entry extension
 
# -A : do not list implied . and ..
 
# He realizado este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
 
alias 'la=ls -AX'
 
</pre>
 
  
===Configuración en ~/.config/user-dirs.dirs===
+
<br />
 +
===Network File System (NFS)===
 +
http://www.learnlinux.org.za/courses/build/net-admin/net-admin-all.html#nfs
  
XDG_DESKTOP_DIR="$HOME/1-disco_local/1-mis_archivos/stockage/desktop-dis"
 
XDG_DOWNLOAD_DIR="$HOME/1-disco_local/1-mis_archivos/stockage/downloads-dis"
 
  
Luego, en mi home, creé un soft link (llamado Desktop) hacia desktop-dis. Esto es apropiado para poder ingresar fácilmente al escritorio desde mi home.
+
<br />
 +
==[[Shell Scripting]]==
  
ln -s 1-disco_local/1-mis_archivos/stockage/desktop-dis/ Desktop
 
ln -s 1-disco_local/1-mis_archivos/stockage/downloads-dis/ Downloads
 
  
==Instalación de algunos programas==
+
<br />

Latest revision as of 13:13, 29 January 2025



Contents

 [hide




1 Instalación


1.1 Creating a bootable USB flash drive


1.1.1 Creating a bootable Linux USB flash drive desde el terminal usando dd

Siguiendo el siguiente procedimiento, creé uno de Ubuntu 15, 18.04, CentOs 7, Red Hat 7.5, desde Ubuntu 15 y todos funcionaron correctamente.

  • Antes de crear el bootable drive es apropiado formatear el dispositivo en Fat32 (vFat).
  • Debemos desmontar el dispositivos antes de ejecutar el comando dd:

umount /dev/sdb*

  • Creación del bootable USB flash a través de dd:
dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
Nota_sdb

Make sure you select as destination the device corresponding to the USB key (/dev/sdb in the above example) and not a partition (such as /dev/sdb1). Esta advertencia creo que depende de en que dev se encuentre montado el usb drive. Generalmente mis USB drives se montaban en /dev/sdb1. En este caso creo que se tendría que poner sdb1 en el comando (no estoy seguro). Sin embargo luego de la última vez que formateé mi USB drive, éste se monta en en /dev/sdb (sin ningún número). En este caso por supuesto habría que colocar sdb en el comando dd como se suguiere arriba. Algo parecido se presenta al formatear el USB drive.

Con este método el bootable CentOS se creó correctamente. En el USB drive se crearon dos particiones:

sdb    iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
├─sdb1 iso9660 CentOS 7 x86_64 2015-12-09-23-03-16-00
└─sdb2 vfat    ANACONDA        C522-73DA



1.1.2 How can I create a Windows bootable USB stick with Ubuntu:

https://www.cyberciti.biz/faq/create-a-bootable-windows-10-usb-in-linux/



1.1.2.1 WoeUSB

https://www.cyberciti.biz/faq/create-a-bootable-windows-10-usb-in-linux/

En la página anterior se describen varios métodos. A través del primer método descrito en dicho link (WoeUSB) creé un bootable-windows-10-usb correctamente en Ubuntu 18.04. A continuación se describe el método.



1.1.2.1.1 Installing WoeUSB

Clone WoeUSB:

git clone https://github.com/slacka/WoeUSB.git

Set the application version string:

cd WoeUSB/
./setup-development-environment.bash

Install WoeUSB’s build dependencies on a Debian or Ubuntu Linux:

sudo apt-get install devscripts equivs gdebi-core
mk-build-deps
sudo gdebi woeusb-build-deps_*.deb
dpkg-buildpackage -uc -b
sudo gdebi ../woeusb*.deb



1.1.2.1.2 Make a Bootable Windows 10 USB from Linux
sudo woeusb --device win_10.iso /dev/sdc

Not a fan of the CLI? Try gui version:

woeusbgui



1.1.2.2 winusb

http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/

http://askubuntu.com/questions/289559/how-can-i-create-a-windows-bootable-usb-stick-with-ubuntu

Esto lo había realizado con éxito a través del comando winusb en Ubuntu 14; instalándolo a partir de los repositorios:

sudo add-apt-repository ppa:colingille/freshlight
sudo apt-get update
sudo apt-get install winusb

Sin embargo, en Ubuntu 16, no pude instalar winusb de dicha manera.

En este post se indica cómo instalarlo manualmente: http://sourcedigit.com/20589-how-to-install-winusb-on-ubuntu-16-04/

Install WinUSB in Ubuntu 16.04

Although WinUSB hasn’t been updated for Ubuntu 16.04 Systems, users can install WinUSB on Ubuntu 16.04 by compiling the WinUSB source code.

Before you begin to install WinUSB, run the command given below to install the dependencies:

sudo apt-get install gcc build-essential libwxbase3.0-dev libwxgtk3.0-dev

Once the dependencies are installed, run the command below to download the WinUSB package and extract it accordingly:

wget ftp://ftp.ru.debian.org/gentoo-distfiles/distfiles/winusb-1.0.11.tar.gz
tar zxf winusb-1.0.11.tar.gz
cd winusb*/src
sed -i -- 's#wxStandardPaths().GetInstallPrefix()#wxStandardPaths::Get().GetInstallPrefix()#g' findFile.cpp
sed -i -- 's#wxStandardPaths().GetDataDir()#wxStandardPaths::Get().GetDataDir()#g' findFile.cpp

Now it’s time to compile winusb-1.0.11 bu running the commands given below:

cd ..
./configure
make
sudo make install
cd ..
rm -rf winusb-1.0.11

Luego de realizar la instalación manual como se indica arriba, tampoco fui capaz de crear el Windows USB bootable debido a que se producían ciertos errores cuando intentaba hacerlo. Luego de varios intentos lo logré. Sin embargo no estoy seguro de cual fue la solución. Creo que a la hora de seleccionar el dispositivo donde será creado el USB bootable, tenemos que utilizar la opciones del programa que nos permiten seleccionar (haciendo clic) el dispositivo exacto en donde lo queremos crear (/dev/sdb1, por ejemplo); y no seleccionar el dispositivo propuesto a penas abrimos el programa (generalmente /dev/sdb, sin el número de partición).

Lo otro importante es que el dispositivo USB debe ser formateado en NTFS.

Sólo a través de este programa (winusb) he logrado crear con éxito un Windows USB bootable.



1.1.2.3 A través de dd

Lo intenté hacer desde la línea de comando a través del comando dd y no resultó.



1.2 Proceso de instalación

Antes de instalar Ubuntu es apropiado chequear si Windows ha sido configurado con un BitLocker Drive Encryption recovery key (Podría estar configurado de esta forma de fábrica). Si es el caso, luego de reaizar cambios en el disco durante el proceso de instalación de Ubuntu, Windows nos pedirá esta key durante el boot. Ver https://www.youtube.com/watch?v=exz3R6icsNk



1.2.1 Algunos notas sobre el instalador de Ubuntu

  • En el proceso de instalación de Ubuntu se propone de una vez la instalación de «Third-party sortwares» (algunos de estos son propietarios). Así, el sistema fue capaz de habilitar directamente el WiFi en mi computadora.
Ubuntu third party sortwares.png
  • Cuando elegimos la partición en donde será instalado Ubuntu y tenemos, por supuesto, que asignarle un «Mount point», el instalador no da la opción de asignar el «Moint point» hasta que seleccionemos «Format the partition» e indiquemos, por supuesto, el «File System». Por tamto, así le hayamos dado un formato a la partición antes de iniciar el intalador de Ubuntu (a través de Gparted), tendremos que realizar el formateo de la partición en cuestión durante el proceso de instalación.
  • Si hemos creado la partición swap previamente con Gparted, el instalador no marca la selección de la partición swap (ver las imágenes abajo). Lo que quiero decir es que el instalador no es claro (al momento de la selección de las particiones) en indicar que hemos seleccionado una partición swap para la instalación. Sin embargo, luego de hacer click en «Install Now», una ventana de warning se abre e indica las particiones que hemos elegido para la instalación del SO. Ahí sí podemos corroborar con claridad las particiones que han sido configuradas para la instalación de Ubuntu.
Formatear la particion durante instalacion.jpg
Seleccion de la particion swap en Ubuntu1.jpg
Seleccion de la particion swap en Ubuntu2.jpg



1.2.2 Creating and selecting the partition where the SO will be installed

Notes about the last installation:

Tradicionalmente, los disco duros permiten un máximo de cuatro (4) particiones primarias (o 3 más una extendida). Sólo puede haber una (1) Extendida y dentro de ésta última pueden haber un máximo de 23 particiones lógicas (https://es.wikipedia.org/wiki/Partici%C3%B3n_de_disco). However, the last time I configured partitions, I did it for a GPT disc. In this kind of discs, no extended or logic partition can be created. You can created as many primary partitions as you want (well! I'm not sure what is the maximum): https://askubuntu.com/questions/927927/why-cant-i-create-an-extended-partition

The other important detail about the last installation was that when I first try to reduce space in the Default "C:" Windows partition using Gparted, I was NOT allowed to do it. The solution that I found was to do it from Windows in a very easy way even with the partition mounted was possible to do it as it is explained here: https://www.easeus.com/partition-master/resize-partitions-windows-11.html . After reducing space that way, I was able to normally manage the partitions using Gparted.


Resize a partition from Windows:

Step 1. Press Win+R keys to open the Command box on your Windows 11.
Step 2. Type diskmgmt.msc and then click "OK".
Step 3. Once you are in Disk Management on Windows 11, Select the partition you want to resize and right-click it choosing "Shrink Volume".
Step 4. A new Shrink dialog box will open as shown below. The minimum amount of space to shrink the partition is specified in MB or GB (1GB = 1024MB) and you have the option to specify a maximum value for how much space you can take away.


Ver nota sobre el Tamaño de la partición.


La parte más delicada es cuando debemos crear (si no existe ya) y seleccionar la partición en la que se instalará el SO.


Para el particionamiento se pueden usar las opciones propuestas por el instalador o podemos también hacer el particionamiento antes de iniciar el instalador a través del programa GParted

GParted se puede utilizar desde Ubuntu Live (Running Ubuntu directly from either a USB stick or a DVD). Recomiendo hacerlo de esta forma para esquemas de particiones complejos

Si se hace a través del instalador, la única confución que se presetan es que este programa no detalla el tipo de partición «Extendida». De hecho, cuando se va a crear una partición, el programa sólo propone como tipos de particiones: «Primaria» o «Lógica». Sin embargo, no es coherente crear una partición lógica antes que una Extendida. Es por ello que cuando creamos la primera partición Lógica el programa automáticamente crea la partición extendida donde, por supuesto, se encontrará la partición Lógica que estamos creando. De ahí en adelante toda partición Lógica que creemos se incluirá dentro de dicha partición Extendida (puesto que sólo puede haber una partición Extendida en el disco). Además, si por equivocación ejecutamos la creacion de una quinta partición Primaria, el programa no dará ningún error y creará la partición sin ningún problema, sólo que ésta no será Primaria sino que el programa aútomáticamente la creará de tipo Lógica.

GParted es un poco mejor puesto que es un programa hecho exclusivamente para particionamiento. Este programa si detalla adecuadamente el tipo de partición Extendida.

Para instalar Linux tenemos que crear por lo menos dos particiones (Indispensables):

La partición Swap : Puede ser Primaria o Lógica -- Se puede crear en cualquier posición -- Filesystem: Swap -- Tamaño -- Utilidad.
La particion root / : Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) -- Tamaño: Minimum 8Go. Pour une question de confort au moins 15Go. 


En muchos forums se propone también la creación de las siguientes particiones (Opcionales):

/boot : Ésta podría ser indispensable -- Creo que debe ser primaria -- Se debe crear al inicio del disco -- Filesystem: Linux (généralement EXT4) -- Tamaño: 250Mo~1Go -- Utilidad -- Punto de montaje: /boot https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
/home : Primaria o Lógica -- Cualquier posición -- Filesystem: Ext4 (EXT2 pour une installation sur clef USB) (Remarque: d'autres systèmes de fichiers sont disponibles) -- Tamaño: Selon votre usage -- Utilidad -- Punto de montaje: /home https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

También he visto que podría ser ventajoso crear particiones para:

/tmp 
/var
/usr

Sin embargo, después de consultar distintas páginas llegué a la conclusión de que no es ventajosa la creación de las particiones opcionales sino en casos particulares.

En la siguiente página se exponen las útilidades (pro y contras) de algunas de las particiones opcionales https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu



1.2.3 La partición swap

What is swap?

Swap space is the area on a hard disk which is part of the Virtual Memory of your machine, which is a combination of accessible physical memory (RAM) and the swap space. Swap space is used when your system decides that it needs physical memory for active processes and there is insufficient unused physical memory available. https://help.ubuntu.com/community/SwapFaq



1.2.3.1 Utilidad

Utilité : L'espace d'échange (en anglais, swap space) est une extension de la mémoire vive (RAM) de votre ordinateur. Afin d'éviter un blocage de votre ordinateur lorsque sa RAM est pleine, Ubuntu se sert de cette partition pour décharger temporairement la RAM. Son utilisation à cet effet est plutôt rare dans les ordinateurs modernes, disposant d'au moins 1 Go de RAM. Cependant, elle sert aussi de décharge de la RAM lors de la mise en hibernation, c'est pour cette raison que la taille de la partition swap doit être d'au moins la taille de votre RAM si vous souhaitez utiliser cette fonction. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu



1.2.3.2 Que tamaño debe tener la partición swap

How much swap do I need?

For less then 1GB of physical memory (RAM), it's highly recommended that the swap space should, as a base minimum, be equal to the amount of RAM. Also, it's recommended that the swap space is maximum twice the amount of RAM

For more modern systems (>1GB), your swap space should be at a minimum minimum be equal to your physical memory (RAM) size "if you use hibernation", otherwise you need a minimum of round(sqrt(RAM)) and a maximum of twice the amount of RAM. https://help.ubuntu.com/community/SwapFaq

I have 16GB RAM. Do I need 32GB swap?

It entirely depends on what you plan to do with the machine. For example if it were a Sap server then yes, I would add 32gb swap (we have boxes at work with 128gb ram and 32gb swap). If you were manipulating massive pictures and video then it makes sense to have a little swap. 32gb is probably overkill. http://askubuntu.com/questions/49109/i-have-16gb-ram-do-i-need-32gb-swap

Here's a very good recommendation from RedHat:

In years past, the recommended amount of swap space increased linearly with the amount of RAM in the system. But because the amount of memory in modern systems has increased into the hundreds of gigabytes, it is now recognized that the amount of swap space that a system needs is a function of the memory workload running on that system. However, given that swap space is usually designated at install time, and that it can be difficult to determine beforehand the memory workload of a system, we recommend determining system swap using the following table. https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html#id4394007

Amount of RAM in the system   Recommended swap space         Recommended swap space 
                                                             if allowing for hibernation
---------------------------   ----------------------------   ---------------------------
2GB of RAM or less            2 times the amount of RAM      3 times the amount of RAM
2GB to 8GB of RAM             Equal to the amount of RAM     2 times the amount of RAM
8GB to 64GB of RAM            0.5 times the amount of RAM    1.5 times the amount of RAM
64GB of RAM or more           At least 4 GB                  No extra space needed



1.2.3.3 Donde colocar la partición Swap

Estuve leyendo y al parecer no importa donde la colocamos en el disco duro: al principio, en el medio o al final. It doesn’t matter where on the hard drive the swap partition is located (beginning, middle or the end).



1.2.3.4 Utilizar la misma partición Swap para distintas instalaciones de Linux

https://forum.ubuntu-fr.org/viewtopic.php?id=762271

Por ejemplo, si en mi computadora instalo Ubuntu y Red Hat... puedo emplear la misma partición Swap para ambos sistemas?

Si tu n'utilises pas la fonction d'hibernation, tu peux utiliser la même swap pour les deux. Il peut y avoir souci si la 2ème install formate la partition swap, changeant ainsi son UUID (la 1ère distrib ne la trouvera donc plus). Ça se règle en corrigeant le UUID dans le fichier /etc/fstab de la 1ère distrib

Et oui, tu peux partager la même partition swap, puisque elle n'est censée contenir quelque chose qu'entre le démarrage et l'extinction, et être vide à l'arrêt du PC (sauf si tu utilises l'hibernation, qui met le contenu de la RAM dans la swap pour le prochain démarrage)

Pour savoir si la swap est utilisée par les 2, ouvre le fichier /etc/fstab des deux distribs, elles doivent comporter la même ligne concernant swap.

Un doute subsiste quand à la partition "swap", comment être certain que cette dernière est utilisée pas Fedora et Ubuntu ?

Pour savoir si la swap est utilisée par les 2, ouvre le fichier /etc/fstab des deux distribs, elles doivent comporter la même ligne concernant swap.



1.2.4 Utilidad de la partición boot

Certains ordinateurs n'arrivent pas à lire les fichiers de démarrage s'ils sont situés trop loin (>100Go) du début du disque. Dans ce cas, il est généralement nécessaire de créer une partition /boot en début de disque5). Mais cette partition /boot séparée n'est généralement pas utile sur un ordi récent (achat après 2007) et elle peut même générer des problèmes, aussi il vaut mieux ne créer cette partition /boot que sur avis des experts du forum en cas où elle est réellement indispensable. https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu



1.2.5 Utilidad de la partición home

Lorsque vous disposez d'un disque dur suffisamment grand, un dossier home séparé permet d'isoler les paramètres personnels et les dossiers personnels des utilisateurs du reste du système. Par défaut, ce dossier fait partie de la partition racine. Un /home séparé est généralement superflu, voire gênant (notamment sur de petits disques) si vous débutez avec Ubuntu. Consulter ce comparatif pour savoir si un home séparé peut vous être utile. Important: un /home séparé ne sert pas à partager des données avec Windows ou MacOS (voir le paragraphe précédent). https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu

Es infinitamente más cómodo tener el /home en una partición separada a la hora de actualizar la versión de ubunto desde un disco o pendrive y ante emergencias que requieran una reinstalación del sistema. Si todo está en la partición “/” antes de reinstalar o actualizar hay que hacer una backup de la carpeta /home donde están nuestros ficheros y preferencias. Ahora bien, si /home está en una partición no será necesario realizar un respaldo. Durante el proceso de instalación debemos marcar la partición / para formateo y /home sin formateo. Despúes se crean los mismos usuarios con el mismo nombre y ya tenemos todos los datos. Es así por experiencia mucho más sencillo y rápido.

http://elblogdeliher.com/mi-recomendacion-para-hacer-las-particiones-para-instalar-ubuntu/



1.2.6 Partición para los datos

Es apropiado crear una partición para todos los datos. Esto resulta de especial interés al momento de formatear y reinstalar los sistemas operativos. De esta manera no es necesario realizar un respaldo de los datos pues esta partición no se tocaría al momento de formatear y reinstalar los SO.

Ahora bien, si queremos compartir los datos entre Linux y Windows, la partición de almacenamiento debe entonces tener formato NTFS. Lo anterior porque bien sabemos que Linux es compatible con este sistema de archivos. Windows, por el contrario, no podría acceder a un sistema de archivos Linux como EXT4.



1.2.7 Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?


1.2.7.1 Chmod and chown en particiones ntfs


1.2.7.2 Error producido cuando ingreso a una partición desde Windows y luego trato de montarla en Ubuntu

https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/

http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation

Cuando inicio el SO se produce un error que interrumpe el booting. El error es producido porque Ubuntu no puede montar la partición NTFS a la cual he accedido en Windows.

Si inicio Ubuntu en modo Upstart, el SO inicia sin montar dicha partición.

Luego si intento montar la partición, se produce el siguiente error:

adelo@adelo-laptop:~$ sudo mount /dev/sda2 1-disco_local/
[sudo] password for adelo: 
The disk contains an unclean file system (0, 0).
Metadata kept in Windows cache, refused to mount.
Failed to mount '/dev/sda2': Operation not permitted
The NTFS partition is in an unsafe state. Please resume and shutdown
Windows fully (no hibernation or fast restarting), or mount the volume
read-only with the 'ro' mount option.

El error es debido a que Microsoft introduced a new feature in Windows 8 and 10 to reduce the boot time in otherwise slow Windows OS. This feature is called Fast Startup

In normal shut down process, power is removed from all components such as CPU, RAM, CD-Rom and hard disks. But in fast start up, Windows 8 saves some system information such as caching the registry etc to a file during shutdown. Part of the metadata about the state of all mounted partitions at the time of turn-off, is among these system information. This reduces the boot time of the Windows 8 but it creates the trouble for Ubuntu.

Since the information about the NTFS partition is stored in Windows 8, this prevents Ubuntu to mount them as mounting them in Linux will alter the metadata of the partitions. This is why it is in protected mode and you cannot mount it (without being root). https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/


El problema se puede resuelver haciendo: http://askubuntu.com/questions/748163/unable-to-mount-ntfs-partition-no-hibernation

sudo ntfsfix /dev/sda2

Sin embargo, habría que ejecutar dicho comando cada vez que queramos iniciar Ubuntu.


Permanent Solution: Disable Fast Startup in Windows 8 and Windows 10.

Use the following path to disable fast startup:

Go to Control Panel > Hardware and Sound > Power Options > System Setting > Choose what the power buttons do and uncheck the Turn on fast startup box. https://itsfoss.com/solve-ntfs-mount-problem-ubuntu-windows-8-dual-boot/


El error descrito arriba se generó en Ubuntu 15. Ubuntu 18.04 no presentó dicho problema. Sin embargo, sí noté que luego de ingrasar a las particiones (1-disco_local, etc) desde Windows, al apagar la computadora, Windows tomaba mucho tiempo en apagar el sistema. Luego de varias pruebas pude corroborar que esto se producía sólo cuando se ingresaba a las particiones. Este problema está relacionado con el error descrito arriba y fue solucionado de la misma forma: «Disable Fast Startup».



1.2.7.3 Can't be put in the trash. Do you want to delete it immediately?

Este problema se solucionó sólo. Me imagino que luego de alguna actualización del sistema.

Luego de realizar algunos cambios en el particionamiento para instalar otros sistemas Linux (RedHat, CentOS) surgió el siguiente error: Cuando quería borrar un archivo directamente desde el escritorio (con la tecla delete) (Gnome - Nautilus) el archivo no podía ser enviado a la papelara. Se desplegaba entonces el mensaje referido arriba en el título de esta sección.

El problema que estoy teniendo es exáctamente el descrito en este Forum:

Impossible to trash files from a folder which is a symbolic link to a NTFS partition folder

http://askubuntu.com/questions/616092/impossible-to-trash-files-from-a-folder-which-is-a-symbolic-link-to-a-ntfs-parti

Since a few days, I cannot send files to trash anymore from some folders.

That worked perfectly for years :(

In my home folder, I have several symbolic links to folders on the NTFS partitions, like this one:

Desktop -> 1-disco_local/1-mis_archivos/.stockage/desktop-dis/

Si intento borrar desde: ~/Desktop, el archivo no puede ser enviado a la papelera, but in the original folder 1-disco_local/1-mis_archivos/.stockage/downloads-dis/, funciona perfecto.


Este problema es también tratado en este Forum, en donde al parecer se ha encontrado una solución para Ubuntu 16.~

https://bugs.launchpad.net/ubuntu/+source/glib2.0/+bug/1495781

https://bugs.launchpad.net/ubuntu/+source/nautilus/+bug/1449112



1.2.8 Esquema de particionamiento

Después de investigar y reflexionar llegué a la conclusión de que, en mi caso, lo mejor es crear sólo las particiones linux indispensables.

Mi disco es supuestamente de 320G. Sin embargo, al sumar los tamaños de las distintas particiones, da un total de Aprox. 300G (298,08G). Al parecer esta diferencia tiene que ver con que el tamaño de la partición depende del FileSystem. Ver nota sobre el Tamaño de la partición.

  • Me ha parecido apropiado instalar todos mis Sistemas Linux dentro de la partición Extendida y los otros SO (Windows) en particiones Primarias.
  • Todos los datos serán guardados en una partición destinada únicamente a este fin, aparte de todos los sistemas operativos intalados.
    • Esto es particularmente ventajoso a la hora de formatear un SO, pues no será necesario realizar un respaldo de los datos.
    • Como la partición de datos es ntfs, podemos entonces acceder a ella desde Linux y Windows.
    • Esta partición la he colocado al inicio del disco. Así, resulta más fácil redimencionarla porque la redimención nunca será al inicio del la partición. Aunque al parecer podemos también redimensionar al inicio de la partición, según algunas fuentes que he leído es menos seguro y toma más tiempo. La otra ventaja de colocarla al inicio del disco es que a la hora de cambiar el esquema de las particiones en donde se encuentran los SO no tendremos que tocar (formatear) la partición de datos. La única operación que podría ser necesario sería la redimención al final de la partición.


Mis particiones.png



2 Mis configuraciones


2.1 user-dirs.dirs: Cambiar la ruta de Desktop - Download - Pictures

Cambiar la ruta de Desktop y Download y eliminar los directorios innecesarios from the Nautilus sidebar.

https://askubuntu.com/questions/79150/how-to-remove-bookmarks-from-the-nautilus-sidebar

/home/adelo/.config/user-dirs.dirs
  • Editamos el archivo de estamanera:
# This file is written by xdg-user-dirs-update
# If you want to change or add directories, just edit the line you're
# interested in. All local changes will be retained on the next run.
# Format is XDG_xxx_DIR="$HOME/yyy", where yyy is a shell-escaped
# homedir-relative path, or XDG_xxx_DIR="/yyy", where /yyy is an
# absolute path. No other format is supported.
# 


# Si se quiere cambiar la imagen del icono de algun directorio, en este directorios se encuentran las imagenes de los icones
# usados por el sistema
# /usr/share/icons/Humanity/places/128/user-desktop.svg
# /usr/share/icons/Humanity/places/64/folder-download.svg


XDG_DESKTOP_DIR="$HOME/desktop"
XDG_DOWNLOAD_DIR="$HOME/desktop/downloads"
XDG_PICTURES_DIR="$HOME/desktop/screenshots"

# XDG_DESKTOP_DIR="$HOME/Desktop"
# XDG_DOWNLOAD_DIR="$HOME/Downloads"
# XDG_TEMPLATES_DIR="$HOME/"
# XDG_PUBLICSHARE_DIR="$HOME/"
# XDG_DOCUMENTS_DIR="$HOME/"
# XDG_MUSIC_DIR="$HOME/"
# XDG_PICTURES_DIR="$HOME/"
# XDG_VIDEOS_DIR="$HOME/"


  • After login the file ~/.config/user-dirs.dirs gets reverted to the original set by /etc/xdg/user-dirs.defaults. To prevent that make the file "read-only" and set the option «enabled» to «False» in /etc/xdg/user-dirs.conf
chmod -w ~/.config/user-dirs.dirs
gedit /etc/xdg/user-dirs.conf  :  '''enabled=false'''


  • XDG_PICTURES_DIR es el directorio en donde se guardan por defecto los screenshots tomados con la correspondiente shortcut key.


  • Luego podemos eliminar los directorios innecesarios from the Nautilus sidebar haciendo click derecho en el diretorio (en el Nautilus sidebar) > Remove.
  • Podemos también agregar new locations to the Nautilus sidebar. Cuando agregamos un nuevo directorio, lógicamente el numbre que se muestra en la sidebar será el nombre del directorio. Sin embargo, podemos luego renombrar el nombre que se muestra en la sidebar (click derecho > Rename). Ésto último no afecta el numbre del directorio al que hace referencia. Yo he realizado este rename simplemente para que el nombre se vea con la primera letra en mayúscula, ya que los directories los he creado con la primera letra en minúscula.


  • Luego creé los siguientes soft links:
ln -s /home/adelo/asystem/archivo/desk    /home/adelo/desktop


  • Luego cabié las imágenes de los íconos:
/usr/share/icons/Humanity/places/128/user-desktop.svg
/usr/share/icons/Humanity/places/64/folder-download.svg



2.2 Custom Shortcuts


2.2.1 Shortcut to launch the gnome-terminal in a custom position

/home/adelo/1-system/.1-conf-system/open_terminal_at_position.sh
#!/bin/sh

# Este script permite iniciar el gnome-terminal en una posicion deseada «Launch terminal»

# https://unix.stackexchange.com/questions/48984/how-can-i-set-the-position-that-terminal-opens-at
# - La configuración en este file:  « ~/.local/share/applications/gnome-terminal.desktop » funciona when launching the terminal a través del link (ícono) del terminal, pero  no funciono utilizando el shortcut to launch the terminal (Ctrl+Alt+T). Ésto último tampoco funcionó configurando « /usr/share/applications/gnome-terminal.desktop ».
# - The command «xwininfo» display information about the current geometry of a window. Solo tenemos que ejecutar «xwininfo» en el terminal y luego hacer click en la window.

# También traté otro método ampliamente descrito en muchos forums que usa «CompizConfig Settings Manager». Tampoco pude realizar la configuración deseada con «Compiz».

# Por lo tanto, la solución que encontré fue definir un «Custom Shortcuts» usando la interfaz gráfica en «Settings > Devices > Keyboard» que ejecuta este script; de forma similar a como habia definido los shortcuts to «hide_dock» and «hide_icons_on_desktop».
# Definí el shortcut que ejecuta este script igual al shortcut que por defecto ubuntu asigna a «Launch terminal» (Ctrl+Alt+T). Por tanto, tuve que redefinir el shortcut de «Launch terminal» a «Alt T»


# gnome-terminal --geometry=175x17+0+613
gnome-terminal --geometry=175x17+0+4000



2.2.2 Shortcut to hide the desktop icons in GNOME 3

https://askubuntu.com/questions/1072337/shortcut-to-hide-the-desktop-icons-in-gnome-3

La aplicación «gnome-tweaks» permite realizar algunas configuraciones en «Gnome». Entra ellas, la posibilidad de ocultar los ícones del escritorio.

sudo apt-get install gnome-tweaks

Así, usando el GUI de «gnome-tweaks», configuramos el desktop de forma tal que no mostrara los icons por defecto.

Ahora, el siguiente Script (el cual emplea gnome-tweaks) permite ocultar y mostrar los ícones del Desktop:

/home/adelo/1-system/.1-conf-system/hide_icons_on_desktop.sh
#!/bin/sh


# https://askubuntu.com/questions/1072337/shortcut-to-hide-the-desktop-icons-in-gnome-3

# La siguiente l'inea la tuve que adicionar porque el script no estaba funcionando. Esta soluci'on la encontr'e aqu'i:
# https://stackoverflow.com/questions/44934641/glib-gio-message-using-the-memory-gsettings-backend-your-settings-will-not-b
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/

if $(gsettings get org.gnome.desktop.background show-desktop-icons);
then new="false";
else new="true";
fi
gsettings set org.gnome.desktop.background show-desktop-icons $new

gsettings set org.gnome.shell.extensions.dash-to-dock show-running $new
gsettings set org.gnome.shell.extensions.dash-to-dock show-favorites $new
gsettings set org.gnome.shell.extensions.dash-to-dock show-show-apps-button $new

Luego adicionamos el Script al «keyboardsettings» an entry:

Settings > Devices > Keyboard

https://linuxconfig.org/how-to-automatically-execute-shell-script-at-startup-boot-on-systemd-linux

https://askubuntu.com/questions/919054/how-do-i-run-a-single-command-at-startup-using-systemd

https://opensource.com/life/16/11/running-commands-shutdown-linux

https://unix.stackexchange.com/questions/48973/execute-a-command-before-shutdown



2.2.3 Shortcut to hide the dock

De forma similar a como se hizo con los desktop icons. Utilizando el siguiente script. Le dimos el shortcut Ctrl+Alt+B

/home/adelo/1-system/.1-conf-system/hide_dock.sh
#!/bin/sh


# https://askubuntu.com/questions/1072337/shortcut-to-hide-the-desktop-icons-in-gnome-3

# La siguiente l'inea la tuve que adicionar porque el script no estaba funcionando. Esta soluci'on la encontr'e aqu'i:
# https://stackoverflow.com/questions/44934641/glib-gio-message-using-the-memory-gsettings-backend-your-settings-will-not-b
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/

if $(gsettings get org.gnome.shell.extensions.dash-to-dock show-running);
then new="false";
else new="true";
fi

gsettings set org.gnome.shell.extensions.dash-to-dock show-running $new
gsettings set org.gnome.shell.extensions.dash-to-dock show-favorites $new
gsettings set org.gnome.shell.extensions.dash-to-dock show-show-apps-button $new



2.3 Permisologia de archivos y directorios


2.3.1 Ajustar la permisologia de todos los archivos y directorios

No es para nada apropiado, reajustar la permisología de los directorios/archivos de programas. Esto podría generar problemas en la ejecución de archivos. Por tanto; si queremos reajustar la permisología de archivos, sólo se podría hacer en nuestros archivos personales. NUNCA EN ARCHIVOS DE PROGRAMAS.

Ver:

Linux#Ajustar permisologia recursivamente en traitant de facon differentiee les repertoires et les fichiers

Linux#A través del comando find

permisologia.sh
#! /bin/bash

# Para los directorios:
find 1-system -type d -exec chmod 755 {} +

# Para los archivos:
find 1-system -type f -exec chmod 644 {} +



2.3.2 Ajustar la permisologia por defecto al crear un archivo o directorio

También es muy importante resaltar que no se debemos reajustar la permisología por defecto de nuevos archivos/directorios creados por la misma razón explicada arriba. Cuando los programas se instalan, crean directoris y archivos que serán entonces creados con la permisología que hayamos ajustado. Esto no es para nada apropiado. Hacer esto me trajo problemas con el programa LibreOffice por ejemmplo. Dicho programa no abría cuando se ejecutaba en la sesión de ususario porque una de las carpetas de configuraciones en /usr/lib/libreoffice/.... se había creado con permisos que impedían que un usuario accediera a ella y por tanto el probrama no funcionaba. Espero que este error no me traiga más problemas con los programas que instalé luego de modificar la permisología por defecto de nuevos directorios/archivos creados.

Ver Linux#Permisología por defecto

Añadir la siguiente línea a .bashrc

umask u=rwx,g=rx,o=rx

Debido a que la mayoría de los sistemas Unix no permiten que nuevos archivos (directorios sí) sean creados con permisos de ejecución activados, independientemente de la máscara; con la «umask» anterior los directorios y archivos serán creados con permisología:

drwxr-xr-x  (755)
-rw-r--r--  (644)



2.4 fstab: Montar discos automáticamete

/etc/fstab
#===========================
# Cambios realizados por mi
#===========================
# Disco_local:
UUID=761657CB1CD1E939			/home/adelo/1-system/1-disco_local	ntfs	auto,users,exec,permissions	0	0

# Disco_externo - TOSHIBA EXT:
UUID=3C9A5D379A5CEF40    /home/adelo/asystem/.mount/disco_ext    ntfs    auto,nofail,users,permissions  0       0

Para saber el UUID de la partición:

sudo blkid

Ver Linux#Para discos externos



2.5 .bashrc (home)

/home/adelo/.bashrc
#===========================
# Cambios realizados por mi
#===========================

# Ajustar la permisología por defecto (base) de los archivos y directorios creados.
# Debido a que la mayoría de los sistemas Unix no permiten que nuevos archivos (directorios sí) sean creados con permisos de ejecución activados, independientemente de la máscara; con la siguiente «umask» los directorios y archivos serán creados con permisología:
# -rw-r--r-- (644)
# drwxr-xr-x (755)
# He llegado a la conclusión de que esto no es para nada apropiado. Ver explicación en http://perso.sinfronteras.ws/index.php/Linux#Permisologia_de_archivos_y_directorios
# umask u=rwx,g=rx,o=rx


# -X : sort alphabetically by entry extension
# -A : do not list implied . and ..
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
alias la='ls -AX'


# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
# alias ls='ls  -v  --color=auto'
# Quiero también que «ls» ignore los archivos listados en .hidden:
function ls_ignore_hidden() {                                   # $* or $@ represent all the arguemnts. Ver https://stackoverflow.com/questions/12314451/accessing-bash-command-line-args-vs
  if [[ $@ == *"a"* ]]  ||  [[ $@ == *"A"* ]]  ||  [[ ! -f "./.hidden" ]] ; then    # Ver https://linuxize.com/post/how-to-check-if-string-contains-substring-in-bash
      ls  -v  --color=auto  $@ 
  else
      ls  -v  --color=auto  `perl -pe 's/(.*)/--ignore $1/' ./.hidden`  $@
  fi
}
alias ls=ls_ignore_hidden


# He hecho el siguiente alias para crear el comando "del", ya que escribir «gio trash» cada vez que vamos a mover un archivo a la papelera resulta tedioso.
alias del="gio trash"


# He creado los comandos cds y cdp para facilitar el acceso a 1-system y 1-pe:
function cds() {
  cd ~/1-system
}


# Para cambiar el nombre desplegado en la esquina superior derecha del la gnome-ventana del terminal:
# La siguiente función is to rename terminal tab title in gnome-terminal:
# Si queremos cambiar el title in gnome-germinal ejecutamos esta funci'on en el terminal de la siguiente forma:
# # set-title my new tab title
function set-title() {
  if [[ -z "$ORIG" ]]; then
    ORIG=$PS1
  fi
  TITLE="\[\e]2;$*\a\]"
  PS1=${ORIG}${TITLE}
}


## Instalacion de JDK Oracle Java 8
# export JAVA_HOME=/usr/java/jdk1.8.0_221
# export PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
# export JRE_HOME


# Después de la instalación de Eclipse, para adicionar el ejecutable a la lista de comandos:
PATH=$PATH:/home/adelo/.eclipse/java-2019-09/eclipse:


# Después de la instalación de NetBeans, para adicionar el ejecutable a la lista de comandos:
PATH=$PATH:/home/adelo/.netbeans-dir/netbeans/bin:
# Otra forma de hacerlo es a trav'es de un soft link
# ln -s /home/adelo/.netbeans-dir/netbeans/bin/netbeans /usr/local/bin/netbeans


# Installacion de Android Studio
PATH=$PATH:/home/adelo/.androidStudio/android-studio/bin


export ANDROID_HOME=/home/adelo/.androidStudio/androidSDK
export ANDROID_SDK_ROOT=/home/adelo/.androidStudio/androidSDK
# export ANDROID_SDK_HOME=/home/adelo/.android


export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools


# export PATH=${PATH}:/home/adelo/1-system/.1-conf-system/1-archivos_programas-ubuntu/android-sdk/platform-tools


# He dos comandos para facilitar la apertura de Jupyter-notebook en los directorios que más uso
function jdata() {
  jupyter notebook --browser='firefox' /home/adelo/1-system/1-disco_local/1-mis_archivos/1-formal_pure_and_applied_sciences/1-computer_science_an_IT/2-data_science/0data_science_codes/01data_science_expert &
}

function jdb() {
  jupyter notebook --browser='firefox'  /home/adelo/1-system/1-disco_local/1-mis_archivos/1-formal_pure_and_applied_sciences/1-computer_science_an_IT/others/3-database/0database_expert &
}


# ...
# alias gnome-terminal='gnome-terminal --geometry=175x17+0+4000'

Ver Mover archivos a la papelera desde el terminal para más detalles del por qué se ha realizado la siguiente configuración: alias del=gvfs-trash



2.6 .bashrc (root)

/root/.bashrc
#===========================
# Cambios realizados por mi
#===========================

# Ajustar la permisología por defecto (base) de los archivos y directorios creados: ---------- (000) d--------- (000)
# He llegado a la conclusión de que esto no es para nada apropiado. Ver explicación en http://perso.sinfronteras.ws/index.php/Linux#Permisologia_de_archivos_y_directorios
# umask u=,g=,o=


# -X : sort alphabetically by entry extension
# -A : do not list implied . and ..
# Se puede realizar este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
alias la='ls -AX'


# -v : sort num'ericamente. Es necesario porque cuando se hace alphabetically el 10 es colocado primero que el 1. El problema es que la opci'on -ve no es compatible con ordenamiento alfab'etico. Si se usa esta opci'on los archivos que no comiencen por n'umeros no ser'an ordenados alfab'eticamente. -v tampoco es compatible con el alias realizado arriba (la='ls -AX'):
alias ls='ls -v --color=auto'


# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
alias del="gio trash"


/etc/bash.bashrc
#===========================
# Cambios realizados por mi
#===========================

# -X : sort alphabetically by entry extension
# -A : do not list implied . and ..
# He realizado este alias para que el comando "la" ordene los archivos ocultos de último y no liste los directorios . y ..
alias 'la=ls -AX'



2.7 .profile

/home/adelo/.profile
#===========================
# Cambios realizados por mi
#===========================


# hide icons on desktop and dock
export GIO_EXTRA_MODULES=/usr/lib/x86_64-linux-gnu/gio/modules/
gsettings set org.gnome.desktop.background show-desktop-icons false
gsettings set org.gnome.shell.extensions.dash-to-dock show-running false
gsettings set org.gnome.shell.extensions.dash-to-dock show-favorites false
gsettings set org.gnome.shell.extensions.dash-to-dock show-show-apps-button false



2.8 .megaignore

sudo chown adelo:adelo .megaignore
sudo chmod 600 .megaignore
sudo chattr +i .megaignore  (immutable)


.megaignore
# No se pueden colocar comments al lado de la orden
# -p se usa para path
# -d:1-mis_archivos/1-pure_sciences/*
# -s:* se crea automaticamente. Creo que esta excluyendo los symbolic links
-:venv
-:.venv
-:env
-:.env
-:__pycache__
-:node_modules
-:.next
-:Thumbs.db
-:desktop.ini
-:*.crdownload
-:*.sb-????????-??????
-:.respaldo_shadow*
-:*tr4sh*
-:*.tmp
-:.~*
-:~.*
-:.*~
-:*d4t4*
-:*n0b4*
-p:.mount
-s:*


.megaignore (linux work-laptop)
# No se pueden colocar comments al lado de la orden
# -p se usa para path
# -d:1-mis_archivos/1-pure_sciences/*
# -s:* se crea automaticamente. Creo que esta excluyendo los symbolic links
-:venv
-:.venv
-:env
-:.env
-:__pycache__
-:node_modules
-:.next
-:Thumbs.db
-:desktop.ini
-:*.crdownload
-:*.sb-????????-??????
-:.respaldo_shadow*
-:*tr4sh*
-:*.tmp
-:.~*
-:~.*
-:.*~
-:*d4t4*
-:*n0b4*
-:2-social_sciences
-:3-musica
-:4-carrera
-:5-multimedia
-p:.mount
-s:*


.megaignore (windows)
# No se pueden colocar comments al lado de la orden
# -p se usa para path
# -d:1-mis_archivos/1-pure_sciences/*
# -s:* se crea automaticamente. Creo que esta excluyendo los symbolic links
-:venv
-:.venv
-:env
-:.env
-:__pycache__
-:node_modules
-:.next
-:Thumbs.db
-:desktop.ini
-:*.crdownload
-:*.sb-????????-??????
-:.respaldo_shadow*
-:*tr4sh*
-:*.tmp
-:.~*
-:~.*
-:.*~
-:*d4t4*
-:*n0b4*
-p:.mount
-p:.asystem-conf
-p:archivo/*
+p:archivo/desk
-p:archivo/desk/*
+p:archivo/desk/windows
+p:archivo/desk/windows/*
-s:*



3 Things to do after installing Ubuntu 18.04

https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/



3.1 Update


3.2 Enable additional repositories


3.3 Algunas configuraciones en Gnome and Nautilus


3.4 Instalar paquetes para xfs support


3.5 Install media codecs

Permite reproducir videos en el web browser (en facebook por ejemplo):

sudo apt install ubuntu-restricted-extras



3.6 Si se instala Windows



3.7 Instalar

  • apache2
  • nginx
  • MySQL
  • mycli
  • PostgreSQL
  • PHP
  • nodejs
  • typescript
  • Oracle JDK
  • Eclipse
  • NetBeans
  • Sublime Text
  • VirtualBox
  • PacketTracer
  • Virtual Paradigm
  • ------
  • imagemagick
Contiene «convert» which is required by MediaWiki
  • sshfs
  • gvfs-bin
  • Google Cloud SDK
  • Gparted
  • Google Chrome
  • LaTeX
    • kile
  • kate
  • gimp
  • shutter
  • pdftk
  • gnome-tweaks
  • Para el respaldo:
    • rsync (debería estar by default)
    • sshpass
    • pv
  • LVM and xfs support for Ubuntu:
    • lvm2
    • xfsprogs
    • xfsdump



4 Red Hat

Mi página de estudio para la certificación RHCSA: Study points for the RHCSA exam

He creado una cuenta for the Red Hat Developer Program (email y clave habitual) lo cual me permite descargar una versión gratis de Red Hat:

http://developers.redhat.com/

http://developers.redhat.com/products/rhel/download/

http://developers.redhat.com/products/rhel/get-started/

%%%%%%%%

Al crear la cuenta Red Hat Developer Program me han enviado el siguiente correo:

Hi Adelo,

I saw that you joined Red Hat Developers and I have the privilege of welcoming you on behalf of the Red Hat Developers team. So, welcome! We are happy to have you join us and to get you started we thought some quick highlights would be helpful:

  • Product downloads: Many of Red Hat’s solutions including JBoss EAP and Red Hat Enterprise Linux for developers are available free to you as a member and can be found here.
  • Highlighted and new content: For ease we will have that on our homepage and will be adding material multiple times a week.
  • You can contribute: We welcome content contributions from our members around the globe. Three easy ways to contribute can be found here. And did I mention contributing gets you swag?

Again, welcome to Red Hat Developers.

Andréa

%%%%%%%%

Si no se crea una cuenta en Red Hat Developer Program, se puede descargar una versión de prueba gratis de 30días de Red Hat https://access.redhat.com/products/red-hat-enterprise-linux/evaluation

Para crear el bootable usb: https://access.redhat.com/articles/142303



4.1 All certifications and exams

https://www.redhat.com/en/services/all-certifications-exams

https://en.wikipedia.org/wiki/Red_Hat_Certification_Program#Examination_required_for_each_certification



4.1.1 Red Hat Certified System Administrator (RHCSA) exam

https://www.redhat.com/en/services/training/ex200-red-hat-certified-system-administrator-rhcsa-exam



4.2 All training courses and exams

https://www.redhat.com/en/services/training/all-courses-exams



4.3 Documentación gratis

Creo que esta guía para RedHad está bastante buena: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/System_Administrators_Guide/

En esta página se encuentra una excelente documentación de Red Hat. Parte del contenido está basado en los putos a evaluar en los exámenes de certifiación Red Hat. Everything you need to pass your RHCSA, RHCE, LFCS, LFCE and much more: https://www.certdepot.net/



4.4 Instalación

Short guide: https://developers.redhat.com/products/rhel/hello-world/

Instalation guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/index.html

Red hat-installation summary.jpg



4.4.1 System Requirements

The requirements for your physical system are:

a 64-bit x86 machine.

4 GB of RAM

20 GB of available disk space.

For more detailed minimum hardware requirements and compatibility information, see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-installation-planning-x86.html



4.4.2 Software selection

The Red Hat Enterprise Linux Server .iso can be used to install a system with a full graphical desktop. You will select Server with a GUI under Software Selection during installation. By default, Red Hat Enterprise Linux Server will not install a graphical desktop.

  • Click Software selection.
  • On the next screen, under Software selection, in the Base environment list on the left, select Server with GUI.
  • In the list Add-ons for selected environment on the right, select Development tools.
Configuración que elegí en la última instalación de RHEL 7.5
Configuración que elegí en la última instalación de RHEL 7.5



4.4.3 Installation destination

Installation Destination section of the the Red Hat Enterprise Linux Installation Guide: https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/sect-disk-partitioning-setup-x86.html

En la guía de instalación de Red hat se encuentra la siguiente nota: «An installation of Red Hat Enterprise Linux requires a minimum of one partition but Red Hat recommends using at least the following partitions or volumes:

  • /
  • /home
  • /boot
  • swap»,

Sin embargo, más adelante veremos que el instalador de Red hat presenta una opción que genera las particiones automáticamente a partir de espacio «unallocated» en el disco. Esta opción genera sólo particiones para /, /boot y swap (no genera la partición /home). Creo que la partición /home no es necesaria en mi caso, así que seguiré dicho esquema de particiones sin incluir la /home.



4.4.3.1 Particionamiento

Para seleccionar o realizar cambios en las particiones donde será instalado el SO debemos: From the Installation Summary:

  • Installation destination > Seleccionar la option «I will configure particioning». Lo cual nos llevará a la ventana «Manual Particioning»
  • El programa de instalación de Red Hat permite intalar el SO en particiones previamente creadas, o crear nuevas particiones a partir de espacio «unallocated» en el disco.
  • Crear nuevas particiones a partir de espacio «unallocated». Hay dos posibilidades:
  • 1- Click here to create them automatically: Crea automáticamete el esquema de particiones recomendado a partir de todo el espacio «unallocated» restante. Por ejemplo, si en nuestro disco quedan 40G de espacio «unallocated», esta opción creará el siguiente esquema:
  • /boot
  • 1024 MB
  • Device type: Standar Partition (esta partición no puede ser LVM)
  • File System: xfs
  • /
  • 35.12 Gb
  • Device type: LVM
  • File System: xfs
  • /swap
  • 3968 Mb
  • Device type: LVM
  • File System: swap
  • 2- Crear cada partición por separado haciendo click en el ícono «+» que se encuentra en la parte de abajo del menú. Si no queremos tomar todo el espacio «unallocated» restante, debemos usar esta opción.
  • Asignar «Mount points» a particiones previamente creadas antes de iniciar el instalador de Red Hat (creadas a través de Gparted por ejemplo).
El problema de esta opción es que Red hat propone como estadart, la creación de todos las particiones que queramos implementar «/ /swap /home etc» (excepto la /boot) dentro de una partición (o Device type) LVM. Ahora, el problema es que Gparted (que es el programa que he venido usando para la creación de esquemas de particiones complejos) no propone la opción para cración de LVM. Además, si lo hacemos a través de particiones previamente creadas, el instalador de Red Hat no permite formatear la partición sino sólo asignarle un «Mount point»; y me ha parecido que es apropiado (no sólo surante la intalación de Red Had, sino durante la instalación de cualquier SO) que el programa de instalación formetee la partición antes de realizar la instalación.
  • Recomiendo la creación de particiones manuales a partir de espacio «unallocated». Construir el esquema de particionamiento propuesto por «Click here to create them automatically».
Click here to create them automatically.
Esquema de particiones generado automáticamente a partir de todo el espacio «unallocated» restante en el disco.
Particiones creadas manualmente haciendo click en «+»
Particiones creadas manualmente haciendo click en «+»
Particiones creadas manualmente haciendo click en «+»



4.4.3.2 LVM and xfs

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/installation_guide/sect-disk-partitioning-setup-x86

LVM (Logical Volume Management): https://wiki.ubuntu.com/Lvm

Por lo que he leido, LVM (Logical Volume Management) es similar a crear una partición extendida y dentro de ella particiones lógicas.

What is LVM: LVM stands for Logical Volume Management. It is a system of managing logical volumes, or filesystems, that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a filesystem.

Why use LVM? For a long time I wondered why anyone would want to use LVM when you can use gparted to resize and move partitions just fine. The answer is that lvm can do these things better, and some nifty new things that you just can't do otherwise. I will explain several tasks that lvm can do and why it does so better than other tools, then how to do them. First you should understand the basics of lvm.

XFS is a highly scalable, high-performance file system that supports file systems up to 16 EiB (approximately 16 billion GiB), files up to 8 EiB (approximately 8 billion GiB), and directory structures containing tens of millions of entries. XFS supports metadata journaling, which facilitates quicker crash recovery.



4.4.3.2.1 LVM and xfs support for Ubuntu

Para poder leer particiones LVM y xfs en Utuntu (y para que sean detectadas correctametne por Gparted) debemos instalar algunos paquetes.

sudo apt-get install lvm2
sudo apt-get install xfsprogs xfsdump
Advertencia generada en Gparted when LVM suport for Ubuntu is missing
Advertencia generada en Gparted when XFS file system suppor for Ubuntu is missing



5 CentOS

https://www.centos.org/

https://en.wikipedia.org/wiki/CentOS

CentOS (Community Enterprise Operating System) is a Linux distribution that provides a free, enterprise-class, community-supported computing platform functionally compatible with its upstream source, Red Hat Enterprise Linux (RHEL). In January 2014, CentOS announced the official joining with Red Hat while staying independent from RHEL, under a new CentOS governing board.

  • Parece ser que no hay versiones separadas para Desktop o Server:
  • CentOS es en esencia a Server distribution, aunque también puede ser usado en Desktop or Workstations.
  • Most distros don't have Server or Desktop versions. Centos is generally used as Server. There are no roles. Everything depends on what packages you install, how you configure it, which repos you use.
  • Agreed. I would say that CentOS is the open source version of Red Hat Enterprise Linux thus they are both a server distro. The desktop version would essentially be Fedora.
  • Fedora is not the Desktop version... although it's often viewed that way. It's more the development/unstable version -- it races years ahead of a stabilized rhel/cent, which brings in the latest and ostensibly greatest features of whatever desktop environment you're following.
  • Sin embargo, there is a «minimal» version that's command line only and great for servers.



5.1 Install Gnome GUI on CentOS 7 or RHEL 7

https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-gnome-gui-on-centos-7-rhel-7.html



6 Filesystem Hierarchy Standard

https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

Directory Description
/
Primary hierarchy root and root directory of the entire file system hierarchy.
/bin
Essential command binaries that need to be available in single user mode; for all users, e.g., cat, ls, cp.
/boot
Boot loader files, e.g., kernels, initrd.
/dev
Essential device files, e.g., /dev/null.
/etc
Host-specific system-wide configuration files

There has been controversy over the meaning of the name itself. In early versions of the UNIX Implementation Document from Bell labs, /etc is referred to as the etcetera directory,[3] as this directory historically held everything that did not belong elsewhere (however, the FHS restricts /etc to static configuration files and may not contain binaries).[4] Since the publication of early documentation, the directory name has been re-explained in various ways. Recent interpretations include backronyms such as "Editable Text Configuration" or "Extended Tool Chest".

/home
Users' home directories, containing saved files, personal settings, etc.
/lib
Libraries essential for the binaries in /bin/ and /sbin/.
/media
Mount points for removable media such as CD-ROMs (appeared in FHS-2.3).
/mnt
Temporarily mounted filesystems.
/opt
Optional application software packages.
/proc
Virtual filesystem providing process and kernel information as files. In Linux, corresponds to a procfs mount.
/root
Home directory for the root user.
/run
Run-time variable data: Information about the running system since last boot, e.g., currently logged-in users and running daemons.
/sbin
Essential system binaries, e.g., fsck, init, route.
/srv
Site-specific data served by this system, such as data and scripts for web servers, data offered by FTP servers, and repositories for version control systems.
/sys
Contains information about the devices connected to the computer.
/tmp
Temporary files (see also /var/tmp). Often not preserved between system reboots, and may be severely size restricted.
/usr
Secondary hierarchy for read-only user data; contains the majority of (multi-)user utilities and applications.
/var
Variable files—files whose content is expected to continually change during normal operation of the system—such as logs, spool files, and temporary e-mail files.



7 Upgrade the system

https://docs.ovh.com/gb/en/dedicated/updating-kernel-dedicated-server

https://tutorials.ubuntu.com/tutorial/tutorial-upgrading-ubuntu-desktop#0

https://help.ubuntu.com/community/UpgradeNotes?_ga=2.166774206.1403639924.1537856764-959153226.1536526077

An upgrade is the process of going from an earlier version of Ubuntu to a newer version of Ubuntu with an installed system. An example of this would be going from Ubuntu 17.10 to Ubuntu 18.04 LTS. To avoid damaging your running system, upgrading should only be done from one release to the next release (e.g. Ubuntu 16.04 to Ubuntu 16.10) or from one LTS release to the next (e.g. Ubuntu 16.04 LTS to Ubuntu 18.04 LTS). If you wish to 'skip' a version, you can back up your data and do a fresh installation, or progressively upgrade to each successive version. For example, to upgrade from Ubuntu 16.10 to Ubuntu 17.10, first upgrade to 17.04, then upgrade 17.04 to 17.10.



8 Update the system

To update Ubuntu 18.04, press Super Key (Windows Key) to launch the Activity Overview and look for Software Updater. Run it to check for updates.

Alternatively:

sudo apt update && sudo apt upgrade



9 Enable additional repositories for more software

https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/

Ubuntu has several repositories from where it provides software for your system. Enabling all these repositories will give you access to more software and proprietary drivers.

Go to Activity Overview by pressing Super Key (Windows key), and search for Software & Updates:

  • Under the Ubuntu Software tab, make sure you have checked all of the Main, Universe, Restricted and Multiverse repository checked.
  • Now move to the Other Software tab, check the option of Canonical Partners.

Once it completes, you’ll find more applications to install in the Software Center.



10 Apt-get


10.1 Update System Packages

The «update» command is used to resynchronize the package index files from the their sources specified in /etc/apt/sources.list file. The update command fetched the packages from their locations and update the packages to newer version.

sudo apt-get update



10.2 Upgrade Software Packages

The «upgrade» command is used to upgrade all the currently installed software packages on the system. Under any circumstances currently installed packages are not removed or packages which are not already installed neither retrieved and installed to satisfy upgrade dependencies.

sudo apt-get upgrade



10.3 How to check the version of a package using apt

Verificar la version de un paquete instalado o disponible en los repositorios

https://stackoverflow.com/questions/18885820/how-to-check-the-version-before-install-packages-using-apt-get

apt-cache policy <package name> will show the version details.

It also shows which version is currently installed and which versions are available to install.

For example:

apt-cache policy hylafax+

También:

apt-cache show <package name>


Por ejemplo, podemos ver las versiones disponibles de r-base con:

sudo apt policy r-base
r-base:
 Installed: 3.5.2-1bionic
 Candidate: 3.6.0-2bionic
 Version table:
    3.6.0-2bionic 500
       500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
    3.6.0-1bionic 500
       500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
    3.5.3-1bionic 500
       500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
*** 3.5.2-1bionic 500
       500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
       100 /var/lib/dpkg/status
    3.5.1-2bionic 500
      500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages
    3.5.1-1bionic 500


Si queremos listar solo paquetes instalados y no todos los paquetes «disponibles y instalados», podemos usar: https://askubuntu.com/questions/17823/how-to-list-all-installed-packages

apt list --installed openjdk*



10.4 Installing a specific Version of a package

En general, si queremos installar una versión específica de un paquete:

sudo apt install r-base=3.5.1-2bionic

Sin embargo, en muchos casos no es tan fácil así. Cuando los paquetes tienen dependencias, la ejecución del comando anterior no resuelve las dependencias automáticamente. Si el paquete tiene muchas dependencia (como es el caso de r-base) la instalación se torna un poco complicada.

Al tratar de instalar «r-base» veremos que la única dependencia es el paquete «r-recommended». Entonces, antes de instalar la «r-base» tenemos que instalar «r-recommended=3.5.1-2bionic». Sin embargo, «r-recommended» tiene muchas dependencias; y aunque la ejecución de «sudo apt install r-recommended=3.5.1-2bionic» resulve las dependencias e instala el paquete, luego se presentan problemas. Lo que pasó cuando lo hice de esta forma fue que aparentemente se había instalado la versión deseada; pero cuando desplegaba la versión del R con «sudo R --version» o en el terminal del R «version» se mostraba la versión más reciente disponible en la Version table. Esto pasa porque al ejecutar «sudo apt install r-recommended=3.5.1-2bionic» se instala la versión deseada de «r-recommended=3.5.1-2bionic» pero con respecto a las dependencias, podría instalarse la versión más reciente disponible en la Version table.

Fui capaz de instalar una versión específica de la siguiente forma:

sudo apt-get install r-recommended=3.5.3-1bionic r-base-core=3.5.3-1bionic r-base-core-dbg=3.5.3-1bionic r-base-dev=3.5.3-1bionic r-cran-mgcv r-doc-html=3.5.3-1bionic r-cran-nlme=3.1.137-1cranBionic0
sudo apt-get install r-base=3.5.3-1bionic r-base-html=3.5.3-1bionic

Se debe notar que se debe ejecutar el comando apt-get con todas las dependencias en una sóla orden, sino se hace de esta manera, apt-get podría resolver dependencias e instalar versiones incorrectas de algunos paquetes.

Note que hemos especificado la versión «=3.5.3-1bionic» para todos los paquetes excepto para «r-cran-nlme=3.1.137-1cranBionic0». Las versiones de «r-cran-nlme» no siguen el mismo orden que «r-base» pero tuvimos también que indicar una versión específica de «r-cran-nlme» porque la versión más reciente de este paquete dependía de versiones más reciente de «r-base».



10.5 Desinstalar un programa

Uninstall the program and all configuration files:

sudo apt-get --purge remove <programa> (podría ser necesario colocar <programa>*) 

También se podría:

sudo apt-get autoremove eclipse*

Lo anterior will uninstall the dependencies and related packages that were installed along with eclipse. This should do the trick.

También podría ser necesario:

rm -r ~/.<programa>/ (en caso de que el programa instale una carpeta en el directorio ~)

Uninstall just the program. If you’d like to remove the program but keep the configuration files, enter the following command:

sudo apt-get remove <programname>



10.6 Repositorios - List and Remove Repositories

List repositories:

apt policy

Si agregamos un repositorio incorrecto (que no existe o lo que sea), al ejecutar «apt update» se generará un error como el siguiente:

Err:14 http://ppa.launchpad.net/webupd8team/gnome3/ubuntu bionic Release
  404  Not Found [IP: 91.189.95.83 80]

E: The repository 'http://ppa.launchpad.net/webupd8team/gnome3/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

esto trae algunos probleminas. Por ejemplo, al abrir el GUI «Software Updater» (tecla SO: escribir "software updater"), la aplicacion generará el error: https://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/

Failed to download repository information. Check your internet connection.

La solución es eliminar el repositorio incorrecto. Esto lo podemos hacer en línea de comando por supuesto. También puede realizarse fácilmente (como se muestra aquí: https://itsfoss.com/failed-to-download-repository-information-ubuntu-13-04/) a través del GUI «Software & Updates» > go to «other Software» and look for the software source that is causing this problem. Uncheck the box before it to exclude it from future updates.


How to list and remove PPA repository by command line:

https://www.powercms.in/blog/how-remove-ppas-ubuntu-1404141015041510-and-linux-mint

https://linuxconfig.org/how-to-list-and-remove-ppa-repository-on-ubuntu-18-04-bionic-beaver-linux

https://askubuntu.com/questions/307/how-can-ppas-be-removed

En los links anteriores se esplica como eliminar PPA. Sin embargo ese método me ha funcionado sólo cuando el repositorio inicia con 'ppa'. Por ejemplo:

500 http://ppa.launchpad.net/videolan/master-daily/ubuntu bionic/main

puede ser eliminado con:

sudo add-apt-repository --remove ppa:PPA_REPOSITORY_NAME/PPA
$ sudo add-apt-repository --remove ppa:videolan/master-daily

Sin embargo, con un repositorio que no inicia con 'ppa' el comando no puede ser ejecutado de dicha forma. Por ejemplo:

500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages

El repositorio anterior pudo ser borrado a través del siguiente comando:

sudo add-apt-repository --remove 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'

En dicha ocasión fue ejecutado con el «deb» porque dicho repositorio fue incluido de la siguiente forma:

sudo add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


Sin embargo, luego intenté eliminar este repositorio:

500 http://cran.rstudio.com/bin/linux/ubuntu xenial/ Packages

y no pude hacerlo a través de ninguno de los siguientes comandos:

sudo add-apt-repository 'deb http://cran.rstudio.com/bin/linux/ubuntu xenial/'
sudo add-apt-repository 'http://cran.rstudio.com/bin/linux/ubuntu xenial/'

No encontré forma de eliminar dicho repositorio...



11 Para saber las características del hardware y del SO


11.1 Procesador - nucleos - velocidad - fabricante - arquitectura - 32 o 64bit

lscpu


The next file display las características de cada procesador:

more /proc/cpuinfo

Si queremos, por ejemplo contar el número de CPUs / Cores:

cat /proc/cpuinfo | grep processor | wc -l
cat /proc/cpuinfo | grep 'core id'
nproc



11.2 Para saber la memoria RAM y Swap - total y en uso

free -m

O graficamente en System > Administration > System monitor

Hay también otros comandos detallados aquí http://www.cyberciti.biz/faq/check-ram-in-ubuntu/



11.3 Para ver las particiones y dispositivos montados

Muestra las particiones o dispositivos montados en el orden en el que se encuentran en el disco duro. Es el único comando que conozco que las muestra en el orden correcto. Además da muestra el tamaño exacto de la partición (el tamaño ajustado al momento del particionamiento. Los otros comandos no muestran este tamaño exacto; claro no sé cual es el tamaño correcto) Ver nota sobre el Tamaño de la partición. Tambíen dice si la partición es de tipo Primaria, extendida o lógica y el File system. Muestra también las características del disco duro (tamaño, fabricante, modelo):

sudo gparted


sudo parted /dev/sda then type print
sudo parted -l


Muestra todas las particiones en el disco y los dispositivos montados. Muestra también el tamaño de la partición y el File system:

lsblk -fm
lsblk -fm /dev/sda


Muestra todas las particiones en el disco y los dispositivos montados. Da información, aunque no tan precisa, del filesystem type de cada partición o dispositivo. Muestra también algunas características del disco duro (tamaño, modelo):

sudo fdisk -l


A través del comando mount podemos saber el tipo de sistemas de archivos de particiones/dispositivos montados (check filesystem type):

 mount

Al parecer el tipo fuseblk se refiere a una partición ntfs ver http://ubuntuforums.org/showthread.php?t=1096841


Para saber el UUID de una partición:

sudo blkid


Muestra información sólo de particiones/dispositivos montados:

df -h



11.3.1 Partition size - Different partition sizes reported by df and parted

http://ubuntuforums.org/showthread.php?t=1575190

http://linux.derkeiler.com/Mailing-Lists/Fedora/2009-04/msg01901.html



11.4 Desplegar el SO instalado - detallando la version

lsb_release -a

http://askubuntu.com/questions/55609/how-do-i-check-system-specifications



11.5 Para saber si el SO instalado es 32 o 64bit

uname -a

Result for 32-bit Ubuntu:

   Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

whereas the 64-bit Ubuntu will show:

   Linux discworld 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


O a través del comando:

getconf LONG_BIT



11.6 dmidecode

sudo dmidecode | more

Este comando despliega las características detalladas de todos los componentes del hardware:

  • System Information,
  • BIOS Information,
  • Processor Information, etc.

Por ejemplo si se quieren saber las carecterísticas de la computadora (Modelo, Fabricante, Serial etc):

sudo dmidecode | grep -A 9 "System Information"

También se puede utilizar este comando empleando ciertos String a través de la opción -s:

sudo dmidecode -s String_keyword
sudo dmidecode -s system-product-name
sudo dmidecode -s bios-release-date
sudo dmidecode -s baseboard-product-name
sudo dmidecode -s baseboard-manufacturer



11.7 sysinfo - lshw

sudo apt-get install sysinfo

Para crear un archivo html con todas las características del hardware:

sudo lshw -html > mySpecs.html

then check the html file.



11.8 Startup Menu

Al iniciar la computadora podemos ver todas estas características en el Startup Menu. En mi caso F1 me lleva a System Information en donde se despliega esta información. También se puede verificar en el BIOS Setup.



12 Algunas funciones del shell - terminal


12.1 Historique

  • Flecha hacia arriba: remonter,
  • Flecha hacia abajo: redescendre dans l'historique;


  • Ctrl + R <chaine>: Chercher une commande dans l'historique contenant <chaine> ;
    • A nouveau Ctrl + R: cherche la commande précédente ;


Ctrl + G: interrompt la recherche.


history -c && history -w
history -c && history -w && clear && clear



13 Some networking commands

https://askubuntu.com/questions/461825/how-to-connect-to-wifi-from-the-command-line

To see list of saved connections, use (<SavedWiFiConn>):

nmcli c

To see list of available WiFi hotspots (<WiFiSSID>):

nmcli d wifi list

or:

sudo iwlist wlan0 scanning

Para conectarse a una red:

nmcli c up <SavedWiFiConn>
nmcli c up iptime

Para conectarse nmcli c down <SavedWiFiConn>



14 Grub2

The main GRUB 2 folder locations include /boot/grub/ and /etc/grub.d/. User preferences are stored in the /etc/default/grub file. The GRUB 2 menu is built by information contained in /boot/grub/grub.cfg.

En este video se explica como configurar grub2: https://www.youtube.com/watch?v=bIH-1hDvZb0



14.1 Installing - Reinstalling Grub2

https://help.ubuntu.com/community/Grub2/Installing



14.1.1 Reinstalling GRUB 2 from a Working System

If Ubuntu is operating normally, boot into the working installation and run the following command from a terminal:

«a» is the drive (letter) on which you want GRUB to write the boot information. Normally users should not include a partition number, which would produce an error message as the command would attempt to write the information to a partition.

sudo grub-install /dev/sda
sudo grub-install --recheck /dev/sda   (éste no es indispensable.. no sé realmente la utilidad)
sudo update-grub

This will rewrite the MBR information to point to the current installation and rewrite some GRUB 2 files (which are already working). Since it isn't done during execution of the previous command, running «sudo update-grub» after the install will ensure GRUB 2's menu is up-to-date.



14.1.2 If a system has become unbootable

There are various methods for reinstalling GRUB 2:



14.1.2.1 Restore or Reinstall Grub 2 from a Ubuntu Live CD or USB

https://help.ubuntu.com/community/Grub2/Installing

http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

Grub 2 typically gets overridden when you install Windows or another Operating System. To make Ubuntu control the boot process, you need Reinstall (Repair/Restore) Grub using a Ubuntu Live CD.

Warning: Using the sudo command, especially from a Live CD can do serious damage to your system. Read all instructions and confirm you understand before executing any commands.


  • Mount the partition your Ubuntu Installation is on. If you are not sure which it is, launch GParted (included in the Live CD) and find out. It is usually a EXT4 Partition. Replace the «a6» with your drive letter, and partition number:
sudo mount /dev/sda6 /mnt


  • Now bind the directories that grub needs access to to detect other operating systems, like so:
sudo mount --bind /dev /mnt/dev &&
sudo mount --bind /dev/pts /mnt/dev/pts &&
sudo mount --bind /proc /mnt/proc &&
sudo mount --bind /sys /mnt/sys


  • Now we jump into that using chroot:
sudo chroot /mnt


  • Now install, check, and update grub. This time you only need to add the drive letter (usually a):
grub-install /dev/sda
grub-install --recheck /dev/sda
update-grub


  • Now grub is back, all that is left is to exit the chrooted system and unmount everything:
exit &&
sudo umount /mnt/sys &&
sudo umount /mnt/proc &&
sudo umount /mnt/dev/pts &&
sudo umount /mnt/dev &&
sudo umount /mnt


  • Shut down and turn your computer back on, and you will be met with the default Grub2 screen.



14.1.2.2 Via Boot-Repair Graphical Tool

https://help.ubuntu.com/community/Boot-Repair



14.1.2.3 Via GRUB2 Rescue mode

GRUB 2 provides a rescue mode which allows the user to attempt to repair GRUB 2 from a special GRUB terminal during boot. https://help.ubuntu.com/community/Grub2#Command_Line_and_Rescue_Mode



14.2 Grub no detecta alguno de los SO instalados

La última vez instalé Red Hat cuando ya se encontraban Ubuntu y Windows instalados en mi disco. Como era de esperarse, Red Hat reinstaló el grub. Sin embargo, al reiniciar la computadora, el menú del grub sólo mostraba Ubuntu y Red Hat, dejando inbootable a Windows. Lo mismo pasó al instalé CentOS cuando ya se encontraban Ubuntu, Red Hat y Windows instalados. El grub que instaló CentOS dejó unbootable a Windows.

Esto ya me había pasado en una ocasión anterior y lo había resolvido reinstalando grub2 desde Ubuntu como se muestra en Linux#Reinstalling GRUB 2 from a Working System

Sin embargo, la última vez que formetée la computadora, al tratar de solucionar este problema reinstalando GRUB 2 from Ubuntu, no funcionó, el grub se reinstalaba e incluía a Windows pero esta vez dejaba por fuera a Red Hat.

From my researches, al parecer este problema está relacionado con la configuración de particiones que realicé en Red Hat. En dicha configuración incluí una partición para el /boot (XFS) y dentro de un LVM, la partición / y swap. Entonces, como se ha dicho en otras secciones, es necesario instalar algunos paquetes que adicionan soporte para este tipo de particinoes.

Para solucionar este problema, en Ubuntu: https://askubuntu.com/questions/351002/triple-boot-ubuntu-windows-showing-up-but-not-red-hat

  1. Instalé los paquetes de soporte para particiones: Linux#LVM and xfs support for Ubuntu
  2. Monté la partición /boot de Red Hat (NO tuve que montar la partición LVM de Red Hat, solo la /boot que es standard (xfs) partition)
  3. Reinstalé grub2 como se muestra en Linux#Reinstalling GRUB 2 from a Working System
  • Luego de eso, el comando «update-grub» detectó la instalación de Red Hat, y éste fue incluido en el Grub.



15 SSH

La instalación base de SSH se hace a través de dos paquetes:

openssh-client   permite conectarse a otra computadora
openssh-server   permite que otra computadora se conecte


Hay dos approach para la autentificación al usar SSH:

  • Using the password de la «cuenta linux»
  • SSH Keys

When using a password, ssh pedirá el password de la «cuenta linux» a la que nos estemos conectando al momento de realizar la conexión.



15.1 SSH Keys

https://www.digitalocean.com/community/tutorials/how-to-set-up-ssh-keys--2

Al usar este método, debemos crear un par de keys: a public and a private key (SSH puede comprobar cuando estas dos keys (public and private) match. La «private key» estará siempre en la computadora a la cual corresponda (donde fue creada) y la «public key» será copiada en las computadoras a las que nos queremos conectar. De esta forma, al momento de realizar la conección, SSH verifica si la «public key» de la computadora que trata de acceder a la otra, se encuentra el la computadora a la cual se quiere acceder. Esta verificación se hace verificando que la «private key» corresponda con algunas de las «public key» que se encuentran en la computadora a la cual se quiere acceder.

A través de este método no es necesario que SSH solicite un password al momento de realizar la conexión. SSH keys provide a more secure way of logging into a server with SSH than using a password alone. While a password can eventually be cracked with a brute force attack, SSH keys are nearly impossible to decipher by brute force alone.



15.1.1 Create the RSA Key Pair

The first step is to create the key pair on the client machine:

ssh-keygen -t rsa

This generates an RSA key pair. RSA (Rivest-Shamir-Adleman) is a widely used asymmetric encryption algorithm. When you use -t rsa, ssh-keygen will create an RSA key pair with a default key length of 2048 bits unless specified otherwise.


ssh-keygen -t ed25519 -b 4096

This generates an Ed25519 key pair, a newer and more modern cryptographic algorithm. Ed25519 is an elliptic curve algorithm that offers high security with relatively smaller key sizes. By using -t ed25519, ssh-keygen will create an Ed25519 key pair, and the -b 4096 option sets the key length to 4096 bits.


ssh-keygen -t rsa -C "adeloaleman@gmail.com"

By default, creo que la key sera asociada al hostname, lo que ya es muy adecuado para identificar la key


Once you have entered the Gen Key command, you will get a few more questions:

Enter file in which to save the key (/home/adelo/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):

It's up to you whether you want to use a passphrase. Entering a passphrase does have its benefits: the security of a key, no matter how encrypted, still depends on the fact that it is not visible to anyone else. Should a passphrase-protected private key fall into an unauthorized users possession, they will be unable to log in to its associated accounts until they figure out the passphrase, buying the hacked user some extra time. The only downside, of course, to having a passphrase, is then having to type it in each time you use the key pair.

Luego de ejecutar el comando ssh-keygen, the private and public keys will be located in:

/home/demo/.ssh/id_rsa
/home/demo/.ssh/id_rsa.pub


Una «public key» es algo así:

ssh-rsa
AAAAB3NzaC1yc2EAAAADAQABAAABAQC7eJzkbD+DdE9X8qk/GRD7dhYF8KVTpjNzRg5qCU5NkpeBiIKMZh8UTY41DWKPGTxh0KhMGYQ+
LKxMluQGGrOKJE1uEcgnyI2ljbCDZEbpJWvVVngctmJfrm8gubt1djMPRZkwXJK8OaOHsX4UYbrxAW2R3u4gkez13uB0EJAF6l/SifYZz
ZbdySKoOWoXrtDsuNtQ1OxSMOsdc1PPmQh2lHNtdUiHkEA/PBiwo9lRBFjeVzBsc7EEMITOK1VGDKTtAoOkxJnvpXbm6FjOuTME3j2cEX
lWWcyeX9jtkrRDVcDge8G+HpY+5Le4gQBrNYRIVh9ohs72+dOU8n+6CV   adeloaleman@gmail.com


note que la key está asociada al email «adeloaleman@gmail.com» ya que fue creada a través de:

ssh-keygen -t rsa -C "adeloaleman@gmail.com"

Si ejecutamos el comando sin palabra asociada:

ssh-keygen -t rsa -C

la «public key» será asociada a: user@computerName. En mi caso «adelo@adelo-laptop»



15.1.2 Copy the Public Key en la computadora a la cual nos vamos a conectar

Once the key pair is generated, it's time to place the public key on the server that we want to use.

La «public key» se debe copiar into the «authorized_keys» file de la computadora a la cual nos vamos a conectar:

~/.ssh/authorized_keys

You can copy the public key into the «authorized_keys» file with the ssh-copy-id command:

ssh-copy-id -i ~/.ssh/my_key.pub demo@198.51.100.0
ssh-copy-id demo@198.51.100.0

Se debe notar que para poder ejecutar el comando anterior debemos ser capaces de autentificar la conexión (ssh trafic hacia la computadora a la cual nos queremos conectar). Lo anterior es más que lógico porque si no fuera así, seríamos entonces capaces de copiar nuestra «public key» en cualquier computadora y conectarnos luego a ella; lo cual no tiene sentido. Por tanto, cuando ejecutemos el comando anterior, SSH debe solicitar el password de la cuenta@computadora a la que nos estemos conectando. Luego de que la «public key» sea copiada en la computadora a la cual vamos a acceder, podremos realizar la conección «ssh adelo@159.20.10.1» sin necesidad de ingresar el password de la cuenta@computadora.

Generalmente la opción de «solicitar el password de la cuenta@computadora» está activada en uno de los archivos de configuraciones de SSH:

/etc/ssh/sshd_config
    PasswordAuthentication yes

«PasswordAuthentication yes» permite que SSH solicite el password de la cuenta@computadora al momento de realizar la conexión.

«PasswordAuthentication no» impide que la autentificación se realice a través del password de la cuenta@computadora. Así, la utentificación debe ajuro realizarse con SSH Keys.


Por tanto, si intentamos compiar nuestra «public key» a través de «ssh-copy-id demo@198.51.100.0» en una computadora que impide la autentificación a través del password de la cuenta@computadora («PasswordAuthentication no») la autentificación no podrá realizarse y no podremos por tanto copiar la «public key» en la computadora destino. Éste es el caso de VM Instance creadas en la Google Cloud Platform. Entonces, para ser capaces de estableser la conexión con SSH, debemos primero conectarnos a la computadora destino (con algún otro método pues con SSH no hemos todavía sido capaces de autentificar y estableser la conexion) y: https://www.digitalocean.com/community/questions/ssh-copy-id-not-working-permission-denied-publickey

Edit ssh config:

sudo nano /etc/ssh/sshd_config

Change this line:

«PasswordAuthentication no»   to   «PasswordAuthentication yes»

Restart daemon:

sudo systemctl restart sshd



15.2 SSH timeout due to inactivity

http://cdb.systems/blog-in-neque-arcu-vulputate/214-amazon-ec2-ssh-timeout-due-inactivity.html

1 way: you local computer: Esta es la solución que he implementado y funciona perfectametne. Es general para todas las instance a las que te conectes.

You can set a keep alive option in your ~/.ssh/config file on your computer's home dir:

ServerAliveInterval 50

Amazon AWS usually drops your connection after only 60 seconds of inactivity, so this option will ping the server every 50 seconds and keep you connected indefinitely.


2 way: your instance settings:

http://cdb.systems/blog-in-neque-arcu-vulputate/214-amazon-ec2-ssh-timeout-due-inactivity.html



15.3 SSH troubleshooting

If you have copied your keys to your host:

~/.ssh/adelo_ssh  
~/.ssh/adelo_ssh.pub

and the content of «~/.ssh/adelo_ssh.pub» is in the «~/.ssh/authorized_keys» file on your remote server,

but the SSH connection is still NOT working, you might want to try the following on your host server:

vi ~/.ssh/config
Host sinfronteras.ws
   User root
   IdentityFile ~/.ssh/adelo_ssh

If the above doesn't work, you can also try this:

eval $(ssh-agent -s)
ssh-add ~/.ssh/adelo_ssh



16 Mount discs


16.1 Mounting windows partition

sudo mount /dev/nvme0n1p3 /home/adelo/1-system/4-windows/
sudo umount /dev/nvme0n1p3



BitLocker:

Nuevas particiones windows vienen con una encryption option called BitLocker


Es posible que la clave se encuentre en:


Sino encontramos la clave, para desactivarla se pueden seguir estas indicaciones:


If bitlocker: https://itsfoss.com/mount-encrypted-windows-partition-linux/

sudo apt install dislocker
sudo mkdir /mnt/bitlocker
sudo dislocker  /dev/nvme0n1p3 -p238051-178***********************66-465377 -- /mnt/bitlocker
sudo mount -t ntfs-3g -o loop /mnt/bitlocker/dislocker-file /home/adelo/1-system/4-windows


You can unmount the mounted partition from the file manager. Just click the unmount symbol beside the partition named windows-mount. Otherwise, unmount command is always there for you:

sudo umount /mnt/bitlocker
sudo umount /home/adelo/1-system/4-windows



16.2 Montar discos permanentemente

http://doc.ubuntu-fr.org/mount_fstab

Para montar permanentemente mi disco_local y mi disco_ext, tuve que agregar las siguientes líneas en el archivo /etc/fstab

# Disco_local:
# Actualmente *(Ver notas abajo)
UUID=2368f4a6-993f-4cfa-8ed4-de39f3b35c7c   /home/adelo/1-system/1-disco_local  ext4  defaults                     0  0
# Configuracion en mi previa computadora:
# UUID=0B8D61386C315368                     /home/adelo/1-system/1-disco_local  ntfs  auto,users,exec,permissions  0  0

# Disco externo - TOSHIBA EXT:
UUID=3C9A5D379A5CEF40                       /home/adelo/1-system/2-disco_ext    ntfs  auto,nofail,users,permissions  0  0

*La configuración que tenía en mi previa computadora no funcionó; se generaba un error al momento del booting. De hecho, la primera vez que intenté montar el disco a través de la configuración del antigua, se generaron errores que no pude solucionar al cambiar las opciones a «defaults». Cuando intentaba montar la partición con «mount /dev/nvme0n1p5 /home/adelo/1-system/», y se generaba el error «Structure Needs Cleaning». No pude solucionar esos problemas y lo que hice fue volver a formatear la partición; luego de eso fui capaz de montarla normalmente con un «mount ..» y a través de «defaults» en el fstab. El único detalle fue que luego de montar la partición con «defaults» tuve que hacer un «chown adelo:adelo 1-disco_local».



16.2.1 chmod y chown en particiones ntfs

Al iniciar la recherche sobre la permisología (chmod) en particiones ntfs, encontré muchos foros en los que se afirmaba que no se podían cambiar los permisos en particiones ntfs. Se planteaba como única solución, la asignación de los permisos deseados al punto de montaje de la partición; lo cual hacía que todos los archivos dentro de la partición tuvieran los mismos permisos que fueron asignados al punto de montaje. A continuación muestro algunas de las páginas en donde encontré dicha información:

Tu ne peux pas changer les droits sur les fichiers d'une partition NTFS pour la bonne raison qu'ils ne sont pas gérés commes sous UNIX. En revanche tu peux changer les droits ou attribuer la propriété sur toute la partition. Pour cela il te suffit de changer les options de montage, soit en option de mount soit directement dans le fstab. Pour plus d'infos sur la procédure voir la documentation mount_fstab


Sin embargo, al final encontré que actualmente sí existe una solución para modificar la permisología de archivos en particiones ntfs.

En los siguientes posts, aunque al inicio de la conversación se decía que no era posible por las mismas razones antes explicadas, al final se encuentra una solución para poder cambiar los permisos en particiones ntfs:

Lo único que tuve que hacer fue adicionar la siguiente línea al archivo /etc/fstab:

Para particiones internas:

# <file system>          <mount point>                 <type>    <options>                           <dump>  <pass>
UUID=0B8D61386C315368    /home/adelo/1-mis_archivos    ntfs      auto,users,exec,permissions         0       0



16.2.1.1 Para discos externos

http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in

https://wiki.archlinux.org/index.php/Fstab#External_devices

En disco duros externos debemos utilizar la opción <nofail>. Esto porque cuando el disco no está conectado al iniciar la computadora (boot), el sistema buscará la partición (si no se usa <nofail>), al no encontrarla generará un error y el sitema no iniciará correctamente. Con <nofail> el sistema monta la partición durante el boot si el disco se encuentra conectado, y omite este proceso cuando el disco no está conectado. En este caso, el disco será montado luego de conectarlo mientras la computadora está funcionando.

The only inconvenience with <nofail> is that if you connect the device while the system is running, depending on configuration (too many variables to test), the device may not mount immediately. This can be remedied with a simple mount -a or mount /specific_device or a reboot. http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in

En mi caso, aunque no lo monta inmediatamente, el ínoco de la unidad es desplegado en el Launcher, y haciendo clic en él, el disco se monta normalmente. A través de "sudo mount -a" también se monta correctamente; pero cuando queramos desmontarlo habrá que hacerlo como root porque fue montado como root.

UUID=3C9A5D379A5CEF40    /home/adelo/toshiba_ext       ntfs      auto,nofail,users,exec,permissions	0       0

Para saber el UUID de la partición: sudo blkid

auto: will automatically mount the partition when you boot.

users: allows users to mount and umount.

exec: permite ejecutar archivos. Esta opción se debe colocar luego de la opción <users>. Si no se usa esta opción, podremos modificar los derechos y pertenencias de los archivos. Sin embargo, aún dándole permisos de ejecución a un archivo, éste no podrá ser ejecutado. Ver http://askubuntu.com/questions/30243/why-does-ubuntu-refuse-to-execute-files-from-an-ntfs-partition

nofail: external devices that are to be mounted when present but ignored if absent. https://wiki.archlinux.org/index.php/Fstab#External_devices

permissions: es justamente la opción que permite la modificación de los permisos y pertenencia de los archivos.

dump est utilisé pour les sauvegardes. (Ver mount_fstab)

pass pour l'ordre de vérification au démarrage: (Ver mount_fstab)

  • 1 pour la racine
  • 2 pour les autres partitions Linux
  • 0 pour le swap et les partitions windows: Une valeur de <pass> à 0 signifie qu'il n'y aura pas de vérification au démarrage (Déconseillé dans la plupart des cas).

Otras opciones y una explicación más detallada del uso del archivo etc/fstab se encuentra en mount_fstab

No hay ni siquiera que crear antes el directorio /home/adelo/1-mis_archivos. Éste se creará y la partición será montada automáticamente luego de reiniciar la computadora; y podremos modificar la permisología (chmod) de la pertenencia (chown) de los archivos que se encuentre en tal partición ntfs.

Ahora bien, para modificar la pertenencia y los derechos de la partición y de todos los archivos que se encuentran en ella:

chown -R adelo:adelo /home/adelo/1-mis_archivos

Para modificar los permisos de todos los archivos en la partición ver aquí


En el siguiente post también se encuentra una vía similar (haciendo uso de otras opciones en el archivo /etc/fstab) para poder cambiar los permisos en particiones ntfs. Sin embargo este método no lo he corroborado:



16.3 Mount a remote filesystem in your local machine

Conozco dos formas:



16.3.1 Using the SSH File Transfer Protocol

https://www.digitalocean.com/community/tutorials/how-to-use-sshfs-to-mount-remote-file-systems-over-ssh

Debemos instalar el paquete sshfs:

sudo apt-get install sshfs

Luego, para montar el remote filesystem:

sshfs root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud

Ahora, de la forma anterior, se presenta un problema cuando se pierde la conexión por instantes. Se presentan los problemas explicados en estos forums:

https://serverfault.com/questions/306796/sshfs-problem-when-losing-connection: sshfs problem when losing connection: «When I lost the connection the shell become frozen, if I open another shell and I try to access to the mounting point also this new shell froze»

https://askubuntu.com/questions/358906/sshfs-messes-up-everything-if-i-lose-connection: SSHFS messes up everything if i lose connection: «When I say everything is messe up i mean: My console stops working if i do something as simple as 'ls'. I can't unmount either through the console or the File Browser. Consequently, i can't mount it again, therefore i can't work.

Como se sugiere en los dos forums anteriores, la solución es utilizar la opción «reconnect» del comando sshfs. El siguiente forum explica bien como utilizar esta opción: https://askubuntu.com/questions/716612/sshfs-auto-reconnect

Por tanto, debemos usar el comando sshfs de la siguiente forma:

sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 root@sinfronteras.ws:/ /home/adelo/1-system/3-cloud

sshfs -o reconnect,ServerAliveInterval=5,ServerAliveCountMax=3 visitor@sinfronteras.ws:/root/1-system-cloud/2-mis_archivos_cloud/remote_projects /home/adelo/1-system/3-cloud

The ServerAliveInterval=15 option asked sshfs to check if the server is alive every 15 seconds. ServerAliveCountMax=3 allows the server to not respond for up to three alive checks. The result is that if the server is unavailable for 1 minute, sshfs will reconnect to the server.



16.3.2 Using the Network File System protocol NFS

https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04

En este link se encuentra la página de Google Cloud que explica como Mounting Fileshares on Compute Engine Clients a través de NFS: https://cloud.google.com/filestore/docs/mounting-fileshares

Como ya mencionamos, NFS no encripta los datos, lo cual supone problemas de seguridad, pero por la misma razón es más rápido que SSH: https://superuser.com/questions/344255/faster-way-to-mount-a-remote-file-system-than-sshfs

No he podido montar un remote filesystem con NFS entre dististas networks (a través the Internet). Al parecer, por las razones de seguridad que ya hemos explicado, NFS mount se usa dentro de la misma Network; debería, sin embargo, ser posible establecer la conexión entre distintas Networs, pero no he podido hacerlo.

De la única forma que he logrado montar un remote filesystem con NFS fue entre dos Google Cloud VM Instances creadas en el mismo proyecto (se encuentran la misma direct Network). Para hacerlo tuve que usar los Internal IP's. Con los External IP's no pude realizar la conexión. Cuando traté de realizar la conexión con los External IP's, al ejecutar el «mount» se generaba el error «NFS mount timeout» luego de varios minutos. A continuación muestro algunos links que utilicé para trata de solventar este error: https://serverfault.com/questions/894881/mounting-nfs-server-running-in-vm-connection-timed-out https://access.redhat.com/solutions/1751813


https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04:

Instalación:

On the Host:

sudo apt install nfs-kernel-server

On the Client:

udo apt install nfs-common


Creating the Share Directories on the Host:

sudo mkdir /var/nfs/general -p

Since we’re creating it with sudo, the directory is owned by the root user on the host. NFS will translate any root operations on the client to the nobody:nogroup credentials as a security measure. Therefore, we need to change the directory ownership to match those credentials:

sudo chown nobody:nogroup /var/nfs/general


Configuring the NFS Exports on the Host Server:

Next, we’ll dive into the NFS configuration file to set up the sharing of these resources.

Open the /etc/exports file in your text editor with root privileges:

/etc/exports:

directory_to_share    client(share_option1,...,share_optionN)

We’ll need to create a line for each of the directories that we plan to share. Since our example client has an IP of 203.0.113.24, our lines will look like the following. Be sure to change the IP address shown here to that of your client:

/etc/exports:

/var/nfs/general    203.0.113.24(rw,sync,no_subtree_check)
/home               203.0.113.24(rw,sync,no_root_squash,no_subtree_check)

When you are finished making your changes, save and close the file. Then, to make the shares available to the clients that you configured, restart the NFS server with the following command:

sudo systemctl restart nfs-kernel-server

También es necesario: https://unix.stackexchange.com/questions/106122/mount-nfs-access-denied-by-server-while-mounting-on-ubuntu-machines

sudo exportfs -a

Sin «exportfs -a» he encontrado el error: «mount.nfs: access denied by server while mounting on Ubuntu machines»


Adjusting the Firewall on the Host:

Si hemos ajustado reglas en el firewall, puede también ser necesario realizar las configuraciones necesarias para permitir el tráfico NFS. Ver https://www.digitalocean.com/community/tutorials/how-to-set-up-an-nfs-mount-on-ubuntu-18-04


Creating Mount Points and Mounting Directories on the Client:

Now that the host server is configured and serving its shares, we'll prepare our client.

We'll create a directories for our mount:

sudo mkdir -p /nfs/general

Finally, to mount the remote filesystem:

sudo mount 203.0.113.0:/var/nfs/general /nfs/general



16.3.3 Mount a remote filesystem in Windows 10

https://stackoverflow.com/questions/443732/how-do-i-mount-a-remote-linux-folder-in-windows-through-ssh

https://www.nsoftware.com/sftp/netdrive/



16.4 Mount an URL

Montar, por ejemplo: http://www.es.sinfronteras.ws

https://blog.amarkulo.com/mount-web-dav-folder/

https://github.com/maxogden/mount-url

https://superuser.com/questions/181351/can-i-use-fstab-to-mount-http-shares



16.5 Mount LVK partitions

https://askubuntu.com/questions/766048/mount-unknown-filesystem-type-lvm2-member



17 MEGAsync

https://mega.nz


Desktop app installation: https://mega.io/desktop#download


File ignores: Ver Linux#.megaignore


Hay excelente medidas de seguridad para no perde la data por errores:

  • Cuando un directory está synced:



18 Google Drive sync

IMPORTANTE!! Falta documentar este proceso...


IMPORTANTE!! Ver cual es el proceso a llevar a cabo cuando algún archivo es no tomado en cuenta por la sync. Podemos hacerlo con el archivo /home/adelo/desktop/atm/IDG/inventario.txt que está faltando en la 2da laptop.



Google Drive for desktop offers two-way sync by what they call Computers syncing. Google Drive for desktop works on Window and macOS but not in Linux :(

https://drive.google.com/drive/computers

https://support.google.com/drive/answer/10838124?visit_id=638293670466682722-426317989&p=empty_state_computers_web&rd=1


On Ubuntu:

I haven't found something that support two-way sync on linux. There are services like rclone that offers one way sync (Destination is updated to match source : https://rclone.org/commands/rclone_sync/).


This paid service apparently offers 2-way sync in Linux, but I wasn't able to make it work: https://www.goodsync.com/


The way I've found so far to implement two-way sync is as follows:


Google Drive can also be mounted using https://linuxconfig.org/sync-google-drive-on-ubuntu-20-04-focal-fossa-gnome-desktop. However, the path where Google Drive is mounted is google-drive://adeloaleman@gmail.com/ , and I found it hard to access the mounted partition as a normal directory.


rclone config
rclone mount remote_name: ~/google-drive   # remote_name (gdrive in our case) is create it during «rclone config»
Above process won't keep the drive mounted. To keep your Google Drive always mounted with Rclone, you can set it up as a systemd service on your Linux system:


  • Use unison to sync Google Drive with the folder you want:


On Windows:

As mentioned, there is Google Drive for desktops for Windows and Mac that allows two-way sync. It must be installed from https://support.google.com/drive/answer/10838124?visit_id=638460278672489341-2663509460&p=empty_state_computers_web&rd=1

However, because I'm not really using Windows, I'm not going to implement any complex two-way sync in Windows:

  • So, on Google Drive for desktop, I haven't chosen any folders to sync from my computer to Google Drive.
  • The only thing I'm gonna do is to mount Google Drive on Windows (This is automatically done when installing Google Drive for desktop).
  • Then, I'm creating a link to Google Drive > desk-w on the Windows Desktop.
  • Everything done on Windows that we need to keep must be saved on Google Drive > desk-w; that's it!


19 Chown

chown command changes the user and/or group ownership of for given file. The syntax is:

chown owner-user file
chown options owner-user:owner-group file
chown adelo:adelo prueba.txt
chown -R adelo:adelo directorio



20 Chmod

https://doc.ubuntu-fr.org/permissions



20.1 En gerant chaque droit separement

À qui s'applique le changement:

  • u (user, utilisateur) représente la catégorie "propriétaire" ;
  • g (group, groupe) représente la catégorie "groupe propriétaire" ;
  • o (others, autres) représente la catégorie "reste du monde" ;
  • a (all, tous) représente l'ensemble des trois catégories.

La modification que l'on veut faire:

  • + : ajouter
  • - : supprimer
  • = : affectation

Le droit que l'on veut modifier

  • r : read ⇒ lecture
  • w : write ⇒ écriture
  • x : execute ⇒ exécution
  • X : eXecute ⇒ exécution, concerne uniquement les répertoires (qu'ils aient déjà une autorisation d'exécution ou pas) et les fichiers qui ont déjà une autorisation d'exécution pour l'une des catégories d'utilisateurs. Nous allons voir plus bas dans la partie des traitements récursifs l'intérêt du X.
chmod <options> u+rwx,g+rx-w,o+r-wx fichier3
chmod <options> ug+rw fichier3
chmod <options> a-rx fichier3
chmod -R a-rX directorio



20.2 En octal

  • r = 4
  • w = 2
  • x = 1
  • - = 0

Par exemple:

  • Pour rwx, on aura : 4+2+1 = 7
  • Pour rw-, on aura : 4+2+0 = 6
  • Pour r--, on aura : 4+0+0 = 4
  rwx        r-x        ---
7(4+2+1)   5(4+0+1)   0(0+0+0)



20.3 Ajustar permisología recursivamente

chmod -R 750 Documents



21 File immutable

An immutable file cannot be modified, deleted, or renamed, and no links can be created to this file. This is often used to protect critical system files or configuration files from accidental changes.


sudo chattr +i filename


To verify if the file has been made immutable, you can use the lsattr command:

lsattr filename

This should display something like:

----i-------- filename

The i in the attribute list indicates that the file is immutable.


Removing the immutable Attribute:

sudo chattr -i filename



22 Hard and symbolic (soft) links

http://stackoverflow.com/questions/185899/what-is-the-difference-between-a-symbolic-link-and-a-hard-link

Underneath the file system files are represented by inodes (or is it multiple inodes not sure)

A file in the file system is basically a link to an inode. A hard link then just creates another file with a link to the same underlying inode.

When you delete a file it removes one link to the underlying inode. The inode is only deleted (or deletable/over-writable) when all links to the inode have been deleted.

A symbolic link is a link to another name in the file system. The soft link points to the name of a file, and not to the contents.

Once a hard link has been made the link is to the inode. deleting renaming or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode is reflected in all files that refer to that inode.

Note: Hard links are only valid within the same File System. Symbolic links can span file systems as they are simply the name of another file.


Let's create hard and soft links:

Al crear links es apropiado colocar las rutas absolutas de la fuente y la destinación:

ln blah1 blah1-hard   (hard link not allowed for directory)
ln -s blah2 blah2-soft

Si blah2 es renombrado, the contents of the file blah2-soft could not be found because the soft link points to the name of the other file (that was changed) and not to the contents.

If blah1 is deleted, blah1-hard still holds the contents.

If blah2 is deleted, blah2-soft is just a link to a non-existing file.



22.1 What's the difference between a hard link and a copy?

https://bbs.archlinux.org/viewtopic.php?id=53484

Hay que internalizar que si se edita un archivo hardlink (siendo éste otro nombre para un mismo archivo) el cambio será reflejado en el archivo original (pues en realidad es el mismo archivo).

Si se hace una copia de un hard link, la copia no será un hard link sino un archivo normal. Es decir, es idéntico hacer una copia del archivo original o del hard link.

No se puede crear un hard link entre dos particiones; sólo soft links son posibles en este caso.

Aunque no se pude hacer un hardlink de un directorio, a través de la orden "cp -rlp", el comand cp copia todo el arbol de directorios y crea hardlinks de todos los archivos en el directorio:

cp -rlp : copy directories *R*ecursively + *L*ink files instead of copying + *P*reserve mode, ownership and timestamps (for non-hardlinked content such as directories)

Si se quieren preservar los softlinks debemos entonces usar también la opción -d

 cp -rlpd



23 Buscar una cadena de caracteres archivos recursivamente - Convinación de find y grep

find . -type f -print | xargs grep "palabra"


Y para buscar una linea que contenga dos palabras especificas:

find . -type f -print | xargs grep "palabra1" | grep "palabra2"


O también:

find . -exec egrep palagra '{}' +


Otra forma:

egrep -r palabra *



24 ls


24.1 Listar sólo archivos o sólo directorios

Listar solo directorios:

ls -lah | grep -v "^-"

Listar solo archivos:

ls -lah | grep -v "^d"



25 Listar archivos con su ruta absoluta

List files with their absolute path in linux:

readlink -f *



26 Listar archivos modificados antes, después, o en una cierta fecha

https://techjourney.net/find-files-that-are-modified-today-or-since-certain-time-ago-in-unix-linux/

To find all files modified in the last 24 hours (last full day) in current directory and its sub-directories:

find . -mtime -1 -print

To find all files with regular file types only, and modified in the last 24 hours (last full day) in current directory and its sub-directories:

find /directory_path -type f -mtime -1 -print

To find all files that are modified today only (since start of day only, i.e. 12 am), in current directory and its sub-directories:

touch -t `date +%m%d0000` /tmp/$$
find /tmefndr/oravl01 -type f -newer /tmp/$$
rm /tmp/$$



27 Contar archivos en un directorio

https://www.pedroventura.com/linux/contar-todos-los-archivos-existente-en-un-directorio-en-linux/

Con find

La cuenta es mas exacta con find, por ejemplo:

find . -maxdepth 2 -type f | wc -l #Contar los archivos pero solo en carpetas dos niveles por debajo

find . -type f | wc -l # Contar archivos de forma recursiva ilimitada

find . -type d | wc -l # Contar directorios de forma recursiva ilimitada

find . -type l | wc -l # Contar enlaces de forma recursiva ilimitada

find . | wc -l #Contar archivos y carpetas de forma recursiva

find . -type f -iname “*.php” | wc -l # Contar archivos con una extensión determinada


Con ls

Con ls es también apropiado para contar los archivos en un sólo directorio. Sin embargo, la forma recursiva (ls -R) no resulta muy apropiada porque se incluye una línea en blanco al finalizar el directorio; además que no se puede diferenciar entre archivos y directorios.

ls | wc -l

Para incluir los archivos ocultos:

ls -A | wc -l

El parámetro -A lista todos los archivos excepto la ruta de carpetas . y ..



28 Crear y borrar usuarios

How to Add (create) and Delete Users on Ubuntu 16.04 https://www.digitalocean.com/community/tutorials/how-to-add-and-delete-users-on-ubuntu-16-04

adduser newuser

You can delete the user itself, without deleting any of their files, by typing this as root:

deluser newuser

If, instead, you want to delete the user's home directory when the user is deleted, you can issue the following command as root:

deluser --remove-home newuser



29 Which

Retorna la ruta de un ejecutable. Por ejemplo si queremos saber donde se encuentra el ejecutable para el comando python, ejecutamos:

adelo@adelo-laptop:~$ which python
/usr/bin/python



30 Source

The source command can be used to load any functions file into the current shell script or a command prompt.

The source command can be abbreviated as just a dot (.) in Bash and similar POSIX-ish shells. However, this is not acceptable in C shell, where the command first appeared.

Uno de los usos más comunes es para reload your .bashrc without re-login or restart.

source .bashrc
. .bashrc



31 Kill process in port

Matar proceso en puerto

https://stackoverflow.com/questions/9346211/how-to-kill-a-process-on-a-port-on-ubuntu

You want to use backtick not regular tick:

sudo kill -9 `sudo lsof -t -i:9001`

If that doesn't work you could also use $() for command interpolation:

sudo kill -9 $(sudo lsof -t -i:9001)



32 du

Para incluir archivos ocultos:

  • La opción -a incluye los archivos ocultos, pero no se puede utilizar con la opción -s, --summarize. La cual permite desplegar el tamaño de un directorio y no de cada archivo por separado. Entonces para poder utilizar la opción --sumarize y desplegar también los archivos ocultos, debemos:
  • Para listar sólo los archivos ocultos:
du -hs .[^.]*
  • Si queremos listar ocultos y normales:
du -hs $(ls -A)
  • Si queremos ordenar los archivos por tamaño:
du -s $(ls -A) | sort -rn  

Note que en el caso anterior, no se debe usar la opción -h para así asegurarse de que la unidad de tamaño sea siempre la misma. Porque el comando sort no distingue entre tamaños sino sólo por los números. Es decir, si colocamos la opción -h, sort colocará un archivo de 50M antes de un archivo de 5G porque 50 es mayor que 5 y no hará distinción de la unidad.

  • Ahora si queremos listar en una unidad en particular:
sudo du -csh --block-size=1M $(ls -A) | sort -rn   (--block-size=1G)

Note que en este caso, un archivo cuyo tamaño sea menor al block-size será listado con un tamaño igual al block-size. Por ejemplo si colocamos --block-size=1G, un archivo de 1k será listado con tamaño 1, que en este caso se refiere a 1G.

  • Si queremos excluir algún archivo o directorio:
du -s --exclude=Directorio $(ls -A) | sort -rn



33 setxkbmap and loadkeys

https://ubuntuforums.org/archive/index.php/t-1551403.html

setxkbmap works when you have a graphical interface. So, when you run Ubuntu server that only works through the terminal, setxkbmap won't work.


loadkeys is to be used when you only have a terminal.

The syntax is the same

setxkbmap es



34 Tar and Zip


34.1 tar

De esta forma el archivo tar.gz se creará en el mismo lugar donde se ejecuta el comando y dentro del tar.gz se creará el full-path del directorio que se está comprimiendo. Es decir, cuando descomprimamos el archivo obtendremos el directorio /var/www/sinfronteras_ws/perso/

tar cvzf archivo.tar.gz /var/www/sinfronteras_ws/perso/1-archivos

De esta forma el full-path no es generado en el .tar.gz. Cuando descomprimamos el .tar.gz obtendremos sólo los archivos que están en 1-archivos (sin la ruta completa /var/www/sinfronteras_ws/perso/)

tar -czpvf ruta/destino/archivo.tar.gz -C /var/www/sinfronteras_ws/perso/1-archivos .



34.2 zip

Syntax for Creating a zip file:

zip myfile.zip filename.txt
unzip file.zi
unzip file.zip -d destination_folder



35 GnuPG

gpg


Para desplegar el contenido en el terminal:

gpg -d filename


GnuPG (gpg) decryption not asking for passphrase: https://security.stackexchange.com/questions/103034/gnupg-decryption-not-asking-for-passphrase



36 La papelera - Trash

En ubuntu 15 el directorio Trash se localiza en la ruta: ~/.local/share/Trash



36.1 Mover archivos a la papelera desde el terminal

http://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal

You can use gvfs-trash command from the package gvfs-bin which is installed by default in Ubuntu. Si no está instalado:

sudo apt-get install gvfs-bin

Move file to trash:

gio trash
gvfs-trash filename

According to man gvfs-trash it is deprecated in favour of «gio trash», see man gio: https://askubuntu.com/questions/213533/command-to-move-a-file-to-trash-via-terminal

See the content of the trash:

gvfs-ls trash://

Empty the trash:

gvfs-trash --empty


http://unix.stackexchange.com/questions/42757/make-rm-move-to-trash

As far as using any program as replacement/alias for rm is concerned, there are good reasons not to do that. Most important for me are:

  • The program would need to understand/handle all of rm's options and act accordingly
  • It has the risk of getting used to the semantics of your "new rm" and performing commands with fatal consequences when working on other people's systems


# He hecho el siguiente alias para crear el comando "del", ya que escribir gvfs-trash cada vez que vamos a mover un archivo a la papelera resulta tedioso.
alias del=gvfs-trash



37 Free Up Space On Ubuntu

Liberar espacio



37.1 Clean up APT cache in Ubuntu

You can see the size of this cache with the command below:

sudo du -sh /var/cache/apt

Now, you have two options to handle the cache. Either remove only the outdated packages, like those superseded by a recent update, making them completely unnecessary.

sudo apt-get autoclean

Or clean out the cache in its entirety (frees more disk space):

sudo apt-get clean



37.2 Clean the thumbnail cache

As user and root:

du -sh ~/.cache/thumbnails
rm -rf ~/.cache/thumbnails/*



37.3 Empty the Trash

Vaciar papeleras

Los directorios Trash* pueden ser borrados sin ningún problemas puesto que se crean automáticamente.

  • Papeleras en la partición donde se encuentra instalado Ubuntu:
/home/adelo/.local/share/Trash  (Estas rutas creo que deben ser comprobada como usuario y como root. Ver nota abajo)
/home/adelo/.Trash-*
/root/.local/share/Trash
link del ícono de la papelera

Nota: Por alguna razón que aún desconozco, al comparar los archivos en las dos rutas mostradas arriba con los archivos que se encueentran en la papelera al abrila a través del link del ícono de la papelera, se encuentran discrepancias. Es decir, hay archivos que se observan a través del link de la papelera que no se encuentran en las dos rutas mostradas arriba y viceversa. Por esta razón, debo también vaciar la papelera a través del link de la papelera.

  • Papeleras en disco_local (comprobar como usuario y como root):
/home/adelo/1-system/1-disco_local/.Trash-0
/home/adelo/1-system/1-disco_local/.Trash-1000
  • Papeleras en disco_ext (comprobar como usuario y como root):
/home/adelo/1-system/2-disco_ext/.Trash-0
/home/adelo/1-system/2-disco_ext/.Trash-1000
  • Papeleras en el cloud:
/root/.local/share/Trash
/root/.Trash-*



38 GParted

A la hora de redimensionar una partición, el programa GParted permite reducir tanto al inicio como al final de la partición. Ahora, es seguro redimensionar al inicio del disco? http://unix.stackexchange.com/questions/63258/can-i-safely-resize-my-partition-from-its-beginning

Cuando el programa GParted carga la tabla de particiones, la partición Swap se activa (o monta: no sé si se usa este término en este caso) automáticamente. Es por ello que a primera instancia la opción de redimensionar editar (redimensionar, borrar, etc.) esta partición estará desactivada. También, si dicha partición Swap se encuentra dentro de una partición Extendida, tampoco podremos editar la partición Extendida. Para poder realizar cambios en estas particiones debemos desactivar la partición Swap. Para esto tenemos que seleccionar la partición Swap y luego usar la opción "Swapoff" en el menú "Partition" para desactivarla.

A través del programa de particionamiento prupuesto durante la instalación de Ubuntu, no se pueden realizar redimensiones al inicio de la partición. Tampoco se pueden rediminsionar particiones Extendidas o Swap.

Ahora bien, la redimensión es un proceso que puede tomar mucho tiempo.



39 Fdisk

n => Create new Partition (Then create what you need)

t => Specify type (NTFS is 07 I think, but you can take a look at the list with L)

w => Write the changes to disk and exit



39.1 Crear una partición con fdisk

sudo fdisk /dev/sdb 
Welcome to fdisk (util-linux 2.27.1).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): n
Partition type
  p   primary (0 primary, 0 extended, 4 free)
  e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-4028415, default 2048): 
Last sector, +sectors or +size{K,M,G,T,P} (2048-4028415, default 4028415): 
Created a new partition 1 of type 'Linux' and of size 1,9 GiB.
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.



40 Mostrar barra de progreso al Copiar, mover y borrar archivos


40.1 gcp

Comando para copiar mostrando una barra de progreso y velocidad.

gcp -r origen/archivo /destino



41 Alias

http://www.computerhope.com/unix/ualias.htm

Aliases are used to customize the shell session interface:

alias ls='ls --color=auto'
alias ll='ls -la'
alias .....='cd ../../../../'
Éste lo he adicionado a mi .bashrc:
alias 'la=ls -AX'



42 Formatear una unidad Flash USB

https://askubuntu.com/questions/198065/how-to-format-a-usb-drive



42.1 Usando el terminal

Para mostrar los distintos dispositivos y particiones en el sistema:

lsblk -fm

Antes de formatear una device debemos desmontarla:

umount /dev/sdb*

Par usar el comando mkfs.* sobre una entire device (sdb por ejemplo) y no sobre una partición dentro de esta (sdb1 por ejemplo), debemos usar la opción -I. Ver Nota sdb

$ sudo mkfs.vfat -I /dev/sdb

http://tecadmin.net/format-usb-in-linux/#

https://ksearch.wordpress.com/2010/09/29/format-usb-in-linux/

$ sudo umount /dev/sdc1
$ sudo umount /dev/sdb*

Format with vFat FileSystem

$ sudo mkfs.vfat /dev/sdc1

Format with NTFS FileSystem. En este caso la opción -I no me ha funcionado. Cuando intento formatear en formato NTFS sobre la entire device, obtengo un error:

/dev/sdb is entire device, not just one partition.
Refusing to make a filesystem here!

Por eso tuve que crear una partición en la device antes de formatear --> Crear una partición con fdisk

$ sudo mkfs.ntfs /dev/sdc1

Format with EXT4 FileSystem

$ sudo mkfs.ext4 /dev/sdc1



42.2 Interfaz gráfica

https://askubuntu.com/questions/198065/how-to-format-a-usb-drive



43 Programas para realizar respaldos (Backup)


43.1 rsync

http://www.thegeekstuff.com/2010/09/rsync-command-examples/

http://www.thegeekstuff.com/2011/01/rsync-exclude-files-and-folders/

One of the main feature of rsync is that it transfers only the changed block to the destination, instead of sending the whole file. De hecho, si jamás se ha realizado un proceso rsync entre dos directorios, rsync comprobará las diferencias entre los dos directorios antes de transferir cualquier archivo. Por tanto (aún durante la primera sincronización entre dos directorios) serán transferidos sólo los bloques distintos.

rsync -azvu --delete --progress Source/ Destination/

Si colocamos "Source/" (con el slash al final) todo el contenido del directorio Source será copiado dentro del directorio Destination. Si destination no existe, éste será creado. Ahora bien, si colocamos "Source" (sin el slash) será copiado el directorio "Source" como tal dentro del directorio Destination.

rsync -azvu --delete --progress --exclude 'Figuras' --exclude 'ejercicios' --exclude 'TP_Processus/processus_files' Source/ Destination/
-a, --archive, archive mode; equals -rlptgoD (no -H,-A,-X). This option does the following:
-l, --links copy symlinks as symlinks (Preserves symbolic links)
-p, --perms preserve permissions
-t, --times preserve modification times (Preserves timestamp)
-g, --group preserve group
-o, --owner preserve owner (super-user only)
-D same as --devices --specials
--devices preserve device files (super-user only)
--specials preserve special files
-r, --recursive (ayuda from man rsync)
This tells rsync to copy directories recursively. See also --dirs (-d).
Beginning with rsync 3.0.0, the recursive algorithm used is now an incremental scan that uses much less memory than before and begins the transfer after the scanning of the first few directories have been completed. This incremental scan only affects our recursion algorithm, and does not change a non-recursive transfer. It is also only possible when both ends of the transfer are at least version 3.0.0.
Some options require rsync to know the full file list, so these options disable the incremental recursion mode. These include: --delete-before, --delete-after, --prune-empty-dirs, and --delay-updates. Because of this, the default delete mode when you specify --delete is now --delete-during when both ends of the connection are at least 3.0.0 (use --del or --delete-during to request this improved deletion mode explicitly). See also the --delete-delay option that is a better choice than using --delete-after.
Incremental recursion can be disabled using the --no-inc-recursive option or its shorter --no-i-r alias.
-z is to enable compression
-v verbose
-u : Do not overwrite the modified files at the destination (desde la última sincronización). In a typical sync situation, if a file is modified at the destination, we might not want to overwrite the file with the old file from the source.
--delete it to delete the Files Created at the Target: If a file is not present at the source, but present at the target, you might want to delete the file at the target during rsync. Si el archivo fue modificado en la destinación, éste no será sobre-escrito. Ahora bien, en la siguiente sincronización, si el archivo no vuelto a ser modificado, será sobre-escrito.
--progress : View the rsync Progress during Transfer. Displays detailed progress, i.e how many files are copies, at what rate it is copying the file, etc)
--exclude is to exclude files or directories while doing synchronization. Ver 6 rsync Examples to Exclude Multiple Files and Directories
--delete-after : No entiendo bien cual podría ser la ventaja de borrar después y no antes. Pero he visto en varios foros que usan esta opción en lugar de --delete. En este foro explican cual es la razón, aunque no entendí: Par défaut rsync avec l'option --delete supprime les fichiers qui ont disparus de la source avant tout transfert. Lorsque le fichier a été tout simplement supprimé de la source ça ne pose pas de problème. Par contre si le fichier a été déplacé à un autre endroit c'est plus embêtant car il y a un moment où le fichier n'est plus dupliqué sur le serveur de backup. Pour éviter ce petit soucis il faut ajouter l'option --delete-after pour que les fichiers soit supprimés après la copie et plus avant. http://raphastronome.astro5000.com/?post/Option-delete-after-de-rsync
-H, --hard-links (ayuda from man rsync)
This tells rsync to look for hard-linked files in the source and link together the corresponding files on the destination. Without this option, hard-linked files in the source are treated as though they were separate files.
This option does NOT necessarily ensure that the pattern of hard links on the destination exactly matches that on the source. Cases in which the destination may end up with extra hard links include the following:
  • If the destination contains extraneous hard-links (more linking than what is present in the source file list), the copying algorithm will not break them explicitly. However, if one or more of the paths have content differences, the normal file-update process will break those extra links (unless you are using the --inplace option).
  • If you specify a --link-dest directory that contains hard links, the linking of the destination files against the --link-dest files can cause some paths in the destination to become linked together due to the --link-dest associations.
Note that rsync can only detect hard links between files that are inside the transfer set. If rsync updates a file that has extra hard-link connections to files outside the transfer, that linkage will be broken. If you are tempted to use the --inplace option to avoid this breakage, be very careful that you know how your files are being updated so that you are certain that no unintended changes happen due to lingering hard links (and see the --inplace option for more caveats).
If incremental recursion is active (see --recursive), rsync may transfer a missing hard-linked file before it finds that another link for that contents exists elsewhere in the hierarchy. This does not affect the accuracy of the transfer (i.e. which files are hard-linked together), just its efficiency (i.e. copying the data for a new, early copy of a hard-linked file that could have been found later in the transfer in another member of the hard-linked set of files). One way to avoid this inefficiency is to disable incremental recursion using the --no-inc-recursive option.
--partial (ayuda from man rsync)
By default, rsync will delete any partially transferred file if the transfer is interrupted. In some circumstances it is more desirable to keep partially transferred files. Using the --partial option tells rsync to keep the partial file which should make a subsequent transfer of the rest of the file much faster.
--partial-dir=DIR
A better way to keep partial files than the --partial option is to specify a DIR that will be used to hold the partial data (instead of writing it out to the destination file). On the next transfer, rsync will use a file found in this dir as data to speed up the resumption of the transfer and then delete it after it has served its purpose.
Note that if --whole-file is specified (or implied), any partial-dir file that is found for a file that is being updated will simply be removed (since rsync is sending files without using rsync’s delta-transfer algorithm).
Rsync will create the DIR if it is missing (just the last dir -- not the whole path). This makes it easy to use a relative path (such as "--partial-dir=.rsync-partial") to have rsync create the partial-directory in the destination file’s directory when needed, and then remove it again when the partial file is deleted.
If the partial-dir value is not an absolute path, rsync will add an exclude rule at the end of all your existing excludes. This will prevent the sending of any partial-dir files that may exist on the sending side, and will also prevent the untimely deletion of partial-dir items on the receiving side. An example: the above --partial-dir option would add the equivalent of "-f '-p .rsync-partial/'" at the end of any other filter rules.
If you are supplying your own exclude rules, you may need to add your own exclude/hide/protect rule for the partial-dir because (1) the auto-added rule may be ineffective at the end of your other rules, or (2) you may wish to override rsync’s exclude choice. For instance, if you want to make rsync clean-up any left-over partial-dirs that may be lying around, you should specify --delete-after and add a "risk" filter rule, e.g. -f 'R .rsync-partial/'. (Avoid using --delete-before or --delete-during unless you don’t need rsync to use any of the left-over partial-dir data during the current run.)
IMPORTANT: the --partial-dir should not be writable by other users or it is a security risk. E.g. AVOID "/tmp".
You can also set the partial-dir value the RSYNC_PARTIAL_DIR environment variable. Setting this in the environment does not force --partial to be enabled, but rather it affects where partial files go when --partial is specified. For instance, instead of using --partial-dir=.rsync-tmp along with --progress, you could set RSYNC_PARTIAL_DIR=.rsync-tmp in your environment and then just use the -P option to turn on the use of the .rsync-tmp dirfor partial transfers. The only times that the --partial option does not look for this environment value are (1)when --inplace was specified (since --inplace conflicts with --partial-dir), and (2) when --delay-updates was specified (see below).
For the purposes of the daemon-config’s "refuse options" setting, --partial-dir does not imply --partial. This is so that a refusal of the --partial option can be used to disallow the overwriting of destination files with a partial transfer, while still allowing the safer idiom provided by --partial-dir.
-P : same as --partial --progress.
--no-inc-recursive : Ver comentarios en las opciones -r y -H.


Hasta ahora lo único que no he podido solucionar es que cuando muevo un archivo en la Source, la sincronización no entiende que éste ha sido movido y así moverlo también en la destinación (lo cual disminuiría bastante el tiempo de sincronización). Por el contrario, cuando el... Al parecer, la solución a este problema se encuentra explicada aquí: https://lincolnloop.com/blog/detecting-file-moves-renames-rsync/

http://moderncaveman.org/projects/modern/rsync-detect-renamed/patching-rsync-for-renamed.html

http://javier.io/blog/en/2014/08/06/rsync-rename-move.html

  • Me gustaría que le comando imprimiera en pantalla durante la ejecución, los archivos que no fueron sincronizados porque fueron modificados en la destinación (esto por usar la opción -u). Es decir me gustaría saber cuales fueron los archivos modificados en la destinación.



44 Three ways to hide Files and Directories in Linux

Archivos ocultos

http://www.dailygyan.com/2008/01/3-ways-to-hide-files-and-directories-in.html

  1. Make a file named .hidden: We add the name of the file/directory to be hidden into the .hidden file, one name in each line.
  2. Just rename the file/directory and prefix the name with a ' . ' (a dot). Files starting with a ' . ' are considered to be hidden files by linux.
  3. Rename the file and add a '~' to the end. Linux considers files ending in ~ as backup files and hence hides them. En Ubuntu este método funciona sólo en el administrador de archivos (en nautilus por ejemplo) y con archivos normales, no con directorios.



45 Convert


45.1 Combinar o unir imágenes

http://imagemagick.org/Usage/layers/#append

Horizontal:

convert seleccion_categoria1.png +append seleccion_categoria2.png +append -background none -append seleccion_categoria.png

Vertical:

convert seleccion_categoria1.png seleccion_categoria2.png -background none -append seleccion_categoria.png

convert 1.png 2.png -background none -append .png

convert   -background none -append .png



46 Search in a pdf from the command line

https://stackoverflow.com/questions/4643438/how-to-search-contents-of-multiple-pdf-files

find . -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep --with-filename --label="{}" --color "your pattern"' \;
find . -name '*.pdf' -exec sh -c 'pdftotext "{}" - | grep -i --with-filename --label="{}" --color "your pattern"' \;



47 Convertir pdf en svg

http://manpages.ubuntu.com/manpages/cosmic/man1/pdf2svg.1.html

pdf2svg pdffile svgfile [page number]



48 Redimensionar imagen - PDF

[redimensionar / resize | comprimir / compress]

sudo apt-get install imagemagick

Si queremos por ejemplo reducir todas las imágenes en un 50% ejecutamos:

mogrify -resize 50% *.jpg

Si queremos darle un tamaño determinado:

mogrify -resize 1024x768 imagen.jpg



48.1 Comprimir un PDF

Paso 1: Trasformar pdf a ps

pdf2ps Original.pdf Medio.ps

Paso 2: Trasformar ps a pdf

ps2pdf Medio.ps Salida.pdf



49 Cortar pdf

https://askubuntu.com/questions/124692/command-line-tool-to-crop-pdf-files

pdfcrop --margins '0 0 0 0' input.pdf output.pdf

Con 0 0 0 0 debería cortar la imagen a margen cero. También se pueden usar valores negativos

pdfcrop --margins '-5 -5 -5 -5' input.pdf output.pdf


El siguiente script toma un archivo pdf con varias páginas, extrae cada página en un archivo separado y recorta cada página a márgenes cero:

#!/bin/bash

for i in {1..11}
do
        pdftk library.pdf cat $i output pag$i.pdf
        pdfcrop --margins '-3 -3 -3 0' pag$i.pdf pag$i.pdf
        echo "$i "
done

Este ejemplo se puede probar con este archivo: Media:Library.pdf



50 Best way to convert svg to png

https://stackoverflow.com/questions/9853325/how-to-convert-a-svg-to-a-png-with-image-magick

inkscape -z -e test.png -w 3000 test.svg

inkscape -z -e test.png -w 1024 -h 1024 test.svg



51 Convert image to grayscale - black and white

https://linuxconfig.org/convert-image-to-grayscale-with-imagemagick

convert linuxcareer-color.png -colorspace gray linuxcareer-color-grayscale.png



52 Gnome and Nautilus


52.1 Save your eyes with Nightlight

https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/

Nightlight is my favorite feature in GNOME desktop. Keeping your eyes safe at night from the computer screen is very important. Reducing blue light helps reducing eye strain at night.

GNOME provides a built-in Night Light option, which you can activate in the System Settings.

  • Settings-> Devices-> Displays: and turn on the «Night Light» option.



52.2 Configurar el touchpad

  • Settings > Devices > Mouse & Touchpad
    • Edge scrolling
    • Touchpad speed
    • etc...



52.3 How to Move the Unity Desktop’s Launcher

https://www.howtogeek.com/349697/how-to-move-ubuntu%E2%80%99s-launcher-bar-to-the-bottom-or-right/

Cambiar la posición de la barra en donde se encuentran los programas:

  • Settings > Dock



52.4 Choose or disable the alert sound

Desactivar los sonidos de alerta.

https://help.ubuntu.com/stable/ubuntu-help/sound-alert.html.en

  • Settings > Sound > Sound Effects: Alert Volume - Off



52.5 Cambiar el icono de una carpeta

https://ubuntulife.wordpress.com/2010/02/10/tip-cambiar-el-icono-de-una-carpeta/



52.6 Folder color: cambia el color de todas tus carpetas en Ubuntu

https://hipertextual.com/archivo/2014/04/cambiar-color-carpetas-ubuntu/

Folder Color Folder Color es una aplicación muy sencilla que podemos instalar en Ubuntu para cambiar el color de los iconos de las carpetas en Nautilus.

sudo add-apt-repository ppa:costales/folder-color
sudo apt-get update
sudo apt-get install folder-color



52.7 How can I create launchers for an application

Para crear un icon que permita ejecutar la aplicación:

https://askubuntu.com/questions/64222/how-can-i-create-launchers-on-my-desktop

gnome-desktop-item-edit --create-new ~/Desktop

https://www.linuxquestions.org/questions/linux-desktop-74/adding-a-custom-desktop-icon-to-the-dock-panel-in-ubuntu-18-04-a-4175641299/

  • Para adicionar el ícono (icon) a las aplicaciones (que se liste cuando buscamos las aplicaciones en Activities (Windows Tecla), tenemos que colocar el ícono creado en /home/anapaula/.local/share/applications
  • Si luego queremos colocar el ícono (icon) en el Dock (side bar / favorites) lo único que hay que hacer es listar el ícono en Activities y desde ahí hacer right-click > Add to Favorities



52.8 Extension to hide the top bar

Existe una Gnome extension llamada «hide top bar»



52.9 Extension to hide specific icons in the top bar

Por ejemplo, si se desea ocultar un icono específico en la topbar (the date for example)

https://extensions.gnome.org/extension/351/icon-hider/

La instalación se realiza directamente desde el google chrome browser haciendo clic en «ON» en la parte superior derecha de la página de la extensión indicada arriba. Para que la página del google chrome browser nos de la opción de instalar Gnome extensions, debemos primero instalar el «GNOME Shell integration for Chrome», como se muestra aquí: https://wiki.gnome.org/Projects/GnomeShellIntegrationForChrome/Installation

sudo apt-get install chrome-gnome-shell



Esta extensión tiene un problema. Adiciona un appnotification a la lista de los icon cada vez que se inicia la applicación. Por tanto, luego de un tiempo la lista de icons contiene muchos icons innecesarios. La lista se hace tan larga que no es posible desplegar en la ventana los últimos icons. Para limpiar esta lista podemos seguir las indicaciones de este forum: https://github.com/ikalnytskyi/gnome-shell-extension-icon-hider/issues/29

dconf-editor /org/gnome/shell/extensions/icon-hider/



53 Screensho and Screen recording tools

Aplicación para imprimir pantalla



53.1 Gnome Screenshot

https://doc.ubuntu-fr.org/gnome-screenshot

Gnome Screenshot est déjà installé par défaut sur Ubuntu

Lancer l'interface depuis le tableau de bord d'Unity à l'aide des mots-clés "capture d'écran" ou pour les menus classiques, Applications → Accessoires → Capture d'écran. Ou encore depuis un terminal avec la commande suivante:

gnome-screenshot -i

À l'aide de raccourcis: La convinación de tecla normal no me funciona, la siguiente sí:

[ALT]+[FN]+[IMPR] → Capturer la fenêtre active.

En la página Web se pueden ver las otras convinaciones de tecla disponibles



53.2 Shutter

https://askubuntu.com/questions/3578/tool-to-add-shapes-annotations-and-text-using-templates-to-images

Shutter es un buen programa para imprimir pantallas.

También permite editar imágenes: crear flechas y etiquetas de una forma fácil.



53.3 Screen recording - Screencast

Hacer un video de la pantalla.

https://tipsonubuntu.com/2018/06/09/record-gnome-desktop-ubuntu-18-04/

  • Gnome’s built-in screen recorder: Ctrl+Alt+Shift+R (No me ha funcionado para grabar el sonido, solo el video)



https://askubuntu.com/questions/766440/how-to-install-kazam-1-5-3



54 Latex

sudo apt-get install texlive-full (texlive-full ocupa casi 5G de memoria)


54.1 Kile


54.2 Latex documentation

The Comprehensive LATEX Symbol List: https://ftp.heanet.ie/mirrors/ctan.org/tex/info/symbols/comprehensive/symbols-letter.pdf



55 LibreOffice/OpenOffice


55.1 Instalar corrector ortográfico y gramatical en LibreOffice/OpenOffice

http://blog.desdelinux.net/instalar-corrector-ortografico-y-gramatical-en-libreofficeopenoffice/

sudo apt-get install myspell-es
sudo apt-get install myspell-fr myspell-fr-gut
sudo apt-get install myspell-*



55.2 No mostrar número de página y nombre de la página en Excel LibreOffice

How NOT to print sheet name and page number in OpenOffice.org Calc: https://superuser.com/questions/200056/how-not-to-print-sheet-name-and-page-number-in-openoffice-org-calc

Go to: Format > Page: Header/Footer y desactivar ambos



56 Adobe Reader (Acroread)

https://linuxconfig.org/how-to-install-adobe-acrobat-reader-on-ubuntu-18-04-bionic-beaver-linux

Please note that Adobe no longer supports Acrobat Reader for Linux. The latest native Linux version is 9.5.5 dated from 26/04/2013. From this reason you should refrain using/installing Adobe Acrobat Reader if possible to avoid potential vulnerabilities and hacker exploits.

apt install libxml2:i386 gdebi-core
wget ftp://ftp.adobe.com/pub/adobe/reader/unix/9.x/9.5.5/enu/AdbeRdr9.5.5-1_i386linux_enu.deb
sudo gdebi AdbeRdr9.5.5-1_i386linux_enu.deb
acroread



57 pdftk

https://askubuntu.com/questions/1028522/how-can-i-install-pdftk-in-ubuntu-18-04-bionic

The pdftk package in Ubuntu (and its upstream Debian package) was dropped due to its dependency on the now deprecated GCJ runtime. I found a fork that depends on OpenJDK or similar instead.

Install from PPA:

I built a Deb package (for Bionic only) with suitable dependencies:

sudo add-apt-repository ppa:malteworld/ppa
sudo apt update
sudo apt install pdftk

The package contains a wrapper script placed in /usr/bin, so you can invoke it as normally:

pdftk <arguments> ...



58 Vim

«vi» puede ser muy complicado de utilizar. Vale la pena, por lo tanto, instalar «vim»

sudo apt-get install vim

Guardar y cerrar:

:qw

Cerrar sin guardar los cambios:

:q!

Undo:

u



59 GIMP


59.1 How can I put multiple images side by side to make one image

https://gimper.net/threads/re-how-can-i-put-multiple-pics-side-by-side-to-make-one-picture.1042/

Unir/Conbinar varias imágenes:

  • Open one of the pictures in GIMP
  • Go to File > Open As Layers and select the other two pictures
  • Go to Image > Canvas Size and make the canvas a lot bigger, it doesn't have to be exact, just big enough to fit the three pictures
  • Select the different layers one at a time and move them to where you want:
Crl PgUp / PgDn to change layer.
  • Finally go to Image > Fit Canvas to Layers



60 Scilab

sudo apt-get install scilab



61 Skype

sudo apt-get install skype



62 Instalar emulador de Android en Ubuntu / ejecutar aplicaciones de Android en Ubuntu


62.1 Install Genymotion Android Emulator in Ubuntu 14.04

https://www.youtube.com/watch?v=MHmMDEzsJEY



62.1.1 Instalar VirtualBox

Ver Virtualization#Instalación de VirtualBox



62.1.2 Instalar GenyMotion

bash genymotion-2.2...bin
  • Luego entramos en el directorio genymotion e iniciamos el programa:
./genymotion
  • Agregamos una Virtual device:
    • Connect to Genymotion Cloud y agregar un usuario y su contraseña y creamos la Virtual Divice que querramos seleccionando entre las que se encuentran disponibles.
    • Iniciamos la Virtual device creada: en este punto se presentó un problema. Error: Unable to start the virtual device. The virtual device got no IP adress. En el forum http://askubuntu.com/questions/545687/genymotion-virtual-device-got-no-ip-adress alguien publicó: I'm using Ubuntu 14.04 and I got the same error. I reduced the memory below 50% of the total memory. And now it works.
Para hacer esto, ejecuté VirtualBox desde la terminal (como root) y en Settings > System reduje la Memoria. Luego de hacer este cambio genymotion inició correctamente. Sin embargo, en ocasiones se sigue presentando el mismo error.



62.1.3 Instalar WhatsApp

Iniciamos el navegador Web, descargamos WhatsApp de la página oficial y lo instalamos: https://www.whatsapp.com/android/

Si no se inicia el instalador luego de la descarga, nos vamos al directorio de descarga y lo iniciamos desde allí. Cuando el instalador se inicie aparecerá un mensaje diciendo: For security, your tablet is set to block installations of apps obtained from unknown sources. Debemos entoces permitirlo y esto se hace en Settings. Luego de hacer este ajuste en Setting la instalación debería poder completarse



62.2 Las aplicaciones Android llegan a Chrome vía extensión


63 Linux System and network administration


63.1 How To Configure an IP Address In Ubuntu

Ubuntu 18.04 LTS


  • Temporary IP Address configuration using ifconfig: (this configuration will desapear after a reboot)
https://danielmiessler.com/study/manually-set-ip-linux/
ifconfig eth0 192.168.1.5 netmask 255.255.255.0 up


  • Permanent IP Address configuration:
https://www.ostechnix.com/how-to-configure-ip-address-in-ubuntu-18-04-lts/
https://danielmiessler.com/study/manually-set-ip-linux/


We need to modify this file:
/etc/netplan/


And then to apply the configuration, you run:
netplan apply


You could also restart networking service:
systemctl restart netwroking.service



63.2 Automating tasks using the cronschedular - crontab

On Unix-like operating systems, the crontab command opens the cron table for editing. The cron table is the list of tasks scheduled to run at regular time intervals on the system. The daemon which reads the crontab and executes the commands at the right time is called cron. It is named after Kronos, the Greek god of time.


  • To start crontab:
crontab  -e


  • The schedule component of the syntax is broken down into 5 different fields, which are written in the following order:
  • m = minute 0-59
  • h = hour 0-23
  • dom = Day of the month 1-31
  • mon = month 1-12 or JAN-DEC
  • dow = Day of the week 0-6 or SUN-SAT


  • Together, tasks scheduled in a crontab are structured like this:
m   h   dom   mon   dow   command


  • The command can be virtually any command you would normally run on the command line. This lets us automate tasks to run on a schedule


  • Examples:
  • So, to run a command every Monday at 5:30 in the afternoon:
30 17 * * 1 /path/to/command


  • Or every 15 minutes
*/15 * * * * /path/to/command


  • What if we wanted to have Linux write Hello World! to a text file called hello.txt once at 16:00 on Wednesday 24th March?
0   16   24   3   3   echo "Hello World!" >> hello.txt


  • At the end of every workweek at one minute to midnight (to run every Friday at 23:59)
59   23   *   *   5   echo "Hello World!" >> hello.txt


  • This would echo Hello World into hello.txt every minute and write a calendar into calendar .txt
*   *   *   *   * cal > calendar .txt


  • Write to date.txt every minute
*  *  *  *  * date >> date.txt



63.3 Firewall Configuration


63.3.1 How can I see what ports are open

https://askubuntu.com/questions/9368/how-can-i-see-what-ports-are-open-on-my-machine

sudo apt install nmap
nmap localhost
nmap the_ip_address



63.3.2 UFW - Uncomplicated Firewall

https://wiki.ubuntu.com/UncomplicatedFirewall

https://help.ubuntu.com/community/UFW



63.4 Basic configurations


63.4.1 Set the Hostname

Please follow our instructions for setting your hostname. You can use the following commands to make sure it is set properly:

hostname
hostname -f

The first command should show your short hostname, and the second should show your fully qualified domain name (FQDN). https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server



63.4.2 Set the Time Zone

https://www.linode.com/docs/tools-reference/linux-system-administration-basics#protect-files-on-a-remote-server

When setting the time zone of your server, it may be best to use the time zone of the majority of your users. If you’re not sure which time zone would be best, consider using Universal Coordinated Time or UTC (i.e., Greenwich Mean Time).

By default, Linodes are set to UTC. Many operating systems provide built-in, interactive methods for changing time zones:



63.4.2.1 Set the Time Zone in Debian or Ubuntu

Issue the following command and answer the questions as prompted on the screen:

dpkg-reconfigure tzdata



63.4.2.2 Set the Time Zone in CentOS 7 or Arch Linux

View the list of available time zones:

timedatectl list-timezones

Use the Up, Down, Page Up and Page Down keys to navigate to the correct zone. Remember it, write it down or copy it as a mouse selection. Then press q to exit the list.

Set the time zone (change America/New_York to the correct zone):

timedatectl set-timezone 'America/New_York'



63.4.2.3 Set the Time Zone Manually on a Linux System

Find the appropriate zone file in /usr/share/zoneinfo/ and link that file to /etc/localtime. See the examples below for possibilities:

Universal Coordinated Time:

ln -sf /usr/share/zoneinfo/UTC /etc/localtime

Eastern Standard Time:

ln -sf /usr/share/zoneinfo/EST /etc/localtime

American Central Time (including Daylight Savings Time):

ln -sf /usr/share/zoneinfo/US/Central /etc/localtime

American Eastern Time (including Daylight Savings Time):

ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime



63.5 System Diagnostics


63.5.1 Check Current Memory Usage


63.5.2 Monitor I/O Usage with vmstat


63.5.3 Monitor Processes, Memory, and CPU Usage with htop


63.6 Restart the WiFi-Wireless Network Adapter

service network-manager stop
service network-manager start
service network-manager restart



63.7 Connect to a particular WiFi Network

https://askubuntu.com/questions/833905/how-can-i-connect-to-a-specific-bssid

The command nmcli allows to display the WiFi networks with all their details

nmcli c
nmcli d wifi
nmcli -f in-use,ssid,bssid,chan,rate,mode,signal,bars   dev wifi

To connect to a particular network we can spedify the SSID:

nmcli d wifi connect «the_SSID» password «the_password»

Now, if we want to connect to a particular Access Point, we must specify the Access Point ID (bssid) istead:

nmcli d wifi connect «the_BSSID» password «the_password»

When I tried to run this command as root I got an error, so we have to do it as a standard user.

If we don't find the network or Access Point we are looking for, a good idea is to restart the WiFi-wireless Network Adapter:

service network-manager stop
service network-manager start
service network-manager restart

Then, with «nmcli» we can check if we can see the Network or Access Point we are looking for.


The problem that I got in CCT for a long time that avoid me to successfully connect to the CCT network was that CCT has many access points that use different channels. For some reason, my network adaptor wasn't working well in some chanels (I was able to connect to these chanels but the internet connection was too sllow, sometime it doesn't work at all). Actually, I just was able to sucessfully connect using chanel 11. So when I choose an Access Point that was using chanell 11, I was able to get a fast internet connection.



63.8 Request - Renew the IP address from DHCP

Release the current lease and stop the running DHCP client:

dhclient -r


Request a new IP address:

dhclient



63.9 Network Diagnostics

https://www.linode.com/docs/tools-reference/linux-system-administration-basics#network-diagnostics



63.9.1 The ping Command

The ping command tests the connection between the local machine and a remote address or machine. The following commands "ping" google.com and 216.58.217.110:

ping google.com
ping 216.58.217.110

These commands send a small amount of data (an ICMP packet) to the remote host and wait for a response. If the system is able to make a connection, it will report on the “round trip time” for every packet. Here is the sample output of four pings to google.com:

PING google.com (216.58.217.110): 56 data bytes
64 bytes from 216.58.217.110: icmp_seq=0 ttl=54 time=14.852 ms
64 bytes from 216.58.217.110: icmp_seq=1 ttl=54 time=16.574 ms
64 bytes from 216.58.217.110: icmp_seq=2 ttl=54 time=16.558 ms

The time field specifies in milliseconds the duration of the round trip for an individual packet.

You’ll be presented with some statistics once the process is stopped. This will resemble:

--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3007ms 
rtt min/avg/max/mdev = 33.890/40.175/53.280/7.679 ms

There are several important data points to notice:

   Packet Loss, or the discrepancy between the number of packets sent and the number of packets that return successfully. This number shows the percentage of packets that are dropped.
   Round Trip Time (rtt) statistics on the final line report information about all the ping responses. For this ping we see that the fastest packet round trip (min) took 33.89 milliseconds. The average round trip (avg) took 40.175 milliseconds. The longest packet (max) took 53.28 milliseconds. A single standard deviation unit (mdev) for these four packets is 7.67 milliseconds.

The ping command is useful as an informal diagnostic tool to measure point-to-point network latency, and as a tool to simply ensure you are able to make a connection to a remote server.



63.9.2 The traceroute Command

The traceroute command expands on the functionality of the ping command. It provides a report on the path that the packets take to get from the local machine to the remote machine. Each step (intermediate server) in the path is called a hop. Route information is useful when troubleshooting a networking issue: if there is packet loss in one of the first few hops the problem is often related to the user’s local area network (LAN) or Internet service provider (ISP). By contrast, if there is packet loss near the end of the route, the problem may be caused by an issue with the server’s connection.

Here is an example of output from a traceroute command:

$ traceroute 216.58.217.110
traceroute to 216.58.217.110 (216.58.217.110), 30 hops max, 60 byte packets
1  192.168.10.5 (192.168.10.5)  1.355 ms  1.936 ms  3.195 ms
2  192.168.1.1 (192.168.1.1)  3.858 ms  10.273 ms  13.211 ms
3  * * *
4  109.255.255.254 (109.255.255.254)  18.469 ms  20.636 ms  22.270 ms
5  ie-dub01a-ra4-ae31-0.aorta.net (84.116.238.42)  22.525 ms  22.865 ms  22.922 ms
6  ie-dub01a-ri1-ae52-0.aorta.net (84.116.130.117)  22.550 ms  6.635 ms  15.125 ms
7  213.46.165.18 (213.46.165.18)  15.287 ms  16.058 ms  19.209 ms
8  209.85.252.198 (209.85.252.198)  19.466 ms  19.886 ms 209.85.252.196 (209.85.252.196)  18.892 ms
9  209.85.255.221 (209.85.255.221)  28.838 ms  29.073 ms  31.281 ms

10 209.85.254.245 (209.85.254.245) 126.529 ms 209.85.254.251 (209.85.254.251) 109.405 ms 109.747 ms 11 209.85.143.211 (209.85.143.211) 94.186 ms 72.14.236.99 (72.14.236.99) 96.027 ms 96.982 ms 12 209.85.143.255 (209.85.143.255) 94.640 ms 95.372 ms 98.093 ms 13 iad23s42-in-f14.1e100.net (216.58.217.110) 97.375 ms 94.635 ms 94.856 ms

Often the hostnames and IP addresses on either side of a failed jump are useful in determining who operates the machine where the routing error occurs. Failed jumps are designated by lines with three asterisks (* * *).

Adding traceroute output to Linode support tickets is sometimes useful when trying to diagnose network issues. You may also want to forward traceroute information to your Internet Service Provider (ISP) if you suspect that the connectivity issue is with your ISP’s network. Recording traceroute information is particularly useful if you are experiencing an intermittent issue.



63.9.3 The mtr Command

The mtr command, like the traceroute tool, provides information about the route that internet traffic takes between the local system and a remote host. However, mtr provides additional information about the round trip time for the packet. In a way, you can think of mtr as a combination of traceroute and ping.

Here is an example of output from an mtr command:

$ mtr -r 216.58.217.110
Start: Tue Nov 15 03:27:45 2016
HOST: adelo-laptop                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1.|-- 192.168.10.5               0.0%    10    1.0   1.3   0.9   2.8   0.3
 2.|-- 192.168.1.1               10.0%    10    1.5   1.7   1.0   3.5   0.6
 3.|-- 10.253.152.1               0.0%    10   10.1   8.9   7.3  10.7   1.2
 4.|-- 109.255.255.254           10.0%    10    8.6   7.7   5.7   9.8   1.1
 5.|-- ie-dub01a-ra4-ae31-0.aort 30.0%    10    8.4   9.2   7.6  11.0   1.2
 6.|-- de-fra01a-ri2-xe-4-1-0.ao 30.0%    10   12.5   8.9   6.6  12.5   2.4
 7.|-- 213.46.165.18              0.0%    10    7.5  11.8   6.5  41.0  10.3
 8.|-- 209.85.252.198            20.0%    10   11.0   8.6   6.2  11.0   1.8
 9.|-- 209.85.248.57              0.0%    10   17.0  20.8  16.9  26.6   3.8
10.|-- 209.85.254.245            10.0%    10  105.5  96.8  93.0 105.5   4.6
11.|-- 72.14.236.99              10.0%    10   91.8  97.6  91.8 106.9   5.2
12.|-- 209.85.143.255            30.0%    10   93.1  94.2  93.1  96.1   0.8
13.|-- iad23s42-in-f14.1e100.net 30.0%    10   94.9  93.7  92.7  95.2   0.7

Like the ping command, mtr tracks the speed of the connection in real time until you exit the program with CONTROL+C. To have mtr stop automatically and generate a report after ten packets, use the --report flag:

mtr --report

Be aware that mtr will pause for a few moments while generating output. For more information regarding mtr consider our diagnosing network issues with mtr guide.



63.10 Network File System (NFS)

http://www.learnlinux.org.za/courses/build/net-admin/net-admin-all.html#nfs



64 Shell Scripting