Install Xdebug php debugger on WebFaction

Web Development — Mark @ 11:23 pm

This post will detail how to install Xdebug on a WebFaction hosting account:

http://docs.webfaction.com/software/php.html contains useful information but may be inaccurate depending on which version of PHP your application is configured to use.

1. Unpack the tarball: tar -xzf xdebug-2.x.x.tgz.

2. cd xdebug-2.x.x

3. Run phpize – the command for this will depend on which PHP version your application uses. For example, in your Domains/Websites > Applications, if your web app is using PHP 5.4 your phpize command will be phpize54 located in /usr/local/bin

4. ./configure –enable-xdebug –with-php-config=/usr/local/bin/php54-config

5. Run: make

6. cp modules/xdebug.so /home/<username>/modules

7. add the following line to your web application php.ini (/home/<username>/webapps/<webappname>/php.ini:
zend_extension=”/home/<username>/modules/xdebug.so”

8. Verify installation by creating a phpinfo.php page containing “<? phpinfo(); ?>”. Load it in a browser and
look for the info on the xdebug module. If you see it, you have been
successful!

Python development on Windows – Setuptools & Pip configuration

Code,Web Development — Mark @ 9:42 pm

Sometimes installing Python modules on Windows is a pain. You have seen the setuptools error message complaining that you don’t have Visual Studio 2003 installed? Yes, well then you have probably seen that the fix is easy:

python setup.py build –compiler=mingw32 install

But what if you want to install using easy_install or pip? or you want to use a pip requirements.txt file in a virtualenv? I have the solution for you.

First: Install MinGw including gcc, make and all the other regular goodies you would have on a Unix system.

Second: Add your \MinGw\bin directory to your path.

Third: If you are using an older version of Python (pre 2.6.6) you will have to manually set your HOME environment variable to your user directory…

Nginx Spawn-fcgi script for Debian

Web Development — Mark @ 3:50 pm

Looking for a script to manage fcgi for you? Props go to SaturnBoy for his script found at http://saturnboy.com/2008/10/nginx-init-script/

#!/bin/bash
BIND=127.0.0.1:9000
USER=www-data
PHP_FCGI_CHILDREN=15
PHP_FCGI_MAX_REQUESTS=1000
PHP_CGI=/usr/bin/spawn-fcgi
PHP_CGI_NAME=`basename $PHP_CGI`
PHP_CGI_ARGS=”- USER=$USER PATH=/usr/bin PHP_FCGI_CHILDREN=$PHP_FCGI_CHILDREN PHP_FCGI_MAX_REQUESTS=$PHP_FCGI_MAX_REQUESTS $PHP_CGI -b $BIND”
RETVAL=0
start() {
echo -n “Starting PHP FastCGI: ”
start-stop-daemon –quiet –start –background –chuid “$USER” –exec /usr/bin/env — $PHP_CGI_ARGS
RETVAL=$?
echo “$PHP_CGI_NAME.”
}
stop() {
echo -n “Stopping PHP FastCGI: ”
killall -q -w -u $USER $PHP_CGI
RETVAL=$?
echo “$PHP_CGI_NAME.”
}
case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo “Usage: php-fastcgi {start|stop|restart}”
exit 1
;;
esac
exit $RETVAL

Nginx.conf from

http://elasticdog.com/2008/02/howto-install-wordpress-on-nginx/

Python – Convert a Dictionary to a List

Code — Tags: — Mark @ 9:53 pm

We can easily create a Python list by pulling only the values out of a dictionary. This is done via the values() method.

>>> x = {‘a’:1, ‘b’:2}
>>> x
{‘a’: 1, ‘b’: 2}
>>> y = list(x.values())
>>> y
[(1), (2)…

The Ultimate DNS-323 Setup: Part 1 – Router Configuration

DNS323 — Mark @ 2:00 pm

Before you begin messing around with a new home server it is important to understand a few things about how your home router operates.

Your router is typically your only device with a direct connection to the internet. All your other devices connect to the internet through the router. Webpages on the internet cant really tell the difference between your computer or someone else’s in your house. The router takes care of figuring out which of your networked computers requested what from the internet.

Static DHCP

Each of you computers attached to the router is typically assigned an IP address from the router itself through a protocol…

The Ultimate DNS-323 Setup: Part 4 – Mulitple Ways To Control Transmission Remotely

DNS323 — Mark @ 3:57 pm

Transmission Web Interface

Transmission comes with a fantastic web interface built in. The web interface is sometimes referred to as Clutch, which was the name of the web interface project before it was included officially with Transmission.

While transmission-daemon is running on the DNS-323, you can access the web interface by:

http://<DNS-323 IP>:9091 or in my specific case http://192.168.1.5:9091. It is important that you assign you DNS-323 a static IP (easiest to do on the router) so this IP address does not change.

Transmission Remote .NET

This interface is for Windows machines and is very similar to operating uTorrent. The webpage for this project can…

The Ultimate DNS-323 Setup: Part 3 – Transmission Installation & Configuration

DNS323 — Mark @ 3:55 pm

Installation of Transmission BitTorrent Client

From your desktop computer, visit http://www.transmissionbt.com/download.php. You are not looking for an official package; you are looking for the source code. Right click on the bz2 version and click ‘Copy Link Location’. SSH to your DNS-323 and using an unprivileged account, use wget to save the source code on the device (anywhere).

Example: wget http://download.transmissionbt.com/files/transmission-2.04.tar.bz2

Extract the source code: tar -jxvf  transmission-2.04.tar.bz2

Change dir to the source and build the program:

cd transmission-2.04

./configure –enable-daemon

make

As root or by using sudo:

make install

Transmission should now be successfully installed.

Configuring Transmission for Remote Control

To configure Transmission we will first launch it so it will create…

The Ultimate DNS-323 Setup: Part 2 – Debian Installation

DNS323 — Mark @ 3:52 pm

By the end of this guide you will have

-A fully stable and remotely operable BitTorrent client on your DNS-323. I will show you how to setup 1) A remote web interface and 2) A Windows desktop application that is very similar to uTorrent that can remotely control and monitor your torrents.

-Have your DNS323 download torrent files for you with a single click and without using anything but the Firefox web browser.

-Have your DNS323 automatically extract RAR archives after they are downloaded.

-Store and maintain your torrent downloads on the DNS 323.

-Stream videos and movies from you DNS 323 to your Xbox 360 or Playstation 3 (or similarly compatible device).

New Design

Blog — Mark @ 1:56 pm

Glad to have a new design that isn’t shared by half the web!!

Expect an update very soon with a new guide regarding DNS323, Debian and Transmission BitTorrent…

3 Awesome Firefox Add-ons your probably not using but should

Personal — Tags: , — Mark @ 9:19 pm

Over the past year I’ve flip-flopped through all the major web browsers (IE excluded). I used Firefox exclusively for years, had several month long affairs with Opera and finally settled using Google Chrome (or SRWare Iron) since its release. Over the past couple months however I have gone back to Firefox. The usability that can be gained through the use of extensions makes all other stock browser features moot. The extensions on this list are now on my required plugins list but you wont find them on your standard ‘Essential Firefox Add-ons List‘.

1. Omnibar

In order for me to ditch Chrome (and I did try a few times), I had to have the single bar for search and urls. It is such a basic…

Next Page »
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2014 Mark Stahler – Blog | powered by WordPress with Barecity