sábado, 19 de dezembro de 2015

HP LaserJet M1132 MFP no Ubuntu 15.10

Problemas para instalar a impressora LaserJet M1132 MFP no Ubuntu 15.10 e derivados?

Para mim, a instalação do plugin hplip (hplip-3.15.11-plugin.run) não avançava após aceitação da licença.

Solução fornecida por Sergey Dovganyuk aqui.

Espero que ajude.

quinta-feira, 22 de outubro de 2015

Cyanogem 12.1 no Moto X 2013

Cyanogem 12.1 no Moto X 2013


Depois de ter recebido o update para o Lollypop (Android 5.1), meu Moto X (2013) otimizava todos os 92 aplicativos a cada reboot, o que demorava em torno de 10-15 minutos.   Perdi a paciência e resolvi instalar o Cyanogemod, que durante muito tempo foi minha ROM preferida no meu Nexus 4.

Seguem abaixo, minhas anotações do passo a passo de como fazer isso -- claro: usando Linux!


AVISOS:


  • As instruções são fornecidas sem garantia.  Se você segui-las corretamente, passo a passo, não irá ter problemas.  Mas um erro pode danificar seu aparelho.  Faça o procedimento por sua conta e risco.
  • Esteja ciente de que o procedimento abaixo invalida a garantia de fábrica do seu aparelho -- o site da Motorola irá lhe avisar isso.
  • Todos os comandos em terminal são precedidos do símbolo $.  Não é necessário digitar esse simbolo, apenas os comandos que seguem (você pode copiar e colar no terminal).


PRIMEIRO PASSO: DOWNLOAD DOS ARQUIVOS

Será preciso baixar os seguintes arquivos:
--  o ROM Cyanogenmod 12.1 (nesta página, ou diretamente aqui)
-- Google Apps GAPPS 5.1 (nesta página, ou a versão do Google diretamente aqui)
(há a opção open source e a opção do Google, eu usei a open source, mas vai da sua preferência)
==> Baixe estes arquivos e separe-os pois posteriormente serão transferidos para a memória interna do Moto X

Também será necessário ter o Android-STK-Tools no seu computador.
-  Android-SDK (nesta página, ou diretamente aqui)
==> Baixe este arquivo, e extraia o conteúdo em uma pasta de sua preferência.  No meu caso, deixei na pasta de Dowloads, que ficou assim:
Atenção: todos os comandos de terminal devem ser executados a partir da localização da pasta "tools" indicada acima.

-- TWRP (nesta página, ou diretamente aqui)
(baixe este arquivo e coloque ele dentro "tools" do Android-SDK, para facilitar a instalação)

Por fim, será necessário instalar os programas "android-tools-adb" e "android-tools-fastboot", o que no Linux pode facilmente feito no terminal através do comando:
$ sudo apt-get install android-tools-adb android-tools-fastboot
(necessário digitar senha do usuário/administrador)

SEGUNDO PASSO: DESTRAVANDO O BOOTLOADER (Unlock bootloader)

1. Certifique-se de que seu computador possui os programas fastboot e adb.
2. Ative o modo programados e a depuração USB no seu Moto X (Menu Configurações > Sobre o Telefone > clique 7 vezes sobre o número da versão, volte e vá a opção > Programador > Ativar Depuração Android)
3. Conecte seu celular ao PC via USB.
4. Em um terminal, aberto na pasta "tools" do Android-SDK (no Ubuntu, basta clicar com o botão direito do mouse na pasta e escolher "Open in Terminal" ou "Abrir no Terminal"), digite o seguinte comando:
$ adb reboot bootloader
Isso fará seu celular entrar em fastboot mode.
5. Confirme que seu PC "enxerga" o celular digitando
$ adb devices
ou
$ sudo fastboot devices
(será necessário digitar a senha do usuário/administrador) e você deverá ver algo assim:

6. Se o terminal não voltar um número de série e, ao invés, responder "<waiting for device>", isso significa que o fastboot e/ou adb não estão configurados corretamente no seu PC.  Veja a documentação dos programas para mais informações.
7. No mesmo terminal, digite o seguinte comando para obter o código de destravamento do bootloader:
$ sudo fastboot oem get_unlock_data
(o código será fornecido em várias linhas, precedidas da expressão "(bootloader)", como no exemplo abaixo
Use um editor de texto para excluir as expressões e os espaços, deixando apenas o código a ser usado no site da Motorola - vide abaixo)
7.Visite o site da Motorola Bootloader Unlock e siga as instruções lá contidas (login com conta da motorola ou gmail, depois colar o código obtido no passo anterior e, por fim, concordar com os termos) para obter a chave para destravar seu bootloader (KEY), que será enviada ao seu e-mail.
8. Em seguida, com a chave de destravamento recebida da Motorola, com seu celular conectado ao PC em fastboot mode, abra o terminal e digite o seguinte comando:
$ sudo fastboot oem unlock KEY
(substituindo a palavra KEY pela chave de destravamento recebida no seu e-mail)
9. Se seu celular não reiniciar automaticamente, reinicie-o pelo menu (botão de abaixar volume navega e botão de aumentar volume seleciona).  Ele deve estar com o bootloader destravado.
Como ele faz um reset completo, será necessário re-ativar a Depuração USB (USB debugging) para continuar os próximos passos.


TERCEIRO PASSO: INSTALAR O TWRP (TeamWin Recovery Project)

1. Com o seu Moto X conectado ao PC e em fastboot mode (veja instruções 3 a 5 do SEGUNDO PASSO acima), digite o comando abaixo
$ sudo fastboot flash recovQUARTO PASSO:  INSTALAR A ROM CYANOGENMODery TWRP.img
(substituindo o "TWRP.img" pelo nome do arquivo que você baixou - no meu caso, este arquivo era o twrp-2.8.7.0-ghost.img)
2. Reinicie o celular em fastboot mode (segure o botão de abaixar volume + power) para verificar a instalação.


QUARTO PASSO:  INSTALAR A ROM CYANOGENMOD

1. Com o Moto X conectado ao PC, coloque os arquivos (.zip) CyanogenMod, Gaaps e SuperSu na memória interna do seu celular, como faz normalmente, pelo gerenciador de arquivos.
Alternativamente, também pode ser feito via terminal, através do comando
$ adb push arquivo.zip /sdcard/
(substituindo arquivo.zip pelo nome/caminho dos arquivos desejados)
2. Entre no fastboot mode (veja instruções 3 a 5 do SEGUNDO PASSO, acima) e a patir do menu entre no Recovery Mode.
3. Selecione as opções apropriadas com toque na tela.
4. Opcional (mas recomandado): faça um backup, usando o botão Backup.
5. Selecione Wipe e Factory Reset.
6. Selecione Install.  Navegue no /sdcard e selecione o arquivo CyanogenMod[...].zip.  Em seguida, repita o mesmo procedimento para instalar o Gapps.
7. Após finalizar, selecione Reboot para reiniciar o sistema

PRONTO!  Seu Moto X vai iniciar o CyanogenMod (o primeiro boot costuma ser mais demorado -- relaxe e espere)


QUINTO PASSO:  REPARAR GPS e SWIPE

Em alguns casos, o GPS pode não funcionar corretamente.  Se esse for seu caso, é necessário consertar o GPS, o que pode ser feito facilmente, com o celular conectado no PC e no "fastboot mode" (que pode ser ativado com o celular desligado, apertando o botão de abaixar volume + power ou no terminal com o comando $ sudo adb reboot bootloader)

Digite:
$ sudo fastboot erase modemst1
e, em seguida, digite:
$ sudo fastboot erase modemst2

Outra função que pode não funcionar é a escrita contínua (sem necessidade de tirar o dedo do teclado) também conhecida como swipe.  A solução para esta questão veio deste post do Fórum XDA, sendo que basta fazer o download deste zip e instalar via TWRP, como os demais arquivos .zip instalados anteriormente.  Pronto: depois disso seu telcado funcionará com swipe normalmente.

Fonte:  baseado em https://wiki.cyanogenmod.org/w/Install_CM_for_ghost

sexta-feira, 28 de agosto de 2015

Linux no Positivo Unique S1991i com ajuste de brilho

O Unique S1991i é um laptop de entrada da Positivo. Ele vem com um Celeron dual-core 1007U de 1,5Hz, 2G de RAM e 250 de HD.  Sistema OEM Windows 8/8.1 mais uma porção de bloatware (como vários outros computadores) que deixam ele lerdo quase parando.

A solução foi instalar o elementaryos que deixou ele infinitamente mais rápido.

Praticamente tudo funciona automaticamente: teclado e teclas de função, som, CD, Wi-Fi, etc.

O único problema em termos de compatibilidade era o controle de brilho.  A solução veio com um pouco de pesquisa e consiste em adicionar um parâmetro na linha do kernel.


SOLUÇÃO:
Edite o arquivo /etc/default/grub e adicione "acpi_osi=" ao final da linha abaixo, como mostrado:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi="

Depois salve o arquivo e atualize o grub com o seguinte comando:

$sudo update-grub

Reincie o sistema e pronto!

quinta-feira, 27 de agosto de 2015

elementary hot corner to blank screen

Currently using Freya on a T60 and wanted to turn off the screen on demand.

Using elementary's Hot Corners function, it's possible to set up a corner of your screen to respond to the mouse pointer this way, going blank, while the computer remains on (not suspend mode).

To do this, go to System Settings > Desktop > Hot Corners as below:



On the corner of your choice, click on the drop-down menu and select "Execute Custom Command" and copy the code below on the field "Custom Command", as shown above.

xset dpms force off


After this, whenever your mouse pointer hits the chosen corner, the screen will go blank until some activity occurs (mouse or keyboard activity).

Credit goes to neonsignal from http://www.linuxquestions.org/questions/linux-software-2/a-command-to-make-the-screen-go-blank-839037/

quarta-feira, 29 de julho de 2015

Do you want or need latest JRE 8 version 51 on your Linux?

After a being annoyed by warnings about my updated version of Java (8u45) and without an up to date alternative from WebUpd8's PPA, I've decide to look around and found this gorgeous Easy Linux Tips Project, hosted by Google, explaining bit by bit how to manually install JRE 8 update 51 (64 bit), who receives all credits for the tip below:

(looking for instructions for the 32 bit version?  Look here)


HOW-TO FOR 64 BIT UBUNTU AND LINUX MINT


Remove the browser plug-in of the old version

First you'll want to remove the browser plug-in of the old JRE or openJDK (if you have it). Only the browser plug-in needs to be removed! Otherwise unwanted side effects may occur. 

When the old JRE has been installed manually in /opt/java, see theinstruction at the bottom of this column (under the header Removal).

When you don't have an old JRE, you probably have openJDK and the IcedTea browser plug-in. The IcedTea browser plug-in (icedtea-6-jre-cacao) should be removed; openJDK itself can remain on your hard disk. 

Like this:

Ubuntu: click on Ubuntu Software Center (the shopping bag) in the side panel. Linux Mint: launch Software Manager.
Query: icedtea.

Remove only the IcedTea Java-plug-in. Leave OpenJDK itself on your hard disk.

Press the Remove button.

Get JRE

Get the right file from the Java website: http://www.java.com

For 64-bit you want Linux x64. The name of this file ends on .tar.gz. Do not pick Linux x64 RPM (file name ends on x64.rpm), because RPM is not built for Ubuntu and Linux Mint, but for other Linux distro's.

Note: Store the file in the folder Downloads. So in:
/home/your-user-name/Downloads

Firefox puts downloaded files there by default, but not all web browsers do it like that.  

For example, user John should place the file in:
/home/john/Downloads
When in doubt, check it. 

This is important for the terminal commands that you'll execute later on; otherwise they won't be correct.

Install JRE (64-bit)

Note: the terminal commands in this how-to possibly refer to an older version of JRE. When there's a newer version, you can simply adapt the file names in the terminal commands.

This how-to has been written for JRE 8 update 51 (64 bit version).


1. Create a new subfolder in the folder opt, by means of a terminal command:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type (use copy/paste: rapidly click three times on the blue line, in order to select the entire line).
sudo mkdir -p -v /opt/java/64

Press Enter.

Type your password. You won't see anything, not even dots, this is normal.
Press Enter.


2. Now go to the Downloads folder and unpack the compressed JRE file that you just downloaded, with the following combined command:

Type in the terminal (use copy/paste):
cd Downloads && tar xvzf ~/Downloads/jre-8u51-linux-x64.tar.gz

Press Enter.


3. Move the unpacked contents of the JRE file into the system folder that you created in step 1, with the following command:

Type in the terminal (use copy/paste):
sudo mv -v ~/Downloads/jre1.8.0_51 /opt/java/64

Press Enter.

Inform the system and make the new JRE the default

4. Now you'll want to tell the system, that there's a new Java version available:

Type in the terminal (this is one line, use copy/paste):
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/64/jre1.8.0_51/bin/java" 1

Press Enter.

Note: are you updating from a previous Java version, which you have removed manually? Then you'll need to execute the above command twice, because you'll get an error message the first time.


5. Tell the system, that the new Java must be the default:

Type in the terminal (copy/paste):
sudo update-alternatives --set java /opt/java/64/jre1.8.0_51/bin/java

Press Enter.

Install the Firefox plugin

6. Installing the Firefox plugin is simple. First execute the following command, in order to create a certain folder (if it doesn't exist already):

Type in the terminal (copy/paste):
mkdir -v ~/.mozilla/plugins

Press Enter.

If it exists already, you'll see a notification of that.


7. Now remove the IcedTea plugin, if it has been installed:

Type (copy/paste):
sudo apt-get remove icedtea-6-plugin && sudo apt-get remove icedtea-7-plugin

Press Enter.

If it's not there to begin with, you'll get a notification of that.

8. Remove an older version of the Java plugin:

Type (copy/paste):
rm -v ~/.mozilla/plugins/libnpjp2.so

Press Enter.

If it's not there to begin with, you'll get a notification of that.

9. Now you can install the plugin, by creating a symbolic link (you tell Firefox, where the plugin is located):

Type (copy/paste):
ln -s /opt/java/64/jre1.8.0_51/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Press Enter.

Final check

10. Now close and restart Firefox. Check whether everything has succeeded. Type in the URL bar of Firefox (not in the terminal!):

about:plugins

Press Enter.

And scroll down, until you see something approximately similar to this:
Java(TM) Plug-in 11.51.2

You can also use this website (note that this website sometimes doesn't work, even when your Java is perfectly alright):
http://java.com/en/download/installed.jsp

Only enable the plugin when needed

11. Java is frequently under attack from malicious software on websites. Java is platform independent, so Linux is vulnerable, too. Therefore it's better to disable the plugin and only enable it for a short while, whenever you need it. You can do that as follows.

Note: this only applies to Java. There's also Javascript, which is safe. So there's no need to disable Javascript as well.

Tame disk usage with the Java Control Panel

12. By default, Java allows itself to use a crazy maximum amount of disk space for the cache (what were the developers smoking?). You can limit that as follows:

Call up the Java Control Panel as follows (in each user account):

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type in the terminal (use copy/paste):
/opt/java/64/jre1.8.0_51/bin/ControlPanel

Press Enter.

Temporary Internet Files - Settings... Disk Space: limit it to 50 MB.
Click Delete Files... OK - OK - Apply - OK.

Repeat this in each user account.

Do you have a Solid State Drive (SSD)? Then disable this cache entirely, as you'll want to limit write actions as much as possible for an SSD.

Note: this command is only for JRE 8 update 51. You'll need to adapt it when you use another version.

Other user accounts: repeat three commands and limit disk usage

13. Are there any other user accounts on the computer? Then repeat the following three terminal commands in each user account:

rm -v ~/.mozilla/plugins/libnpjp2.so


and then (in case the plugins folder doesn't exist yet):

mkdir -v ~/.mozilla/plugins


and then:

ln -s /opt/java/64/jre1.8.0_51/lib/amd64/libnpjp2.so ~/.mozilla/plugins/

Finally, use the Java Control Panel in those other user accounts, to limit the maximum disk usage of the cache (see step 12).

Removal

Do you wish to remove JRE again? It's very easy, to remove a manually installed JRE. As follows:

a. Remove the folder /opt/java and what's in it, by means of the following terminal command:

Launch a terminal window.
(You can launch a terminal window like this: *Click*)

Type in the terminal (use copy/paste):
sudo rm -r -v /opt/java

Press Enter.

Type your password. You won't see anything, not even dots, this is normal.
Press Enter.

b. Then in the terminal, in order to remove the Java plugin:

Type in the terminal (use copy/paste):
rm -v ~/.mozilla/plugins/libnpjp2.so

Press Enter.

c. Finally, restart your web browser.

Note: are there multiple user accounts? Then repeat step b in those other accounts.

Updating an older version

It's easy to update an older version. Proceed as described above, under the header "Removal". Then install the new version.


terça-feira, 31 de março de 2015