segunda-feira, 11 de outubro de 2021

Adaptador WIFI USB wn723n não funcionando corretamente no linux

Ao utilizar o adaptador de wifi usb da tp link wn723n no meu zorin os 15 e 16, baseados no ubuntu 18.04 e 20.04, notei que a conexão era instável e lenta. Assim como no Windows 7, o ubuntu instala um driver da versão americana automaticamente (v1 e v2) ao invés da versão brasileira/europeia (v3). 


 Para resolver este problema, instale o git caso não o tenha, e no terminal, clone o diretório de clnhub deste endereço com o comando: 

git clone https://github.com/clnhub/rtl8192eu-linux  

e entre no diretório com:

cd rtl8192eu-linux   

 Execute o instalador com:

sudo ./install_wifi.sh

 Reinicie o sistema e verifique em se o driver instalado é a versão r8188 com o comando: 

sudo lshw -c network  

 Caso não seja, remova a versão reportada com o comando:

sudo modprobe -r -v r8169 

 



onde r8169 é a versão que aparece no comando. 

 Atualize o cache com:

 sudo update-initramfs -u 

 e reinicie o computador.

 

 

    Por fim, o driver reportado deve ser o da imagem, e o seu adaptador wifi usb deve estar funcionando corretamente. 

   

 Os arquivos utilizados aqui podem ser baixados aqui, assim como estavam em outubro de 2021 e uma outra versão do tutorial em inglês de onde este foi baseado pode ser encontrada aqui.

quinta-feira, 30 de setembro de 2021

Install Epson Printer Driver on Linux

After trying to print multiple copies of a page using linux on my epson l575 printer, i noticed that only the first page was printed, and sometimes with a white page on the beggining. Eventough Linux-based distros usually installs a network printer automatically, there are some options that are not available on the auto-installed driver. To manually install the driver, you can look into the epson support page for the driver files. 

Look for your printer

Download the version for your system


After downloading the .tar.gz driver files, you can look in the ppd folder for your printer ppd file, extracting it with your compacted files manager, copy it to somewhere. 

Example: Extract the file “epson-inkjet-printer-escpr-1.7.17-1lsb3.2.tar.gz” and look for "ppd > Epson-L575_Series-epson-escpr-en.ppd” file for the L575 printer.



You can as well download my files created in sep/21 for amd64 system here. 

Add the printer if your system haven't done automatically, and in the printer details settings choose the ppd file that you extracted previously.


You can use this in any linux based system. 





segunda-feira, 21 de junho de 2021

Open your applications menu from the dock on linux

After installing Ubuntu Mate and customizing it with some themes, icons and a dock (Plank), i realized that i couldn't access the applications menu (Brisk) neither find a easy tutorial for doing it, so these are the steeps i did for getting it. First you'll need "xdotool", you can install it in Ubuntu based distros on terminal with:

sudo apt install xdotool

Create your .desktop entry in /usr/share/applications. With nano you can run the command below to create the file on the correct place:

sudo nano /usr/share/applications/menu.desktop

Edit the below entry parts that suits your computer configuration, like the menu, the key command and the icon and paste in the nano terminal you opened before.

[Desktop Entry]
Encoding=UTF-8
Name=menu
Comment=menu
X-GNOME-FullName=Brisk Menu
Exec=xdotool key super      
Terminal=false
X-MultipleArgs=false
Type=Application
Icon=/usr/share/icons/Numix-Circle/48/apps/atomic_menu.svg
Categories=Menu;
MimeType=
StartupNotify=true

Use Ctrl + O to save and Ctrl + X to exit.


 

Create your plank dock entry in ~/.config/plank/dock1/launchers/, you can use nano and run:

nano ~/.config/plank/dock1/launchers/menu.dockitem

and copy/paste the entry:

[PlankItemsDockItemPreferences]
Launcher=file:///usr/share/applications/menu.desktop


If you're usint tint2 you can add with: 

launcher_item_app = /usr/share/applications/menu.desktop

Font: https://forums.bunsenlabs.org/viewtopic.php?id=247

quinta-feira, 15 de abril de 2021

Install latest version of java on linux (JDK and JRE) easily

After looking for the latest version of java to install on my linux system (Java 17 when i'm writting this), i found a really interesting tool to install any version of java available for linux with no harassment, that is SDKMan installer.

 First download and install SKDMan with the commands on terminal:

curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh" 

 You can check your installation with:

sdk version

You can see more options in SDKMan site, but in this tutorial we'll install java openjdk. Run the next command to see the availlable versions.

sdk list java

 You should see something like:









Use sdk install java x.y.z-open with your choosen version. In my case: 

sdk install java 17.ea.17-open
That's it, your PATH directory is already set and you can use your java command already.

domingo, 13 de dezembro de 2020

Renaming invalid variables on Stata

After exporting an R database to Stata, the variables were like below, with "." in their names. 


Trying to rename them, resulted on the error: 
You used . in oldname, not newname. . is used in newname to indicate that the corresponding wildcard in oldname be skipped. E.g., "rename a*b* a.b*" removes what is between a and b; variable ausbvalue would be renamed abvalue. 

After searching for a solution, i found one here To rename the variables to a valid name you can just use the code below to fix the var names.

forvalues i = 1/`c(k)' {

    qui mata: st_isname(st_varname(`i')) ? 1 : st_varrename(`i', ustrtoname(st_varname(`i'))) 

}





segunda-feira, 18 de maio de 2020

Video playback slow and lagging on Linux (Solus OS)

After installing solus and trying to playback some 720p and 1080p videos i noticed that the videos were lagging and stuttering really badly in vlc, gnome mpv and other players. Doing some research i didn't found the exactly answer but i found  that running vlc on terminal might show the problem. Reading the errors i saw that there was a libva error showing up and looking for "libva" on Solus software center i found that libva-intel-driver was missing, so i installed it and also libva-32bit library just in case.


And sure enough, the videos are now running smoothly.


So, to solve this problem you can try installing the libva library specific to your system, it worked for me.

sábado, 8 de junho de 2019

Como tocar/adicionar músicas mp3 no aplicativo do Spotify Android/IOS

Esses dias estava querendo escutar uma música que ouvi faz tempo, só que ela não estava disponível no spotify. Eu até pensei em baixar o mp3 e ouvir em outro player, só que eu queria ouvi-la junto com as outras da minha playlist, então eu acabei encontrando uma forma de adicionar musicas mp3 no aplicativo Spotify de Android e Iphone(?).

Pré requisitos:
Um computador com Spotify instalado. (Pode ser de um amigo)
Spotify Premium (Não é possível fazer streaming de músicas não nativas no Spotify).

Mova o seu arquivo mp3 para a pasta de Músicas ou Downloads do seu computador. (Você pode pedir pro seu amigo fazer isso no PC dele e pegar a musica depois). Você pode utilizar o site https://tagmp3.net para inserir a arte de capa, nome do álbum, etc. caso o seu arquivo não tenha.


No aplicativo do Spotify para PC, entre nas Preferências (Ctrl + P ou Arquivo > Editar > Preferências) e marque as opções Mostrar arquivos Locais e a opção da pasta Download ou Músicas (dependendo de onde você colocou o seu mp3)


Vá em Arquivos locais no menu lateral, clique com o botão direito do mouse sobre a música para mostrar mais opções e Adicione a música a uma playlist que você tenha disponível offline do seu Smartphone.


Pronto, agora e só esperar o PC sincronizar com os servidores do Spotify (O que pode demorar minutos ou horas, no meu caso 1 hora) e a musica irá aparecer no celular e você poderá tocá-lá normalmente.