user-avatar
Today is Wednesday
February 22, 2012

Archives: July 2008

July 20, 2008

Youtube web shortcut

by Thomas Capricelli — Categories: Gentoo, KDE — Tags: , , , 3 Comments

You all know the web shortcuts for konqueror, don’t you ? (like gg: or wp: when you want to use google or wikipedia in alt-f2 or konqueror).

Well, I find this really useful, but theres none for youtube (in kde 3 at least, I haven’t checked kde4 yet). This is really easy to do. Go in the settings dialog for web browsing, either from konqueror (settings/configure konqueror), or kcontrol / internet&network / web browsing / web shortcuts. Create a new shorctut using the URL:

http://www.youtube.com/results?search_query=\{@}&search_type=&aq=f

And you’re done. Happy youtubing!

how to configure a web shortcut for youtube

As a side note, I dont use konqueror for browsing, firefox is configured as my main web browser. But, strangely enough, when you use the web shortcuts or if you open a bookmark from the kicker “bookmark” applet, then the right thing is done and the page is opened in firefox. This brings web shortcuts to firefox as well, and I’m happy with that.

July 13, 2008

Linux, a second-class citizen in the PHP world

by Thomas Capricelli — Categories: Admin, Gentoo — Tags: , 5 Comments

PHP has the ability to send mails. Great. To do so, it can either connect to an external smtp server, or use a local MTA. Even greater!

But only on windows. As astounding as it sounds, the feature of using a smtp server is only available on windows : on linux, you need to install a full-blown MTA just to be able to send mails from PHP.

Consider the following quite common setup : you have a main vserver, hosting the MTA (postfix in my case), and a dedicated vserver for all those unsecured php-based web stuff. The natural thing to do would be to ask apache/php to send mail through the MTA on the main vserver. This is just not possible, even with the more recent php version.

You can try to use SSMTP or similar “relay only” MTA, but this wont work very well. They don’t relay headers well enough and for example the “From:” header wont go through.

The most surprising thing about it, is that the feature is here, but for some unknown reason, it is not made available under linux. PHP authors decided that linux would be a second-class citizen in the PHP world, and I don’ understand why it is so.

The solution I’ve finally used is to install postfix as a relay only, and NOT starting smptd (you need to comment out the line related to “smtpd” in the file master.cf). It would not be possible anyway, as the smtp port (25) is already opened on the main vserver (vservers share inet ports). The important steps for the configuration (main.cf) are :

  • relayhost = 192.168.0.1 # IP of your main postfix server
  • inet_interfaces = all #wont be used, but needed anyway
  • mydestination = # nothing -> everything is relayed

Once postfix has started, you can check that no port is opened (“netstat -anp | grep postfix”) and that mails actually go through (‘echo foobar | sendmail mymail@myhost.com’).

© 2012 Thomas Capricelli All rights reserved - Wallow theme v0.46.5 by ([][]) TwoBeers - Powered by WordPress - Have fun!