Author Archive

Getting around the “Media change: please insert the disk labeled..” message in Ubuntu

By marc • May 17th, 2008

So, sometimes when you try to run “apt-get install” on Ubuntu, you may get the following message:

 

Media change: please insert the disc labeled

 'Ubuntu-Server 7.10 _Gutsy Gibbon_ - Release i386 (20071016)'

in the drive '/cdrom/' and press enter

Of course this isn’t a real big problem when you are sitting right next to the computer. However, if it […]



How to set up a Wildcard (catch-all) Virtual Host in Apache

By marc • May 14th, 2008

Suppose that you need to set up a virtual host in Apache that catches all un-matched traffic coming in to your server. There are a number of uses for this, but the main idea is that you have a number of other virtual hosts set up, but you want anything that doesn’t match those to […]



Get a PHP Script’s Own Linux PID (Process Id)

By marc • May 14th, 2008

Previously, I wrote this article on how to check the status of a known system PID from PHP. I figured that I would follow it up with another short article on how to determine the process id of a running PHP script from within itself. Many google searches seem to have led people to the […]



Symfony Bulk Update with Propel

By marc • May 12th, 2008

Here is a quick example of how to do a bulk update with Propel within symfony. This is based on this code snippet on the symfony site. I thought it was extremely useful, so I wanted to post it as an easy reference for myself and others.
Suppose we had a query which looked like this:

 

UPDATE […]



Append Revision Number to CSS and JS Includes in Symfony

By marc • May 7th, 2008

I’m sure many of us have had a similar experience such as the following. You push out a kick-ass update to a client’s website full of brand new design changes to the main.css file or some funkalicious AJAX features to your javascript files. However, later in the day you get a frantic call from the […]



Store Symfony Sessions in Database with Doctrine

By marc • May 4th, 2008

Here is how you can store your sessions in a central database with Doctrine in symfony. If you are trying to do this with Propel, the check out my follow up post: Store Symfony Sessions in Database with Propel
Step1 - Create your sessions table

 

CREATE TABLE IF NOT EXISTS `sessions` (

`sess_id` varchar(64) NOT NULL,

`sess_data` text NOT […]



Set a Static Ip Address in Ubuntu from Command Line

By marc • May 1st, 2008

A common task that you will need to do on a Ubuntu/Debian server is set a static IP address. By default the ip address is set through DHCP, so you will need to change that.
First edit the /etc/network/interfaces file:

 

sudo nano /etc/network/interfaces

Change your file so that it looks similar to the following, but replacing the specific […]



How to Use Symfony and Cron

By marc • Apr 30th, 2008

At some point you may need to have your symfony do some sort of process through the command line and trigger it through a cron job. I’ll will walk you through the steps in order to get it working properly.



Return MySQL Results from an “IN” Query in the Correct Order

By marc • Apr 29th, 2008

The scenario:
You have a list of ids in a particular order that you want to search for in a MySQL table. Perhaps the ids were returned in this order from a search index or something else. Whatever the case is, now you want to get the results in the same order as the ids that […]



Check if Linux Process is Still Alive from PHP

By marc • Apr 28th, 2008

At some point you may need to figure out if a system process is still running from within a PHP application. The secret is by running a system command from PHP that returns the information for a specific process id (PID).
The normal shell command would be something like this:

 

$ ps 4946

Which would return something like […]