Change background and font of Grub2 on Fedora 16.

With Fedora 16 Grub2 was introduced.

We have some major changes with grub2, for example, there’s no menu.lst anymore to edit entries.

I do not know the reason, but the default grub2 of Fedora 16 is raw, with black background, in contrast to Fedora 15 with at least had a background picture.

We can customize grub2 in an easy way, just a few steps:

1) Copy your desired wallpaper to /boot 

# cp /home/user/Pictures/wallpaper1.jpg /boot/wall.jpg

2) Edit /etc/default/grub  and add the following lines:

GRUB_GFXMODE=1920x1080x16
GRUB_GFXPAYLOAD_LINUX=keep
GRUB_BACKGROUND=/boot/wall.jpg

You can use whatever resolution is supported by your monitor.

Next step is to convert a .ttf font (if you want to use a different font) to a suitable format, and generate our new grub.cfg

3) Generate font and grub.cfg

# grub2-mkfont --output=/boot/grub2/unicode.pf2 /usr/share/fonts/Sansation/Sansation_Regular.ttf

# grub2-mkconfig -o /boot/grub2/grub.cfg

In my case, I used Sansation font.

Then, all you have to do is reboot brand new GRUB2.

Here’s mine:

My Grub2. Click to zoom.

 

Posted in Linux | Tagged , , , , , , , , | 6 Comments

Configuring BIND9 Master / Slave on Ubuntu.

I know it is strange to set up this type of configuration on an Ubuntu Desktop, but we had to do it for Internet Services class, and it gave problems to me and most of my class.

I am going to use two virtual machines, both running Ubuntu Desktop. First step is installing bind9.

# apt -get install bind9

The test domain will be “etg.local”

  • Master dns:
    • IP:  192.168.7.1
    • name: dns1
  • Slave dns:
    • IP: 192.168.7.2
    • name: pc02 (with dns2 CNAME)

Be careful with using underscore on names.

MASTER

We are going to start by editing /etc/bind/named.conf.local, to define our zone. I am going to define just one zone. You may want to define also a reverse zone.

named.conf.local

named.conf.local

Notice that the “type” of this host is master, that is important. We also can see that I used absolute path to the file, because I did not specified any directory on the options.

Allow-transfer, allow-update and also-notify are allowing our slave dns to transfer the zone(s) file(s).

This is my zone file:

Zone file

Zone file

 

We must pay attention to thenames to be fully qualified if they include domain name, and both servers must be declared with NS register.

Finally we configure our DNS, this is my configuration file /etc/resolv.conf

/etc/resolv.con

/etc/resolv.conf

SLAVE

Here comes the tricky part, at least with Ubuntu Desktop.

First, we configure /etc/resolv.conf to be equally as in master. Search parameter must be “etg.local” and nameserver “127.0.0.1″

Now, we declare our zone, pay attention:

Zone declaration on slave

Zone declaration on slave

As you may see, we declared the type of this server as slave, and we set who is its master(s).

Now it should replicate our zone from master server, but it won’t until we do a couple more of steps to avoid errors of writing permission.

We have to edit the file /etc/apparmor.d/usr.sbin.named

Default usr.sbin.named

Default usr.sbin.named

We have to find the line highlighted in red.

r stands for read, read permission. So we can deduce that it does not have permission to write the zone, that is the because it gives us permission errors.

We change that line to this:

Modified usr.sbin.named

Modified usr.sbin.named

And the last step is giving all permissions to the the bind group in the bind folder:

# chmod -R 775 /etc/bind

Now we restart first the bind server of the master and then the slave with:

# /etc/init.d/bind9 restart

Then if we want to check the log file to see if everything went fine (slave):

# tail -f /var/log/syslog
Syslog

Syslog

I highlighted some important messages. It tells us that the zone transfer went fine. Now we finally take a look to our recently replicated zone file.

Note: In the next screenshot you will se that the serial is 2. You can transfer with serial, I just added another register (see www) to show you that it really works

Replicated zone

Replicated zone

 

And that’s all, it should work now.

Posted in DNS, Linux | Tagged , , , , , , , , , , , , , , , | Leave a comment

How to install MySQL 5.1 on Ubuntu

 

# apt-get install mysql-client-5.1 mysql-client-core-5.1 mysql-common mysql-server-5.1 mysql-server-core-5.1 mysql-admin mysql-gui-tools-common mysql-query-browser

With this packages we install mysql client, mysql server and some administration tools.

Packages to install

Packages to install

Later, we will be asked to set up a root password:

Asking for root password

Asking for root password

Be sure to remember that password.

Once it is installed we can run MySQL Administrator to manage our recently installed server.

MySQL Administrator Connection

MySQL Administrator Connection

It’s highly recommended to create other user to work

Creating a new user

Creating a new user

With MySQL Administrator you also can manage backups or check server’s health for example.

And finally, with MySQL Query Browser you can que to your server; create new databases, insert values, sql queries, etc.

Creating a new database with Query Browser

Creating a new database with Query Browser

 

Posted in Databases, Linux, MySQL | Tagged , , , , , , , , , , , | Leave a comment

Active Directory – Concepts.

Active Directory is the central repository of information on a Windows 2003 based network. It stores information about all resources that are used on the network, like user and group accounts, shared folders, computers, printers, etc.

Active Directory can be used to locate this resources quickly so that Administrators can create, configure, delete and maintain them as needed.

Logical structure of Active Directory

  • Forest
    • A forest is a collection of domain trees linked together at their roots by transitive trusts
  • Tree
    • Also called a domain tree, a hierarchical grouping of domains beggining with a root domain and branching out to child domains. Must have a contiguous DNS namespace
  • Domain
    • The primary administrative boundary for WS2003 networks. Domains are named using DNS, and a tree consists of one or more domains hierarchically joined by transitive trusts.
  • Organizational Unit (OU)
    • Logical containers you can use to group objects in a domain for security and administration purposes. For example you can reflect your company’s geographical, organizational or administrative structure.
  • Object
    • A user, group, computer, printer, shared folder or anything else which can be contained within a domain or OU.
  • Trust
    • Secure communications between domains, domains trees, or forests

 

Posted in Server 2003, Windows | Tagged , , , , , , , , , , , , | Leave a comment

Tip: How to empty Trash automatically at the start

This is an easy and fast tip.

We have to set up a cron job:

$ crontab -e

And then we only have to write this line:

@reboot rm -rf ~/.local/share/Trash/files/*

And that’s it, on each reboot, Trash will be emptied. I tested this on Ubuntu and Fedora.

Posted in Linux | Tagged , , , , , , , , , , , | Leave a comment

Introduction to Yum package management.

Yum is the package manager of Fedora.It is able to install, remove, update and query packages.

First of all, if you want to work with Yum, you have to have superuser privileges, so we first log in as root:

$ su -

Updating packages

If we want to check if there are updates, we can use the next command:

# yum check-update

Easy, isn’t it? Next step, is update packages. We can choose whether update all or just a single one.

Updating everything:

# yum update

Updating a single one:

# yum update packagename

# yum update google-chrome-stable

We are also able to make queries to find our desired package.

# yum search term1 [term2 term3 termN]

If we want to list available packages we can use:

# yum list available

To list installed packages:

# yum list installed

To retrieve information about a package we use:

# yum search packagename

To install a package:

# yum install packagename

And to remove:

# yum remove packagename

 

Yum is a quit powerful package manager, with a good and clear syntax.

Posted in Linux | Tagged , , , , , , , , , , , | Leave a comment

Functions: How to return more than one value.

We cannot return two variables from a function, but we could use an array for that.

So for example, in JavaScript, it would be like this:

function foo() {
	// do something here
	// whatever
	return [myvalue, myothervalue, otherthing];
}

And then, for use those values:

foo()[0] // this is myvalue
foo()[1] // this is myothervalue
foo()[2] // this is otherthing

This can be applied to any other language  you may know. And that’s how we return more than one value from a function

Posted in Programming | Tagged , , , , , , , , , , , | Leave a comment

Enable “delete key” on GNOME3 (Fedora 15 and Ubuntu 11.04)

By default, we can’t delete files in Nautilus 3 with delete key, as we did always, because it’s deactivated.

For  enable this on Fedora 15, go to terminal and write this down:

$ gsettings set org.gnome.desktop.interface can-change-accels true

Then go to a nautilus window, click on Edit menu and put the mouse over (don’t press, only hover) ”Delete” and press delete key. You will see the new shortcut at the right.

Once you’ve done it, I recommend to turn it off again:

$ gsettings set org.gnome.desktop.interface can-change-accels false

If you use ubuntu you can use dconf-editor. Press ALT+F2 and write dconf-editor and then follow this path: org > gnome > desktop > interface and check can-change-accels.

Then, do the same as in Fedora, but you may have to hit the key twice.

Don’t forget to uncheck the box for preventing changing other shortcuts.

Posted in Linux | Tagged , , , , , , , , , , | Leave a comment

Changes in the blog

Hi all.

As you have noticed, I have changed the theme giving the blog a more professional look. I also have decided to write in english, so more people will be able to read the blog.

Furthermore, is quite important in the technology world. English is also my favorite language, so in this way I will practice it more to get better.

Posted in Uncategorized | 1 Comment

Cambiar la contraseña de un usuario en MySQL.

Para cambiar la contraseña de root, podemos hacer:

# mysqladmin -u root -p’contraseñaantigua’ password ‘nuevacontraseña’

También podemos cambiar con una sentencia SQL:

$ mysql -u root -p

mysql> use mysql;

mysql>UPDATE user SET password=PASSWORD(“nuevacontraseña” ) WHERE user=’adrian’;

flush privileges;

Utilizamos la base de datos mysql, y actualizamos el usuario que queramos. Después el comando flush privileges sirve para recargar los privilegios.

Posted in Databases, MySQL | Tagged , , , , , , , , | Leave a comment