User login

Stefan Freudenberg

Preventing code calling external web services from slowing or stopping display of your site

I think the best way is probably AJAX.

Using curl which takes a timeout argument is also possible.

http://php.net/curl

In Drupal 7, better to use drupal_http_request().

http://api.drupal.org/api/drupal/includes--common.inc/function/drupal_http_request/7

Completely undo commits and history that should never have been

This fix is being done from a remote repository, because stuff was pushed there that shouldn't have been. However, this repository is only supposed to be cloned and not pushed to (one way one time), so we can destructively set it back to the way it should be.

cd /srv/git/agaric/siteproj.git
git reset add42b74103a4c756d7d55c4abf3d5b0ff914b0c

where that is the last good commit.

And that's it.

File this under do not do this at home.

Upgrading Drush from 2 to 3 with lenny

As root:
aptitude
Find drush under PHP.

At the bottom of the information about the drush package, there's an i that means installed next to 2.0 and a p that means no packages or config files or anything are present next to drush 3.3.

Type + when the drush 3.3 line is highlighted.

Then type g to upgrade (twice, first it takes us to a confirmation page).

Note: On Agaric's servers the package list is updated daily by a cron job, but updating the package list can be invoked by hitting u if necessary.

Manually setting up fcgi wrapper permissions

ssh root@agaric-prod
vi /home/members/agariclabs/sites/agaric.com/.red/apache2/apache.conf

Add these two lines inside the VirtualDirectory:

        FCGIWrapper /home/members/agariclabs/sites/agaric.com/bin/php-cgi .php
        SuexecUserGroup agaric agaric

Then copy the bin directory with php-cgi in it from another project and set the permissions to the same user group defined there.

Using a debugger

To open AJAX modal windows or submit forms while watching with a debugger

Start the debugger and go to the desired page once it has completed loading the first. Then go through the next run and submit the form. You stay in the debugger until you stop t. The only important thing is to complete all page loads in the debugger.

[Agaric-specific] Set up a Trac issue queue for a project

Visitors, please note that while Agaric-specific documentation may be informative to you, it is meant primarily for Agaric's internal use and is highly unlikely to work step-by-step without fulfilling an awful lot of dependencies first.

After setting up the project per Deploying the Agaric way, we can use our trac setup vlad task to do most of the work.

From within the project:

rake test vlad:setup_trac

Server blocking someone who should have access? Try etc/hosts.allow

Blocked and receiving an error "ssh: connect to host" "port 22: Connection refused", Stefan added the IP address where this was not working to the hosts allow file, and explained the system.

There's two relevant files: /etc/hosts.allow and /etc/hosts.deny

/etc/hosts.deny is updated by the denyhosts package based on attacks and suspicious behaviour. it can be overridden by /etc/hosts.allow

An entry consists of a service, such as ssh, and a number of IP addresses.

Export and re-import a database with Drush and the command line

These are run from the project's web root, example/web, so that drush can run, but the database itself is stored outside the web root, example/db.

On the export side:

drush sql-dump > ../db/development.sql

On the import side:

drush sql-connect < ../db/development.sql

expands to:

mysql -hlocalhost -uexample -pyMsx2rIP drupal-example < ../db/development.sql

Using Drush 3.1 by installing it in your local user directory

The version of drush in Debian is way behind. Drush 3.1 has been out for a month, Drush reached stable 3.0 on April 23.

Stefan was unsympathetic:

That does not mean the package is ready. What the upstream authors consider stable and the Debian community considers stable might be different things, too. Quality is Debian's top priority not up to date software. In addition to that it will only get into the next stable distro and maybe into the backports repository. In that case we get the upgrade automatically.

Syndicate content