TeeWars

It’s a very fun fast game, inspired by the FPS (First Person Shooter) games. It’s a multiplayer game, so you can play it via the Internet or LAN. The rules are basically winning the opponent team and eliminating all its opponents.

It’s still in an early version but it’s quite stable already.

This game is not in Ubuntu repositories, so you’ll need to download the .deb file:
http://www.getdeb.net/app.php?name=TeeWars

Homepage:
http://www.teewars.com/

Read more...

Turn pdfs into text files

Sometimes we want to study certain pdfs, but their organization and/or formatting is not appropriate. There are several ways of solving this problem, for instance, you can edit or extract the text.

There’s a program called pstotext, whose aim is to remove the text from PostScript files, through the interpreter of those files, called GhostScript.

The installation is very easy, as usually in this Blog:

Install pstotext.


Its use is also very easy. Write in the terminal:

pstotext -output final.txt original.pdf


original.pdf, is the file from which you want to withdraw the text and final.txt is the file which will be created. Note that if you don’t add the parameter -output, the final file won’t be created, but presented in the terminal.

There are other tricks that can be done with this program, for example, seeing the pdf file in the terminal (with the help of the programme less):

pstotext original.pdf | less


Removing a header from a pdf file, and saving it in a text file is also possible by using the grep programme, which according to the parameter searches the lines with that word:

pstotext original.pdf | grep -v "Copyright"> final.txt


Explanation: the grep -v parameter makes all lines appear except those which have the word "Copyright". The "> file.txt" makes what would appear in the terminal to be saved in final.txt file. Don’t forget that the command grep is Case Sensitive, therefore it distinguishes capital letters from small letters.

To search for a word in a pdf file just do:

pstotext original.pdf | grep "word"


To save the text of an Internet pdf file on disk, write:

wget http://name.of.the.site/original.pdf -O- | pstotext -output final.txt


This whole process is done in the terminal. To avoid this, I advise you to try the kword, which can open the pdf files, and then you can save in several file types such as .odt (same as .doc, but free), html, latEx, rtf, and many more.

Install kword.

Note that this program is for KDE, so in Gnome it's a bit slower opening.

Read more...

How to download HD trailers from Apple

The Apple website contains a significant amount of movie trailers. This site includes all the trailers of films which are reasonably well-known. It also provides, for most of them, trailers in HD (High-Definition) format which have a small protection to prevent the download of its content. Hence, I’ve created a script which downloads the trailers in High-Definition.

This kind of protection is basic: there’s a link-file which the user can open through QuickTime, for example, and that file has the name of the real video file. In fact, that video file has a small difference, it has a character add-on.

Thus, after a thorough analysis, I found out the small differences in each file and I’ve created this script. I’m going to publish two versions in this article: in the first one you can choose the HD quality: 480p or 720p or 1020p; while in the second one you can download in 720p quality. Most PCs have a resolution of approximately 720p (opportunity to say that if you want it with another quality you may ask).

So, the functioning of the script is simple: you run it and then it will ask you for the link of the film (you can put the direct link of the film, or the link to the page in HD of the film). After that, it will ask you the quality (the 720p version doesn’t have this option for the script), and it will immediately begin the download. In the end, if the file already existed it will indicate error. If you have successfully managed to copy the trailer, a message indicating success will be displayed. Note that all trailers which are available for that particular film are copied, in the chosen quality.

Aspects to be developed
Since the version is still in development, some small basic options are missing. Note:

1. It only tells you that the trailer already exists at the end of the download;
2. It doesn’t have a native progress bar, therefore, to see the progress, the script has to be opened in the terminal;
3. It only downloads HD trailers, so it doesn’t have the option of downloading trailers with lower quality;
4. It doesn’t include the option of choosing a specific trailer, it downloads all the trailers which are available for that particular film and resolution;
5. It could also be more compact, but since there isn't much processing, I didn’t care about the programming quality, but the practical results.

How to install it?

Its installation is simple: download the script file, open the terminal and go to the folder where you saved the file. Then, in order to make the script executable, type the following:
For the full version:

chmod +x appletrailers.sh


Or to 720p version:

chmod +x appletrailers720.sh


After that, the script is ready to be used, just do the following on the terminal to run it:
For the full version:

./appletrailers


Or to 720p version:

./appletrailers720


File download

Now that I’ve explained its functionalities and problems, I’m going to indicate the links for the download of the two versions and then I will show you the content of each script.

Full version.
720p version.

Code
Full version.

#!/bin/bash
####################################################
#Visit my blog: http://ubuntued.info/ #
####################################################


name=$( zenity --entry --text="URL:" --title="Apple Trailers")

temp=$(echo $name grep "/hd/")

if [[ $temp = "" ]]
then name=$(echo $name"hd/")
fi

quality=$(zenity --text="Which quality do you wish?" --list --radiolist --column sel --column sel2 1 480 2 720 3 1080)

if [[ $name != "" ]]
then
wget $name -File.html

case $quality
in
480)
action=$(cat file.html grep 480 awk -F"','" '{ print $10 }' awk -F"480" '{ print "wget " $1 "h480" $2 }')
;;
720)
action=$(cat file.html grep 720 awk -F"','" '{ print $10 }' awk -F"720" '{ print "wget " $1 "h720" $2 }')
;;
1080)
action=$(cat file.html grep 1080 awk -F"','" '{ print $10 }' awk -F"1080" '{ print "wget " $1 "h1080" $2 }')
;;
esac
rm file.html

action=$(echo $action awk -F"/" '{ print $NF }')
existent=$(ls grep "$action")

if [[ $existent = $action ]]
then zenity --question --text="You already have this trailer: \n \t (File's name: $existent ).\n Do you wish to continue?" exit

fi

$action sh

existent=$(ls grep "$action")

if [[ $existent = $action ]]
then zenity --info --text="Well-succeeded, the file was saved as $existent"
else zenity --error --text="Fail ocurred. Possible problems: The file already existed or the download couldn't be done."

fi

fi

Versão 720p.


#!/bin/bash
####################################################
#Visit my blog: http://ubuntued.info/ #
####################################################

name=$( zenity --entry --text="URL:" --title="Apple Trailers")

temp=$(echo $name grep "/hd/")

if [[ $temp = "" ]]
then name=$(echo $name"hd/")
fi

if [[ $name != "" ]]
then
wget $name -File.html

action=$(cat file.html grep 720 awk -F"','" '{ print $10 }' awk -F"720" '{ print "wget " $1 "h720" $2 }')

rm file.html

action=$(echo $action awk -F"/" '{ print $NF }')
existent=$(ls grep "$action")

if [[ $existent = $action ]]
then zenity --question --text="You already have this trailer: \n \t (File's name: $existent ).\n Do you wish to continue?" exit

fi

$action sh

existent=$(ls grep "$action")

if [[ $existent = $action ]]
then zenity --info --text="Well-succeeded, the file was saved as $existe"
else zenity --error --text="Fail ocurred. Possible problems: The file already existed or the download couldn't be done."

fi

fi

Finally, I would like to inform that whenever I update this script, only this web page will be updated, so if you want to be constantly updated leave a comment and activate the option "Notify me of follow up comments via e-mail." So when I update, I will write an informative comment about the new update and you’ll be notified (:

UPDATES
[2008 Jul 08]

As I have mentioned, I will update this script so that it becomes more effective, more embracing and with fewer errors. Thus, this new update informs you if the trailer you want to copy exists before downloading it.

Read more...

Adjust the transparency of window decorations

The special effects (Compiz) of ubuntu windows use the GTK by default. To adjust the transparency of the windows just go to the configuration editor of GNOME and change the values in the way you want.
1. Press ALT+F2 to open "Run Application";

2. Write gconf-editor and run;
3. Go to apps->gwd and you’ll find the following lines:

metacity_theme_active_opacity -> Value of transparency of the windows on which we are working;
metacity_theme_opacity -> Value of transparency of the windows which are behind.

Value "1" indicates "without any transparency"; value "0" indicates "maximum transparency" (other than invisibility).

Read more...

Find the quickest repository

Ubuntu offers a huge variety of repository servers. There are servers in many countries and many of these countries have more than one server. But, which one is the fastest?

There is an option which tests which server is the fastest to respond to our connection.

Procedure:

  • Go to Synaptic Package Manager (System-> Administration-> Synaptic Package Manager);
  • Settings->Repositories;
  • In the tab "Software Ubuntu" there’s an option which says "Download from". Click on it and then on "Other…";
  • A new window is displayed and you’ve just to click on the button "Select Best Server"

Read more...

Mount ISO files with just 2 clicks

Sometimes we need to use ISO files, but we don’t want to record a CD/DVD for that purpose. But mounting an iso file, without scripts, would be a little complicated for beginners, so it is best to install two scripts, one to mount and the other one to unmount.


You simply have to download the files mount and unmount and install them in the nautilus. If you don’t know how to install scripts, visit this link.

This information was taken from this site:
http://ubuntuforums.org/showthread.php?t=87369

Read more...

Increase Ubuntu speed with preload

Preload is a program which analyses the applications the user uses the most to subsequently predict what applications will be run. Therefore, it stores the dependencies of those programs in the computer’s memory, in order to be faster to boot up.

Install preload

For further information:
http://sourceforge.net/projects/preload

I strongly advise you to use this program!

Versão portuguesa

Version française

Read more...