|
|
| Line 1: |
Line 1: |
| − | [[Media:Linux Configuration and Automation.pdf]]
| + | ~ Migrated |
| − | | |
| − | | |
| − | <br />
| |
| − | ==Instalación==
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===Creating a bootable USB flash drive===
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====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 [[Linux#Formatear una unidad Flash USB|formatear]] el dispositivo en Fat32 (vFat).
| |
| − | * Debemos desmontar el dispositivos antes de ejecutar el comando dd:
| |
| − | | |
| − | <blockquote>
| |
| − | umount /dev/sdb*
| |
| − | </blockquote>
| |
| − | | |
| − | * Creación del bootable USB flash a través de dd:
| |
| − | | |
| − | <blockquote>
| |
| − | <syntaxhighlight lang="bash">
| |
| − | dd if=CentOS-6.5-x86_64-bin-DVD1.iso of=/dev/sdb
| |
| − | </syntaxhighlight>
| |
| − | </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.
| |
| − | | |
| − | 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
| |
| − | | |
| − |
| |
| − | <br />
| |
| − | ====How can I create a Windows bootable USB stick with Ubuntu:====
| |
| − | https://www.cyberciti.biz/faq/create-a-bootable-windows-10-usb-in-linux/
| |
| − | | |
| − | | |
| − | <br />
| |
| − | =====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.
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ======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
| |
| − | | |
| − |
| |
| − | <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
| |
| − | | |
| − | 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.
| |
| − | | |
| − | | |
| − | <br />
| |
| − | =====A través de dd=====
| |
| − | Lo intenté hacer desde la línea de comando a través del comando ''dd'' y no resultó.
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====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.
| |
| − | | |
| − | [[File:Ubuntu_third_party_sortwares.png|800px|thumb|center|]]
| |
| − | | |
| − | * 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.
| |
| − | | |
| − | [[File:Formatear_la_particion_durante_instalacion.jpg|700px|thumb|center|]]
| |
| − | | |
| − | [[File:seleccion_de_la_particion_swap_en_Ubuntu1.jpg|700px|thumb|center|]]
| |
| − | | |
| − | [[File:seleccion_de_la_particion_swap_en_Ubuntu2.jpg|700px|thumb|center|]]
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====Creating and selecting the partition where the SO will be installed====
| |
| − | | |
| − | <span style="color:#5fe8e6">Notes about the last installation:</span>
| |
| − | | |
| − | <span style="color:#5fe8e6">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:#5fe8e6">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.
| |
| − | | |
| − | | |
| − | '''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 [[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.
| |
| − | | |
| − | | |
| − | 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]]
| |
| − | | |
| − | <span style="color:#5fe8e6">'''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>
| |
| − | | |
| − | 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 -- [[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]].
| |
| − | | |
| − | '''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 :''' [[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
| |
| − | | |
| − | '''/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
| |
| − | https://doc.ubuntu-fr.org/tutoriel/partitionner_manuellement_avec_installateur_ubuntu
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ====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=====
| |
| − | 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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | =====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
| |
| − | | |
| − |
| |
| − | <br />
| |
| − | =====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).
| |
| − | | |
| − | | |
| − | <br />
| |
| − | =====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.
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | 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/
| |
| − | | |
| − | | |
| − | <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.
| |
| − | | |
| − | 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.
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====Ahora, ¿Es apropiado tener todos los datos que usaré en Linux en una partición NTFS?====
| |
| − | | |
| − | | |
| − | <br />
| |
| − | =====[[Linux#chmod y chown en particiones ntfs|Chmod and chown en particiones ntfs]]=====
| |
| − | | |
| − | | |
| − | <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/
| |
| − | | |
| − | 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/
| |
| − | | |
| − | | |
| − | <span style="color:#5fe8e6">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>
| |
| − | | |
| − | | |
| − | <br />
| |
| − | =====Can't be put in the trash. Do you want to delete it immediately?=====
| |
| − | <span style="color:#5fe8e6">Este problema se solucionó sólo. Me imagino que luego de alguna actualización del sistema.</span>
| |
| − | | |
| − | 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
| |
| − | | |
| − | | |
| − | <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.
| |
| − | | |
| − | 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]].
| |
| − | | |
| − | * 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.
| |
| − | | |
| − | | |
| − | [[File:Mis_particiones.png|900px|thumb|center|]]
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ==Mis configuraciones==
| |
| − | | |
| − | | |
| − | <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.
| |
| − | | |
| − | https://askubuntu.com/questions/79150/how-to-remove-bookmarks-from-the-nautilus-sidebar
| |
| − | | |
| − | /home/adelo/.config/user-dirs.dirs
| |
| − | | |
| − | * 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.
| |
| − | #
| |
| − | | |
| − | | |
| − | # 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/"
| |
| − | </syntaxhighlight>
| |
| − | </blockquote>
| |
| − | | |
| − | | |
| − | * 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'''
| |
| − | <blockquote>
| |
| − | <syntaxhighlight lang="bash">
| |
| − | chmod -w ~/.config/user-dirs.dirs
| |
| − | gedit /etc/xdg/user-dirs.conf : '''enabled=false'''
| |
| − | </syntaxhighlight>
| |
| − | </blockquote>
| |
| − | | |
| − | | |
| − | * 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:
| |
| − | <blockquote>
| |
| − | <syntaxhighlight lang="bash">
| |
| − | ln -s /home/adelo/asystem/archivo/desk /home/adelo/desktop
| |
| − | </syntaxhighlight>
| |
| − | </blockquote>
| |
| − | | |
| − | | |
| − | * 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>
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ===Custom Shortcuts===
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====Shortcut to launch the gnome-terminal in a custom position====
| |
| − | | |
| − | /home/adelo/1-system/.1-conf-system/open_terminal_at_position.sh
| |
| − | <syntaxhighlight lang="bash">
| |
| − | #!/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
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | 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
| |
| − | <syntaxhighlight lang="bash">
| |
| − | #!/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
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | Luego adicionamos el Script al «keyboardsettings» an entry:
| |
| − | | |
| − | [[File:Adding_custom_shortcut.png|800px|thumb|center|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
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | /home/adelo/1-system/.1-conf-system/hide_dock.sh
| |
| − | <syntaxhighlight lang="bash">
| |
| − | #!/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
| |
| − | </syntaxhighlight>
| |
| − | | |
| − |
| |
| − | <br />
| |
| − | ===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
| |
| − | | |
| − | # Disco_externo - TOSHIBA EXT:
| |
| − | UUID=3C9A5D379A5CEF40 /home/adelo/asystem/.mount/disco_ext ntfs auto,nofail,users,permissions 0 0
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | '''Para saber el UUID de la partición:'''
| |
| − | sudo blkid
| |
| − | | |
| − | Ver [[Linux#Para discos externos]]
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ===.bashrc (home)===
| |
| − | /home/adelo/.bashrc
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | #===========================
| |
| − | # 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'
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | 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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ===.bashrc (root)===
| |
| − | /root/.bashrc
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | #===========================
| |
| − | # 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"
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | | |
| − | /etc/bash.bashrc
| |
| − | <syntaxhighlight lang="bash">
| |
| − | #===========================
| |
| − | # 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'
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===.profile===
| |
| − | /home/adelo/.profile
| |
| − | | |
| − | <syntaxhighlight lang="bash">
| |
| − | #===========================
| |
| − | # 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
| |
| − | </syntaxhighlight>
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===.megaignore===
| |
| − | sudo chown adelo:adelo .megaignore
| |
| − | sudo chmod 600 .megaignore
| |
| − | sudo chattr +i .megaignore (immutable)
| |
| − | | |
| − | | |
| − | .megaignore
| |
| − | <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>
| |
| − | | |
| − | | |
| − | .megaignore (linux work-laptop)
| |
| − | <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>
| |
| − | | |
| − | | |
| − | .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>
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ==Things to do after installing Ubuntu 18.04==
| |
| − | https://itsfoss.com/things-to-do-after-installing-ubuntu-18-04/
| |
| − | | |
| − | * [[Linux#Update the system|Update]]
| |
| − | * [[Linux#Enable additional repositories for more software|Enable additional repositories]]
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ==APT==
| |
| − | ...
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ==Listar características del hardware y del SO==
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===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
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | | |
| − | 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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ===Desplegar el SO instalado - detallando la version===
| |
| − | lsb_release -a
| |
| − | | |
| − | http://askubuntu.com/questions/55609/how-do-i-check-system-specifications
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===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
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===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.
| |
| − | | |
| − | | |
| − | <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
| |
| − | | |
| − | | |
| − | 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.
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ===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.
| |
| − | | |
| − | | |
| − | <br />
| |
| − | ====Create an SSH key pair====
| |
| − | The first step is to create the key pair on the client machine:
| |
| − | | |
| − | | |
| − | This seems to be the best option:
| |
| − | ssh-keygen -t ed25519
| |
| − | ssh-keygen -t ed25519 -C "cybots" -f ~/.ssh/cybots_ssh
| |
| − | : -t ed25519 generates an Ed25519 key pair, which uses a modern elliptic curve algorithm. Ed25519 provides strong security with relatively small key sizes and good performance.
| |
| − | : -C adds a comment to the key that helps you identify it later. An email address is commonly used to identify the key, but you can use any descriptive word or phrase that helps you recognize the key. If you omit the -C option, the key will by default be associated with your machine's hostname, which is often sufficient for identification.
| |
| − | : -f specifies the filename where the key will be saved. If you don’t use this option, the key will be saved with the default name id_ed25519.
| |
| − | | |
| − | | |
| − | 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/cybots_ssh):
| |
| − | 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/cybots_ssh
| |
| − | /home/demo/.ssh/cybots_ssh.pub
| |
| − | | |
| − | | |
| − | Start ssh-agent in the background:
| |
| − | eval "$(ssh-agent -s)"
| |
| − | | |
| − | | |
| − | Add your private SSH key to the SSH authentication agent (ssh-agent). If your SSH key has no passphrase, you might get away without adding it to the agent because SSH can use the key file directly. But if your SSH key is protected by a passphrase (which is recommended for security), then without adding it to the agent, you'll be asked to enter the passphrase every time you connect.
| |
| − | ssh-add ~/.ssh/cybots_ssh
| |
| − | '''When deleting''' an SSH key file, It's also a good idea to remove it from the agent before deleting the file, especially if the agent is still running. To remove it:
| |
| − | ssh-add -d ~/.ssh/your_key_name
| |
| − | | |
| − | | |
| − | <br />
| |
| − | | |
| − | ====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.
| |
| − | | |
| − | | |
| − | <span style="color:#5fe8e6">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:#5fe8e6">Éste es el caso de VM Instance creadas en la Google Cloud Platform.</span> <span style="color:#5fe8e6">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:#5fe8e6">*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 />
| |
| − | ==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 />
| |
| − | ==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 />
| |
| − | ==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 />
| |
| − | ==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 />
| |
| − | ==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 />
| |
| − | ==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 />
| |
| − | ==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.
| |
| − | | |
| − | '''Extract a page from a pdf document'''
| |
| − | | |
| − | pdftk input.pdf cat 3 output page3.pdf
| |