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, 7 de abril de 2015

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

quarta-feira, 21 de maio de 2014

Ubuntu: Chrome sem Java

Se você é um usuário do Google Chrome e atualizou recentemente o aplicativo, provavelmente percebeu (ou vai perceber) dificuldades para acessar bancos e outros sites dependentes do Java.

É que a partir da versão 35.0.1916.114 o Chrome parou de suportar o Netscape Plug-in API (NPAPI), o que, em outras palavras, significa "no more Java for you!".

O aviso oficial foi feito discretamente no Blog do Chromium e a razão é uma só: segurança.

Então, para quem ainda precisa de Java (eu não vivo sem: banco, justiça, CEF, etc.), a solução é continuar a usar, exclusivamente, o Firefox para essas funções.

domingo, 11 de maio de 2014

Annoyed by Thunderbird's "Bulk Mail" notification?

I had this problem when configuring my Yahoo mail on (Ubuntu flavoured) Thunderbird.

It seems like that Yahoo groups junk mail into a folder named "Bulk Mail" and for some reason Thunderbird would notifies me each time a new junk mail arrived.

If you have this problem, you might want to try this simple solution:

Get into Thunderbird Preferences:

Thunderbird Preferences
on Ubuntu*

Then, under the Security tab and the Junk sub-tab, and enable the option "Mark messages determined to be Junk as read":



And you're good: no more annoying notifications from even more annoying junk messages.

* Preferences might be located elsewhere in a non LSB certified OS.

Versions by the time of writing:
Ubuntu 14.04
Thunderbird 24.5.0

terça-feira, 15 de abril de 2014

Heartbleed Bug

Heartbleed Bug, como ficou conhecida, é uma falha existente no software de criptografia de código aberto OpenSSL, largamente utilizada para transmissão de dados (de forma segura) pela Internet, através do protocolo TLS - Transport Layer Security.

Esta falha foi publicamente anunciada dia 7 de abril de 2014, na mesma data em que disponibilizada uma correção para o software OpenSSL, sendo que a maioria dos servidores vulneráveis já implementaram a correção.

Estima-se que esse erro de implementação no OpenSSL deixou 17% dos servidores da Internet (aproximadamente meio milhão de computadores) vulneráveis a ataques, pelos quais um usuário conseguiria "ler" parte da memória RAM nestes servidores, obtendo as chaves privadas do servidor, assim como dados e senhas de usuários.

O xkcd explica, em linguagem simplificada, como essa falha poderia ser aproveitada de forma maliciosa:



A recomendação: troque suas senhas da Internet.

Minha sugestão: passe a usar (se ainda não faz) um gerenciador de senhas.  Na prática, em duas palavras, minhas recomendações específicas de aplicativos: se você busca praticidade (e não se incomoda que suas senhas estejam em um servidor de terceiro, ainda que criptografadas), use LastPass; se você busca uma solução de código aberto e quer que suas senhas fiquem apenas no seu computador, use KeePass ou KeePassX.