February 09, 2012 by Dave
    

Ubuntu's Unity Interface has many handy features, one of which is a new launcher bar that supports Quicklists. Each launcher icon can have a customizable list of options that let you run the program however you want. Here's a quicklist for the popular webserver nginx.

Nginx 
Quicklist

  1. First, Install nginx-init-ubuntu.
  2. Add create a new file .local/share/applications/ named nginx.desktop and paste this inside:

    [Desktop Entry]
    Name=Nginx
    Comment=Nginx Webserver
    Exec=sudo service nginx start
    Icon=/usr/share/icons/nginx.png
    Type=Application
    Categories=Web;Servers;
    StartupNotify=true
    Terminal=true
    #OnlyShowIn=GNOME;Unity;
    X-Ubuntu-Gettext-Domain=nginx
    X-Ayatana-Desktop-Shortcuts=Start;Stop;Restart;
    
    [Start Shortcut Group]
    Name=Start Nginx
    Exec=sudo service nginx start
    TargetEnvironment=Unity
    
    [Stop Shortcut Group]
    Name=Stop Nginx
    Exec=sudo service nginx stop
    TargetEnvironment=Unity
    
    [Restart Shortcut Group]
    Name=Restart Nginx
    Exec=sudo service nginx restart
    TargetEnvironment=Unity
    
  3. Using your file manager (such as nautilus), drag .local/share/applications/nginx.desktop to the launcher.
0 Comments


January 26, 2012 by Dave
    

For those of you using nginx and debian-based distributions such as Ubuntu, Mepis, Mint, etc. you may have noticed that the init script on nginx's wiki doesn't work very well with newer distributions such as Ubuntu 10.04/11.10, etc. Instead, let's use upstart, which is much cleaner.

First, add this to /etc/init/nginx.conf:

description "Nginx HTTP Server"

start on filesystem
stop on runlevel [!2345]

respawn
exec /opt/nginx/sbin/nginx -g "daemon off;"

Note: By default, this script thinks nginx is in /opt/nginx. If your nginx configuration is different, change it to specify the correct location.

...now start 'er up:


$ sudo start nginx
nginx start/running, process 11922

That's all there is to it. You can fork this script over at github if you want to make any changes or suggestions. This repo also includes an old System V style script if you need it.

Kudos

This script is based off of Big Rock's upstart script from their RVM + Rails 3 + nginx + Phusion Passenger guide.

* Updated 2012-04-10: Added upstart instructions

0 Comments


January 23, 2012 by Dave
    

For those of you Linux users using Gnome, KDE, or Unity, here's a desktop entry file that you can use to create a shortcut/launcher icon to Aptana Studio 3. Just add this to /usr/share/applications or ~/.local/share/applications.

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Name=Aptana Studio 3
Comment=The professional, open source development tool for the open web
Icon=/opt/aptana-studio-3/icon.xpm
GenericName=Aptana Studio
Type=Application
Exec=/opt/aptana-studio-3/AptanaStudio3
MimeType=text/plain;
Categories=Development;IDE;

This assumes you've installed Aptana to /opt/aptana-studio-3, so if yours is in a different directory, be sure to change it.

Kudos

Credit goes to Willington Vega for supplying the original desktop entry file. 


0 Comments