Archive for the ‘coding’ Category
Thursday, February 11th, 2010
The other day at work I had to figure out how to accept a email give a reply to anyone that ever sends a email no matter how many times they email the address. Everything I could find had caching in it, with a little digging and poking around the web I found some information that lead me to this solution:
# Auto Reply without caching
# Creator: Richard Genthner
# Date 11-FEB-2010
#
# SENDER the email you want it to look like it came from
# SUBJECT What you want to change the subject to
# FILE the name of the auto reply message
SENDER=bob@example.com
SUBJECT="My Contact information has changed"
FILE=.autoreply_mesg
# Processor this will send the incoming message to /dev/null after sending a auto reply
:0 h c
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: $SENDER
| (formail -r -A"FROM:$SENDER" -A"X-Loop: $SENDER" -I"Subject:$SUBJECT";\
cat $HOME/$FILE) | $SENDMAIL -t
:0
/dev/null
Lets break this done in to sections. First we have is this:
SENDER=help@cfda.gov
SUBJECT="Our Support information has changed"
FILE=.autoreply_mesg
In this section we are setting the SENDER which is the email address that we want the message to look like. SUBJECT is the Subject we want to replace the RE: blah blah with something that is informational. FILE is the name if the file containing our message. In the next section we have the following bits:
:0 h c
* !^FROM_DAEMON
* !^FROM_MAILER
* !^X-Loop: $SENDER
| (formail -r -A"FROM:$SENDER" -A"X-Loop: $SENDER" -I"Subject:$SUBJECT";\
cat $HOME/$FILE) | $SENDMAIL -t
:0
/dev/null
So at first this looks cryptic but lets break it down line by line. So frist we have the :0 to accept anything then h and c tell procmail to keep a copy of the email just in case we need to process it more then in just this one block. * !^FROM_DAEMON says if its not from a daemon then proceed tot he next step. * !^FROM_MAILER means if not from a auto mailer aka mailing lists then proceed to the next step. * !^X-Loop: this mean is that if not a mail loop then proceed to next step. Which is the formail command. Let break this down by options, first we have -r which mean Generate an auto-reply header. This will normally throw away all the existing fields, then we have -A which allows us to apply custom information to the header fields, -I that any existing similar fields are simply removed. then we are cat’ing the auto reply file in the body of the message and then passing it off to the sendmail to send the file.
Posted in Scripting | Tags: email, procmailrc, scripts, system tools, work | No Comments »
Wednesday, June 3rd, 2009
So the other day i was surfing the web and have found a pretty neat PHP library called Flourish. At first was wondering why anyone would want to use a library instead of a MVC these days. I have to say after using its pretty neat. Coming from recent rails development I was missing ActiveRecord from rails in PHP but oh wait this library has Active Record. So i figured since there isn’t any tutorials on how to create a blog application with it. So look towards it in the coming days.
I wrote a simple application with it in about 30 minutes but the only reason i took at look was because the documentation is so good its like reading a book with a map. It has everything you would ever need but json-rpc and xml-rpc. Since this flourish library is in beta it might have those features soon or even just down the road. its pretty stable write now only a few bugs here and there but nothing major with patches all the time. So check it out.
Posted in flourish, php | Tags: activerecord, api, flourish, php, rails, ruby, web development | No Comments »
Wednesday, June 3rd, 2009
I have a brand new job coming in a few days in washington,dc at Symplicity with my friend BP. I’m going to be a PHP developer working with from what i hear a great framework. This has made me spend sometime polishing up my PHP skills since i haven’t been doing much coding with PHP but with Ruby and Python. So far it has been pretty easy to polish them up. Like the old saying just like riding a bike.
Posted in coding, life, php | Tags: job, life, moving | No Comments »
Saturday, August 2nd, 2008
Well for the past week I have been at my new job work my tail off. For starters on the phone fixing a Exchange server with microsoft to fix a domain rename and get exchange to like it. Also this week, I worked on a Cisco System Router and ASA 5505. I have to say the Cisco ASA’s rock I couldn’t believe how easy it was to setup and deploy. The company I work does a lot of high WIFI networking and i have to its interesting. I have to say so far its been interesting. It will be interesting to see what next week will bring to the table. We do a lot with phone systems using VOIP so it will be interesting to see when I get into the phone stuff, but I’m hoping that i just stay in the networking part with a main focus in the security aspect of things to be honest. I also got the chance to learn on the spot how to terminate fiber multimode.
Also my buddy jeremy has introduced me to a lot of new music of the past couple of months and I have to say his latest find is awesome. The band is call the Old Crow Medicine Show below is a video clip of it. Its a got a turn of the century sound to them.
Old Crow Medicine Show — Wagon Wheel
Posted in Django/Python, life | Tags: cisco, features, fiber, jeremy, music, new job, Old Crow Medicine Show, security, voip, wifi, work | No Comments »
Monday, July 7th, 2008
For the past couple of months I have given up on PHP and moved to Django to learn Python for Web. Which at first I was like hrm another framework! Just what i need in my life another dang framework for my clients to want sites done in. I have to say at first I was a little shaky at becuase I didn’t know python and had never programmed in python in my life. I knew with python you could do neat things like make the google logo automatically from friends that worked at google at the time. I have to say if your tight on deadlines take a look at django I was amazed how fast I could develop a complete site in. In the 4 months that i have been using it seriously in, I have built a complete CMS with Forum, Gallery, SMS and NOC(Network Operations Center).
I do have to say one thing, Its not easy to get up and running on a shared hosting enviroment. You will need shell access, able to install python apps and packages. I recommend if you can run it under mod_python instead of fastcgi or wsgi. Mod_python makes it easier to get up runing in a snap.
This project is currently only in none 1.0 releases, I recommend working on the trunk if you don’t mind reworking things time to time due to fixes or better ways to do things. Like currently I’m having to rewrite my gallery due to changes in fields and storing uploaded files.
If you sick of the same old php or RoR(Ruby on Rails) I say give Django a Shot.
Posted in Django/Python, coding | Tags: coding, django, features, IT, OpenSource, projects, work | No Comments »
Friday, March 28th, 2008
So tonight when I was knee deep into django coding a way for a new site for one of my clients. I decieded that it would be neat to have a GTD system in the backend for the users to sumbit requests for the site and what not. I decieded to give them functionitaly of being able to have there own projects and with each project having its own set of tasks. Also at the same time of working on the accounts model I decieded what if I want a user and a project. So i coded the accounts model to allow for projects and users, where users can have many projects and projects can have many users. In the UI it will allow the user then logged in to see on their dashboard their projects and each projects status and their tasks and feature requests. (more…)
Posted in coding | Tags: development, django, git, gtd, json, programming, projects, python, svn, team management, web 2.0, xml | No Comments »
Saturday, March 22nd, 2008
Ok I upgraded tonight to wordpress 2.5 RC-1. I have to say the Admin interface is pretty. I’ll write and code a new theme tonight and work on moving my plugins over to wordpress 2.5.
Posted in coding, site | Tags: coding, css, site, themes, wordpress | No Comments »
Saturday, March 22nd, 2008
Well I have started a clan php application that will have a adobe AIR application that will go with it for team messaging. Also still working on a stealth web 2.0 enterprise application is going to be powered by python, mysql and amazon s3 services and will have a AIR and prism clients for the system. I hope to be able to start back on that project soon as
Posted in coding, life | Tags: programming, web 2.0 | No Comments »
Saturday, January 26th, 2008
I wrote this code when I was coding for a Company doing web development. Basically what this is three parts:
text file containing html
php file calling the text file
A smarty template
So this is how it works. (more…)
Posted in coding, php, portfolio | Tags: applications, coding, css, html, php, portfolio, programming, smarty, tutorials, web apps, work | No Comments »
Friday, January 25th, 2008
Ok, I got bored and decided so I wrote a bunch of PHP in the past month. First one I worked on was a bar code system for my EMS(Employee Management System). For last.FM I have been using the audioscrobbler API and feed parsing which are all simple php concepts that everyone that does php should know how to do. So I know what your saying wheres the code. Well your going to have to read more
(more…)
Posted in coding, php | Tags: coding, concepts, custom classes, last.fm, php, programming, web 2.0 | No Comments »