August 2010

archive

setting a default virtual host in nginx Aug
20
1
0

If there are multiple conf files included in the sites-enabled directory you can set the Nginx server to default to a particular site by adding a listen directive:

server {
listen 80 default;
... }

comments

install and remove .deb packages in ubuntu Aug
20
1
0

You can use the <dpkg> package manager to install downloaded .deb packages on Ubuntu and other debian-based systems.

To install a package pass in the -i flag:

sudo dpkg -i <package.deb>

You can list installed packages with the -l and an optional pattern:

dpkg -l <optional pattern>

This list can be quite long, so it might be helpful to redirect the output into a file.

dpkg -l > dpkg.txt

Use -r to remove a package.

sudo dpkg -r <package>

-r uninstalls the package, but it leaves any configuration files in place so if you ever install that package again it'll already be initialized.

To remove all associated files use -P to purge all the data for the desired package.

sudo dpkg -P <package>

comments

getting the browser to detect rss and atom feeds Aug
17
1
0

When writing sections that has periodic updates, like a blog, it's commonly requested to create an rss or an atom syndication feed for the section.

I develop with Django, and fortunately it comes with a great and easy to use syndication feed framework out-of-the-box to automate much of this process. However, the documentation doesn't talk about how to get browsers to automatically detect that a feed is available so that the syndication feed icon automatically shows up in the user's browser.

The technical term for this is "autodiscovery", and not surprisingly it's easy to implement.

All that needs to be done is to add something similar to this into the <head>  of your HTML page for RSS:

<link href="http://www.example.com/blog.rss" rel="alternate" type="application/rss+xml" title="<title>"/>

or for ATOM:

<link href="http://www.example.com/blog.atom" rel="alternate" type="application/atom+xml" title="<title>"/>

comments