Mostrando postagens com marcador how-to. Mostrar todas as postagens
Mostrando postagens com marcador how-to. Mostrar todas as postagens

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, 12 de junho de 2012

How-to: CyanogenMod 7.2 no Motorola Defy

Vou registrar abaixo os meus passos para instalação do CyanogenMod 7.2 rc3 no meu Motorola Defy, que agora ficou muito mais rápido e com várias funcionalidades interessantes, como o compartilhamento da rede 3G via Wi-Fi, como um roteador wireless (wi-fi).

Embora a ideia seja fazer um arquivo pessoal -- mesmo porque existem outros roteiros na rede -- se você encontrar erros ou tiver sugestões, ficaria grato em recebê-las a fim de aprimorar esse "how-to".

(Esse guia é baseado no Guia de Atualização Completa (em inglês) do CyanogenMod Wiki)


Antes de mais nada: backup

Do Cartão Memória:  errar é humano.  O procedimento descrito abaixo, em tese, não apaga os dados do cartão de memória (SD card) do seu telefone, mas sempre é bom ter cautela e fazer um backup dos dados, que pode ser feito com o telefone ligado a um computador, via USB, num simples cole-e-copie.

Dos Aplicativos:  geralmente os aplicativos comprados no Market (atual Play Store) serão automaticamente reinstalados após a atualização desde que você utilize a mesma conta do google.  Para os aplicativos gratuitos será necessário baixá-los novamente.  Pode-se simplesmente fazer uma lista ou, para quem prefira, há aplicativos como o Titanum que automatizam esse procedimento. 

Das Mensagens, Contatos, Etc.:  provavelmente seus contatos estão vinculados à sua conta google e, neste caso, serão automaticamente restaurados após a atualização.  Caso contrário, você provavelmente vai querer fazer um backup dos contatos, juntamente com as mensagens (SMS) e eventuais outros dados que não se encontram no cartão de memória (SD card).  Aplicativos gratuitos como o MyBackup Root , o SMS Backup & Restore e o Call Logs Backup & Restore auxiliam nessa tarefa.


1º Passo:  ganhar acesso root

Alguns tutoriais sugerem esse procedimento através do programa rageagainsthecage-arm5.  Eu não consegui rootear meu Defy por esse modo.  E achei bem mais fácil usar o SuperOneClick, pelo menos para que tem um Windows à mão. 

No seu telefone, ative o USB em modo de depuração via Configurações > Aplicativos > Desenvolvimento > Depuração USB.  E conecte seu telefone no computador.

No seu computador (Windows), baixe o programa SuperOneClick (download disponível no link acima), descompacte a pasta e abra o programa (não é necessário instalar) com um duplo clique em modo Administrador (clique-direito sobre o icone para abrir o menu com opções).

Na tela abaixo, clique no botão ROOT e espere o processo terminar.


Alternativa para ganhar root sem computador:

Para quem não está com um computador disponível, uma alternativa para ganhar acesso root é o programa GingerBreak, disponível nessa discussão do Fórum xda-developers ou através do Código QR ao lado.

Bastam 3 passos: (i) baixar o arquivo para o cartão de memória do Defy; (ii) habilitar instalação de programas fora do Market (Configurações > Aplicativos > Fontes desconhecidas); (iii) habilitar o modo Depuração USB (Configurações > Aplicativos > Desenvolvimento > Depuração USB).

Depois é só clicar no aplicativo GingerBreak-v1.20.apk, clicar no botão Root e esperar o processo, que pode demorar até 10 minutos.  Depois, se tudo correr bem, o telefone vai reiniciar e o aplicativo SuperUser vai estar instalado.


2º Passo:  instalando o bootmenu e o ClockworkMod Recovery

Certifique-se de que os seguintes programas estão instalados no seu computador:
- Java Development Kit
- Android SDK

Faça o download da última versão do bootmenu (md5: 33e0f340350f1c12fdda394a07c4e529), descompate o conteúdo e coloque-o em uma pasta de nome bootmenu e coloque-a no raiz do cartão de memória do telefone.

Conecte o telefone ao computador via cabo USB.

Abra um terminal e vá até a pasta platform-tools, localizada dentro da pasta android-sdk (onde você instalou o Android SKD) e digite os seguintes comandos (+ tecla enter ao final de cada linha):








adb shell
su
cp -R /sdcard/bootmenu /data/bootmenu
cd /data/bootmenu
chmod 755 *
./install.sh
rm -R /data/bootmenu



OBS 1:  Talvez seja necessário autorizar o acesso root (clicando no botão Permitir que vai surgir na tela do telefone) logo após digitar o comando su no terminal.

OSB 2: Nesse passo, a Depuração-USB deve estar ligada, mas o cartão de memória (SD-card) não pode estar montado/compartilhado com o computador ou você verá o seguinte erro: cp: /sdcard/bootmenu: No such file or directory

Após o comando ./install.sh, será exibida a seguinte mensagem (indicando o sucesso do procedimento):
Install complate....
Plz.. Reboot now....


3º Passo:  instalando o Cyanogenmod

1. Faça o download da sua versão preferida do CyanogenMod: a versão estável, a experimental ou a da noite passada.  (Opcional: baixe o pacote de aplicativos do Google).

2. Coloque o arquivo cm-7.2.0-jordan.zip na raíz do cartão de memória (SD-card).

3. Reinicie seu telefone do modo ClockworkMod Recovery (após alguns segundos de logo da Motorola, a LED azul pisca -- aperte a tecla Volume (-) logo em seguida)

4. O telefone irá para o ClockworkMod Recovery: use os botões de volume para navegar e o botão de ligar para selecionar/confirmar.

(Opcional RECOMENDADO: escolha a opção backup and restore para fazer um backup do estado atual do seu telefone; se algo der errado você ainda poderá retornar ao estado atual)

5. Selecione a opção Recovery > Custom Recovery

6. Selecione a opção wipe data/factory reset.

7. Selecione a opção wipe cache partition.

8. Selecione install from the sdcard.

9. Selecione choose zip from sdcard.

10. Selecione o arquivo da ROM CyanogenMod baixado (cm-7.2.0-jordan.zip ou outra de sua preferência) e aguarde o procedimento (no final os menus azuis retornarão).

(Opcional:  para instalar os aplicativos do Google, repita os passos 8 a 10 selecionando no fim o arquivo gapps____.zip.)

11. Depois da instalação completar, selecione  +++++ Go Back +++++  para voltar ao menu principal, Advanced > Wipe Dalvik Cache.

12. Volte ao menu principal ( +++++ Go Back +++++ ) e escolha a opção Reboot system now.  Pronto: seu Motorola Defy deve reiniciar com o CyangeMod 7.  Aproveite!

Obs: A primeira inicialização com reconstrução dos Caches poder ser mais demorada (5-7 minutos). Seja paciente!



quinta-feira, 5 de abril de 2012

Dropbox no Xubuntu (ou outra distro com XFCE)

Muita gente tem migrado para o Xubuntu em busca de maior velocidade, mas tem se deparado com erros na hora de instalar o Dropbox, o que se deve ao fato do Xubuntu não utilizar o Nautilus como gerenciado de arquivos.

Abaixo, a solução de como instalar o Dropbox no Xubuntu (via Terminal):

$ cd ~/
$ wget -O dropbox.tar.gz http://www.dropbox.com/download\?plat=lnx.x86
$ tar -zxvf dropbox.tar.gz
$ wget -nd http://dl.dropbox.com/u/6995/dbmakefakelib.py
$ wget -nd http://dl.dropbox.com/u/6995/dbreadconfig.py
$ python dbmakefakelib.py
Ao final, será aberta a tela de configuração do Dropbox para que seja criada uma conta ou utilizada uma existente.

créditos 1, crédito 2, crédito 3