M d Y

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:

pub 1024D/XXXXXXXX YYYY-MM-DD

Use this command to edit your key:

gpg --edit-key XXXXXXXX

Add your picture using:

addphoto

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:

/home/user/dir/dir/photo.jpg

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

save

Send your key to a key server.

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

That is it.

Best Regards,
Matheus

M d Y

View photos of PGP/GPG certificates using GnuPG on Ubuntu


Hello,

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

Edit:

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.
Matheus

M d Y

How to split large file in smaller files using Linux


Hello,

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,
Matheus

Reference:

http://www.techiecorner.com/107/how-to-split-large-file-into-several-smaller-files-linux/

M d Y

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.)

\
$ cmake -D CMAKE_BUILD_TYPE=RELEASE -D CMAKE_INSTALL_PREFIX=/usr/local -D BUILD_PYTHON_SUPPORT=ON ..

9. Make it

$ make

10. Install it

$ sudo make install

11.

$ sudo ldconfig -v

12.

$ 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 ..

7.

$ make

8.

$ 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

If you don't want a window showing the webcam remove the enableX

Matheus

Other reference

M d Y

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:

INTERFACES="eth1"; # INTERFACE CONECATADA AO MEU ROTEADOR
ddns-update-style none;
default-lease-time 600;
max-lease-time 7200;
authoritative; # DHCP PRINCIPAL DA REDE

subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.100 192.168.0.150; # FAIXA DE IPS A SER DISTRIBUIDA
option routers 192.168.0.254; # GATEWAY
option domain-name-servers 200.247.141.11; # SERVIDOR DNS
option subnet-mask 255.255.255.0; # MASCARA DE SUBREDE
option broadcast-address 192.168.0.255; # 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,
Matheus

Reference:
Google + DHCP SERVER UBUNTU

M d Y

Share internet in a SERVER connected to WAN port.


Hello,

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) -> Computadores

First of all configure your eth1 manyally as (edit /etc/network/interfaces):

auto eth1
iface eth1 inet static
address 192.168.100.254
netmask 255.255.255.0
network 192.168.100.0
broadcast 192.168.100.255

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 : 192.168.100.1
Subnet Mask : 255.255.255.0
ISP Gateway Address : 192.168.100.254
Primary DNS Address : 200.247.141.11 (DNS)
Secondary DNS Address : 200.247.141.12 (DNS)

So up and running

Matheus

M d Y

Install Ubuntu from Pendrive


Hello,

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,
Matheus

M d Y

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"

Matheus

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

M d Y

Damn Small Linux, VirtualBox 2.2, Java


Hello,

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)

Matheus

M d Y

Ubuntu 9.04, bootChart.


Hello,

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,
Matheus