soledad penadés
repeat 4[fd 100 rt 90]

What package does this file belong to?

20090106 by sole

If you're messing playing around with some code, you probably have reached that point where you copy code from a tutorial but it doesn't compile because your system is missing an include file. And you don't have a clue of where to look for it, or maybe you have a clue but the package maintainers thought of a different naming for the package and it's very different from what you suspect it is.

But lament no more, for I just found a nifty utility for Debian based systems such as Ubuntu that is proving already very useful: apt-file. And I wonder how could I survive without it before. It's very simple to use: enter apt-file search the_missing_include.h in your favourite terminal session, and it will let you know which package(s) contain that cheeky .h.

For example, I was trying to compile a basic sample snippet for testing ALSA, and it has an #include <alsa/asoundlib.h> right in the first line. I crossed my fingers and hoped for that include to be already on my system, but I got this error instead:

alsa_test.c:1:28: error: alsa/asoundlib.h: No such file or directory

Where could the file reside? I guessed it could be in alsa-dev, but apt-file quickly proved me wrong:

$ apt-file search alsa/asoundlib.h
libasound2-dev: /usr/include/alsa/asoundlib.h

So that's it, asoundlib.h is in the package libasound2-dev.

Of course, you can install apt-file with apt-get or with synaptic package manager, as you wish. This is apt-cool! :-D

The irony of spam

20081219 by sole

As soon as I posted yesterday's analysis on eBay scams, I began to get a lot of pingbacks from quite suspiciously looking websites, with domains like ebayblog.info, ebay4you.info, etc… all of them using the .info TLD, which is one of the most commonly used by spammers as far as I have seen.

the irony of spam

So it seems they didn't have enough with parked domains with lots of AdSense ads on the front page, now they have devised some kind of ultraspeedy spider which might be crawling recent posts on certain topics and then stealing the content to feed their domains. Just look at the post id's they are handling: 19574, 23288… it's humanely impossible to write as many articles in domains that young, even if you are so damn verbose! (On second thought: maybe Scobleizer could do that…)

I guess they are using technorati or google blog search to perform a periodic, automated search, although I have seen what looked like robots with strange user agents accessing my domain sometimes and they might be the same kind of content thieves.

But you can't do much when your stuff is online, other than hoping that people are clever enough to distinguish the good source from the bad one :D

eBay scams

20081218 by sole

Everything began with this scam, which I received several times. I kept copies just for the sake of observing what would follow. Since you know, once s(c|p)ammers get your e-mail address, the rubbish stream won't stop flowing:

The missing 'Sony Vaio PCG-VGX Brand New'

Hi again, i have no laptop from you by now if i don`t get an answer in 24 hours i will report you to eBay , PayPal and Police.

The user name was 361jaraldo, obviously totally automated. It surprised me at first since I had never received any fake eBay email like this before, but it was easy to spot it was false. Not only because I hadn't sold any Sony Vaio that I don't own, but also because real eBay emails include your name on them. This one didn't.

What made me laugh was the menacing writing style: he would report to eBay, PayPal and Police!! Yeah, I'm truly frightened!!

Gold lock and key pendant necklace

This one deals with something that I would never ever own or try to buy, it just sounds so blingy-blingy that if it wasn't because I'm sitting on a window inundated by the Mediterranean sun at its best, I would be already shivering.

findingaldo has opened an Unpaid Item case for GOLD EP LOCK AND KEY PENDANT NECKLACE 16-18 SNAKE CHAIN(#250319773021).

Please pay for the item or respond to the seller before Nov-29-2008. If you do not take any action, the seller can choose to give you an an Unpaid Item strike and your account may be suspended as a result.

Ohhh yes I'm sooooo scared! And look at the name: findingaldo. It reminds me to that Waldo Geraldo Falko which used to show up at Bel Air's Prince series.

Plasma TV

This is the latest I got, and it is specially funny considering I don't own a TV and the last thing I would do if I wanted to get rid of one would be selling it in Ebay. The packaging and shipping costs to make sure it arrived without damage would be astronomical!

Please get me back to me as soon as you can with further information about the shipping of the plasma tv that i have bought from you. I am looking forward to get your reply. Thanks in advance !!

But… what for?

I wonder what's the purpose of these e-mails. I mean, the Nigerian-style scams make sense in a way, the Viagra, levitra and tramadol spam emails also make sense in a way, but getting urged to contact someone regarding an item that you don't own and consequently can't sell, or its shipping costs, doesn't make any sense to me. Unless they want to harvest e-mail addresses of ingenuous people, which in that case it does make totally sense.

Why aren't we all using SFTP, HTTPS, SSH et al?

20081216 by sole

Were you to decide, what would you choose?

  • FTP or SFTP?
  • Plain e-mail or signed encrypted mail?
  • e-mail over an unsecured connection or using TLS encryption?
  • BitTorrent unencrypted or encrypted connections?
  • use your default e-mule port number or change it?
  • http or https?
  • telnet or SSH?
  • automatic log-in or having to enter your user name and password for accessing your own computer?

When faced with choosing one or another technology, and unless there are bigger restrictions, we instinctively try to opt for the easiest one, in all terms (time/money/learning curve). Secure/private options tend to require more time for setting up and configuring, testing and learning. Sometimes the difference between unencrypted and encrypted can even be noticed, as in computer resources required for encrypting, which makes us label the encrypted version as "slower".

For example, an FTP connection is usually faster than an SFTP one. I understand that's due to the way SFTP works (opening an SSH connection each time a file is due to be transferred and then sending the contents, instead of reusing the same connection like FTP does). Therefore, a normal user which is forced by their hosting provider to use SFTP simply deduces that SFTP is slower and misses old good FTP-based hosting.

Another example, getting your e-mail via an encrypted connection (TLS) shouldn't be noticeably slower than via an unencrypted plain one. Unfortunately, some ISPs decided it was a good idea to systematically throttle the speed of anything which is not HTTP traffic and other most common protocols, and hence using TLS is painfully slow, even timing out and forcing people to use unencrypted connections, for the sake of simplicity and being able to get the job done.

Now, were the secure methods easier to use, I'm pretty sure they would be the default option, not an extra could-be-nice-to-have-but-it's-fine-if-missing feature. If SFTP was the default set up in shared hosting, you wouldn't stop for a minute and wonder: "hold on — is my data valuable enough so that I do not want someone else to have a peek at it while I'm uploading to my web server? Should I spend X hours trying to enable SFTP instead of uploading my stuff right now?". And the same principle applies to the rest of technologies.

Taking into account the current state of affairs in what regards to subjects such as the war on terror (or how to think of a reason for criminalising every citizen before they are even born) or Phorm (or how several British ISP's, including BT, are trying to suck still more money from their subscribers by data mining their traffic and serving contextual ads for their profit, using technology developed by a company with spyware background) and all that, it sounds to me like a very good idea to begin switching to the safer alternatives. In fact, it seems that it is the most sensible thing to do.

Add SVN support to your Eclipse installation

20081210 by sole

Surprisingly, Eclipse comes by default with CVS support only, which is not very use(ful|d) at this point. You can do all your SVN duties from outside Eclipse, using something like kdesvn, TortoiseSVN, etc, but it is really powerful to be able to do everything from Eclipse. Specially for comparing between versions, checking the changes on one file, etc, it's really handy.

Unfortunately, the installation procedure is horrible and confusing. So no wonder everybody just opt for using external tools. I have installed it several times in several computers and using different operating systems, and I always forget how to do that. But this time I decided to write it down so that not only I can remember how to do that, but also people who are using Eclipse with FDT, Flex, etc… can benefit from SVN without having to resort to external tools.

I will use Eclipse Ganymede which uses a slightly different naming for installing new features, but you will probably find your way if using an older version of Eclipse. If not, just post a comment and I'll try to help :-)

A bit of background

(aka Why can't I just select a new feature to be installed and have it Just-Working?)

It seems that because of bizarre licensing problems they can't distribute the whole feature in just one file, but they had to split the SVN support in two parts: the plug-in itself, which talks to Eclipse and that is distributed from the Ganymede update site, and the SVN Connector, which deals with the SVN server and all that, and is NOT distributed from the eclipse servers, but from Polarion.

So that's why the installation process is somehow divided in two parts.

Installing the plug-in

Go to Help — Software Updates — Available Software

Enter "svn" in the field which says "type filter text".

When it shows the matches, check the feature called "Subversive SVN Team Provider"

Click Install…, and then Finish.

It might ask you to restart the workbench; you can do that if you feel better that way.

Installing a connector

Wooohoo! You have the Team Provider installed, but it is absolutely useless without a connector. Let's install one. Where do you get connectors from? Good question. Somewhere in Eclipse literature you can find a link to this page, which provides links to update sites which will enable you to download one of these mysterious connectors.

What really matters here is that the update site url is http://www.polarion.org/projects/subversive/download/eclipse/2.0/ganymede-site/

Copy and paste that link and in Eclipse go to Help — Software Updates — Available Software

Click on Add site…, and paste the url you just copied. Accept and it should load the available installable features at that location.

Check the following two:

  • Subversive SVN connectors
  • SVNKit 1.2.0 Implementation

and click Install…, and Finish.

Now it would be a good idea to say yes when it asks you to restart the workbench.

Selecting the connector

Not only do you have to install the connector, you might need to tell Eclipse that you want to use the connector. Just for being safe, once you have restarted the workbench, go to Preferences — Team — SVN — SVN Connector.

And make sure that SVNKit 1.2.0 is selected.

Using SVN in Eclipse

You might probably be wondering how to use this fantastic thing now. Well, you obviously need a SVN repository to begin with, but if you've followed until here, you know what we are talking about. So let's create a project to show how to start using SVN here.

Right click over the Project Explorer and select New… — Project… from the pop-up menu. You should have a new option for SVN in the project types list. Open the SVN folder, highlight Projects from SVN and click Next.

Now enter the SVN repository details, which you should already know: the url, user, password, etc. If you don't use the classic trunk/branches/tags structure, you can deactivate that from the Advanced tab, if you uncheck the "Enable structure detection".

Once you're content with the folder and everything, it will ask you for which resources to check out as a project. And it will show you the repository tree for you to browse and select the specific folder you want to check out. Select it, click Finish.

In the next window it asks you what to do, regarding the creation of the project. Check out as a project configured using the New Project Wizard is like creating a normal project from scratch with the typical assistant, only that it is prepopulated with the contents from the SVN repository location you just selected. This is very useful for creating PHP projects, or FDT projects, for example, so that the project acquires the appropriate nature and you get instant gratification from the beginning (i.e. source highlighting, auto-completion, useful contextual options, etc …).

You could also select Check out as a project with the name specified, which will then create a folder with the name you enter, in your current workspace. Very useful for checking different versions of the same repository (for example into your web_root) into the same parent folder, and modifying them in parallel.

Then click Next, change the workspace if you feel like that, and Finish.

Eclipse will check out things from the repo and set up the new project. If you look at it in the project explorer, it has the svn location right next to its name, to denote it is a svn project.

Comparing and reverting

There is more new stuff. Unfold the project to see all the files and open one of them. Edit it and change something, save it. Now go out, leave the computer alone and have a walk. You could also go to an ice rink, there are lots of temporary rinks open right now in London. If that's not your thing, you could also head for the pub, which is an all-time winner option. Unless you head hurts… Anyway, what was that thing you changed? You don't remember at this point, do you? Wouldn't it be great to compare it with the repository version? But we said we didn't want to use external tools, and we won't do that. Right click over the modified file (which has a ">" in front of its name, to denote it has been modified and has not been checked in yet) and select Compare with… Latest from repository. A new tab will open showing the differences between versions. You can even modify the version you changed, using the repository one as reference.

But what if you don't like those changes? Well, you could just wipe out everything by right clicking over the file and selecting Replace with … Latest from repository. Bam! it's gone, you can start from scratch again.

Checking things in (commiting)

Let's imagine you have been doing some work and now are happy with it and want to check that into the repository. It's a matter of right clicking over the changed files and selecting Team… — Commit….

If you have right clicked over a folder, it will show you which files from that folder will be included in the commit. This is your last chance for unselecting files you don't want to include.

On the other hand, if you have clicked over a file which is not yet in the repository, it will complain and say it's not under version control. In this case you need to manually add them first. Right click over the file you want to put under version control (which has a question mark over its icon to show it's not in SVN yet) and select Team — Add to version control…. It will then be included in the next check-ins.

Deleting stuff

This is a very common mistake we do when we do not understand how svn works. If something is under version control, NEVER EVER DELETE IT FROM THE FILE SYSTEM MANUALLY. You need to delete it via subversion. Fortunately, that is very easy with this plug-in: just right click over it and select Delete. Then you'll probably have to check in the parent folder, so that subversion registers the new state of the folder (i.e. this folder has now one file less). Otherwise you risk creating a little (or big, depends on your case) wave of chaos and confusion in subsequent commits and updates.

Updates

By the way, updating is as easy as right clicking over something and then selecting Team — Update.

This is only a very little demonstration of what you can do with subversive; the best way of finding out is to experiment with the different options there. Let me know if there is some area I could expand in this mini tutorial or if something wasn't clear enough, and I'll try to clarify. Happy SVN'ing!