Showing posts with label Linux. Show all posts
Showing posts with label Linux. Show all posts

Friday, September 8, 2023

Arch Linux 2023.09 Brazilian language - Install UEFI or Not

Install Arch Linux 2023.09 x86_64 UEFI (or Not) for Brazilian language.

#loadkeys br-abnt2

#pacman -Syy


Set time:

#timedatectl set-ntp true

If you want to use UEFI, create a disk:

  # fdisk /dev/sda

    Create a GPT partition (option g)

    Create new partitions (option n) with the following specifications:

sda1 - 300MB - Type EFI File System (option 1)
sda2 - 16GB - Type SWAP (option 19)
sda3 - the rest of the disk space - Type Linux Filesystem (root partition) (option 20)

    Finish with (option w)

  # mkfs.fat -F32 /dev/sda1

If you don't want to use UEFI, create a disk:

 # cfdisk /dev/sda

sda1 - 16GB - Type SWAP
sda2 - the rest of the disk space - Type EXT4 (root partition)

  Set sda2 bootable

  save

Regardless of your choice, execute:


# mkswap /dev/<partition of swap>
# swapon /dev/
<partition of swap>

# mkfs.ext4 /dev/<root partition>

# mount /dev/<root partition> /mnt

# pacman-key --init

# pacman-key --populate

 

edit /etc/pacman.conf and uncomment ParallelDownloads = 5

# nano /etc/pacman.conf 

 

ParallelDownloads = 5

 

and Save

# pacstrap -K /mnt linux linux-firmware base base-devel nano

# genfstab -U -p /mnt >> /mnt/etc/fstab

# arch-chroot /mnt

# nano /etc/locale.gen


uncomment a line that you need. ie. pt_BR.UTF-8 UTF-8 and en_US.UTF-8 UTF-8

save

# locale-gen

# ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime

 

# echo LANG=pt_BR.UTF-8 > /etc/locale.conf

# echo KEYMAP=br-abnt2 > /etc/vconsole.conf

# echo FONT=lat1-16 >> /etc/vconsole.conf

# echo FONT_MAP=8859-1 >> /etc/vconsole.conf

# hwclock --systohc

# echo ArchLinux >> /etc/hostname


#passwd

 
# nano /etc/hosts

127.0.0.1  localhost
127.0.1.1  ArchLinux
::1        localhost

save

#pacman -S dhcpcd

#systemctl enable dhcpcd

# mkinitcpio -P
 

If appear WARNING, after finish this tutorial, you need to install firmware modules. Search in AUR.

Microcode Install:
For AMD processors, install the amd-ucode package.
#pacman -S amd-ucode

For Intel processors, install the intel-ucode package.

#pacman -S intel-ucode

#pacman -S grub dosfstools os-prober mtools ntfs-3g freetype2

#nano /etc/default/grub

insert or uncomment

GRUB_DISABLE_OS_PROBER=false

save
 
(in UEFI case)
   #pacman -S efibootmgr

   #mkdir /boot/EFI
 
       #mount /dev/sda1 /boot/EFI #Mount FAT32 EFI partition
 
   #grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck /dev/sda

(NOT in UEFI case)
    #grub-install /dev/sda
 
Regardless of your choice, execute:
 
#grub-mkconfig -o /boot/grub/grub.cfg

#exit

#umount -R /mnt
#reboot


# pacman -S bash-completion openssh rsync exfat-utils mc p7zip zip unrar unarj net-tools

# nano /etc/sudoers

uncomment this line # %wheel ALL=(ALL) ALL

save


User

# useradd -mg users -G wheel -s /bin/bash thiago
# passwd thiago

Install Grafical User Interface - GUI (KDE)

$ sudo pacman -Syu

$ sudo pacman -S xorg

$ sudo pacman -S plasma-meta

$ sudo pacman -S kde-applications-meta

$ sudo systemctl enable sddm

$ sudo systemctl enable NetworkManager

 
Others

$ sudo pacman -S vlc hunspell hunspell-en_GB gimp libreoffice chromium firefox dialog nmap git

For Bluetooth:

# pacman -S blueman
# pacman -S bluez
# pacman -S bluez-hid2hci
# systemctl enable bluetooth.service
# systemctl start bluetooth.service

Tips:
Some programs need to resolve DNS with a limited time and show a timeout error. To resolve this, activate the local DNS resolver.

systemctl enable systemd-resolved.service

Wednesday, February 8, 2023

Merge PDF files in a directory to one PDF file

This script merge files with spaces in the name and sorts them by name.

Enter in a directory with PDFs and execute:

 

ls -v *.pdf | bash -c 'IFS=$'"'"'\n'"'"' read -d "" -ra x;pdfunite "${x[@]}" output.pdf'
 

Source: Stackoverflow

Sunday, February 5, 2023

Joining any files in PostScript or PDF

gs -q -dNOPAUSE -dBATCH -sDEVICE=pswrite -sOutputFile=bla.ps -f foo1.ps foo2.ps

gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=bla.pdf -f foo1.pdf foo2.pdf

or

pdfunite foo1.pdf foo2.pdf result.pdf
 

or

all files (pdf) in directory:

 
ls -v *.pdf | bash -c 'IFS=$'"'"'\n'"'"' read -d "" -ra x;pdfunite "${x[@]}" output.pdf'
 

Thursday, February 2, 2023

ISO 2 USB using dd with progress

 
dd bs=4M if=/path/to/linux.iso of=/dev/sdx oflag=sync status=progress

Monday, August 16, 2021

Proxy to Command-line

These proxy server settings are used by the almost all Linux command-line utilities: ftp, wget, curl, ssh, apt, pacman, yum and others.

 

Edit the file /etc/profile and add this lines:


# vi /etc/profile

http_proxy="http://myproxy.com:port"
HTTP_PROXY="http://myproxy.com:port"
https_proxy="http://myproxy.com:port"
HTTPS_PROXY="http://myproxy.com:port"
ftp_proxy="http://myproxy.com:port"
FTP_PROXY="http://myproxy.com:port"


Save.


Edit the file /etc/environment and add this lines:

# vi /etc/enviroment

http_proxy="http://myproxy.com:port"
HTTP_PROXY="http://myproxy.com:port"
https_proxy="http://myproxy.com:port"
HTTPS_PROXY="http://myproxy.com:port"
ftp_proxy="http://myproxy.com:port"
FTP_PROXY="http://myproxy.com:port"


Save.

Restart the system.

Wednesday, November 22, 2017

Fix EXT4-fs error loading journal

If occurs an  EXT4 filesystem error to loading journal, use the e2fsck to solve an inodes problems.

e2fsck is used to check the ext2/ext3/ext4 family of file systems. For ext3 and ext4 filesystems that use a journal, if the system has been shut down uncleanly without any errors, normally, after replaying the committed transactions in the journal, the file system should be marked as clean. Hence, for filesystems that use journalling, e2fsck will normally replay the journal and exit, unless its superblock indicates that further checking is required.

change X for the number os partition (i.e. /dev/sda2)

# e2fsck -C0 -p -f -v /dev/sdaX

used options:

-C fd


This option causes e2fsck to write completion information to the specified file descriptor so that the progress of the filesystem check can be monitored. This option is typically used by programs which are running e2fsck. If the file descriptor number is negative, then absolute value of the file descriptor will be used, and the progress information will be suppressed initially. It can later be enabled by sending the e2fsck process a SIGUSR1 signal. If the file descriptor specified is 0, e2fsck will print a completion bar as it goes about its business. This requires that e2fsck is running on a video console or terminal.

-p


Automatically repair ("preen") the file system. This option will cause e2fsck to automatically fix any filesystem problems that can be safely fixed without human intervention. If e2fsck discovers a problem which may require the system administrator to take additional corrective action, e2fsck will print a description of the problem and then exit with the value 4 logically or'ed into the exit code. (See the EXIT CODE section.) This option is normally used by the system's boot scripts. It may not be specified at the same time as the -n or -y options.

-f


Force checking even if the file system seems clean.

-v


Verbose mode.

Font: e2fsck(8) - Linux man page

Friday, August 25, 2017

Proxy Exceptions - Ubuntu 17.04

How to add proxy exceptions on Ubuntu desktop
$ gsettings set org.gnome.system.proxy ignore-hosts "['localhost', '127.0.0.0/8', '192.168.1.0/24', 'xmodulo.com', '::1']"

Font: XModulo

Monday, July 4, 2016

Criando Sudoers

Para criar um usuário que acesse privilégios avançados através do sudo faça:

# nano /etc/sudoers


Descomente a linha:

# %wheel ALL=(ALL) ALL

execute, trocando pelo seu usuário:

# gpasswd -a wheel

Feito!
Fonte: Slackware Linux

TeamViewer no Slackware64 14.X

Para instalar o TeamViewer no Slackware64 é preciso antes, instalar o compat32 (vide tutorial), pois precisa rodar o wine em 32 bits.

Depois de instalado, faça:

Baixe: http://slackbuilds.org/slackbuilds/14.1/network/teamviewer.tar.gz
ou
Baixe: http://slackbuilds.org/slackbuilds/14.2/network/teamviewer.tar.gz


# tar -xzvf teamviewer.tar.gz

# cd teamviewer

Baixe: http://download.teamviewer.com/download/teamviewer_i386.deb


# ./teamviewer.SlackBuild

# installpkg /tmp/teamviewer--i486-1_SBo.tgz

# chmod +x /etc/rc.d/rc.teamviewerd

Após a instalação, para iniciar o TeamViewer ao iniciar o Slackware edite o arquivo rc.local e no final dele coloque o if...

# vi /etc/rc.d/rc.local:

if [ -x /etc/rc.d/rc.teamviewerd ]; then
   /etc/rc.d/rc.teamviewerd start
fi

Reinicie.

Wednesday, June 1, 2016

Texlive - Erro pacote Babel

Package babel Error: Unknown option `brazil'. Either you misspelled it.

\usepackage[brazil]{babel}

apt-get install texlive-lang-portuguese

Wednesday, April 8, 2015

Okular com Google Translator

Selecione a palavra a ser traduzida;

Configure Web Shortcuts...



http://translate.google.com/?q=\{@}

Monday, April 6, 2015

Matlab MEX Linux

Problemas com Matlab para rodar o mexa (Matlab no Linux)...

failed to map segment from shared object: Operation not permitted

Se estiver trabalhando em uma partição Windows (NTFS, EXFAT,etc) é preciso inserir o exec na montagem do /etc/fstab

UUID=F4B664646C02A51D /mnt/c ntfs users,defaults,exec 0 0

Fonte: Short IT recipes

Thursday, April 2, 2015

Redução de Tamanho de Imagens via Prompt

Reduzir o tamanho de imagens em 40%.

mkdir resized

for image in *.jpg; do convert $image -resize 40% -quality 80 resized/$image; done

Fonte: a little place of calm

Wednesday, February 4, 2015

Montagem Pasta Compartilhada do VirtualBox

Para montar a pasta compartilhada no Linux (Guest) faça:

Criar diretório para montagem:

sudo mkdir /media/vboxshared

Montagem:

sudo mount -t vboxsf /media/vboxshared


Para automatizar acrescente no fstab:

sudo nano /etc/fstab

/media/vboxshared vboxsf noauto,rw,users 0 0


Linha de comando:

usermod -aG vboxsf


Referência: How-To-Geek

Tuesday, April 22, 2014

Remover mensagem do Teamviewer 9

Para remover a mensagem "Teamviewer is still runinng..." faça:

desligue o teamviewer;

nano ~/.config/teamviewer9/config/client.conf

coloque no final:

[int32] ShowTaskbarInfoOnMinimize = 0

Salve e inicie o teamviewer!




Friday, March 7, 2014

Instalar Pacotes no TexLive - tlmgr

Para instalar pacotes no TexLive faça:

tlmgr install nomedopacote

para listar os pacotes que precisam ser atualizados:

tlmgr update --list

para atualizar os pacotes:

tlmgr update --all

Caso ocorra o erro: "cannot setup TLPDB in..." faça:

tlmgr init-usertree

Testado no Slackware64 14.1 e Ubuntu 14.04.2 LTS

Referência: TUG

Tuesday, April 23, 2013

Criando initrd no Slackware

Como root faça:

cd /boot

mkinitrd -k 3.2.45 -m ext4

No caso do Slackware64 14.0 é o kernel 3.2.45

lilo

Um bom esquema de partição

Um bom esquema de partição para utilização de SSD e HDD.

32 GB SSD (/dev/sdb) e 500 GB HDD (/dev/sda):

Partition Size Type Mount Point

/dev/sda1 2G   swap 
/dev/sda3 200G ext4 /home 
/dev/sda5 50G  ext4 /var 
/dev/sda6 50G  ext4 /usr 

(Sobrou 248 GB livres em /dev/sda)


/dev/sdb1 512M  ext4 /boot

/dev/sdb2 30.5G ext4 /


Feito para um Dell Inspiron 14z 5423

Fonte: $cat /dev/blog

Monday, April 22, 2013

Removendo GPT via linux

Para remover o GPT, acesse um prompt de comandos de um GNU/Linux.

Como root digite:

parted /dev/dispositivo

dispositivo pode ser sda ou sdb, etc... o disco que está com raid.

dentro do parted, digite

mktable

Ao ser questionado sobre: "New disk label type?" digite

msdos

Os dados serão destruídos. Continuar? 

yes

quit

GPT removido.

Este tutorial foi feito para um Ultrabook Dell Inspiron 14z 5423.

Fonte: Digital52