Planet.DebianPT.org

Graciano TorrãoA nossa privacidade online! Estaremos a ser responsáveis?

Este é um tema que tem orientados as minhas reflexões ao longo desta semana.

Tudo começou com a sugestão do meu Browser preferido, o Mozilla Firefox, e as recentes chamadas de atenção para o tema da privacidade.

O próximo passo foi a instalação do Lightbeam for Firefox, que me deixou pasmado quanto à questão “First Party Data vs Third Party Data“.

A título de exemplo, reparem nas associações que ocorrem durante um sessão que consiste em:

  • Aceder ao google e fazer uma pesquisa;
  • Aceder ao email e clicar num daqueles convites para aceder ao facebook;
  • Fazer login no booking.com e procurar um hotel para passar um fim-de-semana com a família.

Eis a teis de associações que foram feitas às nossas custas:

lightbeamNão será pois de espantar que, daqui a nada, comecem a surgir sugestões de locais para férias no nosso email, no facebook, ou noutra rede qualquer!

Mas a questão central é esta.

Até que ponto está preocupado com a sua privacidade?

Deixo uma sugestão no formato “TED” para refletirmos.

<iframe allowfullscreen="true" class="youtube-player" frameborder="0" height="385" src="http://www.youtube.com/embed/pcSlowAhvUk?version=3&amp;rel=1&amp;fs=1&amp;showsearch=0&amp;showinfo=1&amp;iv_load_policy=1&amp;wmode=transparent" type="text/html" width="630"></iframe>


ZACHARiASChromium not playing flash content? Install pepper flash

So one of these days I head up to YouTube, and I simply couldn’t watch any movies. Went check vimeo, same result. Tryed to make a speedtest, nothig. I got worried, but then I came accros a post, stating that the flashplayer would be discontinued for chromium-browser. But there’s an alternative! YAY! (:

Simply install pepper flash

$ sudo apt-get install pepperflashplugin-nonfree


Easy enough? (:

have fun sailors!
kudos


Filed under: Linux, Tutorials

ZACHARiASxUbuntu 14.04 LTS | Post Install – part I

YES! I love Xubuntu! It’s one of my favorite distros on-par with #!, debian xfce, trisquel and ElemnetaryOS.

It’s light on my system, quite simple, user friendly (in a way that my father uses it) quite pretty out of the box, and simply gets things done easily. At first install, I hated it and ran to pure ubuntu, but it got better and I decided to take for a spin.

Now, let’s begin…

First things first: you’ll need to update you’re software sources. Feel free to copy mine, for the time being. Don’t forget to update the mirrors as close to your location as you can.

Flash, java & git

$ sudo apt-get install openjdk-7-jre icedtea-7-jre-jamvm \
gsfonts gsfonts-x11 flashplugin-installer git git-core

TrueType Fonts

Screenshot - 28-01-2015 - 20:28:24

$ sudo apt-get install ttf-mscorefonts-installer

Extra suppport for compressing and decompressing files

 

Screenshot - 28-01-2015 - 20:29:01
$ sudo apt-get install unace rar unrar zip unzip p7zip p7zip-full \
p7zip-rar sharutils uudeview arj cabextract

Multimedia

$ sudo apt-get install libbluray-bdj libmad0 mpeg2dec mpegdemux \
libmpeg3-1 libmpeg2-4 liba52-0.7.4 libquicktime2 libmp4v2-2 faad \
lame flac mpeg3-utils icedax vlc

Now note, that w64codecs and libdvdcss2 where only present on medibuntu repository, which has ceased to exist. So I suggest using debian’s multimedia repo for installing these packages.

Add this line to your souce.list file…

deb http://www.deb-multimedia.org jessie main non-free

…and install the packages

$ sudo apt-get update &amp;&amp; sudo apt-get install w64codecs libdvdcss2

You’ll get a warning if you want to install it from untrusted sources, just say yes. after that just remove the above mentioned line from your repos, or jus add a # to the beggining of it.

BTW: DEBIAN <3

Internet stuff
Some p2p goodness and Chromium

Firstly, the p2p goodies and ftp support

$ sudo apt-get install transmission amule filezilla

Then install Chromium

sudo apt-get install chromium-browser


IM Stuff

$ sudo apt-get install pidgin-data pidgin-themes xchat


Firewall

Screenshot - 28-01-2015 - 20:36:49

A very nimble firewall is gufw, frontend for ufw. Simply install it by:

$ sudo apt-get install gufw

Now, check your state/settings…

$ sudo ufw status verbose

…and add some rules

$ sudo ufw deny 5353/udp && sudo ufw deny 5900/tcp && \
sudo ufw deny 22 && sudo ufw deny 25/tcp \
&& sudo ufw deny 135,139,445/tcp \
&& sudo ufw deny 137,138/udp && sudo ufw deny 110 && sudo ufw deny 2049 \
&& sudo ufw deny 143 && sudo ufw deny 21/tcp && sudo ufw deny ssh

If not enable at this point, please run

$ sudo ufw enable

More info & rules at: www.frozentux.net/documents/iptables-tutorial

Image Stuff (optional in my case)

GIMP + extras

$ sudo apt-get install gimp \
&& sudo apt-get install gimp-plugin-registry gimp-data-extras

After this just reboot your machine

$ sudo reboot

Filed under: Linux, Tutorials

Graciano TorrãoComo recuperar todas as mensagens enviadas “acidentalmente” para a pasta lixo(trash) do GMAIL?

A história é muito simples.
Estava a brincar aos filtros no GMail e enviei 12736 mensagens para o lixo!
Numa primeira abordagem, pensei que tinha que selecionar página a página, o que ao 50 de cada vez, me iria durar a noite toda!
E foi aí que reparei …

gmailRecoverFromTrash
Quando selecionamos todas as mensagens e da página visível (ver 1), surge a opção para selecionar todas (ver 2).
Uff … desta vez safei-me :)


Graciano TorrãoDicas sobre manilupação de “strings” em C++ com base na classe “string”

Atenção!

Este artigo não pretende ser exaustivo quanto ao assunto em análise, ou seja, a manipulação de strings tendo como base os objetos da classe string.

Trata-se apenas de um conjunto de dicas muito simples para quem quer fazer um consulta rápida e seguir viagem …

Recomendo a consulta de http://www.cplusplus.com/reference/string/string/

Vou passar diretamente para os exemplos.

#1 – Declaração e leitura de strings

Neste exemplo vou declarar 3 strings e proceder à respetiva inicialização de várias formas distintas.

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s1;
    string s2("Hello String 2!");
    string s3 = "Hello String 3!";
    string s4( 1, 'z');
    cin >> s1;
    cout << s1 << endl << s2 << endl << s3 << endl << s4 << endl;
    return 0;
}

#2 – Leitura de strings

Caso tenham testado o exemplo anterior, rapidamente se aperceberam que ao introduzir o texto para a string s1, e caso este contenha espaços, apenas vamos ficar com a primeira palavra.

Ora, se o enunciado for algo do tipo “Leia uma frase e …”, lá se vão as palavras que ficam para lá do primeiro espaço!

Isto acontece pois o cin interrompe a leitura do stream assim que encontrar um espaço ou o carater correspondente a “tecla enter pressionada”.

Uma proposta de resolução seria a seguinte:

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    string s2;
    getline(cin, s);
    getline(cin, s2);
    cout << s << endl;
    cout << s2 << endl;
    return 0;
}

#3 – Determinar o comprimento de uma string

Entenda-se por comprimento de uma string o seu número total de carateres.

Neste caso vamos utilizar a função membro length.

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    getline(cin, s);
    cout << "Tamanho: " << s.length() << endl;
    return 0;
}

#4 – Percorrer uma string, carater a carater

Muitos exercício de programação passam por analisar os carateres de uma string, um a um.

Para tal torna-se necessário aceder a cada carater invividualmente, e realizar com este a operação pretendida.

Neste caso, pretendemos contar quantas vezes a letra “a” aparece na string.

Por exemplo, o acesso ao terceiro carater da string s faz-se através de s.at(2).

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    string c;
    int contar=0;
    getline(cin, s);
    for(int i=0; i<s.length();i++)
    {
        c = s.at(i);
        cout << "Carater na posição [" << i << "] -> " << c << endl;
        if(c == "a")
            contar++;
    }
    cout << "O carater 'a' surge " << contar << " vezes." << endl;
    return 0;
}

#5 – Concatenar strings

Podemos concatenar várias strings de forma a obter uma que resulta da combinação das restantes.

Concatenar é o mesmo que juntar.

Vamos imaginar um exemplo no qual é fornecido o nome de uma animal seguido da sua comida preferida.

Experimentem! Basta “somar” :)

#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    string c;
    int contar=0;
    getline(cin, s);
    for(int i=0; i<s.length();i++)
    {
        c = s.at(i);
        cout << "Carater na posição [" << i << "] -> " << c << endl;
        if(c == "a")
            contar++;
    }
    cout << "O carater 'a' surge " << contar << " vezes." << endl;
    return 0;
}

#6 – Substituir carateres numa string

Este tópico resulta de uma questão formulada pelos famosos “BrosWithProject” :)

Desta vez, vamos ver uma forma muito simples de mover todos os carates, um a um, de uma string para outra.

Este processo permite resolver muitos problemas clássicos, ficando o resultado final dependente daquilo que se faz com cada carater extraído.

Vamos então trocar os “v” pelos “b”.

#include <string>
using namespace std;
int main()
{
    string antiga;
    string nova = "";
    string carater;
    getline(cin, antiga);
    for(int i=0; i<antiga.length();i++)
    {
        carater = antiga.substr(i,1);
        if(carater == "v")
            nova+="b";
        else
            if(carater == "b")
                nova+="v";
            else
                nova+=carater;
    }
    cout << nova << endl;
    return 0;
}

#? – E a seguir?

Este é um artigo inacabado que vou preenchendo à medida que forem sugindo as questões :)


Marcos MaradoBooks and Music in 2014

As tradition mandates, here's my yearly post about music release and books I've read the previously here.

Click on the images for details.
Top 10 music releases of 2014

Top 5 books I've read in 2014
You can also see last year's list.

PitxyokiMudar nomes de fotografias para incluir a data no nome


SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for i in *.jpg *.JPG
do
echo Processing $i...
SPEC=$(/usr/bin/exiv2 $i |/bin/grep -a timestamp)
[ $? -eq 0 ] || (echo Skipping $i. && continue);
IFS=$SAVEIFS
read X Y YEAR MONTH DAY HOUR MINUTE SECOND <<<${SPEC//:/ }
IFS=$(echo -en "\n\b")
[ "x$YEAR" = "x" ] && echo Skipping $i. && continue;
mv "$i" "$YEAR-$MONTH-$DAY $HOUR:$MINUTE:$SECOND - $i"
IFS=$(echo -en "\n\b")
done

IFS=$SAVEIFS

Graciano TorrãoKEN ROBINSON – “A escola mata a criatividade”

<iframe allowfullscreen="allowFullScreen" frameborder="0" height="354" mozallowfullscreen="mozallowfullscreen" scrolling="no" src="https://embed-ssl.ted.com/talks/lang/pt/ken_robinson_says_schools_kill_creativity.html" webkitallowfullscreen="webkitAllowFullScreen" width="472"></iframe>

Graciano Torrão2014 in review

The WordPress.com stats helper monkeys prepared a 2014 annual report for this blog.

Here’s an excerpt:

The Louvre Museum has 8.5 million visitors per year. This blog was viewed about 87,000 times in 2014. If it were an exhibit at the Louvre Museum, it would take about 4 days for that many people to see it.

Click here to see the complete report.


Graciano TorrãoMorcela com Ananás

Não é bem “Morcela com Ananás”, pois um dos ingredientes não mencionado faz a diferença.

Refiro-me às folhinhas de coentros, que para além do verde, dão uma acabamento delicioso a este trio.

Fruto do acaso, acabei com uma morcela nas mãos e, saltando os comentários mal intencionados que vos possam ter atravessado a mente, não sabia muito bem o que lhe fazer.

Nestas alturas, o Google está para o informático, tal com o bacalhau está para a cozinha Portuguesa, tal é o seu estatuto de fiel amigo.

Depois de iniciada a pesquisa, o mais difícil é escolher, e eu acabei por selecionar esta receita do Chefe João Pronto: http://lifestyle.sapo.pt/sabores/receitas/morcela-com-ananas?r=sabores.sapo.pt

Desde já aviso que é delicioso!

Enquanto faço a digestão, aproveito para deixar a recomendação.

morcelaComAnanasECoentros


ZACHARiASFlash Nexus Factory Images using Ubuntu

lollipop

Firstly install the needed apps, being:

sudo apt-get install android-tools-adb android-tools-fastboot

After that, turn developer options on and check if you have adb and fastboot working properly by typing

adb devices

adb

If you want to keep your apps and files, and having downloaded the image file extract it and find the flash-all.sh file and open it. Go to the bottom of the file and delete -w and save the file.
If you want to completely wipe your device, skip this step.
-w

Now open the terminal on the folder containing the files and type:

./flash-all.sh

Your device will now be flashed

flashing

rebooting

Now your nexus device, is running latest android version.
kudos


Filed under: Android, Linux, Tutorials

ZACHARiASUBUNTU 14.04 LTS | POST INSTALL – part II

trusty

Now, after installing my software of choice, I’m gonna make my experience as smooth and optimal for me.

THIS IS A WiP. So it will be updated according to my need, laziness and findings.

1. Disable Guest Session uppon login screen
To achieve this, one needs to edit the lightdm config file. open your terminal and type:

$ sudo gedit /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

Now add the following line

allow-guest=false

2. Remove that overlay scrollbar

I simply dont like that overlay bar. It sucks for me. And in elementary, it’s only enable for certain things. so here’s how to completely remove it.

Type this in the terminal and for changes to take efect, just logout and login.

$ sudo apt-get remove scrollbar*

NOTE: by uninstalling the scrollbar, unity-tweak-tool will not work!

3. Configure menubars
Just do as you please.

I turned this

appearance_1

into this

appearance_2

4. Install Numix Theme and Icons

I really like the Numix theming. I really think it’s clean and sharp and well designed. And I do like how it makes ubuntu experience a whole lot better. So let’s get to it.

Let’s add the numix ppa, since it’s the easiest way to have it

sudo add-apt-repository ppa:numix/ppa

Now, let’s update the sources and install that lovely theme vodoo

sudo apt-get update

Fisrt the icon sets

sudo apt-get install numix-icon-theme \
numix-icon-theme-circle numix-icon-theme-bevel

then the GTK theme

sudo apt-get install numix-gtk-theme

This will install al the available numix wallpapers

sudo apt-get install numix-wallpaper*

5. Theming control and stuff

For more control of your dash and theming, I prefer using Unsettings and Gnome Tweak Tool, since after removing scrollbar we can’t use unity-tweak-tool. I’ve also installed Gnome Tweak Tool since Unsettings doesn’t detect numix theming, for some strange reason.

sudo add-apt-repository ppa:diesch/testing
sudo apt-get update
sudo apt-get install unsettings && sudo apt-get install gnome-tweak-tool

6. Edit your dock

This will facilitate a lot your usability. Choose wisely when cleaning your stuff and organizing it. I usually organize it in groups

a) web: browser(s)
b) IM stuff: irc client and pidgin
c) p2p stuff: amule and or torrent client
d) music player
e) handy stuff: terminal and file manager

7. Remove unwanted ubuntu stuff (optional)
I don’t like/use the e-mail application thunderbird, hell, I dont even use Ubuntu’s Software manager. So let’s remove it.

remove thunderbird

sudo apt-get remove thunderbird*

software center

sudo apt-get remove software-center \
&& sudo apt-get --purge remove software-center*

software updater

sudo apt-get remove update-notifier

amazon

sudo apt-get remove unity-webapps-common* \
&& sudo apt-get --purge remove unity-webapps-common*

Filed under: Linux, Tutorials

ZACHARiASUbuntu 14.04 LTS | Post Install – part I

buntu1404

First things first: you’ll need to update you’re software sources. Feel free to copy mine, for the time being. Don’t forget to update the mirrors as close to your location as you can.

Now, let’s begin…

Flash, java & git

$ sudo apt-get install openjdk-7-jre icedtea-7-jre-jamvm \
gsfonts gsfonts-x11 flashplugin-installer git git-core

TrueType Fonts

eula

$ sudo apt-get install ttf-mscorefonts-installer

Extra suppport for compressing and decompressing files

archive

$ sudo apt-get install unace rar unrar zip unzip p7zip p7zip-full \
p7zip-rar sharutils uudeview arj cabextract

Multimedia

$ sudo apt-get install libbluray-bdj libmad0 mpeg2dec mpegdemux \
libmpeg3-1 libmpeg2-4 liba52-0.7.4 libquicktime2 libmp4v2-2 faad \
lame flac mpeg3-utils icedax vlc

Now note, that w64codecs and libdvdcss2 where only present on medibuntu repository, which has ceased to exist. So I suggest using debian’s multimedia repo for installing these packages.

Add this line to your souce.list file…

deb http://www.deb-multimedia.org jessie main non-free

…and install the packages

$ sudo apt-get update && sudo apt-get install w64codecs libdvdcss2

You’ll get a warning if you want to install it from untrusted sources, just say yes. after that just remove the above mentioned line from your repos, or jus add a # to the beggining of it.

BTW: DEBIAN <3

Internet stuff
Some p2p goodness and Chromium

chromium

Firstly, the p2p goodies and ftp support

$ sudo apt-get install transmission amule filezilla

Then install Chromium

sudo apt-get install chromium-browser


IM Stuff

$ sudo apt-get install pidgin-data pidgin-themes xchat


Firewall

firewall

A very nimble firewall is gufw, frontend for ufw. Simply install it by:

$ sudo apt-get install gufw

Now, check your state/settings…

$ sudo ufw status verbose

…and add some rules

$ sudo ufw deny 5353/udp && sudo ufw deny 5900/tcp && \
sudo ufw deny 22 && sudo ufw deny 25/tcp \
&& sudo ufw deny 135,139,445/tcp \
&& sudo ufw deny 137,138/udp && sudo ufw deny 110 && sudo ufw deny 2049 \
&& sudo ufw deny 143 && sudo ufw deny 21/tcp && sudo ufw deny ssh

If not enable at this point, please run

$ sudo ufw enable

More info & rules at: www.frozentux.net/documents/iptables-tutorial

Image Stuff (optional in my case)

GIMP + extras

$ sudo apt-get install gimp \
&& sudo apt-get install gimp-plugin-registry gimp-data-extras

After this just reboot your machine

$ sudo reboot

Filed under: Linux, Tutorials

ZACHARiASFormat usb stick using command line

Login as root

once in root, plugin the usb stick and run

fdisk -l

you’ll find the usb stick somewhere, mine being as shown.

usb

now if the usb is under 4gb run

mkdosfs -F 16 -I [path to your usb stick]

if it’s larger than 4gb run

mkdosfs -F 32 -I [path to your usb stick]

Filed under: Linux, Tutorials

ZACHARiASHow update your Kernel from backports: Debian Wheezy and Crunchbang Waldorf

Kernel is the most important part of your system. It keeps things running nice and smootlhy and also, keeps things more secure. Debian is, however, very cautious when it comes down to put things into the main branch/mirror, so it uses backports.

Quoting debian backports:

You are running Debian stable, because you prefer the Debian stable tree. It runs great, there is just one problem: the software is a little bit outdated compared to other distributions. This is where backports come in.

+ info here: http://backports.debian.org

Backports are packages taken from the next Debian release (called “testing”), adjusted and recompiled for usage on Debian stable. Because the package is also present in the next Debian release, you can easily upgrade your stable+backports system once the next Debian release comes out. (In a few cases, usually for security updates, backports are also created from the Debian unstable distribution.)

1. Install if (#! already has it installed) aptitude

sudo apt-get intall aptitude

2. Check tha latest kernel image available from the repos you have by

aptitude search linux-image

kernel


As you can see the latest image available for may system is linux-image-3.16-0.bpo.3-amd64. For further updates and newer images, just change the image name.

3. So let’s install it by:

sudo apt-get install -t wheezy-backports linux-image-3.16-0.bpo.3-amd64

4. Reboot your system and then check your system info:

sudo reboot
uname -o -s -r -v

And you should be getting something like this:

kernel_updated

NOTE: keep checking once in a while for any updates on the backports

Source: http://goo.gl/5V4lod

kudos!


Filed under: Linux, Tutorials

Footnotes