Category: howto


HOWTO Gimp: seamless textures

A seamless texture

A seamless texture

Have you ever used a background texture in your projects, presentations, wep pages, etc.? Most of us did.

If you’re in a rush, and you need something quick, you can easily google it and find online some great resources for textures and patterns.
One for all, I could suggest subtlepatterns.com where there’s an incredible amount of high quality  tilable textured patterns, and best of all they are free to use (as long as you keep the proper credits!! Pretty fair, I’d say)

But you have another option: GIMP.
Yes, using this great free software you can have your own textures in just a few simple steps, and furthermore, making your textures seamless is just a click away!

Want to know how? Check this excellent tutorial from Vicki Wenderlich: she explains all the steps in a clear way, and she’ll easily lead you to your first seamless texture.

There may be a time, in your life, when you need to compare two text files on a linux server, and all you have is a CLI (Command Line Interface).  How can this be done? Well, it’s a pretty easy task (when you know how to do it!)

All you need is the diff command, and this is how you use it:

diff [first-file] [second-file]

Is it that easy?!? The answer is: YES!

So, for example, let’s say we have two style sheets on our webserver, style1.css and style2.css, and we want to compare them. We will use the following command:

diff style1.css style2.css

and this is what we’ll get in return:

140c138
< color: #999;
---
> color: #666;

What is diff trying to tell us? That line 140 of our first file (style1.css) contains the text color: #999; while line 138 of the second file (style2.css) is different and contains color: #666;.
Did you notice the < and > characters at the beginning of the lines? They indicate which file they refer to: < for the first file, > for the second.

If you have the chance to widen the window of your terminal (at least 126 columns), you may like the -y option, that will display a two column output, with the two files side by side:

diff -y [first-file] [second-file]

Output example of diff with option -y

Output example with option -y

In the process of exploring GIMP, trying to create new background textures for some future works, I came up with the following steps that usually give satisfying results (to me!):

1. first of all, create a new image with a solid colored background;

2. add some noise, using any of the following Filters:
-> Noise -> Casual (set a 5-6%)
-> HSV Noise (Holdness=2; Hue=3; Saturation=20; Value=20);

3. apply Filters -> Artistic -> Apply canvas (depth 3-5);

4. at this point, you can add some other Artistic filters, such as Oilify (mask dim.<8) or GIMPressionist (Paper=defaultpaper;  Scale=30;  Relief=6);

5. now create a new level;

6. choose a non-solid brush, set its opacity at 50% and start drawing casually on the new layer using a white color;

 

7. repeat pt. 5 and 6, this time using a black color;

8. now set these two last levels mode to overlay with an opacity of 50-60%.

There you go. Play with the settings of each filter, and you’ll probably come up with an interesting texture on which you can start creating your content.

 

 

First of all, let me start by saying I am not a professional graphics editor or such, so this how-to might be total nonsense to a pro. But it works for my goals.

That being stated, let me show you how to create a fancy background using GIMP and some simple techniques.

1. Let’s start with an empty image. Since we’re going to have a filled background, I usually start with a white layer

File > New… > 800×400 (or whatever size you need)

2. Now we can start and fill the layer using the blend tool.

Tools > Drawing > Blend

Set the mode to “Difference“, choose a multicolored gradient (anyone you like, as long as it has more than 2 colors; I’m going to use the “Shadow 3” preset in this example), set any form you like (linear, radial or else) and start filling freely, changing directions each time. This is what I get after drawing about 10-15 gradient lines.

using only linear gradients

using just radial gradients

When you’re happy with the result, you can jump to the next step.

3. Turn everything to black and white using the Desaturate tool.

Colors > Desaturate

Choose the options that give you the result you prefer (I have been using the Lightness option)

desaturated image

4. Now you can apply a last finishing touch using the blend tool again. This time change the mode to “Soft light” and use a gradient with a combination of soft colors.

Check the examples below.

example 1

example 2

example 3

example 4

A screenshot of Ubuntu 9.04 with GNOME 2.26.

Screenshot of GNOME on Ubuntu - Image via Wikipedia

At times it may happen that your graphical session on ubuntu freezes and you find yourself unable to do anything else. As a MS Windows user, the first thing that comes to your mind is a reboot of your machine, isn’t it? Well, in ubuntu you might have some other options. Let’s see some of them.

Option 1
If your Ubuntu is prior to 10.04, you can try the ctrl+alt+backspace combination. (note that this will instantly kill your X-windows, with all the programs running within it, like the window manager, and probably everything else, and it won’t ask you for any confirmation)
If your Ubuntu is newer than 10.04, bear in mind that the keystroke ctrl+alt+backspace has been disabled and replaced with alt+print screen+k.

Option 2
Using the command line (tou can try and switch to another tty using the Alt+Fn keys like Alt+F1, Alt+F2, etc., or you can use ssh from another machine), kill your graphical interface using the following commands:

/etc/init.d/gdm restart

note: depending on what you chose as a session manager, you might have to use “/etc/init.d/xdm restart” or “/etc/init.d/kdm restart” or, if you have the 11.10 version, try

sudo service lightdm restart

Option 3
Always from a command line, use the following procedure:

1 – retrieve the PID of your X server

ps -e | grep X

2- kill it

sudo kill PID_OBTAINED_ABOVE 
(example: kill 856)

3- restart it

startx &

 

Leave a comment if you think I’ve missed some better procedures.

Excel 2007 icon

Image via Wikipedia

There’s a nice feature in Excel (tested on Excel 2007 and 2010) that let’s the user directly copy some data (that can be cells, or a chart, or an object) and paste it as an image, whether in another Excel worksheet or in any other program. (n.d.r.: in previous versions of Excel, the same functionality could be achieved only using some lines of VBA code in a macro).

How to do that? Nothing easier:

  1. select the cells (or the chart or object) that you want to copy;
  2. in the Clipboard group of the Home tab, click the arrow below Paste, click As Picture, and then click Copy as Picture (you will be prompted to choose between some options, but I think they are quite straightforward to understand).
There you go, now your selection is in your clipboard, and you can use it wherever you want, on another Excel worksheet or in your favorite image editor program.

 

Reference: Microsoft online support: Create a picture from cells, a chart or an object

Recently one of my PuTTY sessions froze, and I decided to try and kill it using the command line, instead of simply closing the window.
This is the complete procedure:

  1. I opened another PuTTY session
  2. using the who command I found the name of the frozen TTY
    myuser@ubuntu:~$ w
    14:21:07 up 119 days, 12 min, 2 users, load average: 0.06, 0.05, 0.05
    USER  TTY   FROM        LOGIN@ IDLE  JCPU  PCPU  WHAT
    user1 pts/0 192.168.x.x 13:02  1:36  1.81s 0.10s sshd: user1 [priv]
    user1 pts/2 192.168.x.x 14:21  0.00s 0.46s 0.00s w
    myuser@ubuntu:~$
  3. using ps and grep i found its PID
    ps -u root | grep -i pts/0
  4. finally, I killed the blocked session:
    kill -9

To backup a single mysql database, use the following command:

:~$ mysqldump -u my_user_name -p db_name > backup_of_my_db.sql

If compression is needed, the command changes like this:

:~$ mysqldump -u my_user_name -p db_name  | gzip -9 > backup_of_my_db.sql.gz

To extract the compressed .gz file, use the following gunzip command:

:~$ gunzip backup_of_my_db.sql.gz