13.9.17

Resetting a Brother HL-2240D toner error

You'd think that the only thing I do around here is save instructions on how to reset printers.

Here's how you reset a Brother HL-2240D, with TN-420 or TN-450 toner cartridges.

  1. Turn the printer off.
  2. Open the front toner/drum cover.
  3. Press and hold the Go button while turning on the printer.
  4. Release the Go button after the Toner, Drum, and Error LEDs turn on, with the Ready LED off.
    • At this point, all LED lights should be off. 
  5. Press the Go button 2 times. 
    • The Toner, Drum, and Error LEDs will turn on.
  6. Press the Go button:
    • 6 times for TN-420 cartridges.
    • 7 times for TN-450 cartridges.
    • At this point, the Error LED will start to flash.
  7. Close the front cover.
  8. Restart the printer.

These instructions were first found on 123inkcartridges, on Wednesday, September 13, 2017. I copied them here so I had access to them in case it ever left the web.

9.2.16

Simple DNS for VMs with Dnsmasq

I've found that when I'm testing tools on virtual machines that I've run into problems with host name resolution. While /etc/hosts works fine for many things, some tools (like Sitespeed.io) don't respect the entries there, and bomb out when trying to do DNS lookups on my vm network.


Dnsmasq to the rescue! It's pretty simple to set up, and while you can configure it to do things like DHCP and TFTP booting, all I want is to serve up DNS. The first step, of course, is to install it via your favourite package manager. I use CentOS, so I would use yum:



yum install dnsmasq

Once that's installed, a bit of configuration is all you need. All the configuration that we'll do takes place in /etc/dnsmasq.conf. Here's my configuration first, followed by some explanation.



/etc/dnsmasq.conf:
domain-needed
bogus-priv

domain=example.vm
expand-hosts
local=/example.vm/

listen-address=127.0.0.1
#listen-address=192.168.56.16
bind-interfaces

server=10.0.2.3
#server=8.8.8.8

First, we set a couple of network behaviour settings. domain-needed prevents plain names (those without a dot, or attached domain) from leaving your network, like if you searched for example instead of example.com. bogus-priv keeps addresses in non-routed space from being forwarded out to the Internet.


Next, we set the private domain name that you intend to use for your VM network with domain. I used example.vm here. expand-hosts instructs dnsmasq to automatically add this domain added to simple domains you've defined.


Now we can tell dnsmasq what addresses to listen on, with listen-address. In this configuration, I've left it as only listening to requests coming in on the interface bound to localhost, since I only needed it for one particular serve By adding additional lines, with the IP address assigned to other interfaces, you to provide custom DNS service for all of your VMs. bind-interfaces prevents dnsmasq from listening on other interfaces and just throwing away requests that it shouldn't really be listening to.


Finally, the server directive provides other name servers upstream, to forward DNS requests that can't be fulfilled by your local entries. This, again, can have multiple lines. I've set it here to use the DNS server provided by VirtualBox, but I could also set it to my ISP's server, Google's public DNS, or the OpenDNS servers.


I can hear you asking, though, where do we set the DNS names that we need? The beauty of dnsmasq is that it will read the entries you need out of /etc/hosts! Make sure that you include a line in there for localhost (127.0.0.1 localhost).


In order to make sure that you actually are accessing this, make sure to add a line to your /etc/resolv.conf file:



/etc/resolv.conf:

nameserver 127.0.0.1

Don't forget to enable and start the service in systemd. You'll probably need to update some configuration somewhere to make sure that this sticks, since resolv.conf is generally written automatically; this is left as an exercise for the reader (since I'm nearly done this article, and don't want to go figure it out at the moment. I'll update when I do.)






11.12.15

Installing PHP 7.0.0 from scratch on CentOS 7.1


PHP 7.0.0 came out in early December. Since I've been blathering on about building bleeding edge web server software, let's take it for a run. My favourite distro, CentOS 7.1, doesn't have it available in packages yet, so let's build it from sources!


Prerequisites


First, let's assume that you've gone ahead and got (Apache's httpd)[http://shaniber.blogspot.ca/2015/12/installing-apache-httpd-with-http2.html] installed. We did that earlier (link to last blog post) when we set up httpd with HTTP/2 support. If you haven't done that yet, go do it. It's important.


We need some softwares to compile PHP 7 against, so install them first:


yum install -y mysql-devel libxml2-devel bzip2-devel curl-devel libjpeg-devel libpng-devel freetype-devel libc-client-devel libmcrypt-devel sqlite-devel libedit-devel net-snmp-devel systemd-devel mariadb mariadb-server mariadb-devel libxslt-devel

Installation


Now grab the archive, extract it, and get to work compiling it.


wget http://ca3.php.net/distributions/php-7.0.0.tar.gz && tar xf php-7.0.0.tar.gz
cd php-7.0.0
./configure --prefix=/usr/local \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --enable-fpm \
        --with-fpm-systemd \
        --with-fpm-user=php \
        --with-fpm-group=www \
        --with-config-file-path=/etc \
        --with-config-file-scan-dir=/etc/php.d \
        --with-libxml-dir=/usr \
        --with-openssl=/usr/local/openssl-1.0.2d \
        --with-pcre-regex \
        --with-zlib \
        --enable-bcmath \
        --with-bz2=/usr \
        --enable-calendar \
        --with-curl=/usr \
        --enable-exif \
        --with-gd \
        --enable-mbstring \
        --with-mcrypt \
        --with-jpeg-dir=/usr \
        --with-png-dir=/usr \
        --enable-zip \
        --enable-ftp \
        --with-kerberos \
        --with-gettext \
        --with-xmlrpc \
        --with-xsl \
        --enable-opcache \
        --enable-mysqlnd \
        --with-pear 
make
make test
make install

Configuration


We'll set up php the new-fangled way, using FastCGI Process Manager, aka PHP-FPM. I mean, we've got that (server set up with HTTP/2)[http://shaniber.blogspot.ca/2015/12/installing-apache-httpd-with-http2.html] already, and we've got bleeding edge PHP 7.0.0, so let's go all the way, right? (Not really new fangled, PHP-FPM has been around for a while, but let's be honest, mod_php is generally how it's done.)


We defined a 'php' user during the configuration step for PHP to run as, so we should also create it:


useradd -g www -m php

This is just a basic set up, no VirtualHosts, everything right in the main httpd config, with a single pool of FastCGI processes wfrom which to serve PHP.


Set up PHP-FPM


In order to have httpd access PHP, we need to define a PHP-FPM worker. Based on our configuration above, we should find a default configuration file and directory in /etc. Here's a stripped down version of php-fpm.conf that works for me. Edit your file to match your environment. In this case, the php-fpm.log will end up /usr/local/log, so make sure that it exists, as well.


/etc/php-fpm.conf:
;; Global Options
[global]
pid = /var/run/php-fpm.pid
error_log = log/php-fpm.log
log_level = debug

;; Pool Definitions
include=/etc/php-fpm.d/*.conf

Now we need to set up the worker pool. There's varying opinions on the best way to do this, but we're just going to go with a basic dynamic set up for the moment. We can set up multiple pools to serve for different domains, and each must have a unique name, and must listen on a unique port. This will spawn several worker children once it's started up to handle requests.


cd /etc/php-fpm.d
cp www.conf.default example_com.conf

/etc/php-fpm.d/example_com.conf:
[example_com]
user = php
group = www
listen = 127.0.0.1:9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3
access.log = log/$pool.access.log
access.format = "%R - %u %t \"%m %r%Q%q\" %s %f %{mili}d %{kilo}M %C%%"
php_admin_value[error_log] = /var/log/fpm-php.$pool.log
php_admin_flag[log_errors] = on

php.ini configuration


Based on our configuration above, PHP will look for its main configuration file in /etc, and supplemental configuration files in /etc/php.d. Copy one of the versions (development or production) from .../{src}/php-7.0.0/. I'm using the development version. If you're installing this on a production machine, then use the production version.


cd /usr/local/src/php-7.0.0
cp php.ini-development /etc/php.ini

The php.ini file is huge, with numerous configuration settings. We'll just change a couple of settings to make it a little more useful, including setting a timezone, changing some memory limits, making the installation more secure, and enabling OPCache. Remember that if you modify ini settings in your pool config (like we did above), they'll override anything you set here.


/etc/php.ini:
disable_functions = exec,passthru,shell_exec,system,proc_open,popen
expose_php = Off
max_execution_time = 30
memory_limit = 64M
date.timezone = UTC
error_reporting = E_ALL & ~E_DEPRECATED
post_max_size = 5M
upload_max_filesize = 4M

opcache.enable=1
opcache.memory_consumption=64
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=7000
opcache.validate_timestamps=0 ;set this to 1 on production server
opcache.fast_shutdown=1

systemd configuration


Define a service that runs when systemd starts up. This file exists in your src directory, in php-7.0.0/sapi/fpm/php-fpm.service, but needs to be modified for your environment. (It feels like this should be installed automagically, but it wasn't for me). Copy or create it in /etc/systemd/system.


/etc/systemd/system/php-fpm.service:
[Unit]
Description=The PHP 7 FastCGI Process Manager
After=network.target

[Service]
Type=simple
PIDFile=/var/run/php-fpm.pid
ExecStart=/usr/local/sbin/php-fpm --nodaemonize --fpm-config /etc/php-fpm.conf
ExecReload=/bin/kill -USR2 $MAINPID

[Install]
WantedBy=multi-user.target

Now enable and start PHP-FPM.


systemctl enable php-fpm.service
systemctl start php-fpm.service

If you ask systemctl for the status of php-fpm, you should see a master process, and two pool processes for pool example_com, if you've been following along here.


Set up httpd access


Assuming you've gotten to this point, and everything seems to be working, we can now add PHP-FPM support to Apache httpd. We're proxying all files with the .php extention to the workers in the PHP-FPM pool we defined earlier.


First, make sure that the appropriate modules are enabled in /etc/httpd/conf/httpd.conf, and we include the php-fpm.conf file that we'll create later:


LoadModule proxy_module /usr/local/libexec/mod_proxy.so
LoadModule proxy_fcgi_module /usr/local/libexec/mod_proxy_fcgi.so

...

Include conf/extra/php-fpm.conf

Since we're just doing a very basic set up, and no VirtualHosts exist, we will just add the PHP-FPM configuration to the main server, in an extra config file.


/etc/httpd/conf/extra/php-fpm.conf:
<LocationMatch "^/(.*\.php(/.*)?)$">
  ProxyPass fcgi://127.0.0.1:9000/var/www/html/$1
</LocationMatch>

Make sure that the port (9000, here) matches the port you set above in your pool config file. Restart httpd, then add a simple file in your document root (which we set to /var/www/html in our last adventure):


/var/www/html/phpinfo.php:
<?php
    phpinfo();
?>

Now, hit the url for your server and load the file, and see if everything is awesome! If you see the usual PHP Info page, then you can celebrate your Great Success!


Remember now, though, that if you make a change to your PHP configuration in the php.ini file, or if you change your PHP-FPM set up, you'll need to reload your pool.


So what's next? Right now, we've got a pretty basic LAMP stack set up. We should probably abstract this out so that we can apply it to different VirtualHosts. We can also set up PHP-FPM with separate ''ondemand'' master pools for each VHost, for improved security. It would also be pretty nifty to make PHP-FPM communicate via systemd sockets, too.

8.12.15

Installing Apache httpd with HTTP/2 support from scratch on CentOS 7.1


On October 13, 2015, Apache http2 2.4.17 was released. This release, while just a point release, included modhttp2, a formalization within the Apache httpd software of modh2. Since CentOS 7.1, my preferred Linux distribution, doesn't yet include it, we need to compile it from source.

Dependencies


Since mod_http2 is dependent on nghttp2, we need to install this. We'll use the latest version, and compile it from source.

As well, we need a version of OpenSSL that supports ALPN. ALPN allows for application layer protocol negotiation, and is critical for clients to be able to negotiate the upgrade from HTTP 1.1 to HTTP/2. Again, since CentOS 7.1 only includes 1.0.1e, and we need at least 1.0.2, we have to compile it from source.

I'm assuming that you'll apply superuser permissions as appropriate to do things like make install, or moving / editing system files.

Prerequisites


There are several packages that we need to be able to build. We'll assume that we've got the Development group of tools installed.

  • zlib-devel is required by OpenSSL.
  • libev-devl is required by nghttpd.
  • pcre-devel is required by httpd.

System software required by the build.
: yum install -y zlib-devel libev-devel pcre-devel libxml2-devel

OpenSSL


Install the latest OpenSSL. Note that during the make-test phase, the tests will fail due to an expired test certificate, so you might just want to skip that phase.

wget https://www.openssl.org/source/openssl-1.0.2d.tar.gz && tar xf openssl-1.0.2d.tar.gz
cd openssl-1.0.2d
./config --prefix=/usr/local/openssl-1.0.2d shared zlib
make
make test
make install

Update the library path with the new libs.

echo "/usr/local/openssl-1.0.2d/lib " > /etc/ld.so.conf.d/openssl102d.conf
ldconfig

nghttp


Install the latest nghttp.

wget https://github.com/tatsuhiro-t/nghttp2/releases/download/v1.4.0/nghttp2-1.4.0.tar.gz && tar xf nghttp2-1.4.0.tar.gz
cd nghttp2-1.4.0
autoreconf -i
automake
autoconf
env OPENSSL_CFLAGS="-I/usr/local/openssl-1.0.2d/include" OPENSSL_LIBS="-L/usr/local/openssl-1.0.2d/lib -lssl -lcrypto" ./configure 
make
make install

Update the library path with the new libs.

echo "/usr/local/lib " > /etc/ld.so.conf.d/usr-local-lib.conf
ldconfig

APR / APR-util


The latest APR and APR-util are required to build httpd 2.4.x from source.

wget http://apache.mirror.vexxhost.com/apr/apr-1.5.2.tar.gz
cd apr-1.5.2
./configure
make
make install

wget http://apache.mirror.vexxhost.com/apr/apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --with-apr=/usr/local/apr
make
make install

Apache httpd


Now we come to the payoff. We install Apache httpd, at least 2.4.17 as of this writing. We're using a custom layout using the config.layout file. My prefered layout is based on the Fedora layout, but stuffed into /usr/local, what with us compiling it ourselves, and the sysconf dir in the standard /etc.

wget http://apache.mirror.rafal.ca//httpd/httpd-2.4.17.tar.gz
(optional) config.layout:

Local layout
<Layout Local>
    prefix:        /usr/local
    exec_prefix:   ${prefix}
    bindir:        ${prefix}/bin
    sbindir:       ${prefix}/sbin
    libdir:        ${prefix}/lib
    libexecdir:    ${prefix}/libexec
    mandir:        ${prefix}/man
    sysconfdir:    /etc/httpd/conf
    datadir:       ${prefix}/share/httpd
    installbuilddir: ${libdir}/httpd/build
    errordir:      ${datadir}/error
    iconsdir:      ${datadir}/icons
    htdocsdir:     /var/www/html
    manualdir:     ${datadir}/manual
    cgidir:        /var/www/cgi-bin
    includedir:    ${prefix}/include/httpd
    localstatedir: /var
    runtimedir:    /run/httpd
    logfiledir:    ${localstatedir}/log/httpd
    proxycachedir: ${localstatedir}/cache/httpd/proxy
</Layout>

./configure --enable-http2 --enable-ssl --with-ssl=/usr/local --enable-so --enable-mpms-shared=all --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr --enable-pie --with-pcre --enable-mods-shared=all --disable-distcache --disable-imagemap --enable-layout=Local
make
make install

Httpd really should have its own user, so add the www group and apache user.

groupadd www
useradd -g www -m apache

Now you'll need to edit your httpd.conf, to make sure that it's set up properly. You need to enable the three following modules, http2, socache_shmcb, and ssl. As well, since we're doing ssl, using the worker module would give us the best performance, so make sure that it's enabled.

LoadModule http2_module /usr/libexec/mod_http2.so
LoadModule socache_shmcb_module /usr/libexec/mod_socache_shmcb.so
LoadModule ssl_module /usr/libexec/mod_ssl.so

Since we're on CentOS 7, and systemd is the law of the land, you need to add a service, then enable it.

/etc/systemd/system/httpd.service:
[Unit]
Description=The Apache HTTP Server

[Service]
Type=forking
EnvironmentFile=/etc/sysconfig/httpd
PIDFile=/run/httpd/httpd.pid
ExecStart=/usr/local/apache2/bin/apachectl start
ExecReload=/usr/local/apache2/bin/apachectl graceful
ExecStop=/usr/local/apache2/bin/apachectl stop
KillSignal=SIGCONT
PrivateTmp=true

[Install]
WantedBy=multi-user.target

With this, we'll need to create the environment file:

/etc/sysconfig/httpd
#OPTIONS=
LANG=C

And now, we can enable:

systemctl enable httpd.service

It'll start now, but once you reboot, you'll find that httpd won't start, because it can't access /var/run/httpd. This time, we need to add a conf file to /etc/tmpfiles.d, so that the appropriate directory is created in the tmpfs in /run at boot.

/etc/tmpfiles.d/httpd.conf:
d /run/httpd   710 root www

You can now create a module configuration file for mod_http2, and populate it as such:

/etc/httpd/conf/extra/httpd_http2.conf:
<IfModule http2_module>
    LogLevel http2:debug
</IfModule>
# http
Protocols h2c http/1.1

You'll need to edit the ssl configuration as well, to add the https protocol. At the end of the section in /etc/httpd/conf/extra/httpd_ssl.conf, add:

# https
Protocols h2 http/1.1

This assumes that you've got a certificate for your server. If you don't, then creating a self-signed cert, or acquiring a legit cert, is left as an exercise to the reader. Just make sure that it's in place when you go to start httpd, which you will do now:

systemctl start httpd.service

It's now time to actually test this behemoth. We're going to skip testing for HTTP/2 connectivity over http, since that's largely academic. Modern browsers like Firefox only support HTTP/2 with TLS. Since we put an SSL certificate in place earlier, this shouldn't be a problem.

First, make sure you have a SPDY indicator add on installed in your browser. This will give you a little lightning bolt in the URL bar that will indicate the protocol that you've connected with. A couple of indicators for popular browsers are:


Now visit the root of your new site, and you ought to be greeted with a page full on PHP info. If you've gone to the https URL, then you should see a pretty little blue lightning bolt in your URL bar, indicating that your site is being served with HTTP/2.

References? Sure. I'll actually link these some day, probably.

  • https://blog.apar.jp/linux/3484/ (Japanese)
  • https://httpd.apache.org/docs/2.4/install.html
  • https://icing.github.io/mod_h2/howto.html
  • http://pixelinc.co/ubuntu-14-04-3-apache-http-2-web-server-setup/
  • http://blog.astaz3l.com/2015/02/09/how-to-install-apache-on-centos/
  • https://www.howtoforge.com/how-to-use-multiple-php-versions-php-fpm-and-fastcgi-with-ispconfig-3-ubuntu-12.04-lts-p3

7.6.15

Using the Toner Cartridge reset menu on a Brother HL-3140CDW printer

The Brother HL-3140CDW printer is a nifty, inexpensive colour laser printer (at least it was when I bought it). However, Brother has a bad practice of telling you that your toner cartridges are low when they're not.

To work around this, you can easily reset the toner counter, extending the life of your cartridges. It's pretty easy, it's just not in the user manual.

  • Power on your printer.
  • Life open the door.
  • Press and Hold Cancel then Secure, together, and release.

This should put your printer into the Reset menu.

  • Use the UP and DOWN arrows to navigate to the toner cartridge you want to reset.
  • Press OK to select it.
  • Press UP to reset.
  • Repeat for each toner cartridge you want to reset. The LCD will show Accepted after the reset has completed.

Close the printer door / lid when you're done, and then do a happy happy dance, because using this menu, I've been able to more than double the lifespan of my toner cartridges. This makes this machine a really good printer investment.

(Credit to this video for the instructions.)

29.7.14

A's in Boxes: debugging an intermittent font issue on OS X


I found a rather intruiging problem recently, where dialog boxes would come up looking like this:


Obviously, it was rather difficult to understand what was being presented in the dialog box.  It seemed to be limited to dialog boxes that were requesting authentication. Some research showed that this problem was pretty esoteric. I found no information on how this might be fixed, surprisingly. 

Since it was a font issue, I headed to Font Book, OS X's font management tool.  Once there, I found that several fonts had been disabled, due to conflicts.  Closer inspection showed that the fonts that were disabled were duplicates. 

The solution seemed simple: resolve the duplicates. I selected all the fonts, then opened the File menu, and selected Validate Fonts.  This, unsurprisingly, brought up the Font Validation dialog, which tested the fonts.  I selected Warnings or Errors from the drop-down box at the top, checked the Select all fonts checkbox, and clicked Remove Checked.  After it was done churning away, I rebooted.

Most of the dialog box font issues disappeared at this point, with the exception of dialog boxes in Keychain Access.  I still saw the A's in boxes.  Returning to Font Book, I found that I still had one font, Lucida Grande, that was causing problems with a duplicate.  I attempted to remove the disabled version, only to be presented with a warning telling me that I could not remove it, because it contained the system copy f .Lucida Grande UI. 

Since there were multiple copies, I reasoned that it must exist under my account's Library/Fonts folder, and sure enough, there it was.  I rebooted to safe mode, first to check that the dialog box font would work (it did), then to delete the duplicate in my home directory. 

Once the font was moved from the Library/Fonts directory, I rebooted again. This time, when I opened Keychain Access and performed an action, I was greeted with fonts that I could actually read. Success!

(Of course, more searching later led me to find things that would have been useful... thanks, Murphy!)

Alive??!?

Wow. There's a whole lot of cruft and cobwebs here, so many links that don't work, stuff I just don't want online anymore, blah blah blah.

Oh well, time to bring this thing back to life, so I have a place to dump the things that I want to remember. Sound reasonable? Sure, why not.

30.9.05

A One Liner to Change File Bits

Here's a little one-line command that will search all files in a directory with a given filename, and do a text substitution on them:

find . -name "*.html" -exec perl -pi -w -e 's/BADREGEX/GOODWORD\//g;' {} \;

In this case, I'm searching the current directory for all files with the '.html' extention. I'm then replacing all instances of 'BADREGEX' in the file with 'GOODWORD'.

If you pull the perl out of the command, you can use it on individual files:

perl -pi -w -e 's/BADREGEX/GOODWORD\//g;' [filename]

5.5.05

One in the rsync...

So, rsync is your friend. You should hug it, and love it, and buy it a sticky bun and hot chocolate every now and then when its feeling lonely. Here's what I know about it:

/usr/bin/rsync -azv                -e /bin/ssh \ 
               --rsync-path=/usr/bin/rsync \ 
               /web_directory new.webserver.net:/web_directory

OPTIONS:

 -a    Archive mode (enables recursion and preserve everything)

 -z    Compress file data (gzip)

 -v    Verbose (see all the deets)

 -e    Specify the rsh/ssh to use

 -n    Do a dry run (just show what would be done w/o actually 
     doing it)

 /bin/ssh   Path to the ssh, used with -e above

 --delete   Delete files on new.webserver.net that don't exist on 
     old.webserver.net

 --rsync-path=... Path to rsync on new.webserver.net

 /web_directory Path to rsync from

 new.webserver.net:/web_directory
     Host and path to rsync on new.webserver.net

Executing this command as demonstrated here will result in a large output dumped directly to the screen. You can save these to text by appending:

> /tmp/rsync-new.webserver.net:web_directory.log

or something of the ilk. Of course, you can name your log files whatever you want, but I prefer overly descriptive names myself.

Here's a couple more examples:

1) Sync /web_dir on test server from production server (on production server)

rsync -azv --delete -e /usr/bin/ssh --rsync-path=/usr/bin/rsync \
  /web_dir test.webserver.net:/web_dir > \ 
 /tmp/rsync-test.webserver.net:web_dir.log

2) Sync from /web_dir/web_app on build server to production server (on production server)

rsync -azv --delete -e /usr/bin/ssh --rsync-path=/usr/bin/rsync \
 build.webserver.net:/dev_dir/web_app /web_dir/web_app > \
 /tmp/rsync-build.webserver.net:web_dir:web_app.log

3) Pretend to sync from /web_dir/web_app on build server to productions server (on build server)

rsync -azvn --delete -e /usr/bin/ssh --rsync-path=/usr/bin/rsync \
 /dev_dir/web_app production.webserver.net:/web_dir/web_app > \
 /tmp/rsync-production.webserver.net:dev_dir:web_app.log

23.2.05

Some vegetarian recipes

I've been a member of a Vegetarian group on the campus portal (P.A.W.S.), even though I'm not a vegetarian. I haven't been checking it religiously, but I was having a look, and some of the members had posted some lovely looking recipes. I thought this would be a good place to post them for my future reference, and for anyone else that happens (hah!) to be reading my blog.

So, without further ado, I present Vegetarian Chili, and Pad Thai.

Murray Richelhoff's Vegetarian Chili:

1 tbsp Olive Oil
1 medium Onion
3 cloves of Garlic
1 pkg Extra Firm Tofu
1 can of Minced Tomatoes
1 can of Tomato Paste
1 tsp Curry
1/2 tsp Cumin
3 tbsp Chili Powder
Optional: Black Beans, Kidney Beans, Mushrooms, Plum Tomatoes, Chic Peas, Corn, etc, to taste.

Saute the onion and garlic in olive oil for 5 minutes. Add the tofu, and sautee for 15 minutes.

Add the curry, cumin, chili powder, tomatoes, tomato paste, and desired veggies. Simmer for 10 minutes.

Candace Beisel's Pad Thai

8 ounces Uncooked Rice Noodles
1/4 cup Vinegar
3 tbsp Tomato Paste
3 tbsp Water
2 tbsp Sugar
2 tbsp Olive Oil
2 cloves Garlic, Minced
1 Green Chili Pepper, Seeded and Minced
2 Eggs
1 c Bean Sprouts
1/3 c Chopped Unsalted Peanuts
garnish: Lime Wedges and Scallions/Green Onions, Chopped.

Soak noodles in boiling water, according to package directions. Drain and set aside.

In a bowl blend vinegar, tomato paste, sugar, water.

In a frying pan heat oil and stir fry garlic and chili pepper on medium heat 3 minutes.

Add tomato mixture. Make a well in the centre, crack eggs into it, cook til eggs almost set, about 2 nimutes, then stir quickly into the sauce.

Continue to simmer on low 4 to 5 minutes or until sauce is very thick.

Stir in noodles and remove from heat.

To serve, put the noodles and sauce on one side of the plate, and sprouts and peanuts on the other side. Garnish with the lime and scallions/green onions.