06:31 AM 06:31 AM 06:31 AM

Add photo to key PGP/GPG using GnuPG

Good Night,

To add your picture to your PGP key using GnuPG on Linux use:

List the certificates:

gpg --list-keys

Find your and yours certificate will start with:


Use this command to edit your key:

gpg --edit-key XXXXXXXX

Add your picture using:


You must use a JPG photo. The recommended size is something near 240x288. If you use big images, your certificate will be HUGE.

Add the path to your photo:


The system will ask for confirmation, double check it. And press Y if it is correct.
Type your password when the system ask for it.

Save the modifications


Send your key to a key server.

gpg --keyserver keyserver.cais.rnp.br --send-keys XXXXXXXX

That is it.

Best Regards,

09:37 PM 09:37 PM 09:37 PM

View photos of PGP/GPG certificates using GnuPG on Ubuntu


To visualize the photos automatically using GnuPG on Ubuntu you need to edit your config file.


gedit .gnupg/gpg.conf

If you want to enable the exhibition on key listing look for and uncomment

# Display photo user IDs in key listings
# list-options show-photos

If you want to enable the exhibition on verification look for and uncomment

#verify-options show-photos

Add this to the config file with the photo viewer that you want to use. In this case eog

photo-viewer "eog %i"

Save the file, and enjoy.

04:38 AM 04:38 AM 04:38 AM

How to split large file in smaller files using Linux


To split a large file in several smaller files, you can use Split from Linux. How it works? Man split.

split --bytes=1m /path/large/file /path/output/file/prefix

You can replace the suffix of --bytes with many values as follow:
kB = 1000
K = 1024
MB = 1000 * 1000
M = 1024 * 1024
G = 1000 * 1000 * 1000
GB = 1024 * 1024 * 1024

Best Regards,


01:26 AM 01:26 AM 01:26 AM

Facial Recognition using Ubuntu.

Good Night,

I was reading about Facial Recognition and found pam-face-authentication. You must have this packages to use it:
Opencv 1.0.0 +
libpam (dev version)
libX11 (dev version)
Qt4.5 (dev version)

So I decided to try it. Let's start.

Open CV - How to Install
This is a resume of what I did

1. Install the build-essential

$ sudo apt-get install build-essential

2. Access synaptic and search for "CMake", Subversion, GTK+ 2.x, libpng, zlib, libjpeg, libtiff, libjasper, python 2.3+, swig. Don't forget to install the -dev packages too

3. Install libavformat-dev

$ sudo apt-get install libavformat-dev

4. Download the opencv library

$ svn co https://opencvlibrary.svn.sourceforge.net/svnroot/opencvlibrary/tags/latest_tested_snapshot

5. Go to the download folder

$ cd latest_tested_snapshot/opencv

6. Create dir release

$ mkdir release

7. Access it

$ cd release

8. Use cmake (Don't have sure if .. is necessary.)


9. Make it

$ make

10. Install it

$ sudo make install


$ sudo ldconfig -v


$ cd bin

13. Verify if the dependencies works.

$ ./cxcoretest

Now go to Synpactic again and look for Libpam, libX11, Qt4.5 (don't forget the -dev version)

How to install pam-face-authentication? Install PAM-FaCE-AUTH (reference)

1. Download pam-face-authentication (download the last version in my time I used 0.3)

$ wget http://pam-face-authentication.googlecode.com/files/pam-face-authentication-0.3.tar.gz

2. Extract it.

$ tar -xf pam-face-authentication-0.3.tar.gz

3. Go to extracted folder

$ cd pam-face-authentication-0.3

4. Create build

$ mkdir build

5. Go to folder

$ cd build

6. (Don't have sure if .. is necessary.)

$ cmake -D CMAKE_INSTALL_DIR=/usr ..

$ make


$ sudo make install

Access Applications - Other - QtFacetrainer. Configure it. Go to Advanced and test it.

If you want to use it when somebody uses the "su" command. Edit "/etc/pam.d/su"

$ sudo vi /etc/pam.d/su

Add this line in the begin of the file

auth sufficient pam_face_authentication.so enableX

Other reference

03:10 AM 03:10 AM 03:10 AM

Install and Configure DHCP server in Ubuntu

Good night,

If you want to install DHCP server in Ubuntu, use

$ sudo apt-get install dhcp3-server

And then edit /etc/dhcp3/dhcpd.conf I commented all lines and add this ones:

ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative; # DHCP PRINCIPAL DA REDE

subnet netmask {
option routers; # GATEWAY
option domain-name-servers; # SERVIDOR DNS
option subnet-mask; # MASCARA DE SUBREDE
option broadcast-address; # ENDEREÇO DE BROADCAST
default-lease-time 600;
max-lease-time 7200;

Restart eh DHCP server:

$ sudo /etc/init.d/dhcp3-server restart

See you,


06:01 PM 06:01 PM 06:01 PM

Share internet in a SERVER connected to WAN port.


The last days I keep trying to configure my server. I know how to configure the network to this:

MODEM -> (eth0) Servidor (eth1) -> (LAN Port) Router (LAN Ports) -> Computers

This topology don`t work for me, because in this way I lost one WAN Port. So I thought in this topology:

MODEM -> (eth0) Servidor (eth1) -> (Porta WAN) Router (Portas LAN) -> Computadoresauto eth1
iface eth1 inet static

After this I add this iptables rules:

sysctl net.ipv4.ip_forward=1
iptables -t nat -A POSTROUTING --out-interface eth0 -j MASQUERADE
iptables -A FORWARD --in-interface eth0 -j ACCEPT

I need to setup the router manually:

IP Address :
Subnet Mask :
ISP Gateway Address :
Primary DNS Address : (DNS)
Secondary DNS Address : (DNS)

So up and running


09:22 PM 09:22 PM 09:22 PM

Install Ubuntu from Pendrive


Today I will just recomment to you the post of Juliano Martins about how o install Ubuntu from pendrive.

UPDATE: In the last days I tried the tool from Ubuntu (USB Startup Disk Creaator) and it works!

Best Regards,

10:33 PM 10:33 PM 10:33 PM

Execute file in computer startup

Good Night,

This is a simple tip, how to execute some file in computer startup. (I used this tip to enable the port forward on startup)

Copy your file to /etc/init.d/ using "cp file /etc/init.d/file"

Edit /etc/rc.local (as root) and add the file that you want to execute. You must use the full path like /etc/init.d/file.sh for example.

The file must have execution permissions, do this using "chmod +x /etc/init.d/file.sh"


PS: You must add the line before "exit 0" in rc.local

02:30 AM 02:30 AM 02:30 AM

Damn Small Linux, VirtualBox 2.2, Java


A week ago I was thinking about banks autentications, here in Brazil, you have to register your computer to get access to the bank site with your computer. Do this every time you format your hard disk is sux, so i thought, why don't use a virtual machine with a Damn Small linux and use it to access? It's a good idea.

I created my virtual machine with virtualbox and downloaded the last version of Damn Small Linux. I started the virtualmachine and i saw it was running from cd. Searching around the internet i discovered it is dedicated to live-cd but you can install it if you want to. In portuguese version I translated this article about how to install damn small linux but in english i don't have to.

So this is just a tip, if you have to register your computer to do some things, why don't you install a Damn small linux and use it for this? Other advantage is that you can take it with you, and linux don't have virus so you don't have to worry about this kind of security

If you want to install Java to firefox follow this article.

If your mouse don't work use "xsetup.sh" and choose a mouse that isn't USB. It works for me, now i have my USB mouse working. (I think it's something about Virtualmachin)


02:08 AM 02:08 AM 02:08 AM

Ubuntu 9.04, bootChart.


I decided to stay in computer a little more, and have a test with this fresh installation of Ubuntu 9.04. Some people say that the boot would be faster in this new version, so I decided to verify this. I remember in my last instalation (Ubuntu 8.10) with fresh install I got 31 seconds on boot, after some modifications it reduces to 21 seconds. In this version, as promised the boot time decreased. I got 26 seconds. When I have some time i'm going to try to do some optimizations and decrease it more.

To verify the time I used Bootchart. You can get it using:

$ sudo apt-get install bootchart

Or you can go to menu "System -> Administradion -> Synaptic Package Manager" and search for it.

BootChart Image, BootChart logs.

Good night,