Tweet To start off with.. I know you can do this in DNS using a search parameter but I don’t want to do that in my envirnoment.
Sometimes you are working with a hostname that is long due to the domain name. This is the case where I am currently working, the domain is theopenskyproject.com. So I did the following and added into my ~/.bashrc
function ssh() { /usr/bin/ssh $1.
Tweet I’ll be the first to call out Google that their gdata python library for connecting into the Google Apps API is the worst.
I wanted to grab all the shared contacts from our domain and it was a giant in the ass. Here is the code I ended up with
import gdata.contacts.client contact_list = gdata.contacts.client.ContactsClient() contact_list.client_login(email="user@domain.com", password="password", source='comany-app-1', account_type='HOSTED') feed_url = contact_list.GetFeedUri(contact_list="domain.com", projection='full') while True: feed = contact_list.get_feed( uri=feed_url, auth_token=None, desired_class=gdata.
Tweet I have been debating just helping with fabric or writing my own app for a week now and I just think what I need and want fabric just isn’t and too much work to get it to the way I want it to be.
So here are some of the things I want Rollout to be.
Be able to run in console Be able to tie the Rollout API into your own python webapp Rollout output should be multiformat (xml/json) Should be threaded Should have a run_first() and run_last() method Tie in git/svn?
Tweet This is something that is an easy fix. Nginx is a great web server not only for your primary site but for a proxy as well since it is made to serve a lot of requests very fast.
So it is as simple as this
location / { proxy_pass https://staging; proxy_read_timeout 500; proxy_next_upstream error; break; } The key lines are proxy_read_timeout and proxy_next_upstream.
Tweet I’m a big fan of fabric, a python module to make deployments easy. It is still very new but has some great features and some major short comings I don’t think the authors thought of before they designed it.
The major shortcoming is a lack of parallel deployments. Fabric works great on 1 or 2 hosts you need to deploy on but when you have more then that for a large application it is painful.
Tweet I was doing some Django work trying to get PayPal WPP to work with my application and it was stuck behind your basic LinkSys wifi router. Now you can just go in and forward the ports, edit PalPal configs and bla bla bla.
That is no fun. So I found a nice little plugin for eclipse that handles remote editing over SFTP. So now I can do all my remote testing/development via SFTP and not have to make all these changes.
Tweet So you have a var you want to remove leading 0’s on.. well do the follwing
mzupan@mzupan-desktop:~$ var=00014
mzupan@mzupan-desktop:~$ let var=”10#$var”
mzupan@mzupan-desktop:~$ echo $var
14
mzupan@mzupan-desktop:~$
Tweet Fabric is a great tool for helping deploy applications. It is written in Python and still in it’s early stages. The big issue is that fabric will not run on python v2.4. That is a problem since Redhat/CentOS v5 ships with v2.4 so we have to make it work.
So the first thing to do is install python 2.5. I found great rpms here. I am going to mirror the RPMS on my blog just in case.
Tweet So you have a partition with a ton of subdirectories and the partition is almost full and you want to see if there are large files eating up space. There is an easy command you can run to list the 10 biggest files
find /directory -printf ‘%s %p\n’ | sort -nr | head -n 10
You can change the head -n 10 to -n 20 if you want to get the 20 biggest files.
Tweet If you have a puppet network in place you will want to use puppet-dashboard. It is a fairly new project and still has some misssing pieces but overall a good way to tell the health of your puppet network. The thing I really like about it is that you can see when the last check in time is for a client and if it had any errors or warnings during its runs so you can fix them.