<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Srini's Point of View</title><link href="https://www.nyayapati.com/srao/" rel="alternate"/><link href="https://www.nyayapati.com/srao/feeds/all.atom.xml" rel="self"/><id>https://www.nyayapati.com/srao/</id><updated>2019-05-13T08:30:00-04:00</updated><subtitle>My thoughts on technology, food and other fancies…</subtitle><entry><title>Disqus comments not loading</title><link href="https://www.nyayapati.com/srao/2019/05/disqus-comments-not-loading/" rel="alternate"/><published>2019-05-13T08:30:00-04:00</published><updated>2019-05-13T08:30:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2019-05-13:/srao/2019/05/disqus-comments-not-loading/</id><summary type="html">&lt;p&gt;I am a little upset that my disqus comments widget is not loading on my previous post from last week.
It is loading fine on all the older posts but not on the last one. Posting a random rant just to see
if it is an issue with that post …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am a little upset that my disqus comments widget is not loading on my previous post from last week.
It is loading fine on all the older posts but not on the last one. Posting a random rant just to see
if it is an issue with that post or everthing going forward. I hope it is a onetime glitch. I have a feeling
it maybe got to do with me changing the slug on that article. Will find out&amp;nbsp;shortly.&lt;/p&gt;
&lt;p&gt;Update - after a bunch of trials, found the issue with how my &lt;span class="caps"&gt;SITEURL&lt;/span&gt; on my pelican config was causing this.
If I have RELATIVE_URLS set to true, &lt;span class="caps"&gt;SITEURL&lt;/span&gt; becomes relative too. So places where I need the &lt;span class="caps"&gt;SITEURL&lt;/span&gt; be the absolute &lt;span class="caps"&gt;URL&lt;/span&gt;, like for instance in my disqus generated section for each article.. it was breaking that articles disqus&amp;nbsp;widget. &lt;/p&gt;
&lt;p&gt;This &lt;a href="https://github.com/getpelican/pelican/issues/1710"&gt;article&lt;/a&gt; gave me a solution on how to fix this. I defined a new variable called SITEURL_ABS = &lt;span class="caps"&gt;SITEURL&lt;/span&gt; in publishconf.py and changed the template where disqus widget was getting generated and use the SITEURL_ABS variable instead of &lt;span class="caps"&gt;SITEURL&lt;/span&gt;. This needs to be done as &lt;span class="caps"&gt;SITEURL&lt;/span&gt; gets changed if RELATIVE_URLS is set to&amp;nbsp;True.&lt;/p&gt;</content><category term="software"/><category term="pelican"/><category term="disqus"/></entry><entry><title>How to setup kubernetes cluster on EC2 to run the Dask NYC Taxi Demo</title><link href="https://www.nyayapati.com/srao/2019/05/how-to-setup-kubernetes-cluster-on-ec2-to-run-the-dask-nyc-taxi-demo/" rel="alternate"/><published>2019-05-08T11:00:00-04:00</published><updated>2019-05-08T11:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2019-05-08:/srao/2019/05/how-to-setup-kubernetes-cluster-on-ec2-to-run-the-dask-nyc-taxi-demo/</id><summary type="html">&lt;p&gt;I heard about &lt;a href="https://dask.org/"&gt;Dask&lt;/a&gt; at my local Python Meetup last month. After reading about it, I came across
Matthew Rocklin&amp;#8217;s &lt;a href="https://www.youtube.com/watch?v=RA_2qdipVng&amp;t=457s"&gt;Pycon 2017 talk on Dask&lt;/a&gt;
and was blown away by his demo of crunching through around 20 gigs of csv data (60 gigs in memory) in 
matter of a …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I heard about &lt;a href="https://dask.org/"&gt;Dask&lt;/a&gt; at my local Python Meetup last month. After reading about it, I came across
Matthew Rocklin&amp;#8217;s &lt;a href="https://www.youtube.com/watch?v=RA_2qdipVng&amp;t=457s"&gt;Pycon 2017 talk on Dask&lt;/a&gt;
and was blown away by his demo of crunching through around 20 gigs of csv data (60 gigs in memory) in 
matter of a minute. You have to see the demo to really appreciate the power of Dask. He also wrote an article
on his &lt;a href="https://matthewrocklin.com/blog/work/2017/01/12/dask-dataframes"&gt;blog&lt;/a&gt;, which goes over the
same&amp;nbsp;example.&lt;/p&gt;
&lt;p&gt;I thought the best way to get started with Dask would be to re-create the demo. Reading on the blog, I saw that Matthew was using an eight node cluster on &lt;span class="caps"&gt;EC2&lt;/span&gt; of m4.2xlarges (eight cores, &lt;span class="caps"&gt;30GB&lt;/span&gt; &lt;span class="caps"&gt;RAM&lt;/span&gt; each). So I started to look into how to setup that eight node cluster. The main 
&lt;a href="http://docs.dask.org/en/latest/setup/cloud.html"&gt;documentation&lt;/a&gt; now recommends deploying Dask with Kubernetes and&amp;nbsp;Helm.&lt;/p&gt;
&lt;p&gt;This is where my in-experience working with kubernetes became an obstacle. Luckily the documentation and watching a few youtube
videos helped me get started. I am also doing all this from Windows 10 on &lt;a href="https://en.wikipedia.org/wiki/Windows_Subsystem_for_Linux"&gt;&lt;span class="caps"&gt;WSL&lt;/span&gt;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Steps to get this demo&amp;nbsp;working!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. Make sure your aws cli is setup. Read up install instructions &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html"&gt;here&lt;/a&gt; and configuring instructions &lt;a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html"&gt;here&lt;/a&gt;. In my case aws cli was already setup as I use it for other&amp;nbsp;work.&lt;/p&gt;
&lt;p&gt;2. Install Docker. As of May of 2019, docker does not work natively on &lt;span class="caps"&gt;WSL&lt;/span&gt;. The way around it is to have Docker 
be installed on windows and just install the docker client on &lt;span class="caps"&gt;WSL&lt;/span&gt;. Nick Janetakis has a great write up
on his &lt;a href="https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly"&gt;blog&lt;/a&gt; and I got docker working from &lt;span class="caps"&gt;WSL&lt;/span&gt; in no&amp;nbsp;time. &lt;/p&gt;
&lt;p&gt;3. Install kubectl. The official &lt;a href="https://kubernetes.io/docs/tasks/tools/install-kubectl/"&gt;docs&lt;/a&gt; covers 
a lot of ways but none that covers wsl. I found a writeup on &lt;a href="https://devkimchi.com/2018/06/05/running-kubernetes-on-wsl/"&gt;DevKimchi&lt;/a&gt; where I found out that the windows Docker settings has an option to enable
Kubernetes. Once enabled just copy the configuration from windows into &lt;span class="caps"&gt;WSL&lt;/span&gt; and also install the kubernetes cli in &lt;span class="caps"&gt;WSL&lt;/span&gt;.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;~/.kube
$&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;/c/Users/&lt;span class="o"&gt;[&lt;/span&gt;USERNAME&lt;span class="o"&gt;]&lt;/span&gt;/.kube/config&lt;span class="w"&gt; &lt;/span&gt;~/.kube/
$&lt;span class="w"&gt; &lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-LO&lt;span class="w"&gt; &lt;/span&gt;https://storage.googleapis.com/kubernetes-release/release/&lt;span class="k"&gt;$(&lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;https://storage.googleapis.com/kubernetes-release/release/stable.txt&lt;span class="k"&gt;)&lt;/span&gt;/bin/linux/amd64/kubectl
$&lt;span class="w"&gt; &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;+x&lt;span class="w"&gt; &lt;/span&gt;./kubectl
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;mv&lt;span class="w"&gt; &lt;/span&gt;./kubectl&lt;span class="w"&gt; &lt;/span&gt;/usr/local/bin/kubectl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;4. Install &lt;a href="https://github.com/kubernetes/kops/"&gt;Kops&lt;/a&gt;. Kops is a tool used to create, destroy, upgrade and maintain production-grade, highly available, Kubernetes clusters from the command line. Installing on &lt;span class="caps"&gt;WSL&lt;/span&gt; was pretty straight&amp;nbsp;forward.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-LO&lt;span class="w"&gt; &lt;/span&gt;https://github.com/kubernetes/kops/releases/download/&lt;span class="k"&gt;$(&lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;https://api.github.com/repos/kubernetes/kops/releases/latest&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;tag_name&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;cut&lt;span class="w"&gt; &lt;/span&gt;-d&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;quot;&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;/kops-linux-amd64
$&lt;span class="w"&gt; &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;+x&lt;span class="w"&gt; &lt;/span&gt;kops-linux-amd64
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;mv&lt;span class="w"&gt; &lt;/span&gt;kops-linux-amd64&lt;span class="w"&gt; &lt;/span&gt;/usr/local/bin/kops
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;5. Setup &lt;span class="caps"&gt;AWS&lt;/span&gt; &lt;span class="caps"&gt;IAM&lt;/span&gt; group and user. I am going to create a group called kops and user called&amp;nbsp;kops.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;create-group&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;attach-group-policy&lt;span class="w"&gt; &lt;/span&gt;--policy-arn&lt;span class="w"&gt; &lt;/span&gt;arn:aws:iam::aws:policy/AmazonEC2FullAccess&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;attach-group-policy&lt;span class="w"&gt; &lt;/span&gt;--policy-arn&lt;span class="w"&gt; &lt;/span&gt;arn:aws:iam::aws:policy/AmazonRoute53FullAccess&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;attach-group-policy&lt;span class="w"&gt; &lt;/span&gt;--policy-arn&lt;span class="w"&gt; &lt;/span&gt;arn:aws:iam::aws:policy/AmazonS3FullAccess&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;attach-group-policy&lt;span class="w"&gt; &lt;/span&gt;--policy-arn&lt;span class="w"&gt; &lt;/span&gt;arn:aws:iam::aws:policy/IAMFullAccess&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;attach-group-policy&lt;span class="w"&gt; &lt;/span&gt;--policy-arn&lt;span class="w"&gt; &lt;/span&gt;arn:aws:iam::aws:policy/AmazonVPCFullAccess&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;create-user&lt;span class="w"&gt; &lt;/span&gt;--user-name&lt;span class="w"&gt; &lt;/span&gt;kops
$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;iam&lt;span class="w"&gt; &lt;/span&gt;add-user-to-group&lt;span class="w"&gt; &lt;/span&gt;--user-name&lt;span class="w"&gt; &lt;/span&gt;kops&lt;span class="w"&gt; &lt;/span&gt;--group-name&lt;span class="w"&gt; &lt;/span&gt;kops
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;6. Set up an S3 bucket to save your cluster state. Just choose your own unique&amp;nbsp;name.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;aws&lt;span class="w"&gt; &lt;/span&gt;s3api&lt;span class="w"&gt; &lt;/span&gt;create-bucket&lt;span class="w"&gt; &lt;/span&gt;--bucket&lt;span class="w"&gt; &lt;/span&gt;some-kops-state-bucket&lt;span class="w"&gt; &lt;/span&gt;--region&lt;span class="w"&gt; &lt;/span&gt;us-east-1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;7. Setup environment variables to help create our clusters. These variable names are defaults which are 
used by kops. Just make sure sure the cluster name you choose ends with &amp;#8220;k8s.local&amp;#8221;. You can also add this to your .bashrc&amp;nbsp;file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;KOPS_CLUSTER_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;somekops.k8s.local
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;KOPS_STATE_STORE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;s3://some-kops-state-bucket
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;8. Create your cluster. I am using 1 t3.xlarge (4cpu/&lt;span class="caps"&gt;16GB&lt;/span&gt; &lt;span class="caps"&gt;RAM&lt;/span&gt;) as my master and 8 m4.2xlarge (8 cpu/&lt;span class="caps"&gt;32GB&lt;/span&gt; &lt;span class="caps"&gt;RAM&lt;/span&gt;) as my worker&amp;nbsp;nodes. &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;kops&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;cluster&lt;span class="w"&gt; &lt;/span&gt;--name&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;KOPS_CLUSTER_NAME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--node-count&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--node-size&lt;span class="o"&gt;=&lt;/span&gt;m4.2xlarge&lt;span class="w"&gt; &lt;/span&gt;--master-size&lt;span class="o"&gt;=&lt;/span&gt;c4.4xlarge&lt;span class="w"&gt; &lt;/span&gt;--zones&lt;span class="o"&gt;=&lt;/span&gt;us-east-2c
$&lt;span class="w"&gt; &lt;/span&gt;kops&lt;span class="w"&gt; &lt;/span&gt;update&lt;span class="w"&gt; &lt;/span&gt;cluster&lt;span class="w"&gt; &lt;/span&gt;--name&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;KOPS_CLUSTER_NAME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;--yes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Validate your cluster with the command below&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;kops&lt;span class="w"&gt; &lt;/span&gt;validate&lt;span class="w"&gt; &lt;/span&gt;cluster
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/validate_cluster.png"&gt;&lt;img alt="validate_cluster" src="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/validate_cluster.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should proceed further only after you see that your cluster is ready. This was also one of the pain points for me as I wasn&amp;#8217;t sure why my clusters were not getting created properly. It turned out that it was due to &lt;span class="caps"&gt;AWS&lt;/span&gt; availability in the &amp;#8220;us-east-1c&amp;#8221; zone. I switched to &amp;#8220;us-east-2c&amp;#8221; and all was&amp;nbsp;good.&lt;/p&gt;
&lt;p&gt;9. Install &lt;a href="https://helm.sh/"&gt;Helm&lt;/a&gt;. Helm is your package manager for Kubernetes. We will install Dask on the kubernetes cluster we created using helm. Installing helm is pretty straight forward. &lt;a href="https://zero-to-jupyterhub.readthedocs.io/en/v0.4-doc/setup-helm.html"&gt;Zero-to-jupyterhub&lt;/a&gt; docs do a great&amp;nbsp;job.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;bash
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now setup &lt;a href="https://helm.sh/docs/glossary/#tiller"&gt;tiller&lt;/a&gt; on your kubernetes&amp;nbsp;cluster&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;kubectl&lt;span class="w"&gt; &lt;/span&gt;--namespace&lt;span class="w"&gt; &lt;/span&gt;kube-system&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;sa&lt;span class="w"&gt; &lt;/span&gt;tiller
$&lt;span class="w"&gt; &lt;/span&gt;kubectl&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;clusterrolebinding&lt;span class="w"&gt; &lt;/span&gt;tiller&lt;span class="w"&gt; &lt;/span&gt;--clusterrole&lt;span class="w"&gt; &lt;/span&gt;cluster-admin&lt;span class="w"&gt; &lt;/span&gt;--serviceaccount&lt;span class="o"&gt;=&lt;/span&gt;kube-system:tiller
$&lt;span class="w"&gt; &lt;/span&gt;helm&lt;span class="w"&gt; &lt;/span&gt;init&lt;span class="w"&gt; &lt;/span&gt;--service-account&lt;span class="w"&gt; &lt;/span&gt;tiller
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Check if helm is installed&amp;nbsp;correctly&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;helm&lt;span class="w"&gt; &lt;/span&gt;version
Client:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;version.Version&lt;span class="o"&gt;{&lt;/span&gt;SemVer:&lt;span class="s2"&gt;&amp;quot;v2.13.1&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;GitCommit:&lt;span class="s2"&gt;&amp;quot;618447cbf203d147601b4b9bd7f8c37a5d39fbb4&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;GitTreeState:&lt;span class="s2"&gt;&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
Server:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;version.Version&lt;span class="o"&gt;{&lt;/span&gt;SemVer:&lt;span class="s2"&gt;&amp;quot;v2.13.1&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;GitCommit:&lt;span class="s2"&gt;&amp;quot;618447cbf203d147601b4b9bd7f8c37a5d39fbb4&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;GitTreeState:&lt;span class="s2"&gt;&amp;quot;clean&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;10. Install Dask on your cluster. The &lt;a href="http://docs.dask.org/en/latest/setup/kubernetes-helm.html"&gt;official docs&lt;/a&gt;
have a good explanation on how to install a basic cluster. Here is the&amp;nbsp;command &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;helm&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;stable/dask
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The install gives a name to your deployment and you need to use this name if you want to upgrade or later delete your helm install. To validate if your install was successful and your pods are running, use the following&amp;nbsp;command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;kubectl&lt;span class="w"&gt; &lt;/span&gt;get&lt;span class="w"&gt; &lt;/span&gt;pods
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here is a screenshot of the stages the pods go&amp;nbsp;through&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/get_pods.png"&gt;&lt;img alt="Get Pods" src="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/get_pods.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You can see here that the deployment gave my cluster the name of billowing-labradoodle and the status is&amp;nbsp;running.&lt;/p&gt;
&lt;p&gt;The thing which tripped me the most was the docs saying &amp;#8220;By default, the Helm deployment launches three workers using two cores each and a standard conda environment.&amp;#8221; So it took me a while to get to a Dask cluster which had 8 workers with 64 cores. The basic install does create a cluster with 1 jupyter server, 1 scheduler and 3 worker nodes, but the size of the worker nodes is based on your original node size you provisioned in step 8. After a few permutations, I realized I just want to say I want 8 replicas of the workers with my default kubernetes config for cpu and memory the way I set it up (8 cpu/32gig ram) for each worker. Another issue I faced was that the install has basic anaconda installed and thats it. So if you want to use s3 or Google cloud storage you need to have either s3fs or gcsfs installed on all your nodes of your cluster, including your scheduler, jupyter server and worker nodes. These changes can be made easily by overriding the settings used by helm chart by writing your own config.yaml file. Here is my config.yaml&amp;nbsp;file&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# config.yaml&lt;/span&gt;
&lt;span class="nt"&gt;worker&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;replicas&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;8&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;EXTRA_CONDA_PACKAGES&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;numba xarray -c conda-forge&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;EXTRA_PIP_PACKAGES&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;gcsfs s3fs dask-ml --upgrade&lt;/span&gt;
&lt;span class="c1"&gt;# We want to keep the same packages on the worker and jupyter environments&lt;/span&gt;
&lt;span class="nt"&gt;jupyter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;enabled&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;true&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="nt"&gt;env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;EXTRA_CONDA_PACKAGES&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;numba xarray matplotlib -c conda-forge&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p p-Indicator"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;EXTRA_PIP_PACKAGES&lt;/span&gt;
&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="nt"&gt;value&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l l-Scalar l-Scalar-Plain"&gt;gcsfs s3fs dask-ml --upgrade&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now update your helm install with this&amp;nbsp;command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;helm&lt;span class="w"&gt; &lt;/span&gt;upgrade&lt;span class="w"&gt; &lt;/span&gt;billowing-labradoodle&lt;span class="w"&gt; &lt;/span&gt;stable/dask&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;config.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Check your pods and make sure the status says they are all Running with the command &amp;#8220;kubectl get&amp;nbsp;pods&amp;#8221;. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/updated_pods.png"&gt;&lt;img alt="Updated Pods" src="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/updated_pods.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Now run the following command to get the external &lt;span class="caps"&gt;IP&lt;/span&gt; for your jupyter server and scheduler server. I have shortened the external-ip names so you can see what the result looks&amp;nbsp;like.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;kubectl&lt;span class="w"&gt; &lt;/span&gt;get&lt;span class="w"&gt; &lt;/span&gt;services
NAME&lt;span class="w"&gt;                                   &lt;/span&gt;TYPE&lt;span class="w"&gt;           &lt;/span&gt;CLUSTER-IP&lt;span class="w"&gt;       &lt;/span&gt;EXTERNAL-IP&lt;span class="w"&gt;            &lt;/span&gt;PORT&lt;span class="o"&gt;(&lt;/span&gt;S&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;                       &lt;/span&gt;AGE
billowing-labradoodle-dask-jupyter&lt;span class="w"&gt;     &lt;/span&gt;LoadBalancer&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;.xx.xxx.93&lt;span class="w"&gt;    &lt;/span&gt;a251--.amazonaws.com&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="m"&gt;80&lt;/span&gt;:32431/TCP&lt;span class="w"&gt;                  &lt;/span&gt;1h
billowing-labradoodle-dask-scheduler&lt;span class="w"&gt;   &lt;/span&gt;LoadBalancer&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;.xx.xxx.136&lt;span class="w"&gt;   &lt;/span&gt;a026--.amazonaws.com&lt;span class="w"&gt;   &lt;/span&gt;&lt;span class="m"&gt;8786&lt;/span&gt;:32624/TCP,80:31475/TCP&lt;span class="w"&gt;   &lt;/span&gt;1h
kubernetes&lt;span class="w"&gt;                             &lt;/span&gt;ClusterIP&lt;span class="w"&gt;      &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;.xx.x.1&lt;span class="w"&gt;       &lt;/span&gt;&amp;lt;none&amp;gt;&lt;span class="w"&gt;                 &lt;/span&gt;&lt;span class="m"&gt;443&lt;/span&gt;/TCP&lt;span class="w"&gt;                       &lt;/span&gt;1h
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now copy paste the external &lt;span class="caps"&gt;IP&lt;/span&gt; into two browser windows. You should see the Jupyter hub login page and Scheduler page show up. If it doesn&amp;#8217;t show up, just be patient and wait a few minutes. Typically the Scheduler page comes up pretty fast and Jupyter hub page takes a while. Eventually you will be greeted by the login&amp;nbsp;page. &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/login.png"&gt;&lt;img alt="login" src="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/login.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;11. Finally Running the New York Taxi Example. Type in &amp;#8216;dask&amp;#8217; as password for jupyterhub and login. Go into the examples folder and open the 05-nyc-taxi.ipynb notebook. If you were to run this now, it will run.. but it will be really slow and no where close to how fast the demo ran in the pycon video. It eventually occured to me that the given example is using csv files from google storage, whereas all our infrastructure we setup is on &lt;span class="caps"&gt;AWS&lt;/span&gt;. Of course there will be a huge delay! These files need to go over the network between two providers and to top it off, these files are huge.. about close to 2 gigs each. After I realized my mistake, I changed the code to use files from s3 instead and finally the notebook ran as fast as the demo!! Here is the code you need to change to use s3 instead of google cloud (also on MattMatthew Rocklin&amp;#8217;s &lt;a href="https://matthewrocklin.com/blog/work/2017/01/12/dask-dataframes"&gt;article&lt;/a&gt;). The thing to notice in the screenshot below is the number of Workers, the number of Cores and the total Memory across all the workers in step 3&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/notebook.png"&gt;&lt;img alt="Notebook" src="https://www.nyayapati.com/srao/wp-content/uploads/2019/05/notebook.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;s3fs&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;S3FileSystem&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;S3FileSystem&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anon&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ls&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;dask-data/nyc-taxi/2015/&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;pandas&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;pd&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;s3&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;dask-data/nyc-taxi/2015/yellow_tripdata_2015-01.csv&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;nrows&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parse_dates&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;tpep_pickup_datetime&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;tpep_dropoff_datetime&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;dask&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;dask.distributed&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;progress&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Client&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;client&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;dask.dataframe&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;as&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;dd&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;dd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;read_csv&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;s3://dask-data/nyc-taxi/2015/*.csv&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
                &lt;span class="n"&gt;parse_dates&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;tpep_pickup_datetime&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;tpep_dropoff_datetime&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
                &lt;span class="n"&gt;storage_options&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;anon&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="n"&gt;df&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;persist&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;progress&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;df&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The rest is the same. Hope this helps&amp;nbsp;somebody!&lt;/p&gt;</content><category term="software"/><category term="python"/><category term="ec2"/><category term="aws"/><category term="linux"/><category term="kubernetes"/></entry><entry><title>Send Email In Python Bugfix</title><link href="https://www.nyayapati.com/srao/2018/02/send-email-in-python-bugfix/" rel="alternate"/><published>2018-02-22T11:20:00-05:00</published><updated>2018-02-22T11:20:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2018-02-22:/srao/2018/02/send-email-in-python-bugfix/</id><summary type="html">&lt;p&gt;I have been using this python function for a while to send html emails from within my python scripts&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;sendhtmlemail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;emailbody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot; Send html email with given subject and body &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;fromaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_FROM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;toaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_TO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEMultipart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;alternative&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;From&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fromaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;To&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Subject&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;

    &lt;span class="n"&gt;body …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I have been using this python function for a while to send html emails from within my python scripts&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;sendhtmlemail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;emailbody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot; Send html email with given subject and body &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;fromaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_FROM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;toaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_TO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEMultipart&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;alternative&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;From&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fromaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;To&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Subject&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;

    &lt;span class="n"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;emailbody&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;html&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;


    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;smtplib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SMTP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fromaddr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_string&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The emailbody is my html body I want in my email which may also include css in it. the variable EMAIL_FROM and 
EMAIL_TO are global variables which stored the file path where I could have the from email address and to email address.
If I want to send a plain text email, I use the following function&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;sendmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot; Send email with given subject and body &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;fromaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_FROM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;toaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_TO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEMultipart&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;From&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fromaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;To&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Subject&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MIMEText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;plain&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;smtplib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SMTP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fromaddr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_string&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I was recently using the sendhtmlemail function to send an email to multiple addresses. All I did was store the multiple 
 emails as a comma separated string in the EMAIL_TO file and found out that it was not being send to all the recipients. 
 It was only sent to the first recipient and the person who got it could see all the other people the email was sent to..&amp;nbsp;Strange!&lt;/p&gt;
&lt;p&gt;After poking around and reading the official docs, I found out that the second parameter in the smtplib.&lt;span class="caps"&gt;SMTP&lt;/span&gt;&amp;#8217;s 
 sendmail function takes a list of &lt;span class="caps"&gt;RFC&lt;/span&gt; 822 to-address strings (a bare string will be treated as a list with 1 address). 
 &lt;span class="caps"&gt;DOH&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;I fixed this by splitting the toaddr variable on the comma and storing it in a new list and feed the list to the sendmail
 function! Here is my final plain text sendmail version&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;sendmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="sd"&gt;&amp;quot;&amp;quot;&amp;quot; Send email with given subject and body &amp;quot;&amp;quot;&amp;quot;&lt;/span&gt;
    &lt;span class="n"&gt;fromaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_FROM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;toaddr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;readconfig&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;EMAIL_TO&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;MIMEMultipart&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;From&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;fromaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;To&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Subject&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;
    &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MIMEText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;plain&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="n"&gt;toaddr_list&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;x&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;strip&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;x&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;toaddr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;

    &lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;smtplib&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SMTP&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;localhost&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fromaddr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;toaddr_list&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;as_string&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
    &lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;quit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="python"/><category term="email"/></entry><entry><title>Lost SSH During Ubuntu Update</title><link href="https://www.nyayapati.com/srao/2018/01/lost-ssh-during-ubuntu-update/" rel="alternate"/><published>2018-01-24T22:00:00-05:00</published><updated>2018-01-24T22:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2018-01-24:/srao/2018/01/lost-ssh-during-ubuntu-update/</id><summary type="html">&lt;p&gt;I was trying to install security updates on my digitalocean vps and lost my ssh
connection. The one time I was not using tmux! &lt;span class="caps"&gt;GAH&lt;/span&gt;!! It was also stuck at a
stage where it was waiting for me to put in what config changes to use for some
software package …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was trying to install security updates on my digitalocean vps and lost my ssh
connection. The one time I was not using tmux! &lt;span class="caps"&gt;GAH&lt;/span&gt;!! It was also stuck at a
stage where it was waiting for me to put in what config changes to use for some
software package (use my previous or use the&amp;nbsp;default)&lt;/p&gt;
&lt;p&gt;When I logged in again and tried to run the apt-get update again, I saw the following
error&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;E:&lt;span class="w"&gt; &lt;/span&gt;Could&lt;span class="w"&gt; &lt;/span&gt;not&lt;span class="w"&gt; &lt;/span&gt;get&lt;span class="w"&gt; &lt;/span&gt;lock&lt;span class="w"&gt; &lt;/span&gt;/var/lib/dpkg/lock&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;open&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;Resource&lt;span class="w"&gt; &lt;/span&gt;temporarily&lt;span class="w"&gt; &lt;/span&gt;unavailable&lt;span class="o"&gt;)&lt;/span&gt;
E:&lt;span class="w"&gt; &lt;/span&gt;Unable&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;lock&lt;span class="w"&gt; &lt;/span&gt;the&lt;span class="w"&gt; &lt;/span&gt;administration&lt;span class="w"&gt; &lt;/span&gt;directory&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;/var/lib/dpkg/&lt;span class="o"&gt;)&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;is&lt;span class="w"&gt; &lt;/span&gt;another&lt;span class="w"&gt; &lt;/span&gt;process&lt;span class="w"&gt; &lt;/span&gt;using&lt;span class="w"&gt; &lt;/span&gt;it?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So had to find my running process and kill it. Even after killing it, I was
seeing the same error. Turns out I can resume my upgrade from where my ssh
connection died, using the following command&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;dpkg&lt;span class="w"&gt; &lt;/span&gt;--configure&lt;span class="w"&gt; &lt;/span&gt;-a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="linux"/><category term="ubuntu"/></entry><entry><title>How to install MongoDB on a Mac</title><link href="https://www.nyayapati.com/srao/2016/02/how-to-install-mongodb-on-a-mac/" rel="alternate"/><published>2016-02-02T00:00:00-05:00</published><updated>2016-02-02T00:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2016-02-02:/srao/2016/02/how-to-install-mongodb-on-a-mac/</id><summary type="html">&lt;p&gt;I am starting to teach myself the &lt;span class="caps"&gt;MEAN&lt;/span&gt; stack. The &lt;span class="caps"&gt;MEAN&lt;/span&gt; stack
makes use of MongoDB, Express.js, Angular.js and Node.js. The best
part about this stack is that all parts of the stack can be written
in Javascript. Read this &lt;a href="https://en.wikipedia.org/wiki/MEAN_(software_bundle)"&gt;wikipedia&lt;/a&gt; article to know&amp;nbsp;more.&lt;/p&gt;
&lt;p&gt;The best …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am starting to teach myself the &lt;span class="caps"&gt;MEAN&lt;/span&gt; stack. The &lt;span class="caps"&gt;MEAN&lt;/span&gt; stack
makes use of MongoDB, Express.js, Angular.js and Node.js. The best
part about this stack is that all parts of the stack can be written
in Javascript. Read this &lt;a href="https://en.wikipedia.org/wiki/MEAN_(software_bundle)"&gt;wikipedia&lt;/a&gt; article to know&amp;nbsp;more.&lt;/p&gt;
&lt;p&gt;The best way to install mongodb is using homebrew. First make sure homebrew is upto date and there are no&amp;nbsp;issues&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;brew&lt;span class="w"&gt; &lt;/span&gt;update
$&lt;span class="w"&gt; &lt;/span&gt;brew&lt;span class="w"&gt; &lt;/span&gt;doctor
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then install mongodb&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;brew&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;mongodb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Once mongodb is installed, create a data directory where mongodb will create all its database files&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;/data/db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now change ownership to your account so you dont have to use sudo to run&amp;nbsp;mongodb-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;chown&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;id&lt;span class="w"&gt; &lt;/span&gt;-u&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/data/db
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Thats it! Now run the &amp;#8216;mongod&amp;#8217; command to run your instance of mongodb without using&amp;nbsp;sudo.&lt;/p&gt;</content><category term="software"/><category term="mongodb"/><category term="mac"/></entry><entry><title>How to install npm packages on osx without sudo</title><link href="https://www.nyayapati.com/srao/2016/02/how-to-install-npm-packages-on-osx-without-sudo/" rel="alternate"/><published>2016-02-02T00:00:00-05:00</published><updated>2016-02-02T00:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2016-02-02:/srao/2016/02/how-to-install-npm-packages-on-osx-without-sudo/</id><summary type="html">&lt;p&gt;One of the best features of python is how you can have project specific python environments using virtualenv. That way you are not putting any python packages in the global area. I knew I wanted to do something similar for managing and installing npm packages. Basically I did not want …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One of the best features of python is how you can have project specific python environments using virtualenv. That way you are not putting any python packages in the global area. I knew I wanted to do something similar for managing and installing npm packages. Basically I did not want to install the packages in the global area which could mean I would have to use sudo to&amp;nbsp;install.&lt;/p&gt;
&lt;p&gt;Reading up on the internet, I found that npm and node can cause a lot of headache if not setup&amp;nbsp;correctly. &lt;/p&gt;
&lt;p&gt;I followed the following links to setup my environment
http://www.johnpapa.net/how-to-use-npm-global-without-sudo-on-osx/
https://gist.github.com/DanHerbert/9520689&amp;nbsp;https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md&lt;/p&gt;</content><category term="software"/><category term="node"/><category term="npm"/><category term="mac"/></entry><entry><title>Pindi Chole</title><link href="https://www.nyayapati.com/srao/2016/01/pindi-chole/" rel="alternate"/><published>2016-01-24T10:00:00-05:00</published><updated>2016-01-24T10:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2016-01-24:/srao/2016/01/pindi-chole/</id><summary type="html">&lt;p&gt;This is my aunt Leela Mangu&amp;#8217;s special pindi chole&amp;nbsp;recipe.&lt;/p&gt;
&lt;p&gt;Boil 2 cups Chana with 2 tsp ground tea leaves, 2-3 Laung, 2 tsp amla pdr,&amp;nbsp;salt.&lt;/p&gt;
&lt;p&gt;Fry in oil 1 inch ginger, some garlic till brown, add 2 small tomatoes chopped to small pieces.
Add Haldi, little jeera …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is my aunt Leela Mangu&amp;#8217;s special pindi chole&amp;nbsp;recipe.&lt;/p&gt;
&lt;p&gt;Boil 2 cups Chana with 2 tsp ground tea leaves, 2-3 Laung, 2 tsp amla pdr,&amp;nbsp;salt.&lt;/p&gt;
&lt;p&gt;Fry in oil 1 inch ginger, some garlic till brown, add 2 small tomatoes chopped to small pieces.
Add Haldi, little jeera pdr n dhaniya pdr (1/2 tsp), chole masala- 1.5 tsp. When oil starts to leave the masala, add a little of the boiled channa  (mashed somewhat.) Add 1 tsp chai leaves. Add rest of the Chana, let it cook. Then Add anardana 2 tsp, mix well and&amp;nbsp;garnish.&lt;/p&gt;</content><category term="recipes"/><category term="family-recipes"/></entry><entry><title>sambar</title><link href="https://www.nyayapati.com/srao/2016/01/sambar/" rel="alternate"/><published>2016-01-24T00:00:00-05:00</published><updated>2016-01-24T00:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2016-01-24:/srao/2016/01/sambar/</id><summary type="html">&lt;p&gt;This is a recipe I got from my mother-in-law. The cool part about this recipe is that it is made without using any sambar&amp;nbsp;powder. &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Imli - nimbu&amp;nbsp;size&lt;/li&gt;
&lt;li&gt;Vegetables -any of the veggies drumstick, bindi, shimla mirch, red pumpkin, white peta,&amp;nbsp;onion&lt;/li&gt;
&lt;li&gt;coconut - Half coconut-&amp;nbsp;grated&lt;/li&gt;
&lt;li&gt;Masala - chana dal …&lt;/li&gt;&lt;/ol&gt;</summary><content type="html">&lt;p&gt;This is a recipe I got from my mother-in-law. The cool part about this recipe is that it is made without using any sambar&amp;nbsp;powder. &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Imli - nimbu&amp;nbsp;size&lt;/li&gt;
&lt;li&gt;Vegetables -any of the veggies drumstick, bindi, shimla mirch, red pumpkin, white peta,&amp;nbsp;onion&lt;/li&gt;
&lt;li&gt;coconut - Half coconut-&amp;nbsp;grated&lt;/li&gt;
&lt;li&gt;Masala - chana dal, sabud dhaniya, pepper, methi, hing, sabud&amp;nbsp;mirch&lt;/li&gt;
&lt;li&gt;Toor&amp;nbsp;daal&lt;/li&gt;
&lt;li&gt;Tadka - rai, methi, kadi patta and sabud&amp;nbsp;mirch&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Method&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Soak imli and microwave and&amp;nbsp;cool&lt;/li&gt;
&lt;li&gt;Sqeeze out imli&amp;nbsp;water&lt;/li&gt;
&lt;li&gt;Boil any two or three vegetables in imli&amp;nbsp;water&lt;/li&gt;
&lt;li&gt;Add haldi and namak while&amp;nbsp;boiling&lt;/li&gt;
&lt;li&gt;Pressure cook toor dal with&amp;nbsp;haldi&lt;/li&gt;
&lt;li&gt;Mash the toor dal and add it to the cooked&amp;nbsp;vegetable.&lt;/li&gt;
&lt;li&gt;Roast and grind the masala with coconut and add to the&amp;nbsp;sambhar&lt;/li&gt;
&lt;li&gt;after it has boiled for some time add&amp;nbsp;tadka&lt;/li&gt;
&lt;/ol&gt;</content><category term="recipes"/><category term="family-recipes"/></entry><entry><title>sambar</title><link href="https://www.nyayapati.com/srao/2016/01/sambar/" rel="alternate"/><published>2016-01-24T00:00:00-05:00</published><updated>2016-01-24T00:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2016-01-24:/srao/2016/01/sambar/</id><summary type="html">&lt;p&gt;This is a recipe I got from my mother-in-law. The cool part about this recipe is that it is made without using any sambar&amp;nbsp;powder. &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Imli - nimbu&amp;nbsp;size&lt;/li&gt;
&lt;li&gt;Vegetables -any of the veggies drumstick, bindi, shimla mirch, red pumpkin, white peta,&amp;nbsp;onion&lt;/li&gt;
&lt;li&gt;coconut - Half coconut-&amp;nbsp;grated&lt;/li&gt;
&lt;li&gt;Masala - chana dal …&lt;/li&gt;&lt;/ol&gt;</summary><content type="html">&lt;p&gt;This is a recipe I got from my mother-in-law. The cool part about this recipe is that it is made without using any sambar&amp;nbsp;powder. &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Imli - nimbu&amp;nbsp;size&lt;/li&gt;
&lt;li&gt;Vegetables -any of the veggies drumstick, bindi, shimla mirch, red pumpkin, white peta,&amp;nbsp;onion&lt;/li&gt;
&lt;li&gt;coconut - Half coconut-&amp;nbsp;grated&lt;/li&gt;
&lt;li&gt;Masala - chana dal, sabud dhaniya, pepper, methi, hing, sabud&amp;nbsp;mirch&lt;/li&gt;
&lt;li&gt;Toor&amp;nbsp;daal&lt;/li&gt;
&lt;li&gt;Tadka - rai, methi, kadi patta and sabud&amp;nbsp;mirch&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Method&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Soak imli and microwave and&amp;nbsp;cool&lt;/li&gt;
&lt;li&gt;Sqeeze out imli&amp;nbsp;water&lt;/li&gt;
&lt;li&gt;Boil any two or three vegetables in imli&amp;nbsp;water&lt;/li&gt;
&lt;li&gt;Add haldi and namak while&amp;nbsp;boiling&lt;/li&gt;
&lt;li&gt;Pressure cook toor dal with&amp;nbsp;haldi&lt;/li&gt;
&lt;li&gt;Mash the toor dal and add it to the cooked&amp;nbsp;vegetable.&lt;/li&gt;
&lt;li&gt;Roast and grind the masala with coconut and add to the&amp;nbsp;sambhar&lt;/li&gt;
&lt;li&gt;after it has boiled for some time add&amp;nbsp;tadka&lt;/li&gt;
&lt;/ol&gt;</content><category term="recipes"/><category term="family-recipes"/></entry><entry><title>Bellam Menthikai</title><link href="https://www.nyayapati.com/srao/2015/12/bellam-menthikai/" rel="alternate"/><published>2015-12-09T10:00:00-05:00</published><updated>2015-12-09T10:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2015-12-09:/srao/2015/12/bellam-menthikai/</id><summary type="html">&lt;p&gt;This is my aunt Suguna Rao&amp;#8217;s recipe. This is a quick way of making this recipe. This does not involve drying the mango in the&amp;nbsp;sun. &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;One raw green mango (remove skin and cut into chips) - 2&amp;nbsp;cups&lt;/li&gt;
&lt;li&gt;Gud - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Salt - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Mirchi Powder - 1 …&lt;/li&gt;&lt;/ol&gt;</summary><content type="html">&lt;p&gt;This is my aunt Suguna Rao&amp;#8217;s recipe. This is a quick way of making this recipe. This does not involve drying the mango in the&amp;nbsp;sun. &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;One raw green mango (remove skin and cut into chips) - 2&amp;nbsp;cups&lt;/li&gt;
&lt;li&gt;Gud - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Salt - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Mirchi Powder - 1&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Menthi podi - 2&amp;nbsp;pinch&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Method&amp;nbsp;1&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Mix the cut mango with gud, salt and mirchi powder. Cover and keep&amp;nbsp;aside&lt;/li&gt;
&lt;li&gt;Next day add 2 pinches of menti podi and mix really&amp;nbsp;well.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The above recipe does not last long and you need to finish it up quickly. If you want to make a bigger
batch and want it to last longer you need to put it out in the&amp;nbsp;sun.&lt;/p&gt;
&lt;h2&gt;Method&amp;nbsp;2&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Mix the cut mango with gud and&amp;nbsp;salt&lt;/li&gt;
&lt;li&gt;keep it out in the sun everyday till you see it oozing a&amp;nbsp;syrup&lt;/li&gt;
&lt;li&gt;Add the mirchi powder and menti podi and mix&amp;nbsp;well&lt;/li&gt;
&lt;/ol&gt;</content><category term="recipes"/><category term="family-recipes"/></entry><entry><title>Coconut Chutney</title><link href="https://www.nyayapati.com/srao/2015/12/coconut-chutney/" rel="alternate"/><published>2015-12-09T09:30:00-05:00</published><updated>2015-12-09T09:30:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2015-12-09:/srao/2015/12/coconut-chutney/</id><summary type="html">&lt;p&gt;Coconut chutney goes great with Idli&amp;#8217;s, Dosa&amp;#8217;s and vadda&amp;#8217;s. One recent thread on my family&amp;#8217;s recipes group on facebook had a 
couple of variations on this traditional chutney. I will try to post all the different styles on making this&amp;nbsp;dish.&lt;/p&gt;
&lt;h2&gt;&lt;span class="caps"&gt;M.S.&lt;/span&gt; Leela&amp;nbsp;Method&lt;/h2&gt;
&lt;p&gt;Ingredients …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Coconut chutney goes great with Idli&amp;#8217;s, Dosa&amp;#8217;s and vadda&amp;#8217;s. One recent thread on my family&amp;#8217;s recipes group on facebook had a 
couple of variations on this traditional chutney. I will try to post all the different styles on making this&amp;nbsp;dish.&lt;/p&gt;
&lt;h2&gt;&lt;span class="caps"&gt;M.S.&lt;/span&gt; Leela&amp;nbsp;Method&lt;/h2&gt;
&lt;p&gt;Ingredients - Take half a coconut
              two or three green chillies
              less than half teaspoonful of lal mirch powder,
              5-6 curry leaves
              A pinch of hing
              Tamarind or lime juice per&amp;nbsp;taste&lt;/p&gt;
&lt;p&gt;Method -      Add all above and make a smooth paste in a grinder/Mixie. Add salt to taste and finally 
              add a tadka of mustard seeds and curry&amp;nbsp;leaves&lt;/p&gt;
&lt;p&gt;Variation to above method from my aunt Suguna Rao - Add one table spoon of yogurt while making paste in the&amp;nbsp;grinder.&lt;/p&gt;
&lt;h2&gt;Sita Rao&amp;nbsp;Method&lt;/h2&gt;
&lt;p&gt;Take equal quantity of grated coconut and fried chutney dal. Add green chillies, salt and grind to smooth paste. 
Add a tempering of mustard seeds, jeera, udad dal and dried red&amp;nbsp;chillies.&lt;/p&gt;
&lt;p&gt;variation - add raw onion and ginger while grinding the smooth&amp;nbsp;paste.&lt;/p&gt;</content><category term="recipes"/><category term="family-recipes"/></entry><entry><title>Mukkala Pulusu</title><link href="https://www.nyayapati.com/srao/2015/12/mukkala-pulusu/" rel="alternate"/><published>2015-12-09T08:45:00-05:00</published><updated>2015-12-09T08:45:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2015-12-09:/srao/2015/12/mukkala-pulusu/</id><summary type="html">&lt;p&gt;My relatives started a new group on facebook to share family recipes. I thought I would start 
writing them down on my blog so they are searchable. The first recipe is a Andhra dish called Mukkala Pulusu. 
Some other names it is known as are &amp;#8216;Theepi Pulusu&amp;#8217;, &amp;#8216;Dappalam&amp;#8217; and &amp;#8216;Meetha …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My relatives started a new group on facebook to share family recipes. I thought I would start 
writing them down on my blog so they are searchable. The first recipe is a Andhra dish called Mukkala Pulusu. 
Some other names it is known as are &amp;#8216;Theepi Pulusu&amp;#8217;, &amp;#8216;Dappalam&amp;#8217; and &amp;#8216;Meetha Pulusu&amp;#8217;. This recipe is from &lt;span class="caps"&gt;M.S.&lt;/span&gt; Leela. She is one of my Dad&amp;#8217;s elder sisters. Here is the recipe&amp;nbsp;- &lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Pumpkin -&amp;nbsp;250gms&lt;/li&gt;
&lt;li&gt;Eggplant -&amp;nbsp;250gms&lt;/li&gt;
&lt;li&gt;Okra/Ladies finger -&amp;nbsp;250gms&lt;/li&gt;
&lt;li&gt;Optional vegetables - Gheeya/Sweet&amp;nbsp;Potato/Carrots&lt;/li&gt;
&lt;li&gt;Gud - one big ladoo (1&amp;nbsp;fist)&lt;/li&gt;
&lt;li&gt;Besan&lt;/li&gt;
&lt;li&gt;Green Koriander/Hara&amp;nbsp;Dhaniya&lt;/li&gt;
&lt;li&gt;Green&amp;nbsp;Chillies&lt;/li&gt;
&lt;li&gt;Salt&lt;/li&gt;
&lt;li&gt;Haldi&lt;/li&gt;
&lt;li&gt;Imli Water - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Tadka/Tempering - jeera, Mustard seeds, Urad Dal, Meethi seeds, Dried Red Chillies, Kaddi Patta,&amp;nbsp;Hing&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;Recipe&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Boil all the vegetables in 3 glasses of water along with dhaniya, hari mirch, haldi, salt and gud in a&amp;nbsp;pot.&lt;/li&gt;
&lt;li&gt;Boil imli and add the pulp to the boiled&amp;nbsp;vegetables.&lt;/li&gt;
&lt;li&gt;Roast besan; cool it and stir in half a cup of&amp;nbsp;water.&lt;/li&gt;
&lt;li&gt;While Stirring the pulusu add the besan&amp;nbsp;mix.&lt;/li&gt;
&lt;li&gt;Temper all the ingredients meant from tempering from above list of ingredients (item 12) and add to the&amp;nbsp;pot.&lt;/li&gt;
&lt;li&gt;In the end, add more hara dhaniya and serve it&amp;nbsp;hot.&lt;/li&gt;
&lt;/ol&gt;</content><category term="recipes"/><category term="family-recipes"/></entry><entry><title>Adding new Content Using Pelican and Github</title><link href="https://www.nyayapati.com/srao/2015/10/adding-new-content-using-pelican-and-github/" rel="alternate"/><published>2015-10-05T14:00:00-04:00</published><updated>2015-10-05T14:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2015-10-05:/srao/2015/10/adding-new-content-using-pelican-and-github/</id><summary type="html">&lt;p&gt;I am super excited to finally get this end to end workflow to work. I am writing this post from Github, 
which in turn causes travis-ci to do a pelican build and finally push the build to shireenrao.github.io and also 
pushes the build to &lt;a href="http://www.nyayapati.com/srao"&gt;my personal blog&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am super excited to finally get this end to end workflow to work. I am writing this post from Github, 
which in turn causes travis-ci to do a pelican build and finally push the build to shireenrao.github.io and also 
pushes the build to &lt;a href="http://www.nyayapati.com/srao"&gt;my personal blog&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;I will follow this up with a detailed how-to&amp;nbsp;soon.&lt;/p&gt;</content><category term="software"/><category term="pelican"/><category term="github"/><category term="travis-ci"/></entry><entry><title>Kadai Gosht</title><link href="https://www.nyayapati.com/srao/2015/05/kadai-gosht/" rel="alternate"/><published>2015-05-10T22:34:00-04:00</published><updated>2015-05-10T22:34:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2015-05-10:/srao/2015/05/kadai-gosht/</id><summary type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2015/05/IMG_7245.jpg"&gt;&lt;img alt="IMG_7245" src="https://www.nyayapati.com/srao/wp-content/uploads/2015/05/IMG_7245.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This dish is a very popular dish from North India. I have had this at restaurants and Dhaba&amp;#8217;s in and around New Delhi. So how is this different than all the different types of mutton I have made in the past. Well.. I did some research and found this …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2015/05/IMG_7245.jpg"&gt;&lt;img alt="IMG_7245" src="https://www.nyayapati.com/srao/wp-content/uploads/2015/05/IMG_7245.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This dish is a very popular dish from North India. I have had this at restaurants and Dhaba&amp;#8217;s in and around New Delhi. So how is this different than all the different types of mutton I have made in the past. Well.. I did some research and found this recipe and tried it today. It came out really well!! I am really satisifed with the results and all I can say it&amp;#8217;s all in the execution. Here is the recipe&amp;nbsp;-&lt;/p&gt;
&lt;h2&gt;Ingredients&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Goat meat - 2 1/2 pounds in 1 to 2 inch&amp;nbsp;chunks&lt;/li&gt;
&lt;li&gt;Onions - 2 big red onions&amp;nbsp;sliced&lt;/li&gt;
&lt;li&gt;Tomatoes - 3 Vine tomotoes&amp;nbsp;sliced&lt;/li&gt;
&lt;li&gt;Ginger and Garlic paste - 3&amp;nbsp;tbls&lt;/li&gt;
&lt;li&gt;Chili Powder - 1 tsp (2-3 if you want&amp;nbsp;spicy)&lt;/li&gt;
&lt;li&gt;turmeric powder 1/2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Cumin POwder - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Coriander Powder - 3&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Salt - to&amp;nbsp;taste&lt;/li&gt;
&lt;li&gt;Crushed Dried Fenugreek leaf - 1&amp;nbsp;tbls&lt;/li&gt;
&lt;li&gt;Green Chilies - 4-5 (may add 3-4 more if you want it&amp;nbsp;spicy)&lt;/li&gt;
&lt;li&gt;Cilantro - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Yogurt - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Oil - 1&amp;nbsp;cup&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Recipe&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;Heat oil in a dutch&amp;nbsp;oven&lt;/li&gt;
&lt;li&gt;Add the ginger garlic paste and cook for a&amp;nbsp;minute&lt;/li&gt;
&lt;li&gt;Add the goat meat and brown it for maybe 5&amp;nbsp;minutes.&lt;/li&gt;
&lt;li&gt;Add the sliced onions and&amp;nbsp;tomatoes&lt;/li&gt;
&lt;li&gt;Add chili powder, cumin powder, coriander powder, turmeric powder, salt and crushed fenugreek&amp;nbsp;leave&lt;/li&gt;
&lt;li&gt;Mix all the spices well into the meat, onions and&amp;nbsp;tomatoes.&lt;/li&gt;
&lt;li&gt;Now reduce heat to medium and put a lid on the dutch&amp;nbsp;oven&lt;/li&gt;
&lt;li&gt;You don&amp;#8217;t need to add any water. You will see a lot of liquid starts forming in the dish because of all the&amp;nbsp;ingredients.&lt;/li&gt;
&lt;li&gt;After 5 minutes add the yogurt and mix it into the&amp;nbsp;dish. &lt;/li&gt;
&lt;li&gt;Keep mixing every 5-10 minutes and make sure nothing sticks to the bottom. Cook for an hour or till the meat is&amp;nbsp;tender.&lt;/li&gt;
&lt;li&gt;Once you see the oil oozing at the top, add the green chilies and cilantro and mix it in the&amp;nbsp;curry.&lt;/li&gt;
&lt;li&gt;Now you can remove the lid and cook till the gravy reduces to required&amp;nbsp;consistency. &lt;/li&gt;
&lt;li&gt;Serve with hot Naan or tandoori&amp;nbsp;rotis&lt;/li&gt;
&lt;/ol&gt;</content><category term="recipes"/><category term="mutton"/><category term="goat"/></entry><entry><title>Where is the sqlite file for my Flask app</title><link href="https://www.nyayapati.com/srao/2015/04/where-is-the-sqlite-file-for-my-flask-app/" rel="alternate"/><published>2015-04-24T13:34:00-04:00</published><updated>2015-04-24T13:34:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2015-04-24:/srao/2015/04/where-is-the-sqlite-file-for-my-flask-app/</id><summary type="html">&lt;p&gt;I am really enjoying working with the Python Flask Web Framework. I won
a O&amp;#8217;Reilly book last year on Flask Web Development by Miguel Grinberg and am
finally getting around to reading it and trying out what the book teaches. So
far it&amp;#8217;s been&amp;nbsp;excellent!&lt;/p&gt;
&lt;p&gt;From the start …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am really enjoying working with the Python Flask Web Framework. I won
a O&amp;#8217;Reilly book last year on Flask Web Development by Miguel Grinberg and am
finally getting around to reading it and trying out what the book teaches. So
far it&amp;#8217;s been&amp;nbsp;excellent!&lt;/p&gt;
&lt;p&gt;From the start of the book we develop a simple app and add new features as we
learn new concepts. I got to the Databases chapter and hit my first roadblock!
The book teaches you to use SQLAlchemy for database management which is good. 
That way you interact with one library and behind the scenes you can have any 
of the supported databases. For the examples in the book we used&amp;nbsp;sqlite.&lt;/p&gt;
&lt;p&gt;Here is the snippet I typed in to create my database instance. This is not a complete
working snippet. It just has parts which are relevant to start using&amp;nbsp;SQLAlchemy.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;flask_sqlalchemy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SQLAlchemy&lt;/span&gt;

&lt;span class="n"&gt;basedir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SQLALCHEMY_DATA_BASE_URI&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;\
    &lt;span class="s1"&gt;&amp;#39;sqlite:////&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;basedir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;data.sqlite&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SQLALCHEMY_COMMIT_ON_TEARDOWN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;

&lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SQLAlchemy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I then define my database models. The book shows us examples on how to create
User table and Role table and how they are related. Then to exercise different
database operations it shows how you can open a Flask shell and try out the
different commands on the command prompt. The flask shell is possible because
of the Flask-Script extension. All you have to do is to first install
flask-script in your&amp;nbsp;virtualenv&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;flask-script
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;then in your flask app use the Manager provided by flask_script&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;flask&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;flask_script&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Manager&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;manager&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Manager&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# ...&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="vm"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;__main__&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;manager&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;run&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This allows you to interact with your flask app on the command line. This also
lets you open a python shell while the app is running. Works great for testing&amp;nbsp;purposes. &lt;/p&gt;
&lt;p&gt;So with the database instance defined, I opened the python shell to test out
the different database operations. The first command you learn is the
create_all command. This creates your tables based on the model you defined.
Here is my interactive session&amp;nbsp;- &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;venv&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="n"&gt;hello&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt; &lt;span class="n"&gt;shell&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;hello&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;create_all&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;At this point the application directory should have a new file called
data.sqlite. This is the name we gave to  our database in app.config above. I
did not see the file in the application directory. I proceeded with the
exercise of creating roles and users and commiting my work. I could query the
tables too. I checked the application directory again and again didnt see the
file. This was getting wierd!! where is the&amp;nbsp;file???&lt;/p&gt;
&lt;p&gt;I turned to google and found a solution on stackoverflow. It turns out that I
had a typo in my configuration for the database, because of which my database
was created in memory. That was sneaky! I would have preffered an error
instead. In the config secriotn, instead of &amp;#8216;SQLALCHEMY_DATA_BASE_URI&amp;#8217; it should have been&amp;nbsp;&amp;#8216;SQLALCHEMY_DATABASE_URI&amp;#8217;. &lt;/p&gt;
&lt;p&gt;Here is the corrected&amp;nbsp;snippet&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;flask_sqlalchemy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;SQLAlchemy&lt;/span&gt;

&lt;span class="n"&gt;basedir&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;abspath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;dirname&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__file__&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Flask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="vm"&gt;__name__&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SQLALCHEMY_DATABASE_URI&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;\
    &lt;span class="s1"&gt;&amp;#39;sqlite:////&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;basedir&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;data.sqlite&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;config&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;SQLALCHEMY_COMMIT_ON_TEARDOWN&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;

&lt;span class="n"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;SQLAlchemy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="macosx"/><category term="python"/><category term="flask"/></entry><entry><title>Installing homebrew MacVim with YouCompleteMe on Yosemite</title><link href="https://www.nyayapati.com/srao/2014/12/installing-homebrew-macvim-with-youcompleteme-on-yosemite/" rel="alternate"/><published>2014-12-08T10:53:00-05:00</published><updated>2014-12-08T10:53:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-12-08:/srao/2014/12/installing-homebrew-macvim-with-youcompleteme-on-yosemite/</id><summary type="html">&lt;p&gt;I was pulling my hair to get my vim setup with YouCompleteMe on my
macbook after I upgraded to Yosemite. On Mavericks it was pretty
straight forward. The following used to work&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# install xcode and command line tools  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;xcode-select&lt;span class="w"&gt; &lt;/span&gt;--install&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# install homebrew  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;ruby&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-fsSL&lt;span class="w"&gt; &lt;/span&gt;https://raw.githubusercontent.com …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I was pulling my hair to get my vim setup with YouCompleteMe on my
macbook after I upgraded to Yosemite. On Mavericks it was pretty
straight forward. The following used to work&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# install xcode and command line tools  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;xcode-select&lt;span class="w"&gt; &lt;/span&gt;--install&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# install homebrew  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;ruby&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-fsSL&lt;span class="w"&gt; &lt;/span&gt;https://raw.githubusercontent.com/Homebrew/install/master/install&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# install python  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;brew&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# install macvim  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;brew&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;macvim
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now following instructions on the &lt;a href="https://github.com/gmarik/Vundle.vim"&gt;Vundle Github
page&lt;/a&gt; to setup Vundle.&lt;br&gt;
Add the reference to YouCompleteMe plugin in your .vimrc file along
with other plugins you use. Here is what mine looks like&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;nocompatible&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; be iMproved, required  &lt;/span&gt;
&lt;span class="s2"&gt;filetype off &amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;required

&lt;span class="s2"&gt;&amp;quot; set the runtime path to include Vundle and initialize  &lt;/span&gt;
&lt;span class="s2"&gt;set rtp+=~/.vim/bundle/Vundle.vim  &lt;/span&gt;
&lt;span class="s2"&gt;call vundle#begin()  &lt;/span&gt;
&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;alternatively,&lt;span class="w"&gt; &lt;/span&gt;pass&lt;span class="w"&gt; &lt;/span&gt;a&lt;span class="w"&gt; &lt;/span&gt;path&lt;span class="w"&gt; &lt;/span&gt;where&lt;span class="w"&gt; &lt;/span&gt;Vundle&lt;span class="w"&gt; &lt;/span&gt;should&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;plugins&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="s2"&gt;&amp;quot;call vundle#begin(&amp;#39;~/some/path/here&amp;#39;)&lt;/span&gt;

&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;let&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Vundle&lt;span class="w"&gt; &lt;/span&gt;manage&lt;span class="w"&gt; &lt;/span&gt;Vundle,&lt;span class="w"&gt; &lt;/span&gt;required&lt;span class="w"&gt;  &lt;/span&gt;
Plugin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;gmarik/Vundle.vim&amp;#39;&lt;/span&gt;

Plugin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;altercation/vim-colors-solarized&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Plugin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Lokaltog/powerline&amp;#39;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;rtp&amp;#39;&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;powerline/bindings/vim/&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Plugin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;kien/ctrlp.vim&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Plugin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;scrooloose/syntastic&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Plugin&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;Valloric/YouCompleteMe&amp;#39;&lt;/span&gt;

&lt;span class="s2"&gt;&amp;quot; All of your Plugins must be added before the following line  &lt;/span&gt;
&lt;span class="s2"&gt;call vundle#end() &amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;required&lt;span class="w"&gt;  &lt;/span&gt;
filetype&lt;span class="w"&gt; &lt;/span&gt;plugin&lt;span class="w"&gt; &lt;/span&gt;indent&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; required&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now Install all plugins including YouCompleteMe using Vundle by
launching vim and executing&amp;nbsp;:PluginInstall&lt;/p&gt;
&lt;p&gt;Complete &lt;span class="caps"&gt;YCM&lt;/span&gt; install by running the following from within the &lt;span class="caps"&gt;YCM&lt;/span&gt; vim
bundle&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/.vim/bundle/YouCompleteMe&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;./install.sh&lt;span class="w"&gt; &lt;/span&gt;--clang-completer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now after doing the above on Yosemite, everytime I opened vi, I would
get a python crashed error message pop&amp;nbsp;up.&lt;/p&gt;
&lt;p&gt;After looking around for a fix, this
&lt;a href="https://github.com/Valloric/YouCompleteMe/issues/1136"&gt;post&lt;/a&gt; gave me
the right direction.&lt;br&gt;
I first have to make sure I have the file&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;/Library/Developer/CommandLineTools/usr/lib/libclang.dylib&lt;/p&gt;
&lt;p&gt;If the above file is missing, that means command line tools has not been
installed.&lt;br&gt;
Run &amp;#8220;xcode-select &amp;#8212;install&amp;#8221; and follow the prompts to install command
line&amp;nbsp;tools.&lt;/p&gt;
&lt;p&gt;I exported the variable EXTRA_CMAKE_ARGS on terminal&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nv"&gt;EXTRA_CMAKE_ARGS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;-DEXTERNAL_LIBCLANG_PATH=/Library/Developer/CommandLineTools/usr/lib/libclang.dylib&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then in the same terminal session running the following&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/.vim/bundle/YouCompleteMe&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;./install.sh&lt;span class="w"&gt; &lt;/span&gt;--clang-completer&lt;span class="w"&gt; &lt;/span&gt;--system-libclang
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That did the trick. MacVim with YouCompleteMe should now be working.
CodeCompletion on vim could not get any better&amp;nbsp;:)&lt;/p&gt;</content><category term="software"/><category term="macosx"/><category term="python"/><category term="vim"/></entry><entry><title>How to pip install python packages offline</title><link href="https://www.nyayapati.com/srao/2014/06/how-to-pip-install-python-packages-offline/" rel="alternate"/><published>2014-06-04T17:18:00-04:00</published><updated>2014-06-04T17:18:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-06-04:/srao/2014/06/how-to-pip-install-python-packages-offline/</id><summary type="html">&lt;p&gt;You may wonder why would you even need to do that.. Well in my case, I
was using virtualenv for a project I was working on and when it came
time to install the needed python packages, I realized I was on a train
with no internet connection. I had …&lt;/p&gt;</summary><content type="html">&lt;p&gt;You may wonder why would you even need to do that.. Well in my case, I
was using virtualenv for a project I was working on and when it came
time to install the needed python packages, I realized I was on a train
with no internet connection. I had those packages installed on my
system, but not in my virtualenv. That put the kibosh on my work that
day. So when I found that you can actually create a kind of a local
repository on your computer so you could then pip install from that
location.. I was&amp;nbsp;excited!!&lt;/p&gt;
&lt;p&gt;Start by deciding where would that location be. I put it as a dot
directory in my home folder on my mac. The dot folder makes it a hidden
folder so it doesn&amp;#8217;t clutter your finder window. I called my location
.mypypi. So for instance if you wanted to make sure your virtualenv
should have ipython, ipdb and django whenever you create it, you would
first need to download it into your pypi repository you created. I would
do the&amp;nbsp;following&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;.mypypi&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;--download&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.mypypi&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt; &lt;/span&gt;ipdb&lt;span class="w"&gt; &lt;/span&gt;django&lt;span class="w"&gt;  &lt;/span&gt;
Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt;  &lt;/span&gt;
Downloading&lt;span class="w"&gt; &lt;/span&gt;ipython-2.1.0-py2-none-any.whl&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.8MB&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.8MB&lt;span class="w"&gt; &lt;/span&gt;downloaded&lt;span class="w"&gt;  &lt;/span&gt;
Saved&lt;span class="w"&gt; &lt;/span&gt;./.mypypi/ipython-2.1.0-py2-none-any.whl&lt;span class="w"&gt;  &lt;/span&gt;
Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;ipdb&lt;span class="w"&gt;  &lt;/span&gt;
Downloading&lt;span class="w"&gt; &lt;/span&gt;ipdb-0.8.zip&lt;span class="w"&gt;  &lt;/span&gt;
Saved&lt;span class="w"&gt; &lt;/span&gt;./.mypypi/ipdb-0.8.zip&lt;span class="w"&gt;  &lt;/span&gt;
Running&lt;span class="w"&gt; &lt;/span&gt;setup.py
&lt;span class="o"&gt;(&lt;/span&gt;path:/private/var/folders/qk/qk0fnpvd7jg3z8cp48ph2pvw0000gn/T/pip_build_shireenrao/ipdb/setup.py&lt;span class="o"&gt;)&lt;/span&gt;
egg_info&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;package&lt;span class="w"&gt; &lt;/span&gt;ipdb

Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;django&lt;span class="w"&gt;  &lt;/span&gt;
Downloading&lt;span class="w"&gt; &lt;/span&gt;Django-1.6.5-py2.py3-none-any.whl&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;.7MB&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;6&lt;/span&gt;.7MB
downloaded&lt;span class="w"&gt;  &lt;/span&gt;
Saved&lt;span class="w"&gt; &lt;/span&gt;./.mypypi/Django-1.6.5-py2.py3-none-any.whl&lt;span class="w"&gt;  &lt;/span&gt;
Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;gnureadline&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Downloading&lt;span class="w"&gt; &lt;/span&gt;gnureadline-6.3.3-cp27-none-macosx_10_9_x86_64.whl
&lt;span class="o"&gt;(&lt;/span&gt;132kB&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;132kB&lt;span class="w"&gt; &lt;/span&gt;downloaded&lt;span class="w"&gt;  &lt;/span&gt;
Saved&lt;span class="w"&gt; &lt;/span&gt;./.mypypi/gnureadline-6.3.3-cp27-none-macosx_10_9_x86_64.whl&lt;span class="w"&gt;  &lt;/span&gt;
Successfully&lt;span class="w"&gt; &lt;/span&gt;downloaded&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt; &lt;/span&gt;ipdb&lt;span class="w"&gt; &lt;/span&gt;django&lt;span class="w"&gt; &lt;/span&gt;gnureadline&lt;span class="w"&gt;  &lt;/span&gt;
Cleaning&lt;span class="w"&gt; &lt;/span&gt;up...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above command will also make sure all dependencies are also
downloaded. The command also will take a requirements file. Just put &amp;#8220;-r
requirements.txt&amp;#8221; instead of the package name in the above pip install&amp;nbsp;command.&lt;/p&gt;
&lt;p&gt;Now when you are in your virtualenv and are ready to install your
packages, this is all you have to do&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;--no-index&lt;span class="w"&gt; &lt;/span&gt;--find-links&lt;span class="o"&gt;=&lt;/span&gt;file:/&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.mypypi&lt;span class="w"&gt; &lt;/span&gt;ipython
ipdb&lt;span class="w"&gt; &lt;/span&gt;django&lt;span class="w"&gt;  &lt;/span&gt;
Ignoring&lt;span class="w"&gt; &lt;/span&gt;indexes:&lt;span class="w"&gt; &lt;/span&gt;https://pypi.python.org/simple/&lt;span class="w"&gt;  &lt;/span&gt;
Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt;  &lt;/span&gt;
Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;ipdb&lt;span class="w"&gt;  &lt;/span&gt;
Running&lt;span class="w"&gt; &lt;/span&gt;setup.py
&lt;span class="o"&gt;(&lt;/span&gt;path:/Users/shireenrao/mydev/python/temp/build/ipdb/setup.py&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;egg_info
&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;package&lt;span class="w"&gt; &lt;/span&gt;ipdb

Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;django&lt;span class="w"&gt;  &lt;/span&gt;
Downloading/unpacking&lt;span class="w"&gt; &lt;/span&gt;gnureadline&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Installing&lt;span class="w"&gt; &lt;/span&gt;collected&lt;span class="w"&gt; &lt;/span&gt;packages:&lt;span class="w"&gt; &lt;/span&gt;ipython,&lt;span class="w"&gt; &lt;/span&gt;ipdb,&lt;span class="w"&gt; &lt;/span&gt;django,&lt;span class="w"&gt; &lt;/span&gt;gnureadline&lt;span class="w"&gt;  &lt;/span&gt;
Running&lt;span class="w"&gt; &lt;/span&gt;setup.py&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ipdb

Installing&lt;span class="w"&gt; &lt;/span&gt;ipdb&lt;span class="w"&gt; &lt;/span&gt;script&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;/Users/shireenrao/mydev/python/temp/bin&lt;span class="w"&gt;  &lt;/span&gt;
Successfully&lt;span class="w"&gt; &lt;/span&gt;installed&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt; &lt;/span&gt;ipdb&lt;span class="w"&gt; &lt;/span&gt;django&lt;span class="w"&gt; &lt;/span&gt;gnureadline&lt;span class="w"&gt;  &lt;/span&gt;
Cleaning&lt;span class="w"&gt; &lt;/span&gt;up...
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Boom!! It&amp;#8217;s&amp;nbsp;done!!&lt;/p&gt;
&lt;p&gt;Again, the above command also works with &amp;#8220;-r requirements.txt&amp;#8221; instead
of the python package&amp;nbsp;name.&lt;/p&gt;</content><category term="software"/><category term="python"/></entry><entry><title>How to enable upload of files over 2MB in Wordpress running on nginx</title><link href="https://www.nyayapati.com/srao/2014/06/how-to-enable-upload-of-files-over-2mb-in-wordpress-running-on-nginx/" rel="alternate"/><published>2014-06-03T16:04:00-04:00</published><updated>2014-06-03T16:04:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-06-03:/srao/2014/06/how-to-enable-upload-of-files-over-2mb-in-wordpress-running-on-nginx/</id><summary type="html">&lt;p&gt;I was writing a post on a chicken dish I cooked yesterday. As I was
trying to upload some pictures, I saw that the upload failed because the
files were over &lt;span class="caps"&gt;2MB&lt;/span&gt;. This was the first time I was posting pictures on
my wordpress since I move to Digital Ocean …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was writing a post on a chicken dish I cooked yesterday. As I was
trying to upload some pictures, I saw that the upload failed because the
files were over &lt;span class="caps"&gt;2MB&lt;/span&gt;. This was the first time I was posting pictures on
my wordpress since I move to Digital Ocean as my hosting company. I knew
this was a limit on the php configuration on the server, so it was an
easy&amp;nbsp;fix.&lt;/p&gt;
&lt;p&gt;I logged in to my server and edited my php.ini located at
/etc/php5/fpm/php.ini. All I had to do was to change&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="x"&gt;upload_max_filesize = 2M&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="x"&gt;upload_max_filesize = 8M&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now restart the following services&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;service&lt;span class="w"&gt; &lt;/span&gt;php5-fpm&lt;span class="w"&gt; &lt;/span&gt;reload&lt;span class="w"&gt;  &lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;service&lt;span class="w"&gt; &lt;/span&gt;nginx&lt;span class="w"&gt; &lt;/span&gt;reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I went back to trying to upload the image. This time, the upload started
to happen but I eventually saw another failure. Turns out, this time it
was from Nginx. I found that nginx throws a 413 error if a file upload
exceeds its default&amp;nbsp;limit.&lt;/p&gt;
&lt;p&gt;All you have to do to fix that is to over-ride the default in your sites
config file. In my case I add the following in my default configuration
at /etc/nginx/sites-available/default in the server block right under
server_name&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;client_max_body_size&lt;span class="w"&gt; &lt;/span&gt;8M&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Restart the services&amp;nbsp;again-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;service&lt;span class="w"&gt; &lt;/span&gt;php5-fpm&lt;span class="w"&gt; &lt;/span&gt;reload&lt;span class="w"&gt;  &lt;/span&gt;
sudo&lt;span class="w"&gt; &lt;/span&gt;service&lt;span class="w"&gt; &lt;/span&gt;nginx&lt;span class="w"&gt; &lt;/span&gt;reload
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The picture uploads worked this time&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s been great with Digital Ocean so far.. and am really loving them!!
Highly recommend using them. These guys have great documentation and
their &lt;span class="caps"&gt;IRC&lt;/span&gt; channel on freenode are really helpful&amp;nbsp;too!&lt;/p&gt;</content><category term="software"/><category term="nginx"/><category term="Wordpress"/></entry><entry><title>Yummy Chicken Adraki</title><link href="https://www.nyayapati.com/srao/2014/06/yummy-chicken-adraki/" rel="alternate"/><published>2014-06-03T15:10:00-04:00</published><updated>2014-06-03T15:10:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-06-03:/srao/2014/06/yummy-chicken-adraki/</id><summary type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/06/IMG_6307.jpg"&gt;&lt;img alt="IMG_6307" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/06/IMG_6307.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This dish came out really good!! Very tasty if I can say so myself. It
is not very different from my previous effort which you can read
&lt;a href="https://www.nyayapati.com/srao/2010/02/adraki-chicken/"&gt;here&lt;/a&gt;. There were slight changes, so I am
writing it down so I remember what I did and of course to share it …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/06/IMG_6307.jpg"&gt;&lt;img alt="IMG_6307" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/06/IMG_6307.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This dish came out really good!! Very tasty if I can say so myself. It
is not very different from my previous effort which you can read
&lt;a href="https://www.nyayapati.com/srao/2010/02/adraki-chicken/"&gt;here&lt;/a&gt;. There were slight changes, so I am
writing it down so I remember what I did and of course to share it with&amp;nbsp;everybody.&lt;/p&gt;
&lt;p&gt;Ingredients&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Ghee - 2&amp;nbsp;tbsp&lt;/li&gt;
&lt;li&gt;Green Chillies - 3-5 depending on how spicy you&amp;nbsp;want&lt;/li&gt;
&lt;li&gt;cumin - 1&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Chopped Onions -&amp;nbsp;2&lt;/li&gt;
&lt;li&gt;Ginger Garlic Paste - 3&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Dhaniya powder - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Garam Masala - 1&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Turmeric Powder - 1/2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Kashmiri Mirch - 1/4 to 1/2 tsp depending on how spicy you&amp;nbsp;want&lt;/li&gt;
&lt;li&gt;Julienned Ginger - from a 1 and half inch of&amp;nbsp;ginger&lt;/li&gt;
&lt;li&gt;Cilantro - 1/2 cup&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;Tomatoes - 2&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;Kasoori Methi - 2 tsp&amp;nbsp;crushed&lt;/li&gt;
&lt;li&gt;Salt - to&amp;nbsp;taste&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Marinate 2 pounds of Chicken thighs(cut bite sized) for at least 30
minutes&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;2 tbl spoons ginger&amp;nbsp;paste&lt;/li&gt;
&lt;li&gt;2 tsp Black pepper&amp;nbsp;powder&lt;/li&gt;
&lt;li&gt;1/2 tsp&amp;nbsp;Turmeric&lt;/li&gt;
&lt;li&gt;1 tsp&amp;nbsp;Salt&lt;/li&gt;
&lt;li&gt;Juice from 1&amp;nbsp;lemon&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Method&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;heat two table spoons of ghee in a thick bottomed pan. Once the ghee
    is hot, add 3-4 slit green chillies. Once it is slightly cooked,
    take them out with a slotted spoon and save for&amp;nbsp;later.&lt;/li&gt;
&lt;li&gt;Add 1 tsp cumin seeds to the hot&amp;nbsp;ghee.&lt;/li&gt;
&lt;li&gt;Once cumin starts sputtering, add the chopped onions and sauté. Add
    a tsp of salt to help with the&amp;nbsp;caramelizing.&lt;/li&gt;
&lt;li&gt;Once the onions are slightly browned, add the 2 tsp of fresh ginger
    garlic paste and mix it well into the onions and sauté for another 2&amp;nbsp;minutes&lt;/li&gt;
&lt;li&gt;Now add all the powdered spices.. 2 tsp of Dhania powder, 1 tsp of
    garam masala, 1/2 tsp Kashmiri mirch and 1/2 tsp turmeric powder.
    Mix all the spices into the&amp;nbsp;onions.&lt;/li&gt;
&lt;li&gt;Add the sautéed green chillies and chopped Chicken and mix it well
    into the onions. Saute the chicken so all the pink goes away. It may
    take 3-5&amp;nbsp;minutes.&lt;/li&gt;
&lt;li&gt;Add the julienned ginger and chopped cilantro and mix it well into
    the onions and chicken and sauté some more till you see some oil
    releasing around the edge of the&amp;nbsp;vessel&lt;/li&gt;
&lt;li&gt;Add the 2 chopped tomatoes into the vessel and mix it well into the
    chicken, scraping the bottom making sure nothing is getting&amp;nbsp;stuck.&lt;/li&gt;
&lt;li&gt;Lower the heat and cover the vessel. Check every two minutes and mix
    the chicken and make sure nothing is sticking at the&amp;nbsp;bottom.&lt;/li&gt;
&lt;li&gt;Once tomatoes loose their structure and you see a nice consistent
    gravy, crush 2 tsp of Kasoori Methi between your palms and add to
    the dish. Mix it&amp;nbsp;well&lt;/li&gt;
&lt;li&gt;Taste to make sure salt is&amp;nbsp;right&lt;/li&gt;
&lt;li&gt;Check to see if chicken is&amp;nbsp;cooked&lt;/li&gt;
&lt;li&gt;Serve with hot chapati&amp;#8217;s or lachedar&amp;nbsp;parathas&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Here is a nice close up&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/06/IMG_6312.jpg"&gt;&lt;img alt="IMG_6312" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/06/IMG_6312.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="recipes"/><category term="chicken"/></entry><entry><title>How to Reset Django’s admin password</title><link href="https://www.nyayapati.com/srao/2014/06/how-to-reset-djangos-admin-password/" rel="alternate"/><published>2014-06-01T22:29:00-04:00</published><updated>2014-06-01T22:29:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-06-01:/srao/2014/06/how-to-reset-djangos-admin-password/</id><summary type="html">&lt;p&gt;I was working on a django application and because of getting busy at
work and home, the project took a backseat. After getting back to the
project, I realized I don&amp;#8217;t remember what was the username/password I
used to create the admin&amp;nbsp;account.&lt;/p&gt;
&lt;p&gt;Here is what I did …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was working on a django application and because of getting busy at
work and home, the project took a backseat. After getting back to the
project, I realized I don&amp;#8217;t remember what was the username/password I
used to create the admin&amp;nbsp;account.&lt;/p&gt;
&lt;p&gt;Here is what I did. I started a django shell session (% is my prompt)&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;manage.py&lt;span class="w"&gt; &lt;/span&gt;shell&lt;span class="w"&gt;  &lt;/span&gt;
Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.7.6&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;default,&lt;span class="w"&gt; &lt;/span&gt;Apr&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2014&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;:48:52&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;GCC&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;.2.1&lt;span class="w"&gt; &lt;/span&gt;Compatible&lt;span class="w"&gt; &lt;/span&gt;Apple&lt;span class="w"&gt; &lt;/span&gt;LLVM&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;.1&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;clang-503.0.38&lt;span class="o"&gt;)]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;on&lt;span class="w"&gt; &lt;/span&gt;darwin&lt;span class="w"&gt;  &lt;/span&gt;
Type&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;help&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;copyright&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;credits&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;or&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;license&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;more&lt;span class="w"&gt; &lt;/span&gt;information.&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;InteractiveConsole&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;django.contrib.auth.models&lt;span class="w"&gt; &lt;/span&gt;import&lt;span class="w"&gt; &lt;/span&gt;User&lt;span class="w"&gt;  &lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;users&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;User.objects.all&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;users&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&amp;lt;User:&lt;span class="w"&gt; &lt;/span&gt;admin&amp;gt;&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I see I had created a user called admin. Now to change the password is&amp;nbsp;easy..  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;u&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;users&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;u&lt;span class="w"&gt;  &lt;/span&gt;
&amp;lt;User:&lt;span class="w"&gt; &lt;/span&gt;admin&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;u.set_password&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;somepassword&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&amp;gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;u.save&lt;span class="o"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;As I just had one user, this was easy enough.. if you have a lot of
users, you could get the individual users object like this&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="n"&gt;u&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;User&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;objects&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;username__exact&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;someusername&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;set_password&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;somepassword&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;u&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;save&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="django"/><category term="python"/></entry><entry><title>How to install numpy scipy pandas matplotlib and scikit-learn on Mavericks</title><link href="https://www.nyayapati.com/srao/2014/05/how-to-install-numpy-scipy-pandas-matplotlib-and-scikit-learn-on-mavericks/" rel="alternate"/><published>2014-05-19T23:08:00-04:00</published><updated>2014-05-19T23:08:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-05-19:/srao/2014/05/how-to-install-numpy-scipy-pandas-matplotlib-and-scikit-learn-on-mavericks/</id><summary type="html">&lt;p&gt;These are all excellent data analysis tools. I cam across some python
tutorials on data sciences and wanted to follow the examples from the
video.. so went ahead and installed these python packages. This post is
here for future reference on the hurdles I had and how I solved them …&lt;/p&gt;</summary><content type="html">&lt;p&gt;These are all excellent data analysis tools. I cam across some python
tutorials on data sciences and wanted to follow the examples from the
video.. so went ahead and installed these python packages. This post is
here for future reference on the hurdles I had and how I solved them and
maybe help somebody&amp;nbsp;else.&lt;/p&gt;
&lt;p&gt;1. Make sure you have Xcode command lines tools. You can install that
by&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;xcode-select&lt;span class="w"&gt; &lt;/span&gt;install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;2. Install &lt;a href="http://brew.sh"&gt;Homebrew&lt;/a&gt; if you don&amp;#8217;t already have it. As
simple as just running this on your command line&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ruby&lt;span class="w"&gt; &lt;/span&gt;-e&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-fsSL&lt;span class="w"&gt; &lt;/span&gt;https://raw.github.com/Homebrew/homebrew/go/install&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;3. Run the following to make sure homebrew is installed properly. You
will be suggested to change your path so /usr/local/bin has&amp;nbsp;priority&lt;/p&gt;
&lt;p&gt;4. Install homebrew python&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;brew&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt;  &lt;/span&gt;
which&lt;span class="w"&gt; &lt;/span&gt;python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;you should see &amp;#8216;/usr/local/bin/python&amp;#8217; when you execute which&amp;nbsp;python&lt;/p&gt;
&lt;p&gt;4. Now begin installing packages one at a&amp;nbsp;time  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;brew&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;gfortran&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;numpy&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;scipy&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;pandas
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;5. The next package I tried was matplotlib, but that failed with an
error about a file now found.. here is a part of what I&amp;nbsp;saw  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;matplotlib&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# lots of install details here...  &lt;/span&gt;
/usr/X11/include/ft2build.h:56:10:&lt;span class="w"&gt; &lt;/span&gt;fatal&lt;span class="w"&gt; &lt;/span&gt;error:
&lt;span class="s1"&gt;&amp;#39;freetype/config/ftheader.h&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;not&lt;span class="w"&gt; &lt;/span&gt;found&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;#include &amp;lt;freetype/config/ftheader.h&amp;gt;  &lt;/span&gt;
^&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;error&lt;span class="w"&gt; &lt;/span&gt;generated.&lt;span class="w"&gt;  &lt;/span&gt;
error:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;clang&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;failed&lt;span class="w"&gt; &lt;/span&gt;with&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;status&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
----------------------------------------
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;so I installed freetype from homebrew and retried installing
matplotlib&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;brew&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;freetype&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;matplotlib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately, I got the same error. I saw a solution on stack overflow
to create a symlink to the freetype directory in the expected&amp;nbsp;location.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;/usr/X11/include/freetype2/freetype/
/usr/X11/include/freetype&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;matplotlib
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It worked this time. It&amp;#8217;s a hack to do it this way.. just remember you
did this. If the package gets updated later, just remember to remove
this link and try installing the normal&amp;nbsp;way.&lt;/p&gt;
&lt;p&gt;6. Install&amp;nbsp;scikit-learn&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;scikit-learn
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;7. In case you want to play with iPython notebook, you would need the
following&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;tornado&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;pyzmq&lt;span class="w"&gt;  &lt;/span&gt;
pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;jinja2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Thats it.. you now have all scientific packages&amp;nbsp;installed!!&lt;/p&gt;
&lt;p&gt;You could also take the easier route and install one of the following
python distributions&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://store.continuum.io/cshop/anaconda/"&gt;Anaconda&lt;/a&gt; from
    Continuum&amp;nbsp;Analytics&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.enthought.com/products/canopy/"&gt;Enthought&amp;nbsp;Canopy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Happy Data&amp;nbsp;hacking!&lt;/p&gt;</content><category term="software"/><category term="python"/></entry><entry><title>YouCompleteMe install fails due to internal compiler error</title><link href="https://www.nyayapati.com/srao/2014/05/youcompleteme-install-fails-due-to-internal-compiler-error/" rel="alternate"/><published>2014-05-18T15:44:00-04:00</published><updated>2014-05-18T15:44:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-05-18:/srao/2014/05/youcompleteme-install-fails-due-to-internal-compiler-error/</id><summary type="html">&lt;p&gt;While I was trying to set up my development environment on a vagrant vm,
I saw a compiler error while installing the excellent YouCompleteMe vim
plugin. Well let me back up a bit..&lt;br&gt;
You install the plugin using
&lt;a href="https://github.com/gmarik/Vundle.vim"&gt;Vundle&lt;/a&gt;. After the plugin is
installed you need to run a script …&lt;/p&gt;</summary><content type="html">&lt;p&gt;While I was trying to set up my development environment on a vagrant vm,
I saw a compiler error while installing the excellent YouCompleteMe vim
plugin. Well let me back up a bit..&lt;br&gt;
You install the plugin using
&lt;a href="https://github.com/gmarik/Vundle.vim"&gt;Vundle&lt;/a&gt;. After the plugin is
installed you need to run a script to compile &lt;span class="caps"&gt;YCM&lt;/span&gt; with semantic support
for C-family&amp;nbsp;languages:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/.vim/bundle/YouCompleteMe&lt;span class="w"&gt;  &lt;/span&gt;
./install.sh&lt;span class="w"&gt; &lt;/span&gt;--clang-completer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;My install was failing with this wierd error&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;75&lt;/span&gt;%&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Building&lt;span class="w"&gt; &lt;/span&gt;CXX&lt;span class="w"&gt; &lt;/span&gt;object
BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/pthread/thread.cpp.o&lt;span class="w"&gt;  &lt;/span&gt;
Linking&lt;span class="w"&gt; &lt;/span&gt;CXX&lt;span class="w"&gt; &lt;/span&gt;static&lt;span class="w"&gt; &lt;/span&gt;library&lt;span class="w"&gt; &lt;/span&gt;libBoostParts.a&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;75&lt;/span&gt;%&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Built&lt;span class="w"&gt; &lt;/span&gt;target&lt;span class="w"&gt; &lt;/span&gt;BoostParts&lt;span class="w"&gt;  &lt;/span&gt;
Scanning&lt;span class="w"&gt; &lt;/span&gt;dependencies&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;target&lt;span class="w"&gt; &lt;/span&gt;ycm_core&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;77&lt;/span&gt;%&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Building&lt;span class="w"&gt; &lt;/span&gt;CXX&lt;span class="w"&gt; &lt;/span&gt;object
ycm/CMakeFiles/ycm_core.dir/CustomAssert.cpp.o&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;77&lt;/span&gt;%&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Building&lt;span class="w"&gt; &lt;/span&gt;CXX&lt;span class="w"&gt; &lt;/span&gt;object&lt;span class="w"&gt; &lt;/span&gt;ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;78&lt;/span&gt;%&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Building&lt;span class="w"&gt; &lt;/span&gt;CXX&lt;span class="w"&gt; &lt;/span&gt;object
ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangCompleter.cpp.o&lt;span class="w"&gt;  &lt;/span&gt;
c++:&lt;span class="w"&gt; &lt;/span&gt;internal&lt;span class="w"&gt; &lt;/span&gt;compiler&lt;span class="w"&gt; &lt;/span&gt;error:&lt;span class="w"&gt; &lt;/span&gt;Killed&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;program&lt;span class="w"&gt; &lt;/span&gt;cc1plus&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Please&lt;span class="w"&gt; &lt;/span&gt;submit&lt;span class="w"&gt; &lt;/span&gt;a&lt;span class="w"&gt; &lt;/span&gt;full&lt;span class="w"&gt; &lt;/span&gt;bug&lt;span class="w"&gt; &lt;/span&gt;report,&lt;span class="w"&gt;  &lt;/span&gt;
with&lt;span class="w"&gt; &lt;/span&gt;preprocessed&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;source&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;appropriate.&lt;span class="w"&gt;  &lt;/span&gt;
See&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;file:///usr/share/doc/gcc-4.8/README.Bugs&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;instructions.&lt;span class="w"&gt;  &lt;/span&gt;
make&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;***
&lt;span class="o"&gt;[&lt;/span&gt;ycm/CMakeFiles/ycm_core.dir/ClangCompleter/ClangCompleter.cpp.o&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Error
&lt;span class="m"&gt;4&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
make&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;***&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;ycm/CMakeFiles/ycm_core.dir/all&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Error&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
make&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;:&lt;span class="w"&gt; &lt;/span&gt;***&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;ycm/CMakeFiles/ycm_support_libs.dir/rule&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Error&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
make:&lt;span class="w"&gt; &lt;/span&gt;***&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;ycm_support_libs&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Error&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Looking for a solution to the problem, I came across the
&lt;a href="https://github.com/Valloric/YouCompleteMe/issues/267"&gt;same&lt;/a&gt; issue on
github. Basically I was running out of memory on my &lt;span class="caps"&gt;VM&lt;/span&gt; while compiling
the plugin. Somebody hinted on adding swap space would help. So I used
this script to add swap file&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="c1"&gt;# size of swapfile in megabytes  &lt;/span&gt;
&lt;span class="nv"&gt;swapsize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;512&lt;/span&gt;

&lt;span class="c1"&gt;# does the swap file already exist?  &lt;/span&gt;
grep&lt;span class="w"&gt; &lt;/span&gt;-q&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;swapfile&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/etc/fstab

&lt;span class="c1"&gt;# if not then create it  &lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$?&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-ne&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;then&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;swapfile not found. Adding swapfile.&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;fallocate&lt;span class="w"&gt; &lt;/span&gt;-l&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;swapsize&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;M&lt;span class="w"&gt; &lt;/span&gt;/swapfile&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;chmod&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;600&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/swapfile&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;mkswap&lt;span class="w"&gt; &lt;/span&gt;/swapfile&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;swapon&lt;span class="w"&gt; &lt;/span&gt;/swapfile&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/swapfile none swap defaults 0 0&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;/etc/fstab&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;swapfile found. No changes made.&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c1"&gt;# output results to terminal  &lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;/proc/swaps&lt;span class="w"&gt;  &lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;/proc/meminfo&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;Swap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now go ahead and compile YouCompleteMe to Success&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;You can delete the swap file if you don&amp;#8217;t need it. Here use this
script&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/bin/sh&lt;/span&gt;

&lt;span class="c1"&gt;# does the swap file exist?  &lt;/span&gt;
grep&lt;span class="w"&gt; &lt;/span&gt;-q&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;swapfile&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/etc/fstab

&lt;span class="c1"&gt;# if it does then remove it  &lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$?&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-eq&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;then&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;swapfile found. Removing swapfile.&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;sed&lt;span class="w"&gt; &lt;/span&gt;-i&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/swapfile/d&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/etc/fstab&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;3&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;/proc/sys/vm/drop_caches&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;swapoff&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;rm&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;/swapfile&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;No swapfile found. No changes made.&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

&lt;span class="c1"&gt;# output results to terminal  &lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;/proc/swaps&lt;span class="w"&gt;  &lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;/proc/meminfo&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;Swap
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I got the scripts from
&lt;a href="http://programmaticponderings.wordpress.com/2013/12/19/scripting-linux-swap-space/"&gt;here&lt;/a&gt;.&lt;/p&gt;</content><category term="software"/><category term="linux"/><category term="vim"/></entry><entry><title>How to capture shell script output to a logfile and standard output</title><link href="https://www.nyayapati.com/srao/2014/04/how-to-capture-shell-script-output-to-a-logfile-and-standard-output/" rel="alternate"/><published>2014-04-28T15:44:00-04:00</published><updated>2014-04-28T15:44:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-04-28:/srao/2014/04/how-to-capture-shell-script-output-to-a-logfile-and-standard-output/</id><summary type="html">&lt;p&gt;I wanted the ability to review the output from a shell script. I could
always re-direct output to a log file, but then I don&amp;#8217;t see where in the
script I am currently at. I can always open a second terminal and then
tail the lot file I used …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I wanted the ability to review the output from a shell script. I could
always re-direct output to a log file, but then I don&amp;#8217;t see where in the
script I am currently at. I can always open a second terminal and then
tail the lot file I used in the first&amp;nbsp;place.&lt;/p&gt;
&lt;p&gt;Well there is another way.. in&amp;nbsp;short..&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&amp;gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;tee&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;logfile
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This works on a bash shell. I tried to get this to work on csh or tcsh..
but get an&amp;nbsp;error.&lt;/p&gt;</content><category term="software"/><category term="linux"/><category term="unix"/></entry><entry><title>How to make a bootable install of Mavericks on USB Flash Drive</title><link href="https://www.nyayapati.com/srao/2014/04/how-to-make-a-bootable-install-of-mavericks-on-usb-flash-drive/" rel="alternate"/><published>2014-04-15T15:12:00-04:00</published><updated>2014-04-15T15:12:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-04-15:/srao/2014/04/how-to-make-a-bootable-install-of-mavericks-on-usb-flash-drive/</id><summary type="html">&lt;p&gt;Your &lt;span class="caps"&gt;USB&lt;/span&gt; drive should be called Untitled and formatted as Mac &lt;span class="caps"&gt;OS&lt;/span&gt;
Extended (Journaled). The installer should be called Install &lt;span class="caps"&gt;OS&lt;/span&gt; X
Mavericks.app and should be in your Applications&amp;nbsp;folder.&lt;/p&gt;
&lt;p&gt;Run the following command to prepare your &lt;span class="caps"&gt;USB&lt;/span&gt; to be a bootable
installer, Don&amp;#8217;t worry.. it takes 20-25 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Your &lt;span class="caps"&gt;USB&lt;/span&gt; drive should be called Untitled and formatted as Mac &lt;span class="caps"&gt;OS&lt;/span&gt;
Extended (Journaled). The installer should be called Install &lt;span class="caps"&gt;OS&lt;/span&gt; X
Mavericks.app and should be in your Applications&amp;nbsp;folder.&lt;/p&gt;
&lt;p&gt;Run the following command to prepare your &lt;span class="caps"&gt;USB&lt;/span&gt; to be a bootable
installer, Don&amp;#8217;t worry.. it takes 20-25 minutes to&amp;nbsp;finish..&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;/Applications/Install&lt;span class="se"&gt;\ &lt;/span&gt;OS&lt;span class="se"&gt;\ &lt;/span&gt;X&lt;span class="se"&gt;\ &lt;/span&gt;Mavericks.app/Contents/Resources/createinstallmedia&lt;span class="w"&gt; &lt;/span&gt;--volume&lt;span class="w"&gt; &lt;/span&gt;/Volumes/Untitled&lt;span class="w"&gt; &lt;/span&gt;--applicationpath&lt;span class="w"&gt; &lt;/span&gt;/Applications/Install&lt;span class="se"&gt;\ &lt;/span&gt;OS&lt;span class="se"&gt;\ &lt;/span&gt;X&lt;span class="se"&gt;\ &lt;/span&gt;Mavericks.app&lt;span class="w"&gt; &lt;/span&gt;--nointeraction
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You should see something like&amp;nbsp;this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Erasing&lt;span class="w"&gt; &lt;/span&gt;Disk:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;%...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;%...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;20&lt;/span&gt;%...&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;%...&lt;span class="w"&gt;  &lt;/span&gt;
Copying&lt;span class="w"&gt; &lt;/span&gt;installer&lt;span class="w"&gt; &lt;/span&gt;files&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;disk...&lt;span class="w"&gt;  &lt;/span&gt;
Copy&lt;span class="w"&gt; &lt;/span&gt;complete.&lt;span class="w"&gt;  &lt;/span&gt;
Making&lt;span class="w"&gt; &lt;/span&gt;disk&lt;span class="w"&gt; &lt;/span&gt;bootable...&lt;span class="w"&gt;  &lt;/span&gt;
Copying&lt;span class="w"&gt; &lt;/span&gt;boot&lt;span class="w"&gt; &lt;/span&gt;files...&lt;span class="w"&gt;  &lt;/span&gt;
Copy&lt;span class="w"&gt; &lt;/span&gt;complete.&lt;span class="w"&gt;  &lt;/span&gt;
Done.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can then boot up from the &lt;span class="caps"&gt;USB&lt;/span&gt; by holding down the option key, then
install the Mavericks from the &lt;span class="caps"&gt;USB&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;*&lt;a href="http://forums.macrumors.com/showpost.php?p=18081307&amp;amp;postcount=3"&gt;Source&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="macosx"/></entry><entry><title>Desi Murgh Curry</title><link href="https://www.nyayapati.com/srao/2014/04/desi-murgh-curry/" rel="alternate"/><published>2014-04-13T23:35:00-04:00</published><updated>2014-04-13T23:35:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-04-13:/srao/2014/04/desi-murgh-curry/</id><summary type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6055.jpg"&gt;&lt;img alt="IMG_6055" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6055.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It has been ages since I have posted any recipes and I had to post this
dish as it is something special. It&amp;#8217;s not very complicated and is very
tasty. This is a North Indian Chicken curry. It is better to cook this
with chicken on the bone. I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6055.jpg"&gt;&lt;img alt="IMG_6055" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6055.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It has been ages since I have posted any recipes and I had to post this
dish as it is something special. It&amp;#8217;s not very complicated and is very
tasty. This is a North Indian Chicken curry. It is better to cook this
with chicken on the bone. I do it with chicken drum sticks and wings.
Turns out&amp;nbsp;fabulous!!&lt;/p&gt;
&lt;p&gt;Here are the ingredients&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;Large onions, sliced - 2&lt;br&gt;
Ginger and Garlic paste - 2 Table Spoons&lt;br&gt;
Tomatoes, peeled and chopped&lt;br&gt;
Red chilli powder 1 tsp&lt;br&gt;
Turmeric - 1/2 tsp&lt;br&gt;
Cumin Seeds - 1 tsp&lt;br&gt;
Coriander Powder - 3 tsp&lt;br&gt;
Black Cardamoms - 3&lt;br&gt;
Cloves - 5-6&lt;br&gt;
Bay leaf - 1&lt;br&gt;
Salt to taste&lt;br&gt;
Yogurt - 1/2 cup&lt;br&gt;
Chopped&amp;nbsp;cilantro&lt;/p&gt;
&lt;p&gt;Method&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;1. Heat 1/4 cup of cooking oil in a thick bottom vessel. Add the sliced
onions and cook till brown. Remove the onions and make a fine paste of
the fried onions.&lt;br&gt;
2. Add a little more oil to the vessel and heat. Add ginger garlic
paste and stir for a minute or so.&lt;br&gt;
3. Add the chopped tomatoes and stir it well. a couple of minutes
later, add the yogurt and cook for 4-5 minutes and keep mixing.&lt;br&gt;
4. Add the browned onions paste and mix it well into the vessel.&lt;br&gt;
5. Add all the spices along with salt. Cook and stir the dish until oil
separates out.&lt;br&gt;
6. Add the chicken pieces and mix the masala into the chicken.&lt;br&gt;
7. Add 2-3 cups of water and cover up the vessel and reduce the heat to
low heat.&lt;br&gt;
8. Stir occasionaly and cook for 45-50 minutes till chicken is cooked
completely and tender.&lt;br&gt;
9. Remove the lid and cook for another 10 minutes.. you should see the
oil in the sauce separate out. Add the chopped cilantro and mix that
into the curry&lt;br&gt;
10. Serve with hot naan or&amp;nbsp;rice!!&lt;/p&gt;
&lt;p&gt;Here are some more pics I took with my 50mm lens&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6059.jpg"&gt;&lt;img alt="IMG_6059" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6059.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6057.jpg"&gt;&lt;img alt="IMG_6057" src="https://www.nyayapati.com/srao/wp-content/uploads/2014/04/IMG_6057.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="recipes"/><category term="chicken"/></entry><entry><title>Change wordpress wp_mail using a plugin</title><link href="https://www.nyayapati.com/srao/2014/04/change-wordpress-wp_mail-using-a-plugin/" rel="alternate"/><published>2014-04-13T21:53:00-04:00</published><updated>2014-04-13T21:53:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2014-04-13:/srao/2014/04/change-wordpress-wp_mail-using-a-plugin/</id><summary type="html">&lt;p&gt;Hosting wordpress on bluehost has been nice except for one problem. All
notifications from my wordpress come out weird. The domain name of the
sender does not show up as my domain name. It shows up as
username@box###.BlueHost.com as explained
&lt;a href="https://my.bluehost.com/cgi/help/206"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I had figured out a way …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Hosting wordpress on bluehost has been nice except for one problem. All
notifications from my wordpress come out weird. The domain name of the
sender does not show up as my domain name. It shows up as
username@box###.BlueHost.com as explained
&lt;a href="https://my.bluehost.com/cgi/help/206"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I had figured out a way to fix this by editing some core wordpress
scripts and had shared my method in a previous
&lt;a href="https://www.nyayapati.com/srao/2010/02/how-to-change-admin-email-address-boxxxx-bluehost-com-to-mydomain-com-on-a-bluehost-hosted-wordpress/"&gt;post&lt;/a&gt;.
It was working out fine, except for one small problem.. Every time
wordpress got updated, I would loose my fix and I would have to make
those changes&amp;nbsp;again.&lt;/p&gt;
&lt;p&gt;I then found out, I could use filters to over-ride two variable
wp_mail_from and wp_mail_from_name which would do exactly what I
wanted. I then did some digging to understand how wordpress plugins work
to write my own plugin. I also wanted the ability to have my own plugin
settings page, just so I can set the email address and name and have it
saved in the internal wordpress database instead of having it hard coded
in the plugin. These two excellent tutorials on plugins helped me a
lot -
&lt;a href="http://www.smashingmagazine.com/2011/09/30/how-to-create-a-wordpress-plugin/"&gt;here&lt;/a&gt;
and
&lt;a href="http://code.tutsplus.com/tutorials/create-a-custom-wordpress-plugin-from-scratch--net-2668"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Thus was born the plugin
&lt;a href="https://github.com/shireenrao/wp-email-over-rider"&gt;email-over-rider&lt;/a&gt;.
Just download the zip and upload the plugin and activate it. Then go to
the Settings area in your wordpress admin section and you should see the
Email Over-rider sub menu. Just set the required email address and Name
and you are set. No need to update the wordpress code everytime
wordpress gets&amp;nbsp;updated.&lt;/p&gt;
&lt;p&gt;If plugins are not your cup of tea, you could also just add the filters
to your themes functions.php file. The entire method is explained very
nicely
&lt;a href="http://www.butlerblog.com/2011/07/08/changing-the-wp_mail-from-address-in-wordpress-without-a-plugin/"&gt;here&lt;/a&gt;.&lt;/p&gt;</content><category term="software"/><category term="Wordpress"/></entry><entry><title>How to import VMWareVM file from a backup in VMWare Fusion</title><link href="https://www.nyayapati.com/srao/2013/09/how-to-import-vmwarevm-file-from-a-backup-in-vmware-fusion/" rel="alternate"/><published>2013-09-03T23:05:00-04:00</published><updated>2013-09-03T23:05:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-09-03:/srao/2013/09/how-to-import-vmwarevm-file-from-a-backup-in-vmware-fusion/</id><summary type="html">&lt;p&gt;I recently re-installed Mountain Lion on my mac book pro. There were a
couple of reasons why I did that. Mainly because I wanted get rid of
macports and try out homebrew. The reason I wanted to do that was
because I am trying to setup a build and package …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently re-installed Mountain Lion on my mac book pro. There were a
couple of reasons why I did that. Mainly because I wanted get rid of
macports and try out homebrew. The reason I wanted to do that was
because I am trying to setup a build and package process for my PyQt
applications, and macports based pyqt was not working out. Doing a setup
from scratch is a lot of work but it&amp;#8217;s fun for&amp;nbsp;me.&lt;/p&gt;
&lt;p&gt;In my previous setup I had two &lt;span class="caps"&gt;VM&lt;/span&gt;&amp;#8217;s, one was a mountain lion &lt;span class="caps"&gt;VM&lt;/span&gt; and the
other was a Snow Leopard &lt;span class="caps"&gt;VM&lt;/span&gt; for &lt;span class="caps"&gt;VMWARE&lt;/span&gt;. I had backed these two vmwarevm
files on my time machine. After re-installing vmware fusion I restored
the vmwarevm files in its default&amp;nbsp;location.&lt;/p&gt;
&lt;p&gt;I was expecting to see the two vm&amp;#8217;s in my library, but that wasn&amp;#8217;t the
case. Then I thought maybe I need to import these in. Clicking on
File-&amp;gt;Import&amp;#8230; did not work either. I couldn&amp;#8217;t even select the
vmwarevm files as shown in the image below&amp;nbsp;-  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/09/Screen-Shot-2013-09-03-at-07.56.00.png"&gt;&lt;img alt="Screen Shot 2013-09-03 at 07.56.00" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/09/Screen-Shot-2013-09-03-at-07.56.00.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;I thought I would loose the vm&amp;#8217;s and would have to re-create these from
scratch&amp;nbsp;:(&lt;/p&gt;
&lt;p&gt;I tried to google for this, but couldn&amp;#8217;t find any solution for it. I
don&amp;#8217;t know what prompted me, but I remember I saw that the icon on the
two vm&amp;#8217;s was that for fusion. I then double clicked on one of the &lt;span class="caps"&gt;VM&lt;/span&gt;&amp;#8217;s
and viola!! It popped in my vmware library and started up!!&amp;nbsp;Hurrah!!&lt;/p&gt;
&lt;p&gt;That was&amp;nbsp;easy!!&lt;/p&gt;</content><category term="software"/><category term="macosx"/><category term="vmware"/></entry><entry><title>How to update individual packages in the enthought Python Distribution</title><link href="https://www.nyayapati.com/srao/2013/08/how-to-update-individual-packages-in-the-enthought-python-distribution/" rel="alternate"/><published>2013-08-20T16:28:00-04:00</published><updated>2013-08-20T16:28:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-08-20:/srao/2013/08/how-to-update-individual-packages-in-the-enthought-python-distribution/</id><summary type="html">&lt;p&gt;I am recently came across a youtube video about data analysis using
Python by Wes McKinney. So to learn a new library I thought I would
follow the tutorial. As I already had Enthought Python distribution
installed on my macbook, I thought I had all the prerequisites. Sadly
that was …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am recently came across a youtube video about data analysis using
Python by Wes McKinney. So to learn a new library I thought I would
follow the tutorial. As I already had Enthought Python distribution
installed on my macbook, I thought I had all the prerequisites. Sadly
that was not the case. I had to update some of the packages. Luckily epd
comes with its own package manager called enpkg. This is what I did to
update python, numpy and pandas&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;enpkg&lt;span class="w"&gt; &lt;/span&gt;enstaller&lt;span class="w"&gt;  &lt;/span&gt;
Password:&lt;span class="w"&gt;  &lt;/span&gt;
prefix:&lt;span class="w"&gt; &lt;/span&gt;/Library/Frameworks/Python.framework/Versions/7.3&lt;span class="w"&gt;  &lt;/span&gt;
enstaller-4.6.2-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;fetching&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;267&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;KB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
enstaller-4.5.3-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;removing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;607&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;KB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
enstaller-4.6.2-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;installing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;765&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;KB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;enpkg&lt;span class="w"&gt; &lt;/span&gt;ipython&lt;span class="w"&gt;  &lt;/span&gt;
prefix:&lt;span class="w"&gt; &lt;/span&gt;/Library/Frameworks/Python.framework/Versions/7.3&lt;span class="w"&gt;  &lt;/span&gt;
ipython-0.13.1-2.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;fetching&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;2&lt;/span&gt;.55&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
ipython-0.12.1-3.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;removing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;7&lt;/span&gt;.31&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
ipython-0.13.1-2.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;installing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;7&lt;/span&gt;.42&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;enpkg&lt;span class="w"&gt; &lt;/span&gt;pandas&lt;span class="w"&gt;  &lt;/span&gt;
prefix:&lt;span class="w"&gt; &lt;/span&gt;/Library/Frameworks/Python.framework/Versions/7.3&lt;span class="w"&gt;  &lt;/span&gt;
MKL-10.3-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;fetching&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;34&lt;/span&gt;.74&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
numpy-1.7.1-2.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;fetching&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;3&lt;/span&gt;.31&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
pandas-0.12.0-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;fetching&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;3&lt;/span&gt;.97&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
numpy-1.6.1-0.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;removing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;10&lt;/span&gt;.97&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
MKL-10.3-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;installing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;106&lt;/span&gt;.08&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
numpy-1.7.1-2.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;installing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;11&lt;/span&gt;.58&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
pandas-0.12.0-1.egg&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;installing&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;14&lt;/span&gt;.50&lt;span class="w"&gt; &lt;/span&gt;MB
&lt;span class="o"&gt;[&lt;/span&gt;.................................................................&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="enthought"/><category term="epd"/><category term="python"/></entry><entry><title>Run a macro in all buffers in vim</title><link href="https://www.nyayapati.com/srao/2013/08/run-a-macro-in-all-buffers-in-vim/" rel="alternate"/><published>2013-08-12T17:50:00-04:00</published><updated>2013-08-12T17:50:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-08-12:/srao/2013/08/run-a-macro-in-all-buffers-in-vim/</id><summary type="html">&lt;p&gt;I knew vim was powerful, but realized recently that with combined
command line tools it is really really&amp;nbsp;powerful!!&lt;/p&gt;
&lt;p&gt;Our Oracle production database was having issues at work. As a way to
find out the cause, our group was asked to switch our jboss instance to
point to a different …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I knew vim was powerful, but realized recently that with combined
command line tools it is really really&amp;nbsp;powerful!!&lt;/p&gt;
&lt;p&gt;Our Oracle production database was having issues at work. As a way to
find out the cause, our group was asked to switch our jboss instance to
point to a different node on the rack server. The switch, in theory is
quick and painless. One who has permissions can directly go change the
jboss oracle datasources, but in this day and age with all this change
control crap, it&amp;#8217;s really gotten tough doing such things. All changes at
my workplace need to be done by a deployment&amp;nbsp;group.&lt;/p&gt;
&lt;p&gt;As the guy who maintains the jboss instances was out, it was upto me to
to make this change. All the datasource config files for all
environments are stored in one place. It would have been painful to open
all the prod ds files and check which ones were pointing to the oracle
server. Thats where the grep command came in handy. I can just grep the
name of the server (say &lt;span class="caps"&gt;RACK1&lt;/span&gt;) and get a list of&amp;nbsp;files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;-l&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;RACK1&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;*
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;(The reason I used the -l flag is so I just get the list of files and
not get the file contents where the line&amp;nbsp;matched)&lt;/p&gt;
&lt;p&gt;You can combine the above command with vim to open all the files in&amp;nbsp;vim&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;vim&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;-l&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;RACK1&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;All the files are now open in different buffers. Now I could just use a
macro to make my change on the first file and then replay the macro on
all the buffers to make my change on all files at once&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;In command mode on the first buffer&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;qa&lt;/span&gt;/RACK1^McwRACK2^[&lt;span class="k"&gt;q&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Breakdown -&lt;br&gt;
qa - Start recording macro&lt;br&gt;
/&lt;span class="caps"&gt;RACK1&lt;/span&gt;^M - Search file for reference for &lt;span class="caps"&gt;RACK1&lt;/span&gt;&lt;br&gt;
cw - Change word to new server name&lt;br&gt;
^[ - back to command mode&lt;br&gt;
q - stop&amp;nbsp;recording&lt;/p&gt;
&lt;p&gt;Now to apply this macro on all buffers (all files), run this in command
mode&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;bufdo&lt;/span&gt; execute &lt;span class="s2"&gt;&amp;quot;normal @a&amp;quot;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; &lt;span class="nb"&gt;write&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above command is from
&lt;a href="http://vim.wikia.com/wiki/Run_a_command_in_multiple_buffers"&gt;here&lt;/a&gt;&lt;br&gt;
Please note that I have not included how to checkout the files&amp;nbsp;here.&lt;/p&gt;
&lt;p&gt;All these changes were done within a minute but took me 2 hours to have
the changes applied in &lt;span class="caps"&gt;PROD&lt;/span&gt;. That is a different story&amp;nbsp;:)&lt;/p&gt;</content><category term="software"/><category term="vim"/></entry><entry><title>replay a vim macro until end of buffer</title><link href="https://www.nyayapati.com/srao/2013/08/replay-a-vim-macro-until-end-of-buffer/" rel="alternate"/><published>2013-08-12T16:06:00-04:00</published><updated>2013-08-12T16:06:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-08-12:/srao/2013/08/replay-a-vim-macro-until-end-of-buffer/</id><summary type="html">&lt;p&gt;This is an awesome trick I learnt recently. It&amp;#8217;s a great trick if you
don&amp;#8217;t know how many times you need to run your macro. In short it is
called a recursive macro&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;The gist is, you first make sure the register you are going to record
your …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is an awesome trick I learnt recently. It&amp;#8217;s a great trick if you
don&amp;#8217;t know how many times you need to run your macro. In short it is
called a recursive macro&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;The gist is, you first make sure the register you are going to record
your macro in is empty. Now while recording your macro call the register
you are recording in as the last&amp;nbsp;command.&lt;/p&gt;
&lt;p&gt;For example if you are recording your macro in register a&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;In command mode, first make sure your register is empty&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;qaq
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;or  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="k"&gt;let&lt;/span&gt; @&lt;span class="k"&gt;a&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can confirm your register is empty by printing the contents of
register a by using&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c"&gt;&amp;quot;ap&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now suppose I am working on a python script and need to comment out the
script from current line to end of buffer, I would run this in command
mode&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;qaI#^[&lt;span class="k"&gt;j&lt;/span&gt;@aq
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here is the breakdown&lt;br&gt;
qa - start recording in register a&lt;br&gt;
I# - Insert # in the beginning of current line&lt;br&gt;
^[ - Thats what gets types when you hit escape to come out of insert mode&lt;br&gt;
j - go down to next line&lt;br&gt;
@a - nothing happens as register a is empty&lt;br&gt;
q - quit&amp;nbsp;recording&lt;/p&gt;
&lt;p&gt;When you execute @a again as register a now is set it calls itself and
repeats till end of buffer. A very cool trick&amp;nbsp;indeed!!&lt;/p&gt;
&lt;p&gt;Another way using the visual mode is by using the following&amp;nbsp;command&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;VG:normal @&lt;span class="k"&gt;a&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The problem with the visual mode is that it only works when your macro
is only editing on a single line. If you macro spans across lines, the
visual mode trick will not work. I have to confess, I still need to
fully understand how to use normal in vim&amp;nbsp;commands.&lt;/p&gt;</content><category term="software"/><category term="vim"/></entry><entry><title>Compile Vim 7.3 with +clientserver feature on Mac OS X</title><link href="https://www.nyayapati.com/srao/2013/08/compile-vim-7-3-with-clientserver-feature-on-mac-os-x/" rel="alternate"/><published>2013-08-08T22:56:00-04:00</published><updated>2013-08-08T22:56:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-08-08:/srao/2013/08/compile-vim-7-3-with-clientserver-feature-on-mac-os-x/</id><summary type="html">&lt;p&gt;I have been using vim for the longest time but I know I am not the most
efficient and fastest vim user. My interest in vim recently started
after I watched a youtube video on how to use vim as a Python &lt;span class="caps"&gt;IDE&lt;/span&gt;. Here
is a link to the &lt;a href="https://www.youtube.com/watch?v=YhqsjUUHj6g"&gt;video …&lt;/a&gt;&lt;/p&gt;</summary><content type="html">&lt;p&gt;I have been using vim for the longest time but I know I am not the most
efficient and fastest vim user. My interest in vim recently started
after I watched a youtube video on how to use vim as a Python &lt;span class="caps"&gt;IDE&lt;/span&gt;. Here
is a link to the &lt;a href="https://www.youtube.com/watch?v=YhqsjUUHj6g"&gt;video&lt;/a&gt;.
Here is the link to Martin&amp;#8217;s github
&lt;a href="https://github.com/mbrochh/vim-as-a-python-ide"&gt;repo&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Seeing this video, I saw that you can build vim from source and have it
built with python features. Below I show how I built it and installed
this under my home directory in $&lt;span class="caps"&gt;HOME&lt;/span&gt;/opt/vim. I then added a sym link
to my bin directory under my home directory. As the bin directory is in
my path, the built version of vim gets&amp;nbsp;invoked.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;wget&lt;span class="w"&gt; &lt;/span&gt;wget&lt;span class="w"&gt; &lt;/span&gt;ftp://ftp.vim.org/pub/vim/unix/vim-7.3.tar.bz2&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;tar&lt;span class="w"&gt; &lt;/span&gt;xvjf&lt;span class="w"&gt; &lt;/span&gt;vim-7.3.tar.bz2&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;vim73&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;./configure&lt;span class="w"&gt; &lt;/span&gt;--enable-pythoninterp&lt;span class="w"&gt; &lt;/span&gt;--with-features&lt;span class="o"&gt;=&lt;/span&gt;huge&lt;span class="w"&gt; &lt;/span&gt;--prefix&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/opt/vim&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;make&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;make&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/bin&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/opt/vim/bin/vim&lt;span class="w"&gt; &lt;/span&gt;vim&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;ln&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/opt/vim/bin/vi&lt;span class="w"&gt; &lt;/span&gt;vi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This led me to further learn new features/tips and tricks in using vim.
I then found Derek Wyatt&amp;#8217;s excellent and entertaining &lt;a href="http://www.derekwyatt.org/vim/vim-tutorial-videos/"&gt;vim
tutorials&lt;/a&gt;. It has
ignited the desire to learn the editor properly. One of the features I
found out about was the ability to edit multiple files. These files can
be based on some filter on your file system by using the grep command
(My next post will talk about this feature and how I saved the day at
work by editing files based on grep). Unfortunately the feature Derek
talks about needs vim to have the +clientserver feature built&amp;nbsp;in.&lt;/p&gt;
&lt;p&gt;Unfortunately the above build did not add that feature, even thought I
have &amp;#8212;with-features=huge set. After some googling around, I found that
all I had to do was configure the build slight differently. I just have
to add the flag &amp;#8212;enable-gui=gtk2 to the configure&amp;nbsp;command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;vim73&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;make&lt;span class="w"&gt; &lt;/span&gt;distclean&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;./configure&lt;span class="w"&gt; &lt;/span&gt;--enable-pythoninterp&lt;span class="w"&gt; &lt;/span&gt;--with-features&lt;span class="o"&gt;=&lt;/span&gt;huge&lt;span class="w"&gt; &lt;/span&gt;--enable-gui&lt;span class="o"&gt;=&lt;/span&gt;gtk2&lt;span class="w"&gt; &lt;/span&gt;--prefix&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/opt/vim
$&lt;span class="w"&gt; &lt;/span&gt;make&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;make&lt;span class="w"&gt; &lt;/span&gt;install
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you have vim with clientserver features. I will have more updates
coming about vim soon. Keep&amp;nbsp;posted!&lt;/p&gt;</content><category term="software"/><category term="vim"/></entry><entry><title>Kerala Chicken</title><link href="https://www.nyayapati.com/srao/2013/07/kerala-chicken/" rel="alternate"/><published>2013-07-07T20:24:00-04:00</published><updated>2013-07-07T20:24:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-07-07:/srao/2013/07/kerala-chicken/</id><summary type="html">&lt;p&gt;This recipe is a variation on the Malabar mutton curry. I am using
chicken thighs instead of mutton or lamb. You can replace the chicken
with lamb or goat. It&amp;#8217;s quick and easy to&amp;nbsp;do.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_3932.jpg"&gt;&lt;img alt="IMG_3932" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_3932.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;br&gt;
Chicken thighs - 2 pounds&lt;br&gt;
Onions - 1 chopped&lt;br&gt;
Coriander powder - 1 tbsp&lt;br&gt;
Turmeric powder …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This recipe is a variation on the Malabar mutton curry. I am using
chicken thighs instead of mutton or lamb. You can replace the chicken
with lamb or goat. It&amp;#8217;s quick and easy to&amp;nbsp;do.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_3932.jpg"&gt;&lt;img alt="IMG_3932" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_3932.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;br&gt;
Chicken thighs - 2 pounds&lt;br&gt;
Onions - 1 chopped&lt;br&gt;
Coriander powder - 1 tbsp&lt;br&gt;
Turmeric powder - 1/2 tsp&lt;br&gt;
Chili powder - 1/2 tsp&lt;br&gt;
Salt to&amp;nbsp;taste&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Spice Paste&lt;/strong&gt;&lt;br&gt;
Grated coconut - 1/2 cup&lt;br&gt;
Fresh ginger - 1 inch&lt;br&gt;
Garlic - 3 cloves&lt;br&gt;
Cinnamon stick - 1 inch&lt;br&gt;
Cloves - 3&lt;br&gt;
Bay leaves - 2&lt;br&gt;
Curry leaves - 10&lt;br&gt;
Black peppercorns -&amp;nbsp;5&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;For tempering&lt;/strong&gt;&lt;br&gt;
Mustard seeds - 1/2 tsp&lt;br&gt;
Curry leaves - 10&lt;br&gt;
Green chilies - 2&amp;nbsp;slit&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;br&gt;
Roast the ingredients for spice paste till coconut gets browned. Once
it cools down, grind to a fine paste in a food processor by adding water
gradually. Be careful and not add a lot of water and make it&amp;nbsp;watery.&lt;/p&gt;
&lt;p&gt;Now in a heavy bottom pan heat 3 tbsp of oil. Add your chopped onions
and fry for 5 minutes.&lt;br&gt;
Add the spice paste, ground coriander powder, turmeric powder, chili
powder and salt. stir the mixture for a minute and then add 1 and 1/2
cup of water.. Bring this to a&amp;nbsp;boil.&lt;/p&gt;
&lt;p&gt;Once a boil comes in, add your chicken. Reduce the heat and cook covered
for 30 minutes or till the chicken is&amp;nbsp;cooked.&lt;/p&gt;
&lt;p&gt;Prepare the tempering mixture in a small frying pan. Heat 1 tbps of oil
and add mustard seeds.&lt;br&gt;
Once they start popping, add curry leaves and slit green chilies.
Stir-fry for a minute. Add the tempering mixture to your meat curry and
continue cooking until curry is very dry and&amp;nbsp;thick.&lt;/p&gt;
&lt;p&gt;This should go really well with either rice or&amp;nbsp;parathas!&lt;/p&gt;
&lt;p&gt;Here are some more&amp;nbsp;pics&amp;#8230;&lt;/p&gt;
&lt;p&gt;While roasting the spices for the paste&amp;nbsp;-  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_2797.jpg"&gt;&lt;img alt="IMG_2797" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_2797.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Spice Paste&amp;nbsp;-  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_2799.jpg"&gt;&lt;img alt="IMG_2799" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_2799.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Cooking to dry out the sauce and get it thick&amp;nbsp;-  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_2803.jpg"&gt;&lt;img alt="IMG_2803" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_2803.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The finished dish&amp;nbsp;-  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_3929.jpg"&gt;&lt;img alt="IMG_3929" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/07/IMG_3929.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Checkout this quick video of the&amp;nbsp;recipe:&lt;/p&gt;
&lt;iframe width="560" height="315"
src="https://www.youtube.com/embed/PAjF1gqna-0" frameborder="0"
allowfullscreen&gt;&lt;/iframe&gt;</content><category term="recipes"/><category term="chicken"/><category term="food"/></entry><entry><title>Shell script to download Vimeo Videos</title><link href="https://www.nyayapati.com/srao/2013/06/shell-script-to-download-vimeo-videos/" rel="alternate"/><published>2013-06-27T21:24:00-04:00</published><updated>2013-06-27T21:24:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-06-27:/srao/2013/06/shell-script-to-download-vimeo-videos/</id><summary type="html">&lt;p&gt;I know you can easily download vimeo videos, but I wanted to download
all of Derek Wyatt&amp;#8217;s excellent vim tutorials for offline viewing in one
shot. Ideally downloading all videos directly from the rss feed would be
the best option. I could not find any application which did that …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I know you can easily download vimeo videos, but I wanted to download
all of Derek Wyatt&amp;#8217;s excellent vim tutorials for offline viewing in one
shot. Ideally downloading all videos directly from the rss feed would be
the best option. I could not find any application which did that but
found a shell script from &lt;a href="http://ossguy.com/?p=841"&gt;http://ossguy.com/?p=841&lt;/a&gt;. Unfortunately the
script no longer worked&amp;nbsp;:(&lt;/p&gt;
&lt;p&gt;I then found another script on github
&lt;a href="https://github.com/johnteslade/vimeo-downloader"&gt;here&lt;/a&gt;. Reading that
script I saw that it was based on the first script I had found and John
Teslade had fixed it up after Vimeo had made changes to their&amp;nbsp;site.&lt;/p&gt;
&lt;p&gt;I saved the script in my bin directory which is on my path. I then
tested it with a sample video and it worked beautifully. The best part
was that the saved video file was named with the title of the video.
Perfect! Well almost. This script does not dowmload videos based on a
playlist or rss&amp;nbsp;feed.&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s where I come in :). I opened the Derek Wyatt&amp;#8217;s rss feed on
&lt;a href="http://vimeo.com/user1690209"&gt;vimeo&lt;/a&gt;. saved the xml file locally on my
computer. I called it vimeo.xml. Stupid thing all came in one line.
Never mind&amp;#8230; opened the file in vim and used the following commands to
beautify it&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;%s&lt;span class="sr"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;\&lt;span class="k"&gt;r&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;/&lt;span class="k"&gt;g&lt;/span&gt;  
&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt; 
&lt;span class="p"&gt;=&lt;/span&gt;:$
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now just grep the file and look for the string &amp;#8221; &lt;link&gt;&amp;#8221; and pipe it to
a file. Lets call that file&amp;nbsp;playlist.txt&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;link&amp;gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;vimeo.xml&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;playlist.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The contents of the file looked like this&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/user1690209/videos&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/user1690209/videos&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/15443936&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/7133419&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/7129986&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/7096383&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/7035132&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6999927&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6342264&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6332848&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6329762&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6307101&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6306508&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6216655&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6185584&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6170479&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6154082&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6110008&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6093081&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6025010&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/6024774&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/4457161&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/4456458&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/4454614&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/4449258&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/4448635&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;link&amp;gt;&lt;/span&gt;http://vimeo.com/4448265&lt;span class="nt"&gt;&amp;lt;/link&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Clearly you can tell the first two are not video links. So just delete
those two lines. Then do a global search and replace to remove the
strings &amp;#8221; &lt;link&gt;&amp;#8221; and &amp;#8220;&lt;/link&gt;&amp;#8221;. The following vim recipe from
&lt;a href="http://rayninfo.co.uk/vimtips.html"&gt;http://rayninfo.co.uk/vimtips.html&lt;/a&gt; worked for me&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;:&lt;/span&gt;%s#&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;[^&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;]\&lt;span class="p"&gt;+&amp;gt;&lt;/span&gt;##&lt;span class="k"&gt;g&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Save and close the file. Now just run the following command to download
all the videos&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;cat&lt;span class="w"&gt; &lt;/span&gt;playlist.txt&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;vimeo_downloader.sh&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$line&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Maybe some day I will enhance this script to do all this for&amp;nbsp;me.&lt;/p&gt;</content><category term="software"/><category term="linux"/><category term="mac"/><category term="script"/></entry><entry><title>Kasoori Meethi Chicken finally</title><link href="https://www.nyayapati.com/srao/2013/06/kasoori-meethi-chicken-finally/" rel="alternate"/><published>2013-06-24T22:25:00-04:00</published><updated>2013-06-24T22:25:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-06-24:/srao/2013/06/kasoori-meethi-chicken-finally/</id><summary type="html">&lt;p&gt;I made kasoori methi chicken long time ago and posted a picture saying I
would post a recipe soon.. The day is finally here. Better late than
never right??&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3843.jpg"&gt;&lt;img alt="IMG_3843" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3843.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This recipe is a slight twist from a different interesting recipe I came
across. The slight twist is the addition of …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I made kasoori methi chicken long time ago and posted a picture saying I
would post a recipe soon.. The day is finally here. Better late than
never right??&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3843.jpg"&gt;&lt;img alt="IMG_3843" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3843.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This recipe is a slight twist from a different interesting recipe I came
across. The slight twist is the addition of Kasoori Methi. In english it
is called Fenugreek leaves. I will be using dried fenugreek leaves. I
think it is better than using fresh leaves as the dried leaves give a
very distinct flavor. You can get this from any Indian store. This dish
can be made without the addition of Kasoori Methi and it is still a very
tasty&amp;nbsp;dish.&lt;/p&gt;
&lt;p&gt;Another reason I thought this dish was interesting was because of the
use of fried onions paste. Checkout the ingredients and method to make
this&amp;nbsp;dish!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chicken - a whole chicken around 2 pounds(1.2kg) skinned and cut
    into 8&amp;nbsp;pieces&lt;/li&gt;
&lt;li&gt;Onions - 2 large finely&amp;nbsp;sliced&lt;/li&gt;
&lt;li&gt;Garlic Paste - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Ginger Paste - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Tomatoes - 4&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;Yogurt - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Red Chilli Powder - 1&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Turmeric Powder - 1/2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Coriander Powder - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Black Cardamom - 3&amp;nbsp;pods&lt;/li&gt;
&lt;li&gt;CLoves -&amp;nbsp;6&lt;/li&gt;
&lt;li&gt;Bay Leaf -&amp;nbsp;1&lt;/li&gt;
&lt;li&gt;Dried Fenugreek leaves - 1&amp;nbsp;tbsp&lt;/li&gt;
&lt;li&gt;Cilantro - 3 tbsp&amp;nbsp;chopped&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A point to note about the chicken is that if you don&amp;#8217;t like bone in
chicken you can make this dish with boneless thighs. Just use 2 pounds
of chicken thighs cut into&amp;nbsp;chunks.&lt;/p&gt;
&lt;p&gt;Heat about 1/4 cup of cooking oil in a heavy bottom pan. Add the onions
and cook till golden brown. Remove the pan from the heat and remove the
onions with a slotted spoon and let it cool down. Once it has cooled
down use a food processor to make a fine&amp;nbsp;paste.&lt;/p&gt;
&lt;p&gt;Return the pan to heat and add garlic and ginger paste. Stir for a
minute and then add the chopped tomatoes. Cook the tomatoes for a couple
of minutes and then mix in the yogurt. Now cook for 5-6 minute, mixing
every couple of&amp;nbsp;minutes.&lt;/p&gt;
&lt;p&gt;Mix in the onions paste you made earlier, along with all the spices
including the bay leaf, black cardamom and salt to taste. Cook, stirring
until the oil separates&amp;nbsp;out.&lt;/p&gt;
&lt;p&gt;Now add the chicken pieces and spoon the sauce over the chicken. Add 2
cups of water and mix the water in the sauce. Put the lid on the pan and
cook on low heat for 30-35 minutes, stirring occasionally so that the
bottom does not stick till the chicken is cooked. Add more water if&amp;nbsp;needed.&lt;/p&gt;
&lt;p&gt;Remove the lid. Crush the fenugreek leaves in your hands and add to the
pan. Mix it into the sauce. Now cook with the lid open, mixing
occasionally till the oil separates&amp;nbsp;out.&lt;/p&gt;
&lt;p&gt;Add half of the cilantro to the pan and mix it into the sauce. Garnish
with the remaining cilantro and serve this with hot chapati&amp;#8217;s or&amp;nbsp;Naan.&lt;/p&gt;
&lt;p&gt;Hope you enjoy this Yummy Recipe! Here are some more pics of the&amp;nbsp;dish..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3833.jpg"&gt;&lt;img alt="IMG_3833" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3833.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3839.jpg"&gt;&lt;img alt="IMG_3839" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3839.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3840.jpg"&gt;&lt;img alt="IMG_3840" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3840.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3842.jpg"&gt;&lt;img alt="IMG_3842" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3842.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="recipes"/><category term="chicken"/><category term="food"/></entry><entry><title>Installing Snow Leopard in VMWare on Mountain Lion</title><link href="https://www.nyayapati.com/srao/2013/06/installing-snow-leopard-in-vmware-on-mountain-lion/" rel="alternate"/><published>2013-06-24T13:29:00-04:00</published><updated>2013-06-24T13:29:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-06-24:/srao/2013/06/installing-snow-leopard-in-vmware-on-mountain-lion/</id><summary type="html">&lt;p&gt;I am learning how to build &lt;span class="caps"&gt;GUI&lt;/span&gt; applications in Python using PyQt/PySide.
I still have ways to go before I can start building some real
applications. My end goal is to be able to learn how to build a mac
application and then package it as a disk image …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am learning how to build &lt;span class="caps"&gt;GUI&lt;/span&gt; applications in Python using PyQt/PySide.
I still have ways to go before I can start building some real
applications. My end goal is to be able to learn how to build a mac
application and then package it as a disk image (.dmg) like how most mac
software is available. I would also like to learn how to create those
installer packages (.pkg/.mpkg)&amp;nbsp;eventually.&lt;/p&gt;
&lt;p&gt;One of the PySide apps I learnt was a currency converter. I thought, it
would be nice if I could create a dmg file as a proof of concept to the
entire build process. After facing a lot issues to build this on my
Mountain Lion, I finally succeeded. I will be documenting all the issues
I faced during this process in my&amp;nbsp;blog.&lt;/p&gt;
&lt;p&gt;Once I was able to do a build which worked on my own laptop, I sent the
dmg file to my brother to test out. He is still running Lion on his
macbook pro, so I thought it would be a good test for the build. The app
crashed on launch&amp;nbsp;:(&lt;/p&gt;
&lt;p&gt;After trying a couple of things we still could not get this to work.
That&amp;#8217;s when I decided to run an older version of &lt;span class="caps"&gt;MAC&lt;/span&gt; &lt;span class="caps"&gt;OSX&lt;/span&gt; as a &lt;span class="caps"&gt;VM&lt;/span&gt; on
VMWare. That way I can look at console logs and see what failures are
coming up and figure out a fix myself. As I have Snow Leopard media, I
thought it would be easy to do. Unfortunately &lt;span class="caps"&gt;NOT&lt;/span&gt;!!&lt;/p&gt;
&lt;p&gt;Finally got my Snow Leopard &lt;span class="caps"&gt;VM&lt;/span&gt; working after reading
&lt;a href="http://forums.macrumors.com/showthread.php?t=1365439"&gt;this&lt;/a&gt; thread on
MacRumors. I am capturing all that info here just to keep a copy. All
credit goes to the original source. I will document my Pyside Build
ordeal in a separate blog&amp;nbsp;post.&lt;/p&gt;
&lt;!--more Click here for details on how to Install Snow Leopard in VMWare on Mountain Lion --&gt;

&lt;p&gt;&lt;strong&gt;Step One - Preparing the Snow Leopard Installation &lt;span class="caps"&gt;DVD&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. Insert a fresh Snow Leopard Installation &lt;span class="caps"&gt;DVD&lt;/span&gt; into your drive and
launch Disk Utility (/Applications/Utilities/). Since the release of
Mountain Lion, &lt;a href="http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard"&gt;you can obtain this &lt;span class="caps"&gt;DVD&lt;/span&gt; for $19.99 from the Apple
Store&lt;/a&gt;
or call their telesales agents [1-800-&lt;span class="caps"&gt;MY&lt;/span&gt;-&lt;span class="caps"&gt;APPLE&lt;/span&gt; (1-800-692-7753)] or
Customer Service and Sales Support at 1-800-676-2775 or 1-800-275-2273
(ask for a Sales Representative). Do not use a grey, machine-specific
Install &lt;span class="caps"&gt;DVD&lt;/span&gt;: see the attached&amp;nbsp;photos.&lt;/p&gt;
&lt;p&gt;2. Select the device for your optical drive (note that this is &lt;span class="caps"&gt;NOT&lt;/span&gt; the
Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X Installation disk, but rather the device that has mounted it;
in this example the device is named &amp;#8220;SuperDrive”). &lt;span class="caps"&gt;BE&lt;/span&gt; &lt;span class="caps"&gt;VERY&lt;/span&gt; &lt;span class="caps"&gt;CAREFUL&lt;/span&gt; &lt;span class="caps"&gt;HERE&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/Disk-Utility.jpg"&gt;&lt;img alt="Disk
Utility" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/Disk-Utility.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;3. From Disk Utility’s File menu, choose “New &amp;gt; Disk Image from
[device]” from the File menu, set the image format to “&lt;span class="caps"&gt;DVD&lt;/span&gt;/&lt;span class="caps"&gt;CD&lt;/span&gt; master”
and Encryption to none and create the disk image on your Desktop. When
the creation of the disk image file is complete, quit Disk Utility and
eject the Snow Leopard Install &lt;span class="caps"&gt;DVD&lt;/span&gt; from your&amp;nbsp;drive.&lt;/p&gt;
&lt;p&gt;4. Launch Terminal (/Applications/Utilities/); cut and paste or
carefully type the following 4 commands into Terminal and, after each,
hit&amp;nbsp;Return/Enter:&lt;/p&gt;
&lt;p&gt;5. Change to the directory where the image is&amp;nbsp;located.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Desktop
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;6. Mount the disk image in a way that allows any changes to be kept in a
‘shadow’&amp;nbsp;file.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;hdiutil&lt;span class="w"&gt; &lt;/span&gt;attach&lt;span class="w"&gt; &lt;/span&gt;SuperDrive.cdr&lt;span class="w"&gt; &lt;/span&gt;-shadow
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;7. Add the important file to the mounted image with this (including the
quotation&amp;nbsp;marks):  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;touch&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/Volumes/Mac OS X Install DVD/System/Library/CoreServices/ServerVersion.plist&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;8. Unmount the disk image by ‘ejecting’ the ‘Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X Install &lt;span class="caps"&gt;DVD&lt;/span&gt;’ in
Finder. At this point you have two files - SuperDrive.cdr and
SuperDrive.cdr.shadow on the&amp;nbsp;Desktop.&lt;/p&gt;
&lt;p&gt;9. Create a new &lt;span class="caps"&gt;DVD&lt;/span&gt;/&lt;span class="caps"&gt;CD&lt;/span&gt; master disk image ’SuperDrive-Server.cdr’ which
is the same as SuperDrive.cdr, but with the change&amp;nbsp;included.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;hdiutil&lt;span class="w"&gt; &lt;/span&gt;convert&lt;span class="w"&gt; &lt;/span&gt;-format&lt;span class="w"&gt; &lt;/span&gt;UDTO&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;SuperDrive-Server.cdr
SuperDrive.cdr&lt;span class="w"&gt; &lt;/span&gt;-shadow
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;10. Quit Terminal, and continue using SuperDrive-Server.cdr in place of
SuperDrive.cdr. If you wish you can now delete SuperDrive.cdr and
SuperDrive.cdr.shadow - they are no longer&amp;nbsp;needed.&lt;/p&gt;
&lt;p&gt;(steps 4-10 are from
&lt;a href="http://forums.macrumors.com/showpost.php?p=16745691&amp;amp;postcount=413"&gt;here&lt;/a&gt;)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step Two - Installing Snow Leopard into VMWare on Mountain&amp;nbsp;Lion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. Launch&amp;nbsp;VMWare&lt;/p&gt;
&lt;p&gt;2. From the File menu go to New… Then click on the &amp;#8220;Choose Continue
without disc&amp;#8221;&amp;nbsp;button&lt;/p&gt;
&lt;p&gt;3. Drag and Drop the SuperDrive-Server.cdr image you created onto &amp;#8220;Use
operating system installation disc or image&amp;#8221; radio button and click&amp;nbsp;Continue.&lt;/p&gt;
&lt;p&gt;4. Change Operating System to &amp;#8220;Apple Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X&amp;#8221; and Version to &amp;#8220;Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X
Server 10.6 64-bit&amp;#8221; and click&amp;nbsp;continue.&lt;/p&gt;
&lt;p&gt;5. You can click on Customize Settings to make changes to the default. I
took defaults and clicked on&amp;nbsp;Finish.&lt;/p&gt;
&lt;p&gt;6. &lt;span class="caps"&gt;OS&lt;/span&gt; X Snow Leopard will now start to be installed into the VMWare file
called &amp;#8220;Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X Server 10.6 64-bit&amp;#8221; located in &amp;#8220;~Documents/Virtual
Machines&amp;#8221;. As with all Snow Leopard installations, the following
selections need to be made, as they come&amp;nbsp;up:&lt;/p&gt;
&lt;p&gt;a. Use English for the main language (click on the right&amp;nbsp;arrow).&lt;/p&gt;
&lt;p&gt;b. Install Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X (click on&amp;nbsp;Continue).&lt;/p&gt;
&lt;p&gt;c. Agree to the terms of the software licensing agreement by clicking&amp;nbsp;Agree.&lt;/p&gt;
&lt;p&gt;d. Select the disk where you want to install Snow Leopard by clicking on
the Macintosh &lt;span class="caps"&gt;HD&lt;/span&gt;, but &lt;span class="caps"&gt;DO&lt;/span&gt; &lt;span class="caps"&gt;NOT&lt;/span&gt; &lt;span class="caps"&gt;YET&lt;/span&gt; &lt;span class="caps"&gt;CLICK&lt;/span&gt; &lt;span class="caps"&gt;ON&lt;/span&gt; &lt;span class="caps"&gt;INSTALL&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;7. In the Utilities Menu to the right of the Mac &lt;span class="caps"&gt;OS&lt;/span&gt; X Installer Menu (at
the top of the Snow Leopard installation screen), Launch&amp;nbsp;Terminal;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/Terminal.png"&gt;&lt;img alt="Terminal" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/Terminal.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;8. Type the following command (including the quotation marks) in
Terminal and then click &lt;span class="caps"&gt;RETURN&lt;/span&gt;/&lt;span class="caps"&gt;ENTER&lt;/span&gt;:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;mkdir&lt;span class="w"&gt; &lt;/span&gt;-p&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/Volumes/Macintosh HD/System/Library/CoreServices/&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;9. Now type this command (including quotation marks) in Terminal and hit
&lt;span class="caps"&gt;RETURN&lt;/span&gt;/&lt;span class="caps"&gt;ENTER&lt;/span&gt;:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;touch&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;/Volumes/Macintosh HD/System/Library/CoreServices/ServerVersion.plist&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;10. Quit Terminal and go back to the installation of Snow Leopard; &lt;span class="caps"&gt;BUT&lt;/span&gt;
&lt;span class="caps"&gt;FIRST&lt;/span&gt;: Click Customize and select Rosetta and optionally Quicktime 7 and
all printer drivers. Click on &lt;span class="caps"&gt;OK&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;11. Click on Install and the process will take upwards to 30 minutes or
more as Snow Leopard is installed into your &lt;span class="caps"&gt;VM&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;12. As it initiates Snow Leopard be sure to remember the Account Name
and Password you&amp;nbsp;establish.&lt;/p&gt;
&lt;p&gt;13. Upon completion the installation process will reboot and you will
now have a Snow Leopard VMWare Window. Cancel &lt;span class="caps"&gt;ANY&lt;/span&gt; attempt by Software
Update at this time. I recommend the following optional settings in the
Snow Leopard&amp;nbsp;environment:&lt;/p&gt;
&lt;p&gt;a. Go to Preferences in the Finder menu and make sure that Hard Disks
and Connected Servers are&amp;nbsp;selected.&lt;/p&gt;
&lt;p&gt;b. Launch System Preferences and go to Date/Time and then Clock and
select show&amp;nbsp;seconds.&lt;/p&gt;
&lt;p&gt;14. Shut down Snow Leopard. Make a snapshot of your install for&amp;nbsp;backup.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step Three - Updating the Snow Leopard VMWare&amp;nbsp;environment&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;1. Installing VMWare Tools - Start your Snow Leopard VMWare session. Go
to Virtual Machine menu option and click on Install VMWare&amp;nbsp;Tools.&lt;/p&gt;
&lt;p&gt;2. Preparation for updating Snow&amp;nbsp;Leopard&lt;/p&gt;
&lt;p&gt;a. a. Open TextEdit in Snow Leopard. &lt;span class="caps"&gt;NOTE&lt;/span&gt;: The first time you open
TextEdit in the Snow Leopard VMWare environment, go to the TextEdit
Menu, down to Preferences and under Format, instead of the default Rich
Text, click Plain Text; then close the Preferences&amp;nbsp;window.&lt;/p&gt;
&lt;p&gt;b. b. Copy the following xml code into a blank open document in TextEdit
(&lt;span class="caps"&gt;NOTE&lt;/span&gt;: if you open Safari in Snow Leopard and type in the following
&lt;span class="caps"&gt;URL&lt;/span&gt; &amp;#8212; http://forums.macrumors.com/showthread.php?p=14799174 &amp;#8212; you can
then easily copy and paste the following xml text into&amp;nbsp;TextEdit):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="cp"&gt;&amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot;  &lt;/span&gt;
&lt;span class="cp"&gt;&amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;plist&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="na"&gt;version=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;1.0&amp;quot;&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;dict&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;Label&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;com.rectalogic.vmware&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;ProgramArguments&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;array&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/bin/bash&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;-c&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;string&amp;gt;&lt;/span&gt;/bin/rm&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;/System/Library/CoreServices/ServerVersion.plist;
trap&lt;span class="w"&gt; &lt;/span&gt;&amp;quot;/usr/bin/touch&lt;span class="w"&gt; &lt;/span&gt;/System/Library/CoreServices/ServerVersion.plist;
exit&amp;quot;&lt;span class="w"&gt; &lt;/span&gt;SIGINT&lt;span class="w"&gt; &lt;/span&gt;SIGTERM&lt;span class="w"&gt; &lt;/span&gt;SIGHUP;&lt;span class="w"&gt; &lt;/span&gt;sleep&lt;span class="w"&gt; &lt;/span&gt;999999&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ni"&gt;&amp;amp;amp;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;wait&lt;span class="w"&gt; &lt;/span&gt;$!&lt;span class="nt"&gt;&amp;lt;/string&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/array&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;KeepAlive&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;key&amp;gt;&lt;/span&gt;RunAtLoad&lt;span class="nt"&gt;&amp;lt;/key&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;true/&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dict&amp;gt;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/plist&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class="caps"&gt;NOTE&lt;/span&gt;: the 12th line in the middle of the text above to be entered into
Text Edit, runs off the screen here on MacRumors. &lt;span class="caps"&gt;BE&lt;/span&gt; &lt;span class="caps"&gt;SURE&lt;/span&gt; to get the
complete line; either copy and paste the whole text or be sure you are
properly entering this &lt;span class="caps"&gt;COMPLETE&lt;/span&gt;&amp;nbsp;line:&lt;/p&gt;
&lt;p&gt;&lt;string&gt;/bin/rm -f /System/Library/CoreServices/ServerVersion.plist;
trap &amp;#8220;/usr/bin/touch /System/Library/CoreServices/ServerVersion.plist;
exit&amp;#8221; &lt;span class="caps"&gt;SIGINT&lt;/span&gt; &lt;span class="caps"&gt;SIGTERM&lt;/span&gt; &lt;span class="caps"&gt;SIGHUP&lt;/span&gt;; sleep 999999 &lt;span class="amp"&gt;&amp;amp;&lt;/span&gt; wait $!&lt;/string&gt;&lt;/p&gt;
&lt;p&gt;c. Go to Save As in the File Menu of&amp;nbsp;TextEdit.&lt;/p&gt;
&lt;p&gt;(1) Enter the file name: &amp;#8220;com.rectalogic.vmware.plist&amp;#8221; (without the
quotation marks) in the Save As box (delete: &amp;#8220;.txt&amp;#8221;). You will see the
correct default - Plain Text Encoding: Unicode (&lt;span class="caps"&gt;UTF&lt;/span&gt;-8)&lt;/p&gt;
&lt;p&gt;[If you do &lt;span class="caps"&gt;NOT&lt;/span&gt; see &amp;#8220;the correct default - Plain Text Encoding: Unicode
(&lt;span class="caps"&gt;UTF&lt;/span&gt;-8)&amp;#8221; when you try to Save As, it is probably because, when you
pasted in the code, it pasted as Rich Text. You can fix this easily by
going to Format &amp;gt; Make Plain Text, after which the &lt;span class="caps"&gt;UTF&lt;/span&gt;-8 option (and
.txt option) will be&amp;nbsp;available.];&lt;/p&gt;
&lt;p&gt;(2) Uncheck the box &amp;#8220;If no extension is provided, use &amp;#8216;.txt&amp;#8217;.&amp;#8221; and save
it to the Desktop. If it asks which extension, choose&amp;nbsp;.plist.&lt;/p&gt;
&lt;p&gt;(3) Quit&amp;nbsp;TextEdit.&lt;/p&gt;
&lt;p&gt;(4) Go to the Desktop and move the file to /Macintosh
&lt;span class="caps"&gt;HD&lt;/span&gt;/Library/LaunchDaemons/ and when it asks - click Authenticate and then
enter your Snow Leopards account&amp;nbsp;password.&lt;/p&gt;
&lt;p&gt;d. Open Terminal in Snow Leopard from /Macintosh
&lt;span class="caps"&gt;HD&lt;/span&gt;/Applications/Utilities/. Enter the following text in Terminal and
then hit &lt;span class="caps"&gt;RETURN&lt;/span&gt;/&lt;span class="caps"&gt;ENTER&lt;/span&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;chown&lt;span class="w"&gt; &lt;/span&gt;root:wheel&lt;span class="w"&gt; &lt;/span&gt;/Library/LaunchDaemons/com.rectalogic.vmware.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;e. It will ask you for your Snow Leopard account password; enter it
(nothing will appear on screen as you type the password) and hit
&lt;span class="caps"&gt;RETURN&lt;/span&gt;/&lt;span class="caps"&gt;ENTER&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;f. Enter the following text in Terminal and then hit &lt;span class="caps"&gt;RETURN&lt;/span&gt;/&lt;span class="caps"&gt;ENTER&lt;/span&gt;:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;%&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;launchctl&lt;span class="w"&gt; &lt;/span&gt;load&lt;span class="w"&gt; &lt;/span&gt;/Library/LaunchDaemons/com.rectalogic.vmware.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;g. Quit&amp;nbsp;Terminal&lt;/p&gt;
&lt;p&gt;3. Updating Snow Leopard and other software updates&lt;br&gt;
a. In the Apple Menu in Snow Leopard go to Software&amp;nbsp;Updates&amp;#8230;&lt;/p&gt;
&lt;p&gt;b. After it Checks for New Software, it will tell you updates are&amp;nbsp;available:&lt;/p&gt;
&lt;p&gt;(1) Click the Show Details&amp;nbsp;button.&lt;/p&gt;
&lt;p&gt;(2) My advice is that at this time (May, 2012) all updates should be
accepted except for the Apple Software Installation Update 1.0 (which
has had some problems and probably only fixes installation problems of
software that you would preferably be installing into Lion&amp;nbsp;anyway).&lt;/p&gt;
&lt;p&gt;(3) You will most likely have to restart after the Software Installation
and there may be additional software updates that will appear after a&amp;nbsp;restart.&lt;/p&gt;
&lt;p&gt;(4) Repeat this process until all recommended updates are&amp;nbsp;complete.&lt;/p&gt;
&lt;p&gt;c. In System Preferences, go to Sharing and turn on File Sharing. &lt;span class="caps"&gt;NOTE&lt;/span&gt;:
you may have to turn on printer sharing in your Lion environment to
access your printers in Snow&amp;nbsp;Leopard.&lt;/p&gt;
&lt;p&gt;4. Congratulations: you now have a completely functional Snow Leopard
environment in&amp;nbsp;VMWare&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Step Four - Backup your Snow Leopard VMWare Files&lt;/strong&gt;&lt;br&gt;
1. Shut Down Snow&amp;nbsp;Leopard.&lt;/p&gt;
&lt;p&gt;2. Make a backup of the VMWare file &amp;#8220;~Documents/Virtual Machines/Mac &lt;span class="caps"&gt;OS&lt;/span&gt;
X Server 10.6&amp;nbsp;64-bit&amp;#8221;.&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;END&lt;/span&gt; &lt;span class="caps"&gt;OF&lt;/span&gt; &lt;span class="caps"&gt;INSTALLATION&lt;/span&gt; &lt;span class="caps"&gt;INSTRUCTIONS&lt;/span&gt;&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="macosx"/><category term="vmware"/></entry><entry><title>Salmon Papillote</title><link href="https://www.nyayapati.com/srao/2013/06/salmon-papillote/" rel="alternate"/><published>2013-06-24T00:16:00-04:00</published><updated>2013-06-24T00:16:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-06-24:/srao/2013/06/salmon-papillote/</id><summary type="html">&lt;p&gt;This is the easiest dish to make and it is full proof and quick to&amp;nbsp;make.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130624-110517.jpg"&gt;&lt;img alt="20130624-110517.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130624-110517.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ingredients&lt;/p&gt;
&lt;p&gt;Salt - 1 tsp sprinkle all over the fish&lt;br&gt;
Pepper - sprinkle all over the fish&lt;br&gt;
Lemon - quarter wedge&lt;br&gt;
Garlic powder - sprinkle all over the fish&lt;br&gt;
Extra virgin olive&amp;nbsp;oil&lt;/p&gt;
&lt;p&gt;Apply salt, pepper and garlic …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is the easiest dish to make and it is full proof and quick to&amp;nbsp;make.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130624-110517.jpg"&gt;&lt;img alt="20130624-110517.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130624-110517.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Ingredients&lt;/p&gt;
&lt;p&gt;Salt - 1 tsp sprinkle all over the fish&lt;br&gt;
Pepper - sprinkle all over the fish&lt;br&gt;
Lemon - quarter wedge&lt;br&gt;
Garlic powder - sprinkle all over the fish&lt;br&gt;
Extra virgin olive&amp;nbsp;oil&lt;/p&gt;
&lt;p&gt;Apply salt, pepper and garlic powder to the fish. Then drizzle with the
olive oil and squeeze a quarter of lemon. Now seal the salmon in
aluminum&amp;nbsp;foil.&lt;/p&gt;
&lt;p&gt;Preheat the oven at 375 degrees. Put the packaged salmon on a baking
sheet and let it bake for 15&amp;nbsp;minutes.&lt;/p&gt;
&lt;p&gt;Serve it hot with some rice pilaf, mashed potatoes and grilled
asparagus! Do not throw away the sauce you see in the above picture..
Drizzle that on top of fish before serving! It&amp;#8217;s super&amp;nbsp;tasty!!&lt;/p&gt;
&lt;p&gt;The picture below shows how the packaged foil looks&amp;nbsp;like.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130624-110348.jpg"&gt;&lt;img alt="20130624-110348.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130624-110348.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="recipes"/><category term="food"/><category term="salmon"/></entry><entry><title>Chicken Saag</title><link href="https://www.nyayapati.com/srao/2013/06/chicken-saag/" rel="alternate"/><published>2013-06-19T22:50:00-04:00</published><updated>2013-06-19T22:50:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-06-19:/srao/2013/06/chicken-saag/</id><summary type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3815.jpg"&gt;&lt;img alt="IMG_3815" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3815.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This dish came out soo tasty! It goes really well with both cooked white
rice and&amp;nbsp;chapatti&amp;#8217;s..&lt;/p&gt;
&lt;p&gt;Here are the ingredients for this this&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chicken thighs cut into small chunks - 2&amp;nbsp;pounds&lt;/li&gt;
&lt;li&gt;Spinach - 2&amp;nbsp;bunches&lt;/li&gt;
&lt;li&gt;Ginger - one&amp;nbsp;inch&lt;/li&gt;
&lt;li&gt;Garlic - 4&amp;nbsp;cloves&lt;/li&gt;
&lt;li&gt;Green Chillies -&amp;nbsp;2&lt;/li&gt;
&lt;li&gt;Bay Leaves - 2-3&amp;nbsp;leaves&lt;/li&gt;
&lt;li&gt;Pepper …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3815.jpg"&gt;&lt;img alt="IMG_3815" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/IMG_3815.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This dish came out soo tasty! It goes really well with both cooked white
rice and&amp;nbsp;chapatti&amp;#8217;s..&lt;/p&gt;
&lt;p&gt;Here are the ingredients for this this&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Chicken thighs cut into small chunks - 2&amp;nbsp;pounds&lt;/li&gt;
&lt;li&gt;Spinach - 2&amp;nbsp;bunches&lt;/li&gt;
&lt;li&gt;Ginger - one&amp;nbsp;inch&lt;/li&gt;
&lt;li&gt;Garlic - 4&amp;nbsp;cloves&lt;/li&gt;
&lt;li&gt;Green Chillies -&amp;nbsp;2&lt;/li&gt;
&lt;li&gt;Bay Leaves - 2-3&amp;nbsp;leaves&lt;/li&gt;
&lt;li&gt;Pepper Corns -&amp;nbsp;10&lt;/li&gt;
&lt;li&gt;Onions - 1&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;Tomatoes - 3-4&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;Chilli Powder - 1/2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Coriander Powder - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Garam Masala - 1 and 1/2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Turmeric - 1/2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Yogurt - 1/2&amp;nbsp;cup&lt;/li&gt;
&lt;li&gt;Salt to&amp;nbsp;taste&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Method&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cook the spinach in pan. Toss the spinach till it reduces for maybe 5
minutes. Put the cooked spinach with ginger, garlic, green chillies and
water if required in a blender and process to a thick&amp;nbsp;puree.&lt;/p&gt;
&lt;p&gt;Heat the oil in a large heavy pan. Add bay leaves and black peppercorns
and sauté for a minute. Stir in the chopped onions and cook till golden
brown. Add the chopped tomatoes and cook for 6-8&amp;nbsp;minutes.&lt;/p&gt;
&lt;p&gt;Now add the Chilli powder, Coriander Powder, Garam Masala, Turmeric and
salt and mix it into the tomato onion mixture. Cook for 2-3 minutes till
the oil starts to&amp;nbsp;separate.&lt;/p&gt;
&lt;p&gt;Stir in the spinach puree you made earlier. Add about 3/4 cup of water
and simmer for 5 minutes. Add your beaten yogurt and mix it well into
the spinach mixture and simmer for another 5 minutes. Now add your
chicken and stir the spinach to coat the chicken. Cover and cook for
25-30 minutes on medium to low heat till the chicken is&amp;nbsp;tender.&lt;/p&gt;
&lt;p&gt;Garnish with a dollop of yogurt and either server with warm Naan or hot
white&amp;nbsp;rice&lt;/p&gt;
&lt;p&gt;This dish can also be made with Paneer (indian cottage cheese) instead
of chicken. Just cut paneer into cubes and add at the point where you
add the chicken. Paneer does not need to be cooked for 25-30 minutes. It
will be ready in just 5-10&amp;nbsp;minutes&lt;/p&gt;</content><category term="recipes"/><category term="chicken"/><category term="food"/><category term="saag"/><category term="spinach"/></entry><entry><title>Nihari</title><link href="https://www.nyayapati.com/srao/2013/06/nihari/" rel="alternate"/><published>2013-06-18T09:51:00-04:00</published><updated>2013-06-18T09:51:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-06-18:/srao/2013/06/nihari/</id><summary type="html">&lt;p&gt;This is one of those dishes which brings really fond memories of my
childhood going to these shops in Old Delhi(India) serving Nihari early
in the morning. I think this is my favorite dish of all time!! This dish
is usually eaten early in the morning. Read
&lt;a href="http://en.wikipedia.org/wiki/Nihari"&gt;this&lt;/a&gt; wikipedia …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is one of those dishes which brings really fond memories of my
childhood going to these shops in Old Delhi(India) serving Nihari early
in the morning. I think this is my favorite dish of all time!! This dish
is usually eaten early in the morning. Read
&lt;a href="http://en.wikipedia.org/wiki/Nihari"&gt;this&lt;/a&gt; wikipedia entry for more
details on this&amp;nbsp;dish.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130618-094238.jpg"&gt;&lt;img alt="20130618-094238.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130618-094238.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the recipe&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;Ingredients for Nihari&amp;nbsp;Masala&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;3 tbsp&amp;nbsp;saunf/fennel&lt;/li&gt;
&lt;li&gt;2-3 sticks&amp;nbsp;dalchini/cinamom&lt;/li&gt;
&lt;li&gt;6 choti elaichi/green&amp;nbsp;cardamom&lt;/li&gt;
&lt;li&gt;2 badi elaichi/black&amp;nbsp;cardamom&lt;/li&gt;
&lt;li&gt;12-15 kali mirch/black pepper&amp;nbsp;seeds&lt;/li&gt;
&lt;li&gt;1 tbsp sonth/dried ginger&amp;nbsp;powder&lt;/li&gt;
&lt;li&gt;6 pieces -&amp;nbsp;javatiri/mace&lt;/li&gt;
&lt;li&gt;nutmeg 1/2 inch&amp;nbsp;piece&lt;/li&gt;
&lt;li&gt;1.5 tbsp spoon lal mirch/red chili&amp;nbsp;powder&lt;/li&gt;
&lt;li&gt;1 tbsp dhaniya/coriander&amp;nbsp;powder&lt;/li&gt;
&lt;li&gt;1/4 tsp&amp;nbsp;haldi/turmeric&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Ingredients for the&amp;nbsp;recipe&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;1 &lt;span class="caps"&gt;KG&lt;/span&gt; Lamb meat cut into big chunks. You can replace this with any
    red&amp;nbsp;meat.&lt;/li&gt;
&lt;li&gt;1 onion -&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;2 tbsp adrak lahsun/ginger garlic&amp;nbsp;paste&lt;/li&gt;
&lt;li&gt;1 tbsp&amp;nbsp;salt&lt;/li&gt;
&lt;li&gt;1 tbsp lal mirch.red chili&amp;nbsp;powder&lt;/li&gt;
&lt;li&gt;4 tbsp of Nihari&amp;nbsp;Masala&lt;/li&gt;
&lt;li&gt;1/2 cup&amp;nbsp;yogurt&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Take all the ingredients for Nihari Masala and use a dry grinder or
coffee grinder to make a powder.&lt;br&gt;
Now take a heavy bottom vessel as you will be cooking the meat for
atleast 3-4 hours. I used an enameled dutch oven to cook&amp;nbsp;this.&lt;/p&gt;
&lt;p&gt;Add 1/2 cup of ghee to your vessel and heat on a medium flame.&lt;br&gt;
Add 1 chopped onion and cook till light golden&lt;br&gt;
Add 2 tbsp adrak lahsun/Ginger Garlic paste and cook for a minute&lt;br&gt;
Add your meat - 1 &lt;span class="caps"&gt;KG&lt;/span&gt;/2.2 Pounds and let it brown on all sides (maybe
2-3 minutes on each side)&lt;br&gt;
Add 1 tbsp salt&lt;br&gt;
Add 1 tbsp lal mirch/red chili powder&lt;br&gt;
Add 4 tbsp nihari masala pwder from above and mix it well.&lt;br&gt;
Now Add 1/2 cup dahi/yogurt and mix it well into all the&amp;nbsp;meat.&lt;/p&gt;
&lt;p&gt;At this point this is what you should be seeing&amp;nbsp;-&lt;/p&gt;
&lt;iframe width="560" height="315"
src="https://www.youtube.com/embed/krGAgaV21UQ" frameborder="0"
allowfullscreen&gt;&lt;/iframe&gt;
&lt;p&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/{static}wp-content/uploads/2013/06/20130618-142319.jpg"&gt;&lt;img alt="20130618-142319.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130618-142319.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Lower the heat and add about 10 cups of water. Cover up the vessel and
forget about this dish for the next 3-4 hours. Well almost. Just check
every 30 minutes to make sure the masala does not stick to the bottom of
the vessel. If the liquid evaporates and your meat hasn&amp;#8217;t become tender,
just add more&amp;nbsp;water.&lt;/p&gt;
&lt;p&gt;In my case the meat got tender in about 4 hours. I had to replenish the
water at about the 3 hour mark but your mileage might&amp;nbsp;vary.&lt;/p&gt;
&lt;p&gt;Once the meat is tender, make a very thin paste by mixing 1/2 cup of all
purpose flour and 4 tbsp of wheat flour with water. Add this mixture to
your dish. This is used as a thickening agent. Now keep a close eye on
your dish and make sure the bottom is not sticking. Don&amp;#8217;t overly mix the
dish as you don&amp;#8217;t want to break down the meat. Taste and add more salt
if required. Once you see a boil after adding the thin paste the dish
should be&amp;nbsp;ready.&lt;/p&gt;
&lt;p&gt;Add a garnish of julliened ginger, chopped cilantro and crispy fried
onions. Serve it with Naan or&amp;nbsp;chappati.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130618-141754.jpg"&gt;&lt;img alt="20130618-141754.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/06/20130618-141754.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="recipes"/><category term="food"/><category term="lamb"/><category term="nihari"/></entry><entry><title>How to reset QmailAdmin password</title><link href="https://www.nyayapati.com/srao/2013/05/how-to-reset-qmailadmin-password/" rel="alternate"/><published>2013-05-19T07:07:00-04:00</published><updated>2013-05-19T07:07:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-05-19:/srao/2013/05/how-to-reset-qmailadmin-password/</id><summary type="html">&lt;p&gt;Actually you can use this command to reset any users qmail account&amp;nbsp;password.&lt;/p&gt;
&lt;p&gt;Simply run the following command to change the password for
user@domain.com either by using sudo or as&amp;nbsp;root.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# /home/vpopmail/bin/vpasswd user@domain.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above command will ask you for the new password …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Actually you can use this command to reset any users qmail account&amp;nbsp;password.&lt;/p&gt;
&lt;p&gt;Simply run the following command to change the password for
user@domain.com either by using sudo or as&amp;nbsp;root.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# /home/vpopmail/bin/vpasswd user@domain.com&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above command will ask you for the new password twice. That was&amp;nbsp;easy!&lt;/p&gt;</content><category term="software"/><category term="qmail"/></entry><entry><title>Roast Pork Banh Mi at 163 Vietnamese Sandwiches and Bubble Tea</title><link href="https://www.nyayapati.com/srao/2013/05/roast-pork-banh-mi-at-163-vietnamese-sandwiches-and-bubble-tea/" rel="alternate"/><published>2013-05-16T15:09:00-04:00</published><updated>2013-05-16T15:09:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-05-16:/srao/2013/05/roast-pork-banh-mi-at-163-vietnamese-sandwiches-and-bubble-tea/</id><summary type="html">&lt;p&gt;My favorite Banh Mi (Vietnamese Sandwich) place in Chinatown Boston
introduced a bunch of new sandwiches on their menu. The place is called
&lt;a href="http://www.yelp.com/biz/163-vietnamese-sandwiches-and-bubble-tea-boston"&gt;163 Vietnamese Sandwiches and Bubble
Tea&lt;/a&gt;.
It&amp;#8217;s in 66 Harrison Avenue. The name is a mouthful for sure&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;The roast pork looked like thickly cut ham …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My favorite Banh Mi (Vietnamese Sandwich) place in Chinatown Boston
introduced a bunch of new sandwiches on their menu. The place is called
&lt;a href="http://www.yelp.com/biz/163-vietnamese-sandwiches-and-bubble-tea-boston"&gt;163 Vietnamese Sandwiches and Bubble
Tea&lt;/a&gt;.
It&amp;#8217;s in 66 Harrison Avenue. The name is a mouthful for sure&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;The roast pork looked like thickly cut ham with the usual fixings of
vietnamese mayo, drizzle of some kind of fish sauce, thinly sliced
cucumbers carrots and daikon, chopped scallions and cilantro on a crispy
baguette. I usually ask for my sandwich to be spicy so they add some
chopped up Thai Chillies. For $3.75 it&amp;#8217;s a&amp;nbsp;steal.&lt;/p&gt;
&lt;p&gt;Here are some&amp;nbsp;pics&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-145953.jpg"&gt;&lt;img alt="20130516-145953.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-145953.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-150704.jpg"&gt;&lt;img alt="20130516-150704.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-150704.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-150822.jpg"&gt;&lt;img alt="20130516-150822.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-150822.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-150854.jpg"&gt;&lt;img alt="20130516-150854.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130516-150854.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The sandwich is good, but I think their pork chop sandwich, &lt;span class="caps"&gt;BBQ&lt;/span&gt; pork
Sandwich and cold cuts sandwich are much much better than&amp;nbsp;this.&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>Cold Noodle Salad at Fugu Truck Boston</title><link href="https://www.nyayapati.com/srao/2013/05/cold-noodle-salad-at-fugu-truck-boston/" rel="alternate"/><published>2013-05-14T14:27:00-04:00</published><updated>2013-05-14T14:27:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-05-14:/srao/2013/05/cold-noodle-salad-at-fugu-truck-boston/</id><summary type="html">&lt;p&gt;Is it wrong if I said &amp;#8220;I Fugu You&amp;#8221;?? (Read Fugu=Love). I think the food
in Fugu is made with such care and love that every dish comes out tasty
and you just want to come back for more..&lt;br&gt;
And that&amp;#8217;s what I did today. I went back …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Is it wrong if I said &amp;#8220;I Fugu You&amp;#8221;?? (Read Fugu=Love). I think the food
in Fugu is made with such care and love that every dish comes out tasty
and you just want to come back for more..&lt;br&gt;
And that&amp;#8217;s what I did today. I went back for more.. Today I tried their
Cold Noodle salad with sesame sauce with&amp;nbsp;Pork.&lt;/p&gt;
&lt;p&gt;I think it is their best dish yet! It looks as pleasing as it is tasty..
the combination of cilantro, scallions and thinly sliced cucumbers and
carrots give a very colorful and fresh look! I should add that the
noodles were also cooked&amp;nbsp;well.&lt;/p&gt;
&lt;p&gt;Here are some pictures&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150112.jpg"&gt;&lt;img alt="20130514-150112.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150112.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150343.jpg"&gt;&lt;img alt="20130514-150343.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150343.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hmmmm.. Where is my pork?? looks like somebody forgot to put pork in my
order.. but the Guys on Fugu Truck are really nice about it and hook me
up with some extra :) Thanks Guys!! Look at that&amp;nbsp;pile!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150453.jpg"&gt;&lt;img alt="20130514-150453.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150453.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is after mixing it all up with the extra hot chilli oil I asked for
(It&amp;#8217;s soo tasty&amp;#8230; You&amp;nbsp;must!!)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150505.jpg"&gt;&lt;img alt="20130514-150505.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150505.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and don&amp;#8217;t worry, I did not forget the customary pork buns this time&amp;nbsp;too..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150524.jpg"&gt;&lt;img alt="20130514-150524.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-150524.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks @fugutruck for another wonderful&amp;nbsp;lunch!&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>Soy Ramen at Ginza</title><link href="https://www.nyayapati.com/srao/2013/05/soy-ramen-at-ginza/" rel="alternate"/><published>2013-05-14T14:26:00-04:00</published><updated>2013-05-14T14:26:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-05-14:/srao/2013/05/soy-ramen-at-ginza/</id><summary type="html">&lt;p&gt;Finally got to go back to Ginza last week to try their Soy Ramen. So
tasty and refreshing.. I liked it! I still feel the Pork Broth Ramen is
the best tasting among all the options at Ginza.. But second place is a
tough choice. It is a tie between …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Finally got to go back to Ginza last week to try their Soy Ramen. So
tasty and refreshing.. I liked it! I still feel the Pork Broth Ramen is
the best tasting among all the options at Ginza.. But second place is a
tough choice. It is a tie between the miso and soy flavored&amp;nbsp;Ramen!&lt;/p&gt;
&lt;p&gt;Here are some&amp;nbsp;pics&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-141937.jpg"&gt;&lt;img alt="20130514-141937.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-141937.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-142126.jpg"&gt;&lt;img alt="20130514-142126.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130514-142126.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="restaurants"/><category term="ramen food"/></entry><entry><title>Roasted lamb sandwich from Flour Bakery</title><link href="https://www.nyayapati.com/srao/2013/05/roasted-lamb-sandwich-from-flour-bakery/" rel="alternate"/><published>2013-05-01T13:33:00-04:00</published><updated>2013-05-01T13:33:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-05-01:/srao/2013/05/roasted-lamb-sandwich-from-flour-bakery/</id><summary type="html">&lt;p&gt;Today I decided to walk to Flour Bakery + Cafe to try one of their
sandwich&amp;#8217;s and indulge in their famous sticky&amp;nbsp;buns!&lt;/p&gt;
&lt;p&gt;It was another beautiful day in Boston.. Bright, sunny and&amp;nbsp;pleasant.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-131727.jpg"&gt;&lt;img alt="20130501-131727.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-131727.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When I got their I decided on their Roast Lamb sandwich with tomato
chutney and goat …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Today I decided to walk to Flour Bakery + Cafe to try one of their
sandwich&amp;#8217;s and indulge in their famous sticky&amp;nbsp;buns!&lt;/p&gt;
&lt;p&gt;It was another beautiful day in Boston.. Bright, sunny and&amp;nbsp;pleasant.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-131727.jpg"&gt;&lt;img alt="20130501-131727.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-131727.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When I got their I decided on their Roast Lamb sandwich with tomato
chutney and goat cheese.. Sounds yum! For desert I went with their
sticky buns. Actually the bun was going to be a snack for later in the
day&amp;nbsp;;)&lt;/p&gt;
&lt;p&gt;Decided to do take out and eat my lunch over looking the water.. Found a
beautiful wooden bench.. it was more like nicely varnished wooden
pillars joined together to look like a bench. Flour does a nice job with
their packaging for take&amp;nbsp;out.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-132358.jpg"&gt;&lt;img alt="20130501-132358.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-132358.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is a view of their famous Sticky Buns&amp;#8230;&amp;nbsp;droool!!!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-132511.jpg"&gt;&lt;img alt="20130501-132511.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-132511.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is another view of the buns taken&amp;nbsp;indoors&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-133258.jpg"&gt;&lt;img alt="20130501-133258.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-133258.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Finally the sandwich&amp;nbsp;itself..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-132658.jpg"&gt;&lt;img alt="20130501-132658.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-132658.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and here is another&amp;nbsp;angle..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-133236.jpg"&gt;&lt;img alt="20130501-133236.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/05/20130501-133236.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sandwich does look tasty. Loved the bread. I would never have thought of
ever trying the combination of roast lamb with tomato chutney and goat
cheese. They sure go well! The goat cheese adds a nice tangy/tarty
flavor to the sandwich. I would have liked a wee bit more salt but maybe
it&amp;#8217;s just&amp;nbsp;me.&lt;/p&gt;
&lt;p&gt;The bakery has a good vibe and decor is hip. They have a lot of
different sandwiches and baked goods to offer so will have to come back&amp;nbsp;soon.&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>Bi Bim Bap at Fugu Truck Boston</title><link href="https://www.nyayapati.com/srao/2013/04/bi-bim-bap-at-fugu-truck-boston/" rel="alternate"/><published>2013-04-30T15:09:00-04:00</published><updated>2013-04-30T15:09:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-30:/srao/2013/04/bi-bim-bap-at-fugu-truck-boston/</id><summary type="html">&lt;p&gt;I had a nice twitter exchange with @fugutruck last week where I was
recommended to try their Bi Bim Bap. I promised I would come to their
Downtown Boston location this week and true to my promise, I was&amp;nbsp;there!&lt;/p&gt;
&lt;p&gt;I took @Erickinboston and @steveobc with me as I wanted …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I had a nice twitter exchange with @fugutruck last week where I was
recommended to try their Bi Bim Bap. I promised I would come to their
Downtown Boston location this week and true to my promise, I was&amp;nbsp;there!&lt;/p&gt;
&lt;p&gt;I took @Erickinboston and @steveobc with me as I wanted them to join me
this week. It was a beautiful day out and we decided to eat at the Post
Office square. Great&amp;nbsp;decision!!&lt;/p&gt;
&lt;p&gt;I knew what I wanted today&amp;#8230; The Bi Bim Bap which is a Korean style
rice bowl mixed with meat, vegetables and a sweet pepper sauce, and off
course their sooo tasty pork&amp;nbsp;buns!!&lt;/p&gt;
&lt;p&gt;Here is what their Bi Bim Bap looks&amp;nbsp;like&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130430-145331.jpg"&gt;&lt;img alt="20130430-145331.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130430-145331.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The week long wait for the Bi Bim Bap was totally worth it!! I loved the
flavors of the rice bowl. The best way to eat this is to mix everything
together. I didn&amp;#8217;t add the pepper sauce at first as I wanted to taste
this dish on its own. Then mixed the sauce to a little rice to see what
the flavors were like. The sauce definitely gives this dish more meaning
and taste!! All I can say is I am totally at peace after having another
wonderful meal at this fine&amp;nbsp;establishment!!&lt;/p&gt;
&lt;p&gt;@Fugutruck I bow to you for bringing such high standards to the Boston
Food Truck&amp;nbsp;scene!!&lt;/p&gt;
&lt;p&gt;See you guys&amp;nbsp;soon..&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>Pork Belly at Fugu Truck Boston</title><link href="https://www.nyayapati.com/srao/2013/04/pork-belly-at-fugu-truck-boston/" rel="alternate"/><published>2013-04-23T13:15:00-04:00</published><updated>2013-04-23T13:15:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-23:/srao/2013/04/pork-belly-at-fugu-truck-boston/</id><summary type="html">&lt;p&gt;I got a chance to go out and try something new today at Fugu Truck. But
of course I still had to get their pork belly sandwich.. Just love me
some Fugu truck Pork Belly Sandwich!! This time I decided to go with the
grilled Pork Belly Sandwich instead of …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I got a chance to go out and try something new today at Fugu Truck. But
of course I still had to get their pork belly sandwich.. Just love me
some Fugu truck Pork Belly Sandwich!! This time I decided to go with the
grilled Pork Belly Sandwich instead of the steamed. The difference lies
in the texture of the bun. The grilled bun adds a certain crispness to
the dish. Very fresh and&amp;nbsp;tasty!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130423-131241.jpg"&gt;&lt;img alt="20130423-131241.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130423-131241.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The new dish I tried today was the Kimchee Bulgogi&amp;nbsp;Panini..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130423-131416.jpg"&gt;&lt;img alt="20130423-131416.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130423-131416.jpg"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;The kimchi gives it a nice flavor. Both sandwiches were very tasty and
completely&amp;nbsp;different.&lt;/p&gt;
&lt;p&gt;These guys are making it really difficult for me to narrow down one
favorite dish. I still have 3 more dishes to try before I have eaten
their entire menu.. Keep posted to see the other dishes&amp;nbsp;:)&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>Xcode cache causing problems</title><link href="https://www.nyayapati.com/srao/2013/04/xcode-cache-causing-problems/" rel="alternate"/><published>2013-04-10T13:35:00-04:00</published><updated>2013-04-10T13:35:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-10:/srao/2013/04/xcode-cache-causing-problems/</id><summary type="html">&lt;p&gt;The keyboard sequence Command-Option-Shift-K is used to clean out the
build folder. Even better, quit Xcode and clean out
~/Library/Developer/Xcode/DerivedData manually. Remove all its contents
because there&amp;#8217;s a bug where Xcode will run an old version of your
project that&amp;#8217;s in there somewhere. (Xcode 4 …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The keyboard sequence Command-Option-Shift-K is used to clean out the
build folder. Even better, quit Xcode and clean out
~/Library/Developer/Xcode/DerivedData manually. Remove all its contents
because there&amp;#8217;s a bug where Xcode will run an old version of your
project that&amp;#8217;s in there somewhere. (Xcode 4.2 will show you the Derived
Data folder: choose Window &amp;gt; Organizer and switch to the Projects tab.
Click the right-arrow to the right of the Derived Data folder&amp;nbsp;name.)&lt;/p&gt;</content><category term="software"/></entry><entry><title>How to preserve hyperlinks when you turn a web page to pdf</title><link href="https://www.nyayapati.com/srao/2013/04/how-to-preserve-hyperlinks-when-you-turn-a-web-page-to-pdf/" rel="alternate"/><published>2013-04-09T13:00:00-04:00</published><updated>2013-04-09T13:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-09:/srao/2013/04/how-to-preserve-hyperlinks-when-you-turn-a-web-page-to-pdf/</id><summary type="html">&lt;p&gt;This is sooo easy to do on a mac. You can create a &lt;span class="caps"&gt;PDF&lt;/span&gt; from anywhere you
can print on a mac. The problem comes to preserving hyperlinks when
printing a webpage to &lt;span class="caps"&gt;PDF&lt;/span&gt;. The trick is to use Safari. If you print a
webpage on Safari to &lt;span class="caps"&gt;PDF&lt;/span&gt;, all …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is sooo easy to do on a mac. You can create a &lt;span class="caps"&gt;PDF&lt;/span&gt; from anywhere you
can print on a mac. The problem comes to preserving hyperlinks when
printing a webpage to &lt;span class="caps"&gt;PDF&lt;/span&gt;. The trick is to use Safari. If you print a
webpage on Safari to &lt;span class="caps"&gt;PDF&lt;/span&gt;, all hyperlinks are preserved&amp;nbsp;:)&lt;/p&gt;</content><category term="software"/><category term="pdf"/></entry><entry><title>Miso Ramen at Ginza</title><link href="https://www.nyayapati.com/srao/2013/04/miso-ramen-at-ginza/" rel="alternate"/><published>2013-04-09T12:48:00-04:00</published><updated>2013-04-09T12:48:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-09:/srao/2013/04/miso-ramen-at-ginza/</id><summary type="html">&lt;p&gt;After trying out the [clear Pork Broth Ramen at Ginza last
&lt;a href="https://www.nyayapati.com/srao/2013/04/ramen-at-ginza/"&gt;week&lt;/a&gt;, I got a chance to try their Miso Ramen
today.  Me so like it&amp;nbsp;;)  &lt;/p&gt;
&lt;p&gt;Here are a few pics I&amp;nbsp;got&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125623.jpg"&gt;&lt;img alt="20130409-125623.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125623.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is another one from the&amp;nbsp;top..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125807.jpg"&gt;&lt;img alt="20130409-125807.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125807.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Honestly.. it was good! The broth has a nice miso …&lt;/p&gt;</summary><content type="html">&lt;p&gt;After trying out the [clear Pork Broth Ramen at Ginza last
&lt;a href="https://www.nyayapati.com/srao/2013/04/ramen-at-ginza/"&gt;week&lt;/a&gt;, I got a chance to try their Miso Ramen
today.  Me so like it&amp;nbsp;;)  &lt;/p&gt;
&lt;p&gt;Here are a few pics I&amp;nbsp;got&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125623.jpg"&gt;&lt;img alt="20130409-125623.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125623.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is another one from the&amp;nbsp;top..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125807.jpg"&gt;&lt;img alt="20130409-125807.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130409-125807.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Honestly.. it was good! The broth has a nice miso flavor and very
satisfying! The only difference between the Miso based Ramen and Pork
based Ramen other than the wonderful broth was a slice of butter on my
Miso Ramen. Also today the pork was tastier and more tender than the one
I had last time with my Pork Broth&amp;nbsp;Ramen!&lt;/p&gt;
&lt;p&gt;Last time I was there, the place was super busy and waited 30 minutes
for my order to come out. Today I was at Ginza by 11:&lt;span class="caps"&gt;40AM&lt;/span&gt; and I believe
was one of their first customers of the day. The service was quick in&amp;nbsp;comparison.&lt;/p&gt;
&lt;p&gt;My friend from work who got the pork broth ramen was kind enough to let
me taste his pork broth so I could taste and compare the two broths..
it&amp;#8217;s a little tough to decide, but we both agreed that the pork broth is
the the&amp;nbsp;winner!!&lt;/p&gt;
&lt;p&gt;I now have the Soy based broth left to taste.. Will definitely come back
for&amp;nbsp;it!!&lt;/p&gt;</content><category term="restaurants"/><category term="Ramen"/></entry><entry><title>How to Join AVCHD M2TS files and convert to MKV</title><link href="https://www.nyayapati.com/srao/2013/04/how-to-join-avchd-m2ts-files-and-convert-to-mkv/" rel="alternate"/><published>2013-04-05T15:30:00-04:00</published><updated>2013-04-05T15:30:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-05:/srao/2013/04/how-to-join-avchd-m2ts-files-and-convert-to-mkv/</id><summary type="html">&lt;p&gt;There is still no cheap(free) and easy way to work with the &lt;span class="caps"&gt;M2TS&lt;/span&gt; files
created by my Canon H100 video camera. When I am shooting with that
camera, for any event, I end up with a bunch of .m2ts video files. &lt;span class="caps"&gt;VLC&lt;/span&gt;
now plays this format, but still I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;There is still no cheap(free) and easy way to work with the &lt;span class="caps"&gt;M2TS&lt;/span&gt; files
created by my Canon H100 video camera. When I am shooting with that
camera, for any event, I end up with a bunch of .m2ts video files. &lt;span class="caps"&gt;VLC&lt;/span&gt;
now plays this format, but still I have to either create a playlist of
all my files or play them one at a&amp;nbsp;time.&lt;/p&gt;
&lt;p&gt;This is where the freeware
&lt;a href="http://www.videohelp.com/tools/tsMuxeR"&gt;tsMuxer&lt;/a&gt; comes to the rescue.
SmartLabs doesn&amp;#8217;t offer this app anymore, but you can download this from
&lt;a href="http://www.videohelp.com/tools/tsMuxeR"&gt;videohelp.com&lt;/a&gt;. You can
download the app for windows, linux and Mac. If you are running &lt;span class="caps"&gt;OSX&lt;/span&gt;, use
the &lt;a href="http://www.videohelp.com/download/tsMuxeR_1.10.6_VoxMac_Unofficial_Build.dmg"&gt;VoxMac Unofficial
Build&lt;/a&gt;.
Even this build does not work correctly because of some korean fonts (I
would love to know why). Here is a snippet from &lt;a href="http://forums.macrumors.com/showthread.php?t=766885"&gt;macrumors
forums&lt;/a&gt; on how to
fix that&amp;nbsp;problem.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;tsMuxeR is not working due to fonts interpretations problem.&lt;br&gt;
 We got a &amp;#8216;bus error&amp;#8217; when trying to execute the command in
command-line mode.&lt;br&gt;
 The problem is due to 2 particulars korean fonts supplied in Snow
Leopard.&lt;br&gt;
 To solve the problem, if you don&amp;#8217;t use those korean fonts, delete&lt;br&gt;
 the two following fonts
: &lt;strong&gt;AppleMyungjo.ttf&lt;/strong&gt; and &lt;strong&gt;Gungseouche.ttf&lt;/strong&gt; located
in &lt;strong&gt;/Library/Fonts&lt;/strong&gt;&lt;br&gt;
 When done, the tsMuxeR command Line should&amp;nbsp;Work&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Instead of deleting the fonts, I just renamed them using the command
line. tsMuxerGUI now launches with out any&amp;nbsp;problems.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Joining .&lt;span class="caps"&gt;M2TS&lt;/span&gt; file&lt;/strong&gt;&lt;br&gt;
I use tsMuxer to combine all the .&lt;span class="caps"&gt;M2TS&lt;/span&gt; files into one .&lt;span class="caps"&gt;M2TS&lt;/span&gt; file. It&amp;#8217;s
very easy and very quick to join these videos. These steps should work
on Windows and Linux too. Here are the step&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;1. Launch the&amp;nbsp;app  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.36.03-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 2.36.03
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.36.03-PM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Drag and Drop the first file in the sequence in the Input files
window. The Add button doesnt work for &lt;span class="caps"&gt;M2TS&lt;/span&gt;&amp;nbsp;files.  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.39.01-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 2.39.01
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.39.01-PM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Now Select the rest of the files you want to join together, drag and
drop on the Join button at the&amp;nbsp;top.  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.41.46-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 2.41.46
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.41.46-PM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Make sure the Output is set to &lt;span class="caps"&gt;M2TS&lt;/span&gt; muxing and click on the Browse
button to choose an appropriate place to save the output. Now click
Start Muxing to join all the .&lt;span class="caps"&gt;M2TS&lt;/span&gt;&amp;nbsp;files.  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.47.33-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 2.47.33
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.47.33-PM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;You will get a status window showing progress. Click Ok when it
finishes to get back to&amp;nbsp;tsMuxerGui  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.48.51-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 2.48.51
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-2.48.51-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should now have your joined .&lt;span class="caps"&gt;M2TS&lt;/span&gt;&amp;nbsp;file.&lt;/p&gt;
&lt;p&gt;But I still can&amp;#8217;t play This .&lt;span class="caps"&gt;M2TS&lt;/span&gt; on &lt;span class="caps"&gt;XBMC&lt;/span&gt;. The solution is to convert
this to an &lt;span class="caps"&gt;MKV&lt;/span&gt; file :)&lt;br&gt;
The trick is to demux this joined .&lt;span class="caps"&gt;M2TS&lt;/span&gt; file using tsMuxer and then use
&lt;a href="http://www.bunkus.org/videotools/mkvtoolnix/"&gt;mkvmerge&lt;/a&gt; to create an
&lt;span class="caps"&gt;MKV&lt;/span&gt; file. Problem Solved! You can download mkvmerge from the
&lt;a href="http://www.bunkus.org/videotools/mkvtoolnix/"&gt;MKVToolNix&lt;/a&gt; site. They
have binaries for windows, multiple linux platforms and&amp;nbsp;Mac.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Demuxing .&lt;span class="caps"&gt;M2TS&lt;/span&gt;&amp;nbsp;file&lt;/strong&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Drop your joined .&lt;span class="caps"&gt;M2TS&lt;/span&gt; file in the input files section of the&amp;nbsp;tsMuxerGUI  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-3.02.16-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 3.02.16
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-3.02.16-PM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Select Demux in the output section at the bottom and click on Start
Demuxing. You will see the progress window&amp;nbsp;again.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The Demux process creates two files, a .264 (video) file and a .ac3
(audio)&amp;nbsp;file.  &lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click on the add button on the input files section of mkvmerge and
add your .264 and .ac3&amp;nbsp;files.  &lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-3.17.26-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 3.17.26
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-3.17.26-PM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Click on Start muxing at the bottom to create your &lt;span class="caps"&gt;MKV&lt;/span&gt; file. A
progress window comes up during the muxing&amp;nbsp;process.  &lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href="i{static}/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-3.19.11-PM.png"&gt;&lt;img alt="Screen Shot 2013-04-05 at 3.19.11
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/Screen-Shot-2013-04-05-at-3.19.11-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You now have an &lt;span class="caps"&gt;MKV&lt;/span&gt; file which works on &lt;span class="caps"&gt;XBMC&lt;/span&gt;. As tsMuxer and mkvmerge
are tools also available on linux and windows, this process should work
on all&amp;nbsp;platforms.&lt;/p&gt;</content><category term="software"/><category term="m2ts"/><category term="mkv"/></entry><entry><title>Unix Aliases with variables in bash</title><link href="https://www.nyayapati.com/srao/2013/04/unix-aliases-with-variables-in-bash/" rel="alternate"/><published>2013-04-05T13:23:00-04:00</published><updated>2013-04-05T13:23:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-05:/srao/2013/04/unix-aliases-with-variables-in-bash/</id><summary type="html">&lt;p&gt;A lot of times you are typing the same command again and again on the
unix command line. Unix Aliases help to save time from typing out these
long commands. Back when I was using C Shell, I could use parameters in
aliases. For example I have this in my …&lt;/p&gt;</summary><content type="html">&lt;p&gt;A lot of times you are typing the same command again and again on the
unix command line. Unix Aliases help to save time from typing out these
long commands. Back when I was using C Shell, I could use parameters in
aliases. For example I have this in my .cshrc file to find certain
running&amp;nbsp;processes-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;alias&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;chk&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;ps auxwww | grep \!:1&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;running this would show me all commands which have java in&amp;nbsp;them  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;chk&lt;span class="w"&gt; &lt;/span&gt;java
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Unfortunately this alias does not work in Bash. The work around is to
create a function for that, rather than an alias, and then exported it,
like&amp;nbsp;this:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;chk&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ps&lt;span class="w"&gt; &lt;/span&gt;auxwww&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;chk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Note -f switch to export: it tells it that you are exporting a function.
Put this in your .bashrc and you are good to&amp;nbsp;go&lt;/p&gt;</content><category term="software"/><category term="bash"/><category term="csh"/></entry><entry><title>Ramen at Ginza</title><link href="https://www.nyayapati.com/srao/2013/04/ramen-at-ginza/" rel="alternate"/><published>2013-04-04T13:48:00-04:00</published><updated>2013-04-04T13:48:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-04:/srao/2013/04/ramen-at-ginza/</id><summary type="html">&lt;p&gt;My brother gave me some really good news 2 weeks ago..
&lt;a href="http://www.ginza-boston.com/"&gt;Ginza&lt;/a&gt; in Boston Chinatown now offers
Ramen as part of their menu!! Soo exciting!! The best part is that Ginza
is a stones throw away from my workplace. If the ramen is any good, it&amp;#8217;s
going to be …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My brother gave me some really good news 2 weeks ago..
&lt;a href="http://www.ginza-boston.com/"&gt;Ginza&lt;/a&gt; in Boston Chinatown now offers
Ramen as part of their menu!! Soo exciting!! The best part is that Ginza
is a stones throw away from my workplace. If the ramen is any good, it&amp;#8217;s
going to be my goto place whenever I get a craving!! Bro told me that
they offer it in three different broths.. Clear Pork broth, Miso broth
and finally Soy based broth. I have got to try them&amp;nbsp;all!!&lt;/p&gt;
&lt;p&gt;Today I finally got a chance to go try it out.. I got the Clear Pork
broth Ramen and here is how it&amp;nbsp;looks..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130404-134934.jpg"&gt;&lt;img alt="20130404-134934.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/04/20130404-134934.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The broth tastes good and is very fulfilling. The Ramen noodles itself
had a good texture. I did wish I had more noodles&amp;#8230; but it could also
just be the big bowl :). The pork slices could have been more tender but
over all I really enjoyed my&amp;nbsp;lunch!&lt;/p&gt;
&lt;p&gt;I had a quick chat with the staff and they promised me that the Ramen
was not a short time promotion and it was going to be part of their menu
going forward!!&amp;nbsp;Yay!!!&lt;/p&gt;
&lt;p&gt;I am now looking forward to going back to try the Soy and Miso based&amp;nbsp;broths.&lt;/p&gt;</content><category term="restaurants"/><category term="Ramen"/></entry><entry><title>Get Table creation date on SQL Server</title><link href="https://www.nyayapati.com/srao/2013/04/get-table-creation-date-on-sql-server/" rel="alternate"/><published>2013-04-02T10:49:00-04:00</published><updated>2013-04-02T10:49:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-04-02:/srao/2013/04/get-table-creation-date-on-sql-server/</id><summary type="html">&lt;p&gt;I was trying to find some changes I had made to some tables and was
having a hard time finding the table I modified.. This helped me find
the ones I was last working on&amp;nbsp;;)&lt;/p&gt;
&lt;p&gt;For &lt;span class="caps"&gt;SQL&lt;/span&gt; Server 2005 and up, you can&amp;nbsp;use  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;create_date&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;modify_date&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;sys …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I was trying to find some changes I had made to some tables and was
having a hard time finding the table I modified.. This helped me find
the ones I was last working on&amp;nbsp;;)&lt;/p&gt;
&lt;p&gt;For &lt;span class="caps"&gt;SQL&lt;/span&gt; Server 2005 and up, you can&amp;nbsp;use  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;create_date&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="n"&gt;modify_date&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;FROM&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;sys&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tables&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="sqlserver"/></entry><entry><title>How to build Growl 2.0.1 from source on Mountain Lion 10.8.2</title><link href="https://www.nyayapati.com/srao/2013/03/how-to-build-growl-2-0-1-from-source-on-mountain-lion-10-8-2/" rel="alternate"/><published>2013-03-10T23:16:00-04:00</published><updated>2013-03-10T23:16:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-03-10:/srao/2013/03/how-to-build-growl-2-0-1-from-source-on-mountain-lion-10-8-2/</id><summary type="html">&lt;p&gt;Growl is the ultimate notification system for &lt;span class="caps"&gt;OS&lt;/span&gt; X. A lot of apps
support and use growl to notify the user about any status updates. You
can either buy the app from the app store for $3.99 or build and
install from source. &lt;a href="http://growl.info/documentation/developer/growl-source-install.php"&gt;This
page&lt;/a&gt;
explains how to build …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Growl is the ultimate notification system for &lt;span class="caps"&gt;OS&lt;/span&gt; X. A lot of apps
support and use growl to notify the user about any status updates. You
can either buy the app from the app store for $3.99 or build and
install from source. &lt;a href="http://growl.info/documentation/developer/growl-source-install.php"&gt;This
page&lt;/a&gt;
explains how to build Growl from&amp;nbsp;source.&lt;/p&gt;
&lt;p&gt;(Click &lt;a href="#instructions"&gt;here&lt;/a&gt;
to skip my ordeal and see the instructions which worked for&amp;nbsp;me)&lt;/p&gt;
&lt;p&gt;Unfortunately the instructions were not enough. I went through a lot of
issues trying to build this. This post is my ordeal in trying to build
and install Growl on my&amp;nbsp;laptop.  &lt;/p&gt;
&lt;p&gt;Here is a list of requirements as mentioned in the official build
notes&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="caps"&gt;OS&lt;/span&gt; X Mountain Lion -&amp;nbsp;10.8.2&lt;/li&gt;
&lt;li&gt;Xcode -&amp;nbsp;4.6&lt;/li&gt;
&lt;li&gt;Mercurial Client - I used the one from
    &lt;a href="http://mercurial.berkwood.com/"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Git&amp;nbsp;Client&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will now pull down the source code using mercurial to an appropriate
location on our mac. I have a directory called projects where I do all
my development. You may do this, where ever you want under your&amp;nbsp;home.&lt;/p&gt;
&lt;p&gt;Open a terminal window and execute the&amp;nbsp;following&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;LC_ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;en_US.UTF-8&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;hg&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;https://code.google.com/p/growl/&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;growl&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;hg&lt;span class="w"&gt; &lt;/span&gt;tags&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sort
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The &amp;#8220;hg tags | sort&amp;#8221; command shows you all the versions of growl you can
build. Now update the source to what ever version you want. We are
building the latest version as of today, so run the following&amp;nbsp;command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;hg&lt;span class="w"&gt; &lt;/span&gt;update&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Growl.app 2.0.1&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we are ready to do a build. The official notes misses out on telling
us how to do this build.&lt;br&gt;
Reading instructions from other sources I found that running the
following command inside the growl directory should do the&amp;nbsp;trick..&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;xcodebuild&lt;span class="w"&gt; &lt;/span&gt;-project&lt;span class="w"&gt; &lt;/span&gt;Growl.xcodeproj&lt;span class="w"&gt; &lt;/span&gt;-target&lt;span class="w"&gt; &lt;/span&gt;Growl.app&lt;span class="w"&gt; &lt;/span&gt;-configuration&lt;span class="w"&gt; &lt;/span&gt;Release
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here I got my first&amp;nbsp;failure&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;xcodebuild&lt;span class="w"&gt; &lt;/span&gt;-project&lt;span class="w"&gt; &lt;/span&gt;Growl.xcodeproj&lt;span class="w"&gt; &lt;/span&gt;-target&lt;span class="w"&gt; &lt;/span&gt;Growl.app&lt;span class="w"&gt; &lt;/span&gt;-configuration&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Release&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;BUILD&lt;span class="w"&gt; &lt;/span&gt;AGGREGATE&lt;span class="w"&gt; &lt;/span&gt;TARGET&lt;span class="w"&gt; &lt;/span&gt;VCS&lt;span class="w"&gt; &lt;/span&gt;Data&lt;span class="w"&gt; &lt;/span&gt;OF&lt;span class="w"&gt; &lt;/span&gt;PROJECT&lt;span class="w"&gt; &lt;/span&gt;Growl&lt;span class="w"&gt; &lt;/span&gt;WITH&lt;span class="w"&gt; &lt;/span&gt;CONFIGURATION&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Release&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Check&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;dependencies&lt;/span&gt;

&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;BUILD&lt;span class="w"&gt; &lt;/span&gt;NATIVE&lt;span class="w"&gt; &lt;/span&gt;TARGET&lt;span class="w"&gt; &lt;/span&gt;GrowlLauncher&lt;span class="w"&gt; &lt;/span&gt;OF&lt;span class="w"&gt; &lt;/span&gt;PROJECT&lt;span class="w"&gt; &lt;/span&gt;Growl&lt;span class="w"&gt; &lt;/span&gt;WITH&lt;span class="w"&gt; &lt;/span&gt;CONFIGURATION&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Release&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;===&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Check&lt;span class="w"&gt; &lt;/span&gt;dependencies&lt;span class="w"&gt;  &lt;/span&gt;
Code&lt;span class="w"&gt; &lt;/span&gt;Sign&lt;span class="w"&gt; &lt;/span&gt;error:&lt;span class="w"&gt; &lt;/span&gt;The&lt;span class="w"&gt; &lt;/span&gt;identity&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;3rd Party Mac Developer Application: The&lt;/span&gt;
&lt;span class="s1"&gt;Growl Project, LLC&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;doesn&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;t&lt;span class="w"&gt; &lt;/span&gt;match&lt;span class="w"&gt; &lt;/span&gt;any&lt;span class="w"&gt; &lt;/span&gt;valid,&lt;span class="w"&gt; &lt;/span&gt;non-expired
certificate/private&lt;span class="w"&gt; &lt;/span&gt;key&lt;span class="w"&gt; &lt;/span&gt;pair&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;your&lt;span class="w"&gt; &lt;/span&gt;keychains

**&lt;span class="w"&gt; &lt;/span&gt;BUILD&lt;span class="w"&gt; &lt;/span&gt;FAILED&lt;span class="w"&gt; &lt;/span&gt;**

The&lt;span class="w"&gt; &lt;/span&gt;following&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;commands&lt;span class="w"&gt; &lt;/span&gt;failed:&lt;span class="w"&gt;  &lt;/span&gt;
Check&lt;span class="w"&gt; &lt;/span&gt;dependencies&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;failure&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is one of the failures the official document warned us about. A
Quick fix is to generate a self signed certificate with the prefix &amp;#8216;3rd
Party Mac Developer Application: The Growl Project, &lt;span class="caps"&gt;LLC&lt;/span&gt;&amp;#8217;.&lt;/p&gt;
&lt;h4 id="cert"&gt;Create Self Signed&amp;nbsp;Certificate&lt;/h4&gt;
&lt;p&gt;Open the Keychain Access.app, go to Keychain Access menu then go to
&amp;#8216;Certificate Assistant&amp;#8217; and finally click on &amp;#8216;Create a Certificate&amp;#8230;&amp;#8217;.
Fill out all details as shown in the screenshot&amp;nbsp;below&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-6.38.30-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-08 at 6.38.30 PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-6.38.30-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here are the details -&lt;br&gt;
Name: 3rd Party Mac Developer Application: The Growl Project, &lt;span class="caps"&gt;LLC&lt;/span&gt;&lt;br&gt;
Identity Type: Self Signed Root&lt;br&gt;
Certificate Type: Code&amp;nbsp;Signing&lt;/p&gt;
&lt;p&gt;Now click on create and click on continue button when it shows you the
&amp;#8220;You are about to create a self-signed certificate&amp;#8221; and finally click on
Done when you see the below&amp;nbsp;screen.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-6.39.12-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-08 at 6.39.12
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-6.39.12-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Close the Keychain Access app and re-run the build command on the
terminal window.&lt;br&gt;
This time you should see a popup window like the one shown below saying
&amp;#8220;codesign wants to sign using key &amp;#8216;3rd Party Mac Developer Application:
The Growl Project, &lt;span class="caps"&gt;LLC&lt;/span&gt;&amp;#8217; in your keychain&amp;#8221;. Looks promising&amp;#8230; Click
Always&amp;nbsp;Allow.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-6.36.45-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-08 at 6.36.45
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-6.36.45-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;but this time the build failed with two new&amp;nbsp;errors&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/Users/shireenrao/projects/growl/Plugins/Actions/Speech/GrowlSpeechDisplay.m:15:9:
fatal&lt;span class="w"&gt; &lt;/span&gt;error:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ShortcutRecorder/ShortcutRecorder.h&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;not&lt;span class="w"&gt; &lt;/span&gt;found&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;#import &amp;lt;ShortcutRecorder/ShortcutRecorder.h&amp;gt;  &lt;/span&gt;
^&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;error&lt;span class="w"&gt; &lt;/span&gt;generated.

/Users/shireenrao/projects/growl/Plugins/Actions/Speech/GrowlSpeechPrefs.m:12:9:
fatal&lt;span class="w"&gt; &lt;/span&gt;error:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;ShortcutRecorder/ShortcutRecorder.h&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;not&lt;span class="w"&gt; &lt;/span&gt;found&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;#import &amp;lt;ShortcutRecorder/ShortcutRecorder.h&amp;gt;  &lt;/span&gt;
^&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;error&lt;span class="w"&gt; &lt;/span&gt;generated.

&lt;span class="m"&gt;2013&lt;/span&gt;-03-10&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;15&lt;/span&gt;:19:13.982&lt;span class="w"&gt; &lt;/span&gt;xcodebuild&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="m"&gt;45006&lt;/span&gt;:7b03&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;DVTAssertions:&lt;span class="w"&gt; &lt;/span&gt;Warning&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
/SourceCache/IDEXcode3ProjectSupport/IDEXcode3ProjectSupport-2108/Xcode3Sources/XcodeIDE/Frameworks/DevToolsBase/pbxcore/SpecificationTypes/XCGccMakefileDependencies.m:87&lt;span class="w"&gt;  &lt;/span&gt;
Details:&lt;span class="w"&gt; &lt;/span&gt;Failed&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;load&lt;span class="w"&gt; &lt;/span&gt;dependencies&lt;span class="w"&gt; &lt;/span&gt;output&lt;span class="w"&gt; &lt;/span&gt;contents&lt;span class="w"&gt; &lt;/span&gt;from
&lt;span class="sb"&gt;``&lt;/span&gt;/Users/shireenrao/projects/growl/build/Growl.build/Release/Speech.build/Objects-normal/x86_64/GrowlSpeechPrefs.d&lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;.
Error:&lt;span class="w"&gt; &lt;/span&gt;Error&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Domain&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;NSCocoaErrorDomain&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;Code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;260&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;The file&lt;/span&gt;
&lt;span class="s2"&gt;“GrowlSpeechPrefs.d” couldn’t be opened because there is no such file.&amp;quot;&lt;/span&gt;
&lt;span class="nv"&gt;UserInfo&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0x402b75740
&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;NSFilePath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/Users/shireenrao/projects/growl/build/Growl.build/Release/Speech.build/Objects-normal/x86_64/GrowlSpeechPrefs.d,
&lt;span class="nv"&gt;NSUnderlyingError&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0x402e22420&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;The operation couldn’t be completed. No&lt;/span&gt;
&lt;span class="s2"&gt;such file or directory&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;.&lt;span class="w"&gt; &lt;/span&gt;User&lt;span class="w"&gt; &lt;/span&gt;info:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;NSFilePath&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="s2"&gt;&amp;quot;/Users/shireenrao/projects/growl/build/Growl.build/Release/Speech.build/Objects-normal/x86_64/GrowlSpeechPrefs.d&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;NSUnderlyingError&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Error Domain=NSPOSIXErrorDomain Code=2 \&amp;quot;The&lt;/span&gt;
&lt;span class="s2"&gt;operation couldn\U2019t be completed. No such file or directory\&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;}&lt;/span&gt;.&lt;span class="w"&gt;  &lt;/span&gt;
Function:&lt;span class="w"&gt; &lt;/span&gt;void
XCGccMakefileDependenciesParsePathsFromRuleFile&lt;span class="o"&gt;(&lt;/span&gt;NSString&lt;span class="w"&gt; &lt;/span&gt;*,&lt;span class="w"&gt; &lt;/span&gt;void
&lt;span class="o"&gt;(&lt;/span&gt;^&lt;span class="o"&gt;)(&lt;/span&gt;NSString&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Thread:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="nv"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;null&lt;span class="o"&gt;)&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;num&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Please&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;a&lt;span class="w"&gt; &lt;/span&gt;bug&lt;span class="w"&gt; &lt;/span&gt;at&lt;span class="w"&gt; &lt;/span&gt;http://bugreport.apple.com&lt;span class="w"&gt; &lt;/span&gt;with&lt;span class="w"&gt; &lt;/span&gt;this&lt;span class="w"&gt; &lt;/span&gt;warning
message&lt;span class="w"&gt; &lt;/span&gt;and&lt;span class="w"&gt; &lt;/span&gt;any&lt;span class="w"&gt; &lt;/span&gt;useful&lt;span class="w"&gt; &lt;/span&gt;information&lt;span class="w"&gt; &lt;/span&gt;you&lt;span class="w"&gt; &lt;/span&gt;can&lt;span class="w"&gt; &lt;/span&gt;provide.

**&lt;span class="w"&gt; &lt;/span&gt;BUILD&lt;span class="w"&gt; &lt;/span&gt;FAILED&lt;span class="w"&gt; &lt;/span&gt;**

The&lt;span class="w"&gt; &lt;/span&gt;following&lt;span class="w"&gt; &lt;/span&gt;build&lt;span class="w"&gt; &lt;/span&gt;commands&lt;span class="w"&gt; &lt;/span&gt;failed:&lt;span class="w"&gt;  &lt;/span&gt;
CompileC
build/Growl.build/Release/Speech.build/Objects-normal/x86_64/GrowlSpeechDisplay.o
Plugins/Actions/Speech/GrowlSpeechDisplay.m&lt;span class="w"&gt; &lt;/span&gt;normal&lt;span class="w"&gt; &lt;/span&gt;x86_64&lt;span class="w"&gt; &lt;/span&gt;objective-c
com.apple.compilers.llvm.clang.1_0.compiler&lt;span class="w"&gt;  &lt;/span&gt;
CompileC
build/Growl.build/Release/Speech.build/Objects-normal/x86_64/GrowlSpeechPrefs.o
Plugins/Actions/Speech/GrowlSpeechPrefs.m&lt;span class="w"&gt; &lt;/span&gt;normal&lt;span class="w"&gt; &lt;/span&gt;x86_64&lt;span class="w"&gt; &lt;/span&gt;objective-c
com.apple.compilers.llvm.clang.1_0.compiler&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;failures&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So at this point I started looking around the growl google group. I
found a couple of things. Firstly Growl 2.0.1 was built on Xcode 4.5.x.
I am trying to do this on 4.6. Secondly, the rake build tool is now
being used to build growl. Armed with that info this is what I tried&amp;nbsp;next&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Release&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.0.1&lt;span class="w"&gt; &lt;/span&gt;rake&lt;span class="w"&gt; &lt;/span&gt;setup&lt;span class="w"&gt;  &lt;/span&gt;
xcrun:&lt;span class="w"&gt; &lt;/span&gt;error:&lt;span class="w"&gt; &lt;/span&gt;unable&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;find&lt;span class="w"&gt; &lt;/span&gt;utility&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;packagemaker&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;not&lt;span class="w"&gt; &lt;/span&gt;a&lt;span class="w"&gt; &lt;/span&gt;developer&lt;span class="w"&gt; &lt;/span&gt;tool&lt;span class="w"&gt; &lt;/span&gt;or&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;PATH
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Another error.. This time about a tool called packagemaker. After some
google foo, found out that packagemaker is no longer part of xcode. It
is now available in a separate package called Auxiliary tools for Xcode
Developer Preview. Get it from
&lt;a href="https://developer.apple.com/downloads/index.action"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-4.05.28-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-08 at 4.05.28
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-08-at-4.05.28-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just copy PackageMaker to your Applications directory so it is available
on the command line. Once installed, try the build&amp;nbsp;again.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.0.1&lt;span class="w"&gt; &lt;/span&gt;rake&lt;span class="w"&gt; &lt;/span&gt;setup&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/Users/shireenrao/projects/growl/Release&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.0.1&lt;span class="w"&gt; &lt;/span&gt;rake&lt;span class="w"&gt; &lt;/span&gt;build:growl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Two new errors come up&amp;#8230;&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/Users/shireenrao/projects/growl/Plugins/Displays/GrowlDisplayWindowController.m:400:42:
error:&lt;span class="w"&gt; &lt;/span&gt;cast&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;void *&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;non-matching&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;
&lt;span class="s1"&gt;&amp;#39;NSInteger&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;aka&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;long&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-Werror,-Wbad-function-cast&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
NSInteger&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;startPercentage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;NSInteger&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;NSMapGet&lt;span class="o"&gt;(&lt;/span&gt;startTimes,
transition&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

/Users/shireenrao/projects/growl/Plugins/Displays/GrowlDisplayWindowController.m:401:42:
error:&lt;span class="w"&gt; &lt;/span&gt;cast&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;function&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;void *&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;non-matching&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;
&lt;span class="s1"&gt;&amp;#39;NSInteger&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;aka&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;long&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-Werror,-Wbad-function-cast&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
NSInteger&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;endPercentage&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;NSInteger&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;NSMapGet&lt;span class="o"&gt;(&lt;/span&gt;endTimes,&lt;span class="w"&gt; &lt;/span&gt;transition&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;errors&lt;span class="w"&gt; &lt;/span&gt;generated.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a name="code1"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;First Code&amp;nbsp;Change&lt;/h4&gt;
&lt;p&gt;This is a casting error and I think mainly because I am trying to build
this using xcode 4.6. I opened the file
&amp;#8220;growl/Plugins/Displays/GrowlDisplayWindowController.m&amp;#8221; and removed the
cast &amp;#8220;(NSInteger)&amp;#8221; from the two lines right before NSMapGet. Tried
running the command &amp;#8220;&lt;span class="caps"&gt;VERSION&lt;/span&gt;=2.0.1 rake build:growl&amp;#8221; again and got a new&amp;nbsp;error&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/Users/shireenrao/projects/growl/Plugins/Actions/SMS/GrowlSMSDisplay.m:141:97:
error:&lt;span class="w"&gt; &lt;/span&gt;format&lt;span class="w"&gt; &lt;/span&gt;specifies&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;unsigned int&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;but&lt;span class="w"&gt; &lt;/span&gt;the&lt;span class="w"&gt; &lt;/span&gt;argument&lt;span class="w"&gt; &lt;/span&gt;has&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;type&lt;/span&gt;
&lt;span class="s1"&gt;&amp;#39;CFIndex&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;aka&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;long&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;-Werror,-Wformat&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
CFStringRef&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;contentLength&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;
CFStringCreateWithFormat&lt;span class="o"&gt;(&lt;/span&gt;kCFAllocatorDefault,&lt;span class="w"&gt; &lt;/span&gt;NULL,&lt;span class="w"&gt; &lt;/span&gt;CFSTR&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%u&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,
CFDataGetLength&lt;span class="o"&gt;(&lt;/span&gt;postData&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
~~&lt;span class="w"&gt; &lt;/span&gt;^~~~~~~~~~~~~~~~~~~~~~~~~&lt;span class="w"&gt;  &lt;/span&gt;
%lu&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;error&lt;span class="w"&gt; &lt;/span&gt;generated.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a name="code2"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Second Code&amp;nbsp;Change&lt;/h4&gt;
&lt;p&gt;This was an easy fix as the fix is in the error shown above. I just
change %u to %lu in the file growl/Plugins/Actions/&lt;span class="caps"&gt;SMS&lt;/span&gt;/GrowlSMSDisplay.m
on the error&amp;nbsp;line.&lt;/p&gt;
&lt;p&gt;After retrying the build command once again, I finally saw&amp;nbsp;this&lt;/p&gt;
&lt;p&gt;** &lt;span class="caps"&gt;BUILD&lt;/span&gt; &lt;span class="caps"&gt;SUCCEEDED&lt;/span&gt;&amp;nbsp;**&lt;/p&gt;
&lt;p&gt;Yippeee!! The Growl.app is now available under&amp;nbsp;growl/Release/distribution/build/growl/Release/Growl.app&lt;/p&gt;
&lt;p&gt;Just copy that to your applications folder and you have now built Growl
from Source&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;Ok, in all honesty, I am not sure if I am doing the right thing by
taking out the cast from the file
&amp;#8220;growl/Plugins/Displays/GrowlDisplayWindowController.m&amp;#8221;. If I see any
problems with the app, I will revisit this&amp;nbsp;problem.&lt;/p&gt;
&lt;p&gt;I quickly wanted to mention another problem I encountered. A while back,
I had done a build using xcode. I don&amp;#8217;t remember what version of xcode I
had used and I was definitely using an older version of growl. Actually
I don&amp;#8217;t know which version I was using because I had not updated the
mercurial tag to say which version I should be using. As I said, I used
xcode to do the build. The build succeeded. I copied the build to my
applications and it was working for a while. I then started seeing the
message - &amp;#8220;This Beta Has Expired / Please download a new version to keep
using Growl&amp;#8221;. I didn&amp;#8217;t know what happened for a while. Turns out, I did
not copy the app from the release configuration. I had copied Growl.app
from the debug configuration. Only the release configuration doesn&amp;#8217;t
have the beta flag in the&amp;nbsp;code.&lt;/p&gt;
&lt;p&gt;Now I know that to create a release build in xcode, you have to edit
your current scheme. You do that by hitting (⌘&amp;lt;) inside xcode and
highlight &amp;#8220;Run [name of application]. On the right, select &amp;#8220;Build
Configuration&amp;#8221; and choose &amp;#8220;Release&amp;#8221;. Click Ok to close the window. Here
is a screenshot of what you will change&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-10-at-11.43.44-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-10 at 11.43.44
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-10-at-11.43.44-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Build by hitting ⌘B in Xcode. If you have your self signed certificate
and have edited the two files as mentioned above, the build should
succeed. But, there is one slight problem&amp;#8230; The version number in the
app is incorrect. It shows up as 2.0b6 instead of&amp;nbsp;2.0.1.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-10-at-11.42.47-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-10 at 11.42.47
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-10-at-11.42.47-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-11-at-12.01.52-AM.png"&gt;&lt;img alt="Screen Shot 2013-03-11 at 12.01.52
AM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-11-at-12.01.52-AM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That&amp;#8217;s why the rake build method is&amp;nbsp;recommended.&lt;/p&gt;
&lt;p&gt;Here is a quick synopsis of the entire build process without my hiccups&lt;br&gt;
&lt;a name="instructions"&gt;&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Requirements&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span class="caps"&gt;OS&lt;/span&gt; X Mountain Lion -&amp;nbsp;10.8.2&lt;/li&gt;
&lt;li&gt;Xcode -&amp;nbsp;4.6&lt;/li&gt;
&lt;li&gt;Mercurial Client - I used the one from
    &lt;a href="http://mercurial.berkwood.com/"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Git&amp;nbsp;Client&lt;/li&gt;
&lt;li&gt;Packagemaker - look for Auxiliary tools
    &lt;a href="https://developer.apple.com/downloads/index.action"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Create self signed certificate as shown &lt;a href="#cert"&gt;here&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Steps&lt;/strong&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;hg&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;https://code.google.com/p/growl/&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;growl&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;hg&lt;span class="w"&gt; &lt;/span&gt;update&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Growl.app 2.0.1&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Edit files as shown &lt;a href="#code1"&gt;here&lt;/a&gt; and &lt;a href="#code2"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;Release&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;LC_ALL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;en_US.UTF-8&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.0.1&lt;span class="w"&gt; &lt;/span&gt;rake&lt;span class="w"&gt; &lt;/span&gt;setup&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;VERSION&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.0.1&lt;span class="w"&gt; &lt;/span&gt;rake&lt;span class="w"&gt; &lt;/span&gt;build:growl
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Growl.app is available at&amp;nbsp;growl/Release/distribution/build/growl/Release/Growl.app&lt;/p&gt;</content><category term="software"/><category term="growl"/><category term="mac"/></entry><entry><title>XBMC has No Sound after upgrading to Frodo on Mountain Lion</title><link href="https://www.nyayapati.com/srao/2013/03/xbmc-has-no-sound-after-upgrading-to-frodo-on-mountain-lion/" rel="alternate"/><published>2013-03-06T22:03:00-05:00</published><updated>2013-03-06T22:03:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-03-06:/srao/2013/03/xbmc-has-no-sound-after-upgrading-to-frodo-on-mountain-lion/</id><summary type="html">&lt;p&gt;I wanted to test out Frodo on my laptop before I upgraded xbmc on my mac
mini which is my main home theatre &lt;span class="caps"&gt;PC&lt;/span&gt;. I am still running Version 11.0
(Eden) everywhere. Good thing I tested this on my laptop first because
the upgrade was a fail. I could …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I wanted to test out Frodo on my laptop before I upgraded xbmc on my mac
mini which is my main home theatre &lt;span class="caps"&gt;PC&lt;/span&gt;. I am still running Version 11.0
(Eden) everywhere. Good thing I tested this on my laptop first because
the upgrade was a fail. I could not get any sound to play after the
upgrade. After poking around the settings, I found out that the Audio
Output Device was set to Airplay as shown in xbmc&amp;#8217;s Audo Output section
of the System Settings screen shot below&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-06-at-9.43.22-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-06 at 9.43.22
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-06-at-9.43.22-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I just changed it to &amp;#8220;Built-in Output&amp;#8221; and that fixed the issue. I was
also hearing only from one side of my headphones. Seeing the release
notes for this new release I saw that it was a known bug and can be
fixed by changing the Speaker Configuration from 2.1 to 2.0. Here is a
screenshot after my&amp;nbsp;changes.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-06-at-9.23.43-PM.png"&gt;&lt;img alt="Screen Shot 2013-03-06 at 9.23.43
PM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/Screen-Shot-2013-03-06-at-9.23.43-PM.png"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="xbmc"/></entry><entry><title>Bread Pakora</title><link href="https://www.nyayapati.com/srao/2013/03/bread-pakora/" rel="alternate"/><published>2013-03-02T14:25:00-05:00</published><updated>2013-03-02T14:25:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-03-02:/srao/2013/03/bread-pakora/</id><summary type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/20130302-142637.jpg"&gt;&lt;img alt="20130302-142637.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/20130302-142637.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is how I remember eating Bread Pakora&amp;#8217;s in Amar Colony, New Delhi.
So the other day when I suggested to Priya that we should try making
Bread Pakoras with Paneer, Priya was&amp;nbsp;inspired!&lt;/p&gt;
&lt;p&gt;This is Priya&amp;#8217;s recipe&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;br&gt;
Paneer&lt;br&gt;
Dhaniya chutney&lt;br&gt;
Chat masala&lt;br&gt;
White Bread&lt;br&gt;
Besan (Chick …&lt;/p&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/20130302-142637.jpg"&gt;&lt;img alt="20130302-142637.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/03/20130302-142637.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This is how I remember eating Bread Pakora&amp;#8217;s in Amar Colony, New Delhi.
So the other day when I suggested to Priya that we should try making
Bread Pakoras with Paneer, Priya was&amp;nbsp;inspired!&lt;/p&gt;
&lt;p&gt;This is Priya&amp;#8217;s recipe&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;br&gt;
Paneer&lt;br&gt;
Dhaniya chutney&lt;br&gt;
Chat masala&lt;br&gt;
White Bread&lt;br&gt;
Besan (Chick Pea Flour) - 1 Cup&lt;br&gt;
Red Chili powder according to taste&lt;br&gt;
Salt to taste&lt;br&gt;
Baking Soda - 1 pinch&lt;br&gt;
Rice Powder - 1 table&amp;nbsp;spoon  &lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Preparation&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The only paneer you can buy here is the frozen kind, so to give it that
fresh look just take it out of the package at put it in hot water. Once
it is soft, cut it in thick chunks so it will fit in between your&amp;nbsp;sandwich.&lt;/p&gt;
&lt;p&gt;Prepare a smooth batter by mixing Chick pea flour, rice powder, salt,
red chili powder, baking soda and water. The rice powder is used here to
make crisp&amp;nbsp;pakoras.&lt;/p&gt;
&lt;p&gt;Spread Dhaniya Chutney on the bread, put your thick slices of paneer,
sprinkle some chat masala and close it with another slice of&amp;nbsp;bread.&lt;/p&gt;
&lt;p&gt;Heat some cooking oil in a&amp;nbsp;vessel.&lt;/p&gt;
&lt;p&gt;The last step is to dip your sandwich in the batter so it is covered
with the batter on all sides. A good way of doing this is to hold the
sandwich and start dipping into the batter, all the edges first and then
finish off by dipping on the two sides. Now put this in the hot oil and
deep fry till golden brown like you see it in the picture. Take it out
and put it on a wire rack to drain any oil out. Or just use some kitchen
napkins to soak up the excess oil&amp;nbsp;out.&lt;/p&gt;
&lt;p&gt;Cut the pakora into half&amp;#8217;s and sprinkle some chat masala before&amp;nbsp;serving.&lt;/p&gt;</content><category term="recipes"/><category term="food"/></entry><entry><title>Syntax Checking your python script without running it</title><link href="https://www.nyayapati.com/srao/2013/03/syntax-checking-your-python-script-without-running-it/" rel="alternate"/><published>2013-03-01T11:20:00-05:00</published><updated>2013-03-01T11:20:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-03-01:/srao/2013/03/syntax-checking-your-python-script-without-running-it/</id><summary type="html">&lt;p&gt;This is a neat little trick to test your python code on the command line
without running the&amp;nbsp;script.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;py_compile&lt;span class="w"&gt; &lt;/span&gt;yourpythonscript.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;All that command does is compile your python script and create a .pyc
file. If there are any errors, you will see the errors be spit …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is a neat little trick to test your python code on the command line
without running the&amp;nbsp;script.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;py_compile&lt;span class="w"&gt; &lt;/span&gt;yourpythonscript.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;All that command does is compile your python script and create a .pyc
file. If there are any errors, you will see the errors be spit&amp;nbsp;out.&lt;/p&gt;</content><category term="software"/><category term="python"/></entry><entry><title>Read Video files metadata in python using hachoir-metadata</title><link href="https://www.nyayapati.com/srao/2013/02/read-video-files-metadata-in-python-using-hachoir-metadata/" rel="alternate"/><published>2013-02-28T09:17:00-05:00</published><updated>2013-02-28T09:17:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-28:/srao/2013/02/read-video-files-metadata-in-python-using-hachoir-metadata/</id><summary type="html">&lt;p&gt;The only module out there for reading video files metadata I could find
is hachoir-metadata. Actually you can extract metadata from multimedia
files like images, audio files and video files. it also works on
different types of archives. I tested it against all kinds of files and
it does a …&lt;/p&gt;</summary><content type="html">&lt;p&gt;The only module out there for reading video files metadata I could find
is hachoir-metadata. Actually you can extract metadata from multimedia
files like images, audio files and video files. it also works on
different types of archives. I tested it against all kinds of files and
it does a great job in most of the popular ones.
&lt;a href="https://bitbucket.org/haypo/hachoir/wiki/hachoir-metadata"&gt;Their&lt;/a&gt; bit
bucket site lists all the formats hachoir-metadata&amp;nbsp;supports.&lt;/p&gt;
&lt;p&gt;Unfortunately installing it on my mac using python pip does not fulfill
dependencies. I was getting the following error trying to run their
sample&amp;nbsp;program..&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;hachoir-metadata&lt;span class="w"&gt;  &lt;/span&gt;
Traceback&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;most&lt;span class="w"&gt; &lt;/span&gt;recent&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;last&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;  &lt;/span&gt;
File
&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;quot&lt;span class="p"&gt;;&lt;/span&gt;/Users/shireenrao/.virtualenvs/default/bin/hachoir-metadata&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;quot&lt;span class="p"&gt;;&lt;/span&gt;,
line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;lt&lt;span class="p"&gt;;&lt;/span&gt;module&lt;span class="p"&gt;&amp;amp;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;amp&lt;span class="p"&gt;;&lt;/span&gt;gt&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
from&lt;span class="w"&gt; &lt;/span&gt;hachoir_core.error&lt;span class="w"&gt; &lt;/span&gt;import&lt;span class="w"&gt; &lt;/span&gt;error,&lt;span class="w"&gt; &lt;/span&gt;HachoirError&lt;span class="w"&gt;  &lt;/span&gt;
ImportError:&lt;span class="w"&gt; &lt;/span&gt;No&lt;span class="w"&gt; &lt;/span&gt;module&lt;span class="w"&gt; &lt;/span&gt;named&lt;span class="w"&gt; &lt;/span&gt;hachoir_core.error
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I was surprised when doing a google search saw that nobody else had seen
this issue. After reading their website, found that the module had
dependencies. I Fixed this by installing the following&amp;nbsp;dependencies&amp;#8230;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;hachoir-parser&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;hachoir-core
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="python"/></entry><entry><title>My macs list of “Open with” applications start listing the apps twice</title><link href="https://www.nyayapati.com/srao/2013/02/my-macs-list-of-open-with-applications-start-listing-the-apps-twice/" rel="alternate"/><published>2013-02-27T08:17:00-05:00</published><updated>2013-02-27T08:17:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-27:/srao/2013/02/my-macs-list-of-open-with-applications-start-listing-the-apps-twice/</id><summary type="html">&lt;p&gt;When I right click on a file on my mac, I started seeing multiple apps
being listed in the &amp;#8220;Open with&amp;#8230;&amp;#8221;&amp;nbsp;menu.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130227-085554.jpg"&gt;&lt;img alt="20130227-085554.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130227-085554.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Typically this list of apps are the apps which can open the file. Seeing
the same application listed multiple times in the &amp;#8220;Open With&amp;#8230;&amp;#8221; list
doesn&amp;#8217;t harm …&lt;/p&gt;</summary><content type="html">&lt;p&gt;When I right click on a file on my mac, I started seeing multiple apps
being listed in the &amp;#8220;Open with&amp;#8230;&amp;#8221;&amp;nbsp;menu.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130227-085554.jpg"&gt;&lt;img alt="20130227-085554.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130227-085554.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Typically this list of apps are the apps which can open the file. Seeing
the same application listed multiple times in the &amp;#8220;Open With&amp;#8230;&amp;#8221; list
doesn&amp;#8217;t harm anything but is definitely&amp;nbsp;annoying!&lt;/p&gt;
&lt;p&gt;So I googled the problem, and saw others were having the same issue.
Basically the launchServices database gets corrupted which leads to this&amp;nbsp;problem.&lt;/p&gt;
&lt;p&gt;To fix on Mountain&amp;nbsp;Lion:&lt;/p&gt;
&lt;p&gt;1. Open Terminal.app in the /Applications/Utilities/ folder.&lt;br&gt;
2.&amp;nbsp;run&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister&lt;span class="w"&gt; &lt;/span&gt;-kill&lt;span class="w"&gt; &lt;/span&gt;-r&lt;span class="w"&gt; &lt;/span&gt;-domain&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;local&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-domain&lt;span class="w"&gt; &lt;/span&gt;system&lt;span class="w"&gt; &lt;/span&gt;-domain&lt;span class="w"&gt; &lt;/span&gt;user
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;3.&amp;nbsp;Restart&lt;/p&gt;
&lt;p&gt;If you don&amp;#8217;t like using the command line, the free tool Onyx also has an
option under Maintenance -&amp;gt; Rebuild -&amp;gt;&amp;nbsp;launchservices.&lt;/p&gt;
&lt;p&gt;Another option is to uninstall the application which is showing up
multiple time and install it&amp;nbsp;back.&lt;/p&gt;
&lt;p&gt;All the above options&amp;nbsp;work.&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Egg Fried Rice</title><link href="https://www.nyayapati.com/srao/2013/02/egg-fried-rice/" rel="alternate"/><published>2013-02-24T22:52:00-05:00</published><updated>2013-02-24T22:52:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-24:/srao/2013/02/egg-fried-rice/</id><summary type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130224-225353.jpg"&gt;&lt;img alt="20130224-225353.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130224-225353.jpg"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;I love Egg fried rice. The best place for me to eat this is at &lt;a href="http://www.yelp.com/biz/the-best-little-restaurant-boston"&gt;The
Best little
Restaurant&lt;/a&gt;
in Boston Chinatown. It&amp;#8217;s plain, simple and very flavorful. It&amp;#8217;s also
very quick to make at&amp;nbsp;home.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rice - 1 cup, preferably made in advance or left overs are …&lt;/li&gt;&lt;/ul&gt;</summary><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130224-225353.jpg"&gt;&lt;img alt="20130224-225353.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/20130224-225353.jpg"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;I love Egg fried rice. The best place for me to eat this is at &lt;a href="http://www.yelp.com/biz/the-best-little-restaurant-boston"&gt;The
Best little
Restaurant&lt;/a&gt;
in Boston Chinatown. It&amp;#8217;s plain, simple and very flavorful. It&amp;#8217;s also
very quick to make at&amp;nbsp;home.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Ingredients&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rice - 1 cup, preferably made in advance or left overs are&amp;nbsp;best&lt;/li&gt;
&lt;li&gt;Eggs - 3 lightly&amp;nbsp;beaten&lt;/li&gt;
&lt;li&gt;Scallions - 1/2 cup thinly&amp;nbsp;sliced&lt;/li&gt;
&lt;li&gt;Sesame oil - 1&amp;nbsp;teaspoon&lt;/li&gt;
&lt;li&gt;Cooking Oil - 4 tablespoons. Peanut Oil&amp;nbsp;preferred.&lt;/li&gt;
&lt;li&gt;Salt - to&amp;nbsp;taste&lt;/li&gt;
&lt;li&gt;&lt;span class="caps"&gt;MSG&lt;/span&gt; - 2&amp;nbsp;pinches&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Preparation&lt;/strong&gt;&lt;br&gt;
All stir fries should be done over high heat. So heat a wok over high
heat. Add 2 table spoons of cooking oil, swirling to coat the wok
evenly, and heat until hot and just smoking. Season the lightly beaten
egg with a pinch of salt, slightly beat the eggs again to mix in the
salt. Add eggs and swirl the wok in all directions to form a thin even
layer on cooking surface, and cook. As soon as the egg sets, flip the
omlete. Another 30 seconds and you can now take it out of the wok. I
like my omlete to be a nice bright yellow, so I try not to over cook
this. Now add the remaining 2 table spoons of cooking oil and heat it.
Add the one teaspoon of sesame oil and then add the rice, salt, &lt;span class="caps"&gt;MSG&lt;/span&gt; and
stir-fry. Add the cooked eggs and break it up while mixing it into the
rice, letting rice rest several seconds between stirs, until rice is
hot, 2 to 3 minutes. Add scallion greens and stir-fry until combined&amp;nbsp;well.&lt;/p&gt;
&lt;p&gt;You can also add blanched mixed vegetables if you want to make it a
vegetable fried rice. You don&amp;#8217;t have to use Peanut oil if you don&amp;#8217;t have
it. I normally just use regular Olive Oil meant for sautéing instead of
peanut oil.&amp;nbsp;Enjoy!&lt;/p&gt;</content><category term="recipes"/><category term="food"/></entry><entry><title>Fix Python virtualenv errors after upgrading Lion to Mountain Lion</title><link href="https://www.nyayapati.com/srao/2013/02/fix-python-virtualenv-errors-after-upgrading-lion-to-mountain-lion/" rel="alternate"/><published>2013-02-21T07:00:00-05:00</published><updated>2013-02-21T07:00:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-21:/srao/2013/02/fix-python-virtualenv-errors-after-upgrading-lion-to-mountain-lion/</id><summary type="html">&lt;p&gt;I upgraded the &lt;span class="caps"&gt;OS&lt;/span&gt; of my mac mini to Mountain Lion this weekend.
Unfortunately it messed up all my python settings. When I ssh&amp;#8217;d into the
mac mini I saw an ugly python error. The gist of which was the
following&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;“ImportError: No module named&amp;nbsp;virtualenvwrapper.hook_loader”&lt;/p&gt;
&lt;p&gt;Basically I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I upgraded the &lt;span class="caps"&gt;OS&lt;/span&gt; of my mac mini to Mountain Lion this weekend.
Unfortunately it messed up all my python settings. When I ssh&amp;#8217;d into the
mac mini I saw an ugly python error. The gist of which was the
following&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;“ImportError: No module named&amp;nbsp;virtualenvwrapper.hook_loader”&lt;/p&gt;
&lt;p&gt;Basically I just had to Install the Xcode Command Line tools, and that
would have fixed everything. Just in case, I also installed pip,
virtualenv and virtualenvwrapper&amp;nbsp;again.&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s all good now&amp;nbsp;:)&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="python"/></entry><entry><title>“No Camera Found” when I plug in my iPhone</title><link href="https://www.nyayapati.com/srao/2013/02/no-camera-found-when-i-plug-in-my-iphone/" rel="alternate"/><published>2013-02-19T09:58:00-05:00</published><updated>2013-02-19T09:58:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-19:/srao/2013/02/no-camera-found-when-i-plug-in-my-iphone/</id><summary type="html">&lt;p&gt;I was trying to copy some videos I had taken today to my laptop. I was
syncing my iPhone after a really long time.. actually since apple gave
us iCloud I dont have to sync for apps and pictures anymore. as I needed
to get the videos.. I had too …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was trying to copy some videos I had taken today to my laptop. I was
syncing my iPhone after a really long time.. actually since apple gave
us iCloud I dont have to sync for apps and pictures anymore. as I needed
to get the videos.. I had too.. Maybe I should use dropbox for this??
Ohh I digress! so back to what I was doing.. Oh yes, trying to sync my
phone.. I plugged in the &lt;span class="caps"&gt;USB&lt;/span&gt; and saw an error message pop up saying &amp;#8220;No
Camera Fond&amp;#8221;. I tried a couple of things.. rebooted my phone and then my
laptop (Don&amp;#8217;t laugh.. I am a windows user at work).. Nothing worked.
Back to Google I found out what was wrong. My image capture settings had
changed after I installed Canon&amp;#8217;s imagebrowser&amp;nbsp;software.&lt;/p&gt;
&lt;p&gt;On the Mac, after the iPhone is connected to the computer, open the
Image Capture application. Select the iPhone and an option is presented
in the bottom of the left panel. Change the &amp;#8220;Connecting this iPhone
opens&amp;#8221; to an option of your choice. I chose &amp;#8220;no&amp;nbsp;application&amp;#8221;.&lt;/p&gt;</content><category term="software"/><category term="iphone"/></entry><entry><title>GNU Screen on Mac OSX</title><link href="https://www.nyayapati.com/srao/2013/02/gnu-screen-on-mac-osx/" rel="alternate"/><published>2013-02-18T23:54:00-05:00</published><updated>2013-02-18T23:54:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-18:/srao/2013/02/gnu-screen-on-mac-osx/</id><summary type="html">&lt;p&gt;Did you know Gnu Screen came default with your macs? I did not know
that!!&lt;br&gt;
I wanted to run one of my python scripts remotely on my mac mini to
detect duplicates in my image library. As this would take some time, I
didn&amp;#8217;t want to leave the session …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Did you know Gnu Screen came default with your macs? I did not know
that!!&lt;br&gt;
I wanted to run one of my python scripts remotely on my mac mini to
detect duplicates in my image library. As this would take some time, I
didn&amp;#8217;t want to leave the session running on my laptop. I remembered
using screen when I was actively using linux a few years ago and thought
it would be a great solution here. First thing I did was do a quick
google search to see if there was a ready made package for mac &lt;span class="caps"&gt;OSX&lt;/span&gt;. To
my surprise I found out that it&amp;#8217;s already installed on my mac :)&amp;nbsp;Yipppee!!&lt;/p&gt;
&lt;p&gt;Here is a cheat sheet - &lt;a href="http://aperiodic.net/screen/quick_reference"&gt;http://aperiodic.net/screen/quick_reference&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Python development setup on Mountain Lion - part 4</title><link href="https://www.nyayapati.com/srao/2013/02/python-development-setup-on-mountain-lion-part-4/" rel="alternate"/><published>2013-02-18T09:31:00-05:00</published><updated>2013-02-18T09:31:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2013-02-18:/srao/2013/02/python-development-setup-on-mountain-lion-part-4/</id><summary type="html">&lt;h4&gt;Setup Git on mountain lion to use github to save your&amp;nbsp;projects&lt;/h4&gt;
&lt;p&gt;Continuing on my series, today we will be setting up git on our newly
upgraded Mountain Lion.&lt;br&gt;
Go ahead and download the latest version of git from
&lt;a href="http://git-scm.com"&gt;here&lt;/a&gt;. Go ahead and install it. Next go and open an …&lt;/p&gt;</summary><content type="html">&lt;h4&gt;Setup Git on mountain lion to use github to save your&amp;nbsp;projects&lt;/h4&gt;
&lt;p&gt;Continuing on my series, today we will be setting up git on our newly
upgraded Mountain Lion.&lt;br&gt;
Go ahead and download the latest version of git from
&lt;a href="http://git-scm.com"&gt;here&lt;/a&gt;. Go ahead and install it. Next go and open an
account on GitHub if you don&amp;#8217;t already have&amp;nbsp;one.&lt;/p&gt;
&lt;p&gt;We will be using &lt;span class="caps"&gt;SSH&lt;/span&gt; keys to establish a secure connection between our
computer and GitHub. Just follow these excellent instructions as
described at &lt;a href="https://help.github.com/articles/generating-ssh-keys"&gt;https://help.github.com/articles/generating-ssh-keys&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just confirm that once you have it setup you can run the following
command and see the output as shown below&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;-T&lt;span class="w"&gt; &lt;/span&gt;git@github.com&lt;span class="w"&gt;  &lt;/span&gt;
The&lt;span class="w"&gt; &lt;/span&gt;authenticity&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;host&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;github.com (207.97.227.239)&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;can&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;t&lt;span class="w"&gt; &lt;/span&gt;be
established.&lt;span class="w"&gt;  &lt;/span&gt;
RSA&lt;span class="w"&gt; &lt;/span&gt;key&lt;span class="w"&gt; &lt;/span&gt;fingerprint&lt;span class="w"&gt; &lt;/span&gt;is
&lt;span class="m"&gt;16&lt;/span&gt;:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.&lt;span class="w"&gt;  &lt;/span&gt;
Are&lt;span class="w"&gt; &lt;/span&gt;you&lt;span class="w"&gt; &lt;/span&gt;sure&lt;span class="w"&gt; &lt;/span&gt;you&lt;span class="w"&gt; &lt;/span&gt;want&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;continue&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;connecting&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;yes/no&lt;span class="o"&gt;)&lt;/span&gt;?
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Just type yes and hit enter to add the &lt;span class="caps"&gt;RSA&lt;/span&gt; key for github.com to your
list of known_hosts. You should then see the following&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Warning:&lt;span class="w"&gt; &lt;/span&gt;Permanently&lt;span class="w"&gt; &lt;/span&gt;added&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;github.com,207.97.227.239&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;RSA&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;to&lt;span class="w"&gt; &lt;/span&gt;the
list&lt;span class="w"&gt; &lt;/span&gt;of&lt;span class="w"&gt; &lt;/span&gt;known&lt;span class="w"&gt; &lt;/span&gt;hosts.&lt;span class="w"&gt;  &lt;/span&gt;
Hi&lt;span class="w"&gt; &lt;/span&gt;username!&lt;span class="w"&gt; &lt;/span&gt;You&lt;span class="err"&gt;&amp;#39;&lt;/span&gt;ve&lt;span class="w"&gt; &lt;/span&gt;successfully&lt;span class="w"&gt; &lt;/span&gt;authenticated,&lt;span class="w"&gt; &lt;/span&gt;but&lt;span class="w"&gt; &lt;/span&gt;GitHub&lt;span class="w"&gt; &lt;/span&gt;does&lt;span class="w"&gt; &lt;/span&gt;not
provide&lt;span class="w"&gt; &lt;/span&gt;shell&lt;span class="w"&gt; &lt;/span&gt;access.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;That&amp;#8217;s it! You can now checkin and checkout code to&amp;nbsp;GitHub.&lt;/p&gt;
&lt;p&gt;If I want to clone the mp3cleaner project from Github, I will cd to the
location where I will want the project to be copied. I then run the git
clone&amp;nbsp;command.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;clone&lt;span class="w"&gt; &lt;/span&gt;git@github.com:shireenrao/mp3cleaner.git&lt;span class="w"&gt;  &lt;/span&gt;
Cloning&lt;span class="w"&gt; &lt;/span&gt;into&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;mp3cleaner&amp;#39;&lt;/span&gt;...&lt;span class="w"&gt;  &lt;/span&gt;
remote:&lt;span class="w"&gt; &lt;/span&gt;Counting&lt;span class="w"&gt; &lt;/span&gt;objects:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;.&lt;span class="w"&gt;  &lt;/span&gt;
remote:&lt;span class="w"&gt; &lt;/span&gt;Compressing&lt;span class="w"&gt; &lt;/span&gt;objects:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;%&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;9&lt;/span&gt;/9&lt;span class="o"&gt;)&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;.&lt;span class="w"&gt;  &lt;/span&gt;
remote:&lt;span class="w"&gt; &lt;/span&gt;Total&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;delta&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;reused&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;10&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;delta&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Receiving&lt;span class="w"&gt; &lt;/span&gt;objects:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;%&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;11&lt;/span&gt;/11&lt;span class="o"&gt;)&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;4&lt;/span&gt;.15&lt;span class="w"&gt; &lt;/span&gt;KiB,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;.&lt;span class="w"&gt;  &lt;/span&gt;
Resolving&lt;span class="w"&gt; &lt;/span&gt;deltas:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;100&lt;/span&gt;%&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;/2&lt;span class="o"&gt;)&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;done&lt;/span&gt;.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now you can make any changes or add any files. If you are adding new
files you will have to use the&amp;nbsp;command  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;add&lt;span class="w"&gt; &lt;/span&gt;filename
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to add the file to source control. To commit the changes you made, use
the&amp;nbsp;command  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;commit&lt;span class="w"&gt; &lt;/span&gt;-a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This will open your favorite editor to make a comment on what you are
committing.&lt;br&gt;
Now use this command to push your changes out to&amp;nbsp;GitHub  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;push
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you have a new project you want to push to GitHub, you first
login to your github account and create a repository for the project you
are working on. You should see a button on the home screen of Github
which says &amp;#8220;New repository&amp;#8221;&amp;nbsp;-  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/Screen-Shot-2013-02-18-at-8.56.51-AM.png"&gt;&lt;img alt="Screen Shot 2013-02-18 at 8.56.51 AM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/Screen-Shot-2013-02-18-at-8.56.51-AM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;Now fill out the repository name. The other fields are all&amp;nbsp;optional.  &lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/Screen-Shot-2013-02-18-at-9.03.43-AM.png"&gt;&lt;img alt="Screen Shot 2013-02-18 at 9.03.43
AM" src="https://www.nyayapati.com/srao/wp-content/uploads/2013/02/Screen-Shot-2013-02-18-at-9.03.43-AM.png"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;Click on the Create repository button to create your repository. Thats
all you need to do on github.&lt;br&gt;
For the sake of this article, lets call this repo&amp;nbsp;&amp;#8220;Hello-World&amp;#8221;&lt;/p&gt;
&lt;p&gt;Now back on your mac&amp;#8217;s terminal go to where your project lives,
initialize your repo locally. Create an empty &lt;span class="caps"&gt;README&lt;/span&gt; file if it doesnt
exist already. Add all files to your local repo. Commit your changes and
then create a remote named &amp;#8220;origin&amp;#8221; pointing at your GitHub repo. The
last step is to push your changes to&amp;nbsp;github.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;~/projects/Hello-World&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;init&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;touch&lt;span class="w"&gt; &lt;/span&gt;README&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;add&lt;span class="w"&gt; &lt;/span&gt;*&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;commit&lt;span class="w"&gt; &lt;/span&gt;-m&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;first commit&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;remote&lt;span class="w"&gt; &lt;/span&gt;add&lt;span class="w"&gt; &lt;/span&gt;origin&lt;span class="w"&gt; &lt;/span&gt;https://github.com/username/Hello-World.git&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;git&lt;span class="w"&gt; &lt;/span&gt;push&lt;span class="w"&gt; &lt;/span&gt;origin&lt;span class="w"&gt; &lt;/span&gt;master
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you go see your repository on github, you should see your files&amp;nbsp;there.&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="python"/></entry><entry><title>Easy Date Math in Python</title><link href="https://www.nyayapati.com/srao/2012/09/easy-date-math-in-python/" rel="alternate"/><published>2012-09-16T13:08:00-04:00</published><updated>2012-09-16T13:08:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-09-16:/srao/2012/09/easy-date-math-in-python/</id><summary type="html">&lt;p&gt;I was trying to figure out exactly when does 6 months end from a given
date. Well one can just count the days and find out but I thought python
would be a good way to do it quickly. Here is one way to do&amp;nbsp;it&amp;#8230;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;datetime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;date …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I was trying to figure out exactly when does 6 months end from a given
date. Well one can just count the days and find out but I thought python
would be a good way to do it quickly. Here is one way to do&amp;nbsp;it&amp;#8230;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;datetime&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;  
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;dateutil.relativedelta&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;relativedelta&lt;/span&gt;  
&lt;span class="o"&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2012&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="n"&gt;relativedelta&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;months&lt;/span&gt;&lt;span class="o"&gt;=+&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;datetime&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2013&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;14&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/></entry><entry><title>Southern Fried Chicken</title><link href="https://www.nyayapati.com/srao/2012/08/southern-fried-chicken/" rel="alternate"/><published>2012-08-29T17:32:00-04:00</published><updated>2012-08-29T17:32:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-29:/srao/2012/08/southern-fried-chicken/</id><content type="html">&lt;p&gt;I had some craving for some fried chicken the other day and didn&amp;#8217;t want
to wait an entire day for marination. So looking around on the Internet
I found Paula Deens
&lt;a href="http://www.foodnetwork.com/recipes/paula-deen/southern-fried-chicken-recipe/index.html"&gt;recipe&lt;/a&gt;
which was quick to&amp;nbsp;make!&lt;/p&gt;
&lt;p&gt;Here is my take on&amp;nbsp;it.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/20120829-172227.jpg"&gt;&lt;img alt="20120829-172227.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/20120829-172227.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/20120829-172250.jpg"&gt;&lt;img alt="20120829-172250.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/20120829-172250.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="recipes"/><category term="chicken"/><category term="food"/></entry><entry><title>Python development setup on Mountain Lion - part 3</title><link href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-3/" rel="alternate"/><published>2012-08-29T09:17:00-04:00</published><updated>2012-08-29T09:17:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-29:/srao/2012/08/python-development-setup-on-mountain-lion-part-3/</id><summary type="html">&lt;h4&gt;Eclipse setup to use python in a&amp;nbsp;virtualenv&lt;/h4&gt;
&lt;p&gt;Today I will cover how to setup eclipse to use the python virtual
environment we created in &lt;a href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-2/"&gt;part
2&lt;/a&gt; of this&amp;nbsp;series.&lt;/p&gt;
&lt;p&gt;When you first launch eclipse, create a new workspace and call it
something relevant. I called it python273 and created …&lt;/p&gt;</summary><content type="html">&lt;h4&gt;Eclipse setup to use python in a&amp;nbsp;virtualenv&lt;/h4&gt;
&lt;p&gt;Today I will cover how to setup eclipse to use the python virtual
environment we created in &lt;a href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-2/"&gt;part
2&lt;/a&gt; of this&amp;nbsp;series.&lt;/p&gt;
&lt;p&gt;When you first launch eclipse, create a new workspace and call it
something relevant. I called it python273 and created it in a folder
called workspaces under my home&amp;nbsp;directory.&lt;/p&gt;
&lt;p&gt;Now go ahead and install the pydev module. You can do this by going to
the eclipse marketplace. Click on Help-&amp;gt;Eclipse Marketplace&amp;#8230; Type
pydev in the find textbox and click on Go. Click on the Install button
when you see the pydev module. Go through the installation and restart&amp;nbsp;eclipse.&lt;/p&gt;
&lt;p&gt;Once eclipse comes back, open the preferences pane and expand pydev and
select the Interpreter - Python option. Click on the New button on that
screen and fill out the interpreter name and select the path to python
in your virtualenv&amp;nbsp;(/Users/username/.virtualenvs/python273/bin/python)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/Screen-Shot-2012-08-28-at-10.30.26-PM.png"&gt;&lt;img alt="PyDev Python Settings" src="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/Screen-Shot-2012-08-28-at-10.30.26-PM-300x237.png" title="Pydev Python settings"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Click on &lt;span class="caps"&gt;OK&lt;/span&gt;. Now you will be greeted with a dialogue box of all modules
eclipse found. Select all the modules you want to add to eclipses
pythonpath. I will just let the default be. just make sure you are only
using paths which are in your virtualenv. Click &lt;span class="caps"&gt;OK&lt;/span&gt;. You should now see
the following dialogue&amp;nbsp;box&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/Screen-Shot-2012-08-28-at-10.40.18-PM.png"&gt;&lt;img alt="Virtualenv Warning" src="https://www.nyayapati.com/srao/wp-content/uploads/2012/08/Screen-Shot-2012-08-28-at-10.40.18-PM-300x201.png" title="Virtualenv warning"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Just click on Proceed anyways. Then click on &lt;span class="caps"&gt;OK&lt;/span&gt; on the preferences page.
 Now lets switch to pydev mode in eclipse and test our&amp;nbsp;Install.&lt;/p&gt;
&lt;p&gt;Create a new PyDev Project (just select the defaults) and then create a
new module. Just write some print statements, save and then setup some
debug points and start debugging the code. You should now be able to
switch to debug mode and step through&amp;nbsp;code.&lt;/p&gt;
&lt;p&gt;In the next part I will walk through setting up git on your laptop and
integrate github into your&amp;nbsp;workflow.&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="python"/></entry><entry><title>Python development setup on Mountain Lion - part 2</title><link href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-2/" rel="alternate"/><published>2012-08-28T09:06:00-04:00</published><updated>2012-08-28T09:06:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-28:/srao/2012/08/python-development-setup-on-mountain-lion-part-2/</id><summary type="html">&lt;h4&gt;Setup virtualenv and virtualenvwrapper on Mountain&amp;nbsp;Lion&lt;/h4&gt;
&lt;p&gt;In the previous
&lt;a href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-1/"&gt;part&lt;/a&gt; I
went through how you can have multiple versions of python and how you
can easily switch between these versions. Here I will go through setting
up virtualenv and virtualenvwrapper. This will help in keeping all the
different versions …&lt;/p&gt;</summary><content type="html">&lt;h4&gt;Setup virtualenv and virtualenvwrapper on Mountain&amp;nbsp;Lion&lt;/h4&gt;
&lt;p&gt;In the previous
&lt;a href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-1/"&gt;part&lt;/a&gt; I
went through how you can have multiple versions of python and how you
can easily switch between these versions. Here I will go through setting
up virtualenv and virtualenvwrapper. This will help in keeping all the
different versions of python&amp;nbsp;pristine!&lt;/p&gt;
&lt;p&gt;First step is to switch to whatever version of python you want to do
this in. Use the bash switch function we created in &lt;a href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-1/"&gt;part 1&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Next we will install the python package installer
&lt;a href="http://pypi.python.org/pypi/pip/"&gt;pip&lt;/a&gt; using the easy_install&amp;nbsp;command.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;easy_install&lt;span class="w"&gt; &lt;/span&gt;pip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Update Start (July-02-2013) &lt;/strong&gt;&lt;strong&gt;*&lt;/strong&gt;*&lt;br&gt;
The above step is not correct. On my mac, I assumed easy_install to be
part of the python version I switched to, as described earlier. When I
checked the location for easy_install, I realized that it was from the
python version shipped with mountain lion. easy_install is part of
&lt;a href="https://pypi.python.org/pypi/setuptools"&gt;setuptools&lt;/a&gt;. So we will need
to install setuptools for the version of python you are using. As I am
trying to switch to version 2.7.3, I did the following to install
this&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;curl&lt;span class="w"&gt; &lt;/span&gt;-o&lt;span class="w"&gt; &lt;/span&gt;setuptools-0.6c11-py2.7.egg&lt;span class="w"&gt; &lt;/span&gt;https://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;sh&lt;span class="w"&gt; &lt;/span&gt;setuptools-0.6c11-py2.7.egg&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;rm&lt;span class="w"&gt; &lt;/span&gt;setuptools-0.6c11-py2.7.egg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You should now see easy_install in the bin directory of the python
version you are trying to do this for. In my case for python 2.7.3 it
was in &amp;#8220;/Library/Frameworks/Python.framework/Versions/2.7/bin&amp;#8221;. As this
is already in my path thanks due to the python switching tools I showed
you all from the &lt;a href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-1/"&gt;first part&lt;/a&gt; in this
series, we are good. Now run &amp;#8220;sudo easy_install pip&amp;#8221; as first directed
and it will install pip in the right version of python.&lt;br&gt;
&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;&lt;/strong&gt;&lt;em&gt; Update Finish (July-02-2013)&lt;/em&gt;*&lt;/p&gt;
&lt;p&gt;Next install virtualenv and virtualenvwrapper using the pip&amp;nbsp;command  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;virtualenv&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;pip&lt;span class="w"&gt; &lt;/span&gt;install&lt;span class="w"&gt; &lt;/span&gt;virtualenvwrapper
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now add the following variables in your .bash_profile before activating&amp;nbsp;virtualenvwrapper  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;WORKON_HOME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.virtualenvs&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;PIP_VIRTUALENV_BASE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$WORKON_HOME&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;PIP_RESPECT_VIRTUALENV&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;

.&lt;span class="w"&gt; &lt;/span&gt;/usr/local/bin/virtualenvwrapper.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Yes, there is a dot in front of /usr/local/bin/virtualenvwrapper.sh&lt;br&gt;
Next go ahead and create the directory .virtualenvs in your home
directory.&lt;br&gt;
Now that all the ground work is done, go ahead and source your
.bash_profile file. You should see virtualenvwrapper initialise some
files and folders under .virtualenvs. It will also add some more bash
functions to make your life&amp;nbsp;easy.&lt;/p&gt;
&lt;p&gt;Now lets go ahead and create a virtual environment for our python 2.7.3&amp;nbsp;environment.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mkvirtualenv&lt;span class="w"&gt; &lt;/span&gt;python273&lt;span class="w"&gt;  &lt;/span&gt;
Installing&lt;span class="w"&gt; &lt;/span&gt;setuptools...........&lt;span class="w"&gt;  &lt;/span&gt;
Complete&lt;span class="w"&gt; &lt;/span&gt;output&lt;span class="w"&gt; &lt;/span&gt;from&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt;
/Users/username/.v...python273/bin/python&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;#!python  &lt;/span&gt;
&lt;span class="s2"&gt;\&amp;quot;\&amp;quot;\&amp;quot;Bootstra...sys.argv[1:])&lt;/span&gt;

&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/Library/Python/2.7/...ols-0.6c11-py2.7.egg:&lt;span class="w"&gt;  &lt;/span&gt;
Traceback&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;most&lt;span class="w"&gt; &lt;/span&gt;recent&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;last&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;string&amp;gt;&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;279&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;module&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&amp;lt;string&amp;gt;&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;207&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;main&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;build/bdist.linux-i686/egg/setuptools/__init__.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;,
&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;module&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;build/bdist.linux-i686/egg/setuptools/extension.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
&amp;lt;module&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
File
&lt;span class="s2"&gt;&amp;quot;/Users/username/.virtualenvs/python273/lib/python2.7/distutils/__init__.py&amp;quot;&lt;/span&gt;,
line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;16&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;module&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
exec&lt;span class="o"&gt;(&lt;/span&gt;open&lt;span class="o"&gt;(&lt;/span&gt;os.path.join&lt;span class="o"&gt;(&lt;/span&gt;distutils_path,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;__init__.py&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;.read&lt;span class="o"&gt;())&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
IOError:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;Errno&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;No&lt;span class="w"&gt; &lt;/span&gt;such&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;or&lt;span class="w"&gt; &lt;/span&gt;directory:
&lt;span class="s1"&gt;&amp;#39;/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/__init__.py&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
----------------------------------------&lt;span class="w"&gt;  &lt;/span&gt;
...Installing&lt;span class="w"&gt; &lt;/span&gt;setuptools...done.&lt;span class="w"&gt;  &lt;/span&gt;
Traceback&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;most&lt;span class="w"&gt; &lt;/span&gt;recent&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;last&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/usr/local/bin/virtualenv&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;8&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;module&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
load_entry_point&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;virtualenv==1.7.2&amp;#39;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;console_scripts&amp;#39;&lt;/span&gt;,
&lt;span class="s1"&gt;&amp;#39;virtualenv&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;)()&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/Library/Python/2.7/site-packages/virtualenv.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;942&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
main&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;never_download&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;options.never_download&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/Library/Python/2.7/site-packages/virtualenv.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1052&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
create_environment&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;search_dirs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;search_dirs,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;never_download&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;never_download&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/Library/Python/2.7/site-packages/virtualenv.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;598&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
install_setuptools&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;search_dirs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;search_dirs,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;never_download&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;never_download&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/Library/Python/2.7/site-packages/virtualenv.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;570&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
_install_req&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;cwd&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;cwd&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/Library/Python/2.7/site-packages/virtualenv.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1020&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
call_subprocess&lt;span class="w"&gt;  &lt;/span&gt;
%&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;cmd_desc,&lt;span class="w"&gt; &lt;/span&gt;proc.returncode&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
OSError:&lt;span class="w"&gt; &lt;/span&gt;Command&lt;span class="w"&gt; &lt;/span&gt;/Users/username/.v...python273/bin/python&lt;span class="w"&gt; &lt;/span&gt;-c
&lt;span class="s2"&gt;&amp;quot;#!python  &lt;/span&gt;
&lt;span class="s2"&gt;\&amp;quot;\&amp;quot;\&amp;quot;Bootstra...sys.argv[1:])&lt;/span&gt;

&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/Library/Python/2.7/...ols-0.6c11-py2.7.egg&lt;span class="w"&gt; &lt;/span&gt;failed&lt;span class="w"&gt; &lt;/span&gt;with&lt;span class="w"&gt; &lt;/span&gt;error&lt;span class="w"&gt; &lt;/span&gt;code&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Turns out this error came up because Xcode which was installed from the
App Store on my new Mountain Lion install did not come with the command
line tools. Go to the preference pane in Xcode, and then go to the
downloads section and install the command line tools. Once done, go
ahead and try the mkvirtualenv command&amp;nbsp;again.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mkvirtualenv&lt;span class="w"&gt; &lt;/span&gt;python273&lt;span class="w"&gt;  &lt;/span&gt;
New&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;executable&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;python273/bin/python&lt;span class="w"&gt;  &lt;/span&gt;
Installing&lt;span class="w"&gt; &lt;/span&gt;setuptools............done.&lt;span class="w"&gt;  &lt;/span&gt;
Installing&lt;span class="w"&gt; &lt;/span&gt;pip...............done.&lt;span class="w"&gt;  &lt;/span&gt;
virtualenvwrapper.user_scripts&lt;span class="w"&gt; &lt;/span&gt;creating
/Users/username/.virtualenvs/python273/bin/predeactivate&lt;span class="w"&gt;  &lt;/span&gt;
virtualenvwrapper.user_scripts&lt;span class="w"&gt; &lt;/span&gt;creating
/Users/username/.virtualenvs/python273/bin/postdeactivate&lt;span class="w"&gt;  &lt;/span&gt;
virtualenvwrapper.user_scripts&lt;span class="w"&gt; &lt;/span&gt;creating
/Users/username/.virtualenvs/python273/bin/preactivate&lt;span class="w"&gt;  &lt;/span&gt;
virtualenvwrapper.user_scripts&lt;span class="w"&gt; &lt;/span&gt;creating
/Users/username/.virtualenvs/python273/bin/postactivate&lt;span class="w"&gt;  &lt;/span&gt;
virtualenvwrapper.user_scripts&lt;span class="w"&gt; &lt;/span&gt;creating
/Users/username/.virtualenvs/python273/bin/get_env_details&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;python273&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="w"&gt; &lt;/span&gt;which&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt;  &lt;/span&gt;
/Users/username/.virtualenvs/python273/bin/python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Notice how my prompt changed to show me which environment I am in. What
mkvirtualenv did was create a copy of python under your .virtualenv
directory and made it your default&amp;nbsp;python.&lt;/p&gt;
&lt;p&gt;There is a slight problem now. I checked to see the version of python in
the virtualenv I just created and found that the version was 2.7.2. This
was the version of python which came with the new install of Mountain
Lion. After reading the docs on mkvirtualenv I found that mkvirtualenv
used the python version which was used to install virtualenv.. but I
thought I had switched my version of python to use python 2.7.3.. Grr..
ok.. whatever!! I deleted my newly created virtualenv and recreated a
new one again, but this time define the version of python I want to&amp;nbsp;use.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;rmvirutalenv&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;273&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
Removing&lt;span class="w"&gt; &lt;/span&gt;python273...&lt;span class="w"&gt;  &lt;/span&gt;
$&lt;span class="w"&gt; &lt;/span&gt;mkvirtualenv&lt;span class="w"&gt; &lt;/span&gt;python273&lt;span class="w"&gt; &lt;/span&gt;-p
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7&lt;span class="w"&gt;  &lt;/span&gt;
Running&lt;span class="w"&gt; &lt;/span&gt;virtualenv&lt;span class="w"&gt; &lt;/span&gt;with&lt;span class="w"&gt; &lt;/span&gt;interpreter
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7&lt;span class="w"&gt;  &lt;/span&gt;
New&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;executable&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;python273/bin/python&lt;span class="w"&gt;  &lt;/span&gt;
Installing&lt;span class="w"&gt; &lt;/span&gt;setuptools............done.&lt;span class="w"&gt;  &lt;/span&gt;
Installing&lt;span class="w"&gt; &lt;/span&gt;pip...............done.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This confirms my python&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update Start (July-02-2013) &lt;/strong&gt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;*&lt;br&gt;
If you followed my latest update from above for confirming the
existance of easy_install in the version of python you want and
installing if missing, the problem with creating the virutalenv instance
with the wrong version of python will not happen.&lt;br&gt;
&lt;/strong&gt;&lt;strong&gt;&lt;em&gt;*&lt;/em&gt;* Update finish&amp;nbsp;(July-02-2013)&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Here are some commands you will using&amp;nbsp;-&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;deactivate - command will disable the virtual&amp;nbsp;environment.&lt;/li&gt;
&lt;li&gt;workon - command by itself will show you a list of virtual
    environments. To activate a particular environment, run &amp;#8216;workon&amp;nbsp;env_name&amp;#8217;&lt;/li&gt;
&lt;li&gt;rmvirtualenv - run this command with the name of virtualenv to
    delete that&amp;nbsp;environment&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The best part is that now you don&amp;#8217;t need the sudo command to install any
new python modules as python is now under your home directory. You are
now free to use the pip command to install any module you&amp;nbsp;want.&lt;/p&gt;
&lt;p&gt;In the next part I will show you how to setup eclipse to use a virtual
python&amp;nbsp;environment&amp;#8230;&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="python"/></entry><entry><title>Tip on burning dual layer disc on your MacBook Pro</title><link href="https://www.nyayapati.com/srao/2012/08/tip-on-burning-dual-layer-disc-on-your-macbook-pro/" rel="alternate"/><published>2012-08-28T08:10:00-04:00</published><updated>2012-08-28T08:10:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-28:/srao/2012/08/tip-on-burning-dual-layer-disc-on-your-macbook-pro/</id><summary type="html">&lt;p&gt;You can solve this problem by disabling the sudden motion sensor on your
laptop. When the disk is going from layer 1 to layer 2, the sudden
motion sensor activates which then disrupts the burn process. So if you
want to burn a dual layer disc, disable the sensor.. But …&lt;/p&gt;</summary><content type="html">&lt;p&gt;You can solve this problem by disabling the sudden motion sensor on your
laptop. When the disk is going from layer 1 to layer 2, the sudden
motion sensor activates which then disrupts the burn process. So if you
want to burn a dual layer disc, disable the sensor.. But there is a
risk! If you drop you&amp;#8217;re Mac book, the superdrive will be damaged. Your
bes option would be to disable your sensor.. Burn your disc and then
finally enable the sensor&amp;nbsp;again.&lt;/p&gt;
&lt;p&gt;to disable sudden motion sensor start Terminal and&amp;nbsp;type:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;pmset&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;sms&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;to reactivate&amp;nbsp;type:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;sudo&lt;span class="w"&gt; &lt;/span&gt;pmset&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;sms&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Another thing I found was always try to use Verbatim, all the other
brands didn&amp;#8217;t work&amp;nbsp;out.&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Python development setup on Mountain Lion - part 1</title><link href="https://www.nyayapati.com/srao/2012/08/python-development-setup-on-mountain-lion-part-1/" rel="alternate"/><published>2012-08-27T14:13:00-04:00</published><updated>2012-08-27T14:13:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-27:/srao/2012/08/python-development-setup-on-mountain-lion-part-1/</id><summary type="html">&lt;h4&gt;Install and manage multiple versions of Python on Mountain&amp;nbsp;Lion&lt;/h4&gt;
&lt;p&gt;When I was doing python development on snow leopard, I was installing
python modules up the wazoo on the default python which came with the
laptop. I later realized that was not the right way of doing it. To keep …&lt;/p&gt;</summary><content type="html">&lt;h4&gt;Install and manage multiple versions of Python on Mountain&amp;nbsp;Lion&lt;/h4&gt;
&lt;p&gt;When I was doing python development on snow leopard, I was installing
python modules up the wazoo on the default python which came with the
laptop. I later realized that was not the right way of doing it. To keep
things organized will help you when you are developing projects which
have different requirements and using different modules and different
versions. So when I installed mountain lion on my laptop, I thought this
time around I will be more organised about&amp;nbsp;this.&lt;/p&gt;
&lt;p&gt;I didn&amp;#8217;t want to mess with the system python, so I installed python2.7.3
and python 3.2.3 from python.org. After each install, the installation
process is going to try to add that version of python in your path on
the command line. I recommend commenting the lines which were added to
your&amp;nbsp;.bash_profile&lt;/p&gt;
&lt;p&gt;Now one would wonder how would you switch between the different versions
of python? This is where I found this cool script called
update_python_switchers.py from
&lt;a href="http://sevas.github.com/2011/06/14/multiple-python-osx.html"&gt;http://sevas.github.com/2011/06/14/multiple-python-osx.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When you execute this script, it creates a file called
.python_switchers.sh in your home directory. This script detects all
the different versions of python and then creates bash functions based
on what were found. To make these functions available, just source this
file. As recommended on the site just add the following to your&amp;nbsp;.bash_profile  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;OLD_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$PATH&lt;/span&gt;

.&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/.python_switchers.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When I ran the script update_python_switchers.py, I saw the following
error in the&amp;nbsp;execution.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Using&lt;span class="w"&gt; &lt;/span&gt;generic&lt;span class="w"&gt; &lt;/span&gt;prompt&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.3&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.5&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.6&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.7&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;MacPython&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.7&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;MacPython&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;.2&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;EPD&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;32&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;.3&lt;span class="w"&gt;  &lt;/span&gt;
Traceback&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;most&lt;span class="w"&gt; &lt;/span&gt;recent&lt;span class="w"&gt; &lt;/span&gt;call&lt;span class="w"&gt; &lt;/span&gt;last&lt;span class="o"&gt;)&lt;/span&gt;:&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;./update_python_switchers.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;152&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;module&amp;gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;epd64_versions&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;detect_epd64_installs&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
File&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;./update_python_switchers.py&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;line&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;48&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;
detect_epd64_installs&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;directories&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;os.listdir&lt;span class="o"&gt;(&lt;/span&gt;os.path.join&lt;span class="o"&gt;(&lt;/span&gt;EPD64_ROOT,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Versions&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;))&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
OSError:&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;Errno&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;No&lt;span class="w"&gt; &lt;/span&gt;such&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;or&lt;span class="w"&gt; &lt;/span&gt;directory:
&lt;span class="s1"&gt;&amp;#39;/Library/Frameworks/EPD64.framework/Versions&amp;#39;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Looks like the script is failing because the script is trying to look
for the 64 bit version of Enthought Python. As I don&amp;#8217;t have it, I just
commented out the call to detect_epd64_installs() in the script. Now
running the script gives me the following&amp;nbsp;output  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Using&lt;span class="w"&gt; &lt;/span&gt;generic&lt;span class="w"&gt; &lt;/span&gt;prompt&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.3&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.5&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.6&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;System&lt;span class="w"&gt; &lt;/span&gt;Python&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.7&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;MacPython&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;.7&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;MacPython&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;.2&lt;span class="w"&gt;  &lt;/span&gt;
Adding&lt;span class="w"&gt; &lt;/span&gt;EPD&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;32&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;7&lt;/span&gt;.3&lt;span class="w"&gt;  &lt;/span&gt;
Saved&lt;span class="w"&gt; &lt;/span&gt;python&lt;span class="w"&gt; &lt;/span&gt;switcher&lt;span class="w"&gt; &lt;/span&gt;bash&lt;span class="w"&gt; &lt;/span&gt;functions&lt;span class="w"&gt; &lt;/span&gt;to
/Users/username/.python_switchers.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;where I replaced my real username with username. As you can see I have
a lot of versions of python installed.&lt;br&gt;
Just source the .python_switchers.sh in your home directory and now
you should have all the versions of python available to you on a press
of a bash function really quickly. All that function is doing is adding
the version of python to the beginning of your path.&lt;br&gt;
Type &amp;#8216;typeset -F&amp;#8217; on the command line to see all bash functions
available. In my case I&amp;nbsp;see  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_epd_32_73&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_macpython_27&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_macpython_32&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_system_python_23&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_system_python_25&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_system_python_26&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nb"&gt;declare&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;select_system_python_27
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I can now use any of these functions to switch to any of the versions of
python installed on my laptop. Typing the function select_macpython_27
will make python 2.7.3 be my default&amp;nbsp;version.&lt;/p&gt;
&lt;p&gt;One other change I did to the script update_python_switchers.py was to
comment out code which was modifying my command prompt. I like my
default prompt. I can easily tell what is my version of python by
running the command &amp;#8216;python&amp;nbsp;&amp;#8212;version&amp;#8217;.&lt;/p&gt;
&lt;p&gt;In part 2 I will go through setting up virtualenv and&amp;nbsp;virtualenvwrapper..&lt;/p&gt;</content><category term="software"/><category term="mac"/><category term="python"/></entry><entry><title>My Code Editors on Mountain Lion</title><link href="https://www.nyayapati.com/srao/2012/08/my-code-editors-on-mountain-lion-2/" rel="alternate"/><published>2012-08-26T14:12:00-04:00</published><updated>2012-08-26T14:12:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-26:/srao/2012/08/my-code-editors-on-mountain-lion-2/</id><summary type="html">&lt;p&gt;I started playing with &lt;a href="http://www.sublimetext.com/2"&gt;sublimetext2&lt;/a&gt;
sometime before I upgraded to Mountain Lion. I liked it a lot. Specially
for python&amp;nbsp;programming.&lt;/p&gt;
&lt;p&gt;In order to be able to invoke it from the terminal, I created a sym link
to my bin directory. Just make sure your bin folder is in your …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I started playing with &lt;a href="http://www.sublimetext.com/2"&gt;sublimetext2&lt;/a&gt;
sometime before I upgraded to Mountain Lion. I liked it a lot. Specially
for python&amp;nbsp;programming.&lt;/p&gt;
&lt;p&gt;In order to be able to invoke it from the terminal, I created a sym link
to my bin directory. Just make sure your bin folder is in your path. You
can do that by adding this to your&amp;nbsp;.bash_profile  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The other editor I like to use is
&lt;a href="http://www.barebones.com/support/textwrangler/"&gt;TextWrangler&lt;/a&gt;. After I
installed it from the apple app store, I found out that the command line
tools are not available if you get this from the app store.. something
about not being upto apples standards. You can install the command line
tools by going to their
&lt;a href="http://www.barebones.com/support/textwrangler/"&gt;site&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Once installed, you now use the edit command to open textwrangler from
the&amp;nbsp;terminal.&lt;/p&gt;
&lt;p&gt;The below command will open the&amp;nbsp;file.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;edit&lt;span class="w"&gt; &lt;/span&gt;filename
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Something to keep in mind is that if you already have a textwrangler
session open, it will open the file in the same session. If you want a
new window use the following&amp;nbsp;command  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;edit&lt;span class="w"&gt; &lt;/span&gt;--new-window&lt;span class="w"&gt; &lt;/span&gt;filename
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you want multiple&amp;nbsp;files  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;edit&lt;span class="w"&gt; &lt;/span&gt;--separate-windows&lt;span class="w"&gt; &lt;/span&gt;file1&lt;span class="w"&gt; &lt;/span&gt;file2
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>No default Java on Mountain Lion</title><link href="https://www.nyayapati.com/srao/2012/08/no-default-java-on-mountain-lion/" rel="alternate"/><published>2012-08-26T00:29:00-04:00</published><updated>2012-08-26T00:29:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-26:/srao/2012/08/no-default-java-on-mountain-lion/</id><summary type="html">&lt;p&gt;I was trying to see what version of java shipped with mountain lion. So
I opened a terminal session and typed &amp;#8216;java -version&amp;#8217;. I was shocked to
see that there was no java. Instead I was greeted with a popup windows
with an option to install the 1.6 Java …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was trying to see what version of java shipped with mountain lion. So
I opened a terminal session and typed &amp;#8216;java -version&amp;#8217;. I was shocked to
see that there was no java. Instead I was greeted with a popup windows
with an option to install the 1.6 Java Run time.&lt;br&gt;
If one needs to get a jdk, one has to get it from oracle&amp;nbsp;now.&lt;/p&gt;</content><category term="software"/><category term="Java"/><category term="mac"/></entry><entry><title>Mountain Lion on my macbook pro</title><link href="https://www.nyayapati.com/srao/2012/08/mountain-lion-on-my-macbook-pro/" rel="alternate"/><published>2012-08-26T00:22:00-04:00</published><updated>2012-08-26T00:22:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-26:/srao/2012/08/mountain-lion-on-my-macbook-pro/</id><content type="html">&lt;p&gt;I just installed mountain lion on my macbook pro and starting to install
all my development tools. This time I plan to document all the things I
do for the sake of making&amp;nbsp;notes&amp;#8230;&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Setup Python 2.7, Django 1.4 with virtualenv and virtualenvwrapper on Bluehost</title><link href="https://www.nyayapati.com/srao/2012/08/setup-python-2-7-and-django-1-4-on-bluehost/" rel="alternate"/><published>2012-08-03T15:03:00-04:00</published><updated>2012-08-03T15:03:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-08-03:/srao/2012/08/setup-python-2-7-and-django-1-4-on-bluehost/</id><summary type="html">&lt;p&gt;I am pretty excited about learning django. As part of the development
process, I wanted to see what it takes to host a django app and thought
it would be a good exercise to try it out on my domain. In order to do
this, you need shell access. A …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I am pretty excited about learning django. As part of the development
process, I wanted to see what it takes to host a django app and thought
it would be a good exercise to try it out on my domain. In order to do
this, you need shell access. A very important point to make is that the
steps below have been edited slightly. I changed the location and my
username to be /home/username. You have to replace this to whatever is
your location and username on&amp;nbsp;bluehost.&lt;/p&gt;
&lt;p&gt;Here are the steps I took to first install Python. The reason I am doing
this is so I may have multiple versions of&amp;nbsp;python.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkdir python  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd python  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkdir src  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd src  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# wget http://www.python.org/ftp/python/2.7.3/Python-2.7.3.tgz  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# tar xvfz Python-2.7.3.tgz  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd Python-2.7.3  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/Python-2.7.3&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkdir ~/python/python27  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/Python-2.7.3&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# ./configure -prefix=/home/username/python/python27  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/Python-2.7.3&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# make  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/Python-2.7.3&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# make install  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/Python-2.7.3&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd ..&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now add the new python bin to your path by adding the following line to
your .bashrc&amp;nbsp;file  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;/python/python27/bin:&lt;span class="nv"&gt;$PATH&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Source the .bashrc file and use the which command to confirm the
location of&amp;nbsp;python  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# source ~/.bashrc  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# which python  &lt;/span&gt;
/home/username/python/python27/bin/python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now install pip to make life easy. The prerequisite is to install
setuptools&amp;nbsp;first.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# tar xvfz setuptools-0.6c11.tar.gz  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd setuptools-0.6c11  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/setuptools-0.6c11&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# python setup.py install  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/setuptools-0.6c11&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd ..  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# wget http://pypi.python.org/packages/source/p/pip/pip-1.1.tar.gz  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# tar xvfz pip-1.1.tar.gz  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd pip-1.1  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/pip-1.1&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# python setup.py install  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~/python/src/pip-1.1&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Using virtualenv and virtualenvwrapper makes development on multiple
projects so much better. I wont go into details here on why this is
good.. but trust me on this! Here are the instructions on installing
them&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# pip install virtualenv  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# pip install virtualenvwrapper&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Create a directory to keep all your virtual environments&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkdir .virtualenvs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now add virtualenvwrapper.sh script to your .bashrc files to add the
virtualenvwrapper functions to your environment. Add the following line
to your .bashrc. Don&amp;#8217;t forget the dot in front of the&amp;nbsp;path.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;.&lt;span class="w"&gt; &lt;/span&gt;/home/username/python/python27/bin/virtualenvwrapper.sh
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Source the .bashrc file to activate the functions. Then go ahead and
create your virtualenv. I am gonna call mine&amp;nbsp;mydjango.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# source .bashrc  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkvirtualenv mydjango&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Running the which command will tell you which python you are using.
Your prompt will also change to show the virtualenv you are&amp;nbsp;using.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# which python  &lt;/span&gt;
/home/username/.virtualenvs/mydjango/bin/python
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now go ahead install all the packages needed for Django while you are
in your&amp;nbsp;virtualenv.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# pip install Django  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# pip install MySQL-python  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# pip install flup&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now that all requirements are done, we can start our django project.
Lets start with creating a location where all your projects will live. I
chose to put this under django_projects in my home directory. I then go
in that directory and start a new project and call it&amp;nbsp;myproject.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkdir django_projects  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd django_projects  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/django_projects&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# django-admin.py startproject myproject&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I now create a directory in my public_html folder. This is so that the
project is visible using the url&amp;nbsp;http://www.mydomain.com/myproject  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/django_projects&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# mkdir ~/public_html/myproject  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/django_projects&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd ~/public_html/myproject&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now we will create an fcgi file in your public folder. Lets call it
mysite.fcgi. This is to redirect and execute your project. Make note of
the first line.. We need to point the script to the python in the
virtualenv we created earlier. We will also add the project and
virtualenv python instance to the python&amp;nbsp;path..  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#!/home/username/.virtualenvs/mydjango/bin/python  &lt;/span&gt;
import&lt;span class="w"&gt; &lt;/span&gt;sys,&lt;span class="w"&gt; &lt;/span&gt;os

&lt;span class="c1"&gt;# Add a custom Python path.  &lt;/span&gt;
sys.path.insert&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/home/username/.virtualenvs/mydjango&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
sys.path.insert&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="m"&gt;13&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;/home/username/django_projects/myproject&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
os.environ&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;DJANGO_SETTINGS_MODULE&amp;#39;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;myproject.settings&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
from&lt;span class="w"&gt; &lt;/span&gt;django.core.servers.fastcgi&lt;span class="w"&gt; &lt;/span&gt;import&lt;span class="w"&gt; &lt;/span&gt;runfastcgi&lt;span class="w"&gt;  &lt;/span&gt;
runfastcgi&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;threaded&amp;quot;&lt;/span&gt;,&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;daemonize&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;false&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Another point which I initially missed was when I created the file
mysite.fcgi. When setting the DJANGO_SETTINGS_MODULE, make sure it is
set to the name of your project. In this example, I put it as the same
name as my django project + .settings which is&amp;nbsp;myproject.settings.&lt;/p&gt;
&lt;p&gt;Make sure to set the permissions on the&amp;nbsp;file  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/public_html/myproject&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# chmod 755 mysite.fcgi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now create a .htaccess file in the same place&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;AddHandler&lt;span class="w"&gt; &lt;/span&gt;fcgid-script&lt;span class="w"&gt; &lt;/span&gt;.fcgi&lt;span class="w"&gt;  &lt;/span&gt;
RewriteEngine&lt;span class="w"&gt; &lt;/span&gt;On&lt;span class="w"&gt;  &lt;/span&gt;
RewriteCond&lt;span class="w"&gt; &lt;/span&gt;%&lt;span class="o"&gt;{&lt;/span&gt;REQUEST_FILENAME&lt;span class="o"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;!-f&lt;span class="w"&gt;  &lt;/span&gt;
RewriteRule&lt;span class="w"&gt; &lt;/span&gt;^&lt;span class="o"&gt;(&lt;/span&gt;.*&lt;span class="o"&gt;)&lt;/span&gt;$&lt;span class="w"&gt; &lt;/span&gt;mysite.fcgi/&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;QSA,L&lt;span class="o"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now turn off your virtualenv with the deactivate&amp;nbsp;command.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~/public_html/myproject&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# cd  &lt;/span&gt;
&lt;span class="o"&gt;(&lt;/span&gt;mydjango&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;# deactivate  &lt;/span&gt;
&lt;span class="o"&gt;[&lt;/span&gt;~&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="c1"&gt;#&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you go to http://www.yourdomain.com/myproject/ you should see
your standard Django-powered&amp;nbsp;page.&lt;/p&gt;
&lt;p&gt;Here are the sources I used to get this to work. Thanks for all the&amp;nbsp;help!  &lt;/p&gt;
&lt;p&gt;http://simplyargh.blogspot.com/2012/04/python-27-django-14-on-bluehost.html&lt;br&gt;&amp;nbsp;http://alextreppass.co.uk/getting-django-working-on-bluehost  &lt;/p&gt;
&lt;p&gt;http://blog.ruedaminute.com/2011/01/2011-installation-instructions-for-django-on-bluehost/&lt;/p&gt;</content><category term="software"/><category term="python"/></entry><entry><title>My take on Butter Chicken</title><link href="https://www.nyayapati.com/srao/2012/02/my-take-on-butter-chicken/" rel="alternate"/><published>2012-02-09T10:50:00-05:00</published><updated>2012-02-09T10:50:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2012-02-09:/srao/2012/02/my-take-on-butter-chicken/</id><summary type="html">&lt;p&gt;This is my favourite chicken dish of
all time! Not many restaurants in Boston serve this dish! The only place
I know of which even comes close to the same taste one would get in
delhi is Royal Bengal in Cambridge.. Here is my&amp;nbsp;version..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2009/11/Butter-Chicken.jpg"&gt;&lt;img alt="Butter Chicken" src="https://www.nyayapati.com/srao/wp-content/uploads/2006/07/Butter-Chicken.jpg" title="Butter Chicken"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;This dish is actually made …&lt;/p&gt;</summary><content type="html">&lt;p&gt;This is my favourite chicken dish of
all time! Not many restaurants in Boston serve this dish! The only place
I know of which even comes close to the same taste one would get in
delhi is Royal Bengal in Cambridge.. Here is my&amp;nbsp;version..&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2009/11/Butter-Chicken.jpg"&gt;&lt;img alt="Butter Chicken" src="https://www.nyayapati.com/srao/wp-content/uploads/2006/07/Butter-Chicken.jpg" title="Butter Chicken"&gt;&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;This dish is actually made from
tandoori chicken but who has a tandoor.. so this has been modified so it
can easily be made at home. For those who are vegetarian can just skip
the chicken and either put fried tofu or fresh Paneer. As we only get
frozen paneer in the indian stores, what I do is put the frozen paneer
in hot water which completely softens the&amp;nbsp;paneer.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Marinate for&amp;nbsp;Chicken&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cut 4 pounds of boneless skinless chicken thighs into bite size&amp;nbsp;pieces&lt;/li&gt;
&lt;li&gt;Season with 2 tsp salt, 1 tsp pepper, ¼ cup lemon juice, 2 table
    spoon ginger garlic paste and cover and put in ur fridge for 30&amp;nbsp;minutes&lt;/li&gt;
&lt;li&gt;Whisk ½ tsp red pepper powder, ½ tsp cumin powder, ¼ tsp turmeric
    pdr, 1tsp garam masala, 1 and ½ tsp coriander powder in 1-2 cups of
    yogurt and mix into the chicken. Put this back in the fridge for a
    couple of&amp;nbsp;hours.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Broil chicken&lt;/strong&gt;&lt;br&gt;
Spread the chicken in a drip tray and broil in the oven on high for 6-8
minutes on each side. Keep this&amp;nbsp;aside.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The&amp;nbsp;Curry&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Heat a heavy bottom pan.. add 2 table spoon of butter and about ½
    cup of cooking oil ( I used olive oil (not&amp;nbsp;evoo)).&lt;/li&gt;
&lt;li&gt;Once oil is hot add about 1 tsp fenugreek seeds and let it crackly a
    bit.. don’t burn this as this can give your dish a bitter&amp;nbsp;taster&lt;/li&gt;
&lt;li&gt;once the fenugreek seeds are a little darker than its normal color
    add 2 finely sliced onions. ( I only use red onions in Indian&amp;nbsp;cooking)&lt;/li&gt;
&lt;li&gt;Cook till it is soft and light brown.. We don’t want it to be
    completely&amp;nbsp;caramelized.&lt;/li&gt;
&lt;li&gt;Now add 2 table spoons of ginger garlic paste. It will make a world
    of a difference if you use fresh ginger garlic instead of the store&amp;nbsp;bought.&lt;/li&gt;
&lt;li&gt;Slit 2 Thai chili peppers and add that to your&amp;nbsp;pan&lt;/li&gt;
&lt;li&gt;Now add your dry spices at this point. I put in salt, red pepper
    powder, garam masala, coriander powder,&amp;nbsp;turmeric.&lt;/li&gt;
&lt;li&gt;keep mixing the onions and the spices you added and don’t let things
    stick to the pan. You also don’t want to over cook the spices you
    added. Maybe 30 seconds depending on the&amp;nbsp;heat.&lt;/li&gt;
&lt;li&gt;Add two cans of crushed tomatoes and mix the onions into the sauce.
    Give this a good boil and keep mixing making sure it doesn’t stick
    to the&amp;nbsp;pan.&lt;/li&gt;
&lt;li&gt;crush 2-3 tsp of kasoori methi (dried fenugreek leaves) in your
    hands and mix into the&amp;nbsp;pan&lt;/li&gt;
&lt;li&gt;Now add half a pint of light cream into the sauce and&amp;nbsp;mix.&lt;/li&gt;
&lt;li&gt;Bring it to a boil and then add the broiled&amp;nbsp;chicken.&lt;/li&gt;
&lt;li&gt;Another boil should finish the&amp;nbsp;dish.&lt;/li&gt;
&lt;/ul&gt;</content><category term="recipes"/><category term="chicken"/><category term="food"/></entry><entry><title>Tandoori Style Butter Chicken at Trader Joe’s</title><link href="https://www.nyayapati.com/srao/2011/10/tandoori-style-butter-chicken-at-trader-joes/" rel="alternate"/><published>2011-10-19T00:04:00-04:00</published><updated>2011-10-19T00:04:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-10-19:/srao/2011/10/tandoori-style-butter-chicken-at-trader-joes/</id><content type="html">&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2011/10/20111019-000337.jpg"&gt;&lt;img alt="20111019-000337.jpg" src="https://www.nyayapati.com/srao/wp-content/uploads/2011/10/20111019-000337.jpg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="restaurants"/></entry><entry><title>Time Machine backup to an SMB share</title><link href="https://www.nyayapati.com/srao/2011/06/time-machine-backup-to-an-smb-share/" rel="alternate"/><published>2011-06-16T14:55:00-04:00</published><updated>2011-06-16T14:55:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-06-16:/srao/2011/06/time-machine-backup-to-an-smb-share/</id><summary type="html">&lt;p&gt;If you wanted Time Machine to work with a &lt;span class="caps"&gt;SMB&lt;/span&gt; share you will notice that
it doesn&amp;#8217;t work. To get it to work run the following command on the&amp;nbsp;terminal  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;defaults&lt;span class="w"&gt; &lt;/span&gt;write&lt;span class="w"&gt; &lt;/span&gt;com.apple.systempreferences&lt;span class="w"&gt; &lt;/span&gt;TMShowUnsupportedNetworkVolumes&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now mount your &lt;span class="caps"&gt;SMB&lt;/span&gt; share. The best way to do this is …&lt;/p&gt;</summary><content type="html">&lt;p&gt;If you wanted Time Machine to work with a &lt;span class="caps"&gt;SMB&lt;/span&gt; share you will notice that
it doesn&amp;#8217;t work. To get it to work run the following command on the&amp;nbsp;terminal  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;defaults&lt;span class="w"&gt; &lt;/span&gt;write&lt;span class="w"&gt; &lt;/span&gt;com.apple.systempreferences&lt;span class="w"&gt; &lt;/span&gt;TMShowUnsupportedNetworkVolumes&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now mount your &lt;span class="caps"&gt;SMB&lt;/span&gt; share. The best way to do this is to click on
Go-&amp;gt;connect to server in the finder menubar. For the server name you
enter smb://username:password@servername/ShareName. I have a &lt;span class="caps"&gt;NAS&lt;/span&gt; share
which has a Guest account with no password so my address looks like
smb://Guest:@MyServer/HomeShare/TimeMachineBackup. Notice I have no
password as no password is required for the Guest account.&lt;br&gt;
Once mounted, Control click on the Time machine in the Dock and select
&amp;#8220;Time Machine Preferences&amp;#8221;. Once you select &amp;#8220;Choose Backup Disk&amp;#8221; you
should see your &lt;span class="caps"&gt;SMB&lt;/span&gt; Share. Select your &lt;span class="caps"&gt;SMB&lt;/span&gt; share and start your Time
Share.&lt;br&gt;
Once Time Machine backup starts, you will see an error saying that it
cannot create image error. This error message was expected as Time
machine could not create a file called a sparsebundle which is required
for it to work on the &lt;span class="caps"&gt;SMB&lt;/span&gt; share. For this to work correctly we will be
creating the sparsebundle manually. Turn off Time machine and go on to
the next&amp;nbsp;step.&lt;/p&gt;
&lt;p&gt;In your terminal find your mac address. You can do this with the
following&amp;nbsp;command  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ifconfig&lt;span class="w"&gt; &lt;/span&gt;en0&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;ether
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Make a note of the mac address without the colon symbol. For this
example lets assume my &lt;span class="caps"&gt;MAC&lt;/span&gt; address is 000000000000. Decide on how big
you want your Time Machine backup to be. Then run the hdiutil command to
create your sparsebundle file. Here is the command I created for a 200
Gigs share&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;hdiutil&lt;span class="w"&gt; &lt;/span&gt;create&lt;span class="w"&gt; &lt;/span&gt;-size&lt;span class="w"&gt; &lt;/span&gt;200g&lt;span class="w"&gt; &lt;/span&gt;-fs&lt;span class="w"&gt; &lt;/span&gt;HFS+J&lt;span class="w"&gt; &lt;/span&gt;-volname&lt;span class="w"&gt; &lt;/span&gt;“OSX&lt;span class="w"&gt; &lt;/span&gt;Backup”&lt;span class="w"&gt; &lt;/span&gt;mymac_000000000000.sparsebundle
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Where 000000000000 is my mac address and mymac is my mac&amp;nbsp;name.&lt;/p&gt;
&lt;p&gt;Now copy the sparsebundle file to the Nas share you want for your
backups. In my case I copied it to the TimeMachineBackup folder on my
&lt;span class="caps"&gt;NAS&lt;/span&gt;&amp;nbsp;Share.&lt;/p&gt;
&lt;p&gt;Go back to Time machine preferences and turn on Time machine. You should
now see that the backup starts up with no problems. Depending on what
you are backing up, the first time it runs it might take some&amp;nbsp;time.&lt;/p&gt;
&lt;p&gt;An important point to note is that for this to work your &lt;span class="caps"&gt;NAS&lt;/span&gt; Share needs
to be mounted. You can set Time machine to be manual so that way you can
make sure your &lt;span class="caps"&gt;SMB&lt;/span&gt; share is mounted before you click on the backup&amp;nbsp;button.&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Super Secret features and shortcuts for your MAC</title><link href="https://www.nyayapati.com/srao/2011/05/super-secret-features-and-shortcuts-for-your-mac/" rel="alternate"/><published>2011-05-18T15:28:00-04:00</published><updated>2011-05-18T15:28:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-05-18:/srao/2011/05/super-secret-features-and-shortcuts-for-your-mac/</id><content type="html">&lt;p&gt;http://mac.appstorm.net/how-to/os-x/30-super-secret-os-x-features-and-shortcuts/&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>terminal tips and tricks for Mac OS X</title><link href="https://www.nyayapati.com/srao/2011/05/terminal-tips-and-tricks-for-mac-os-x/" rel="alternate"/><published>2011-05-12T15:26:00-04:00</published><updated>2011-05-12T15:26:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-05-12:/srao/2011/05/terminal-tips-and-tricks-for-mac-os-x/</id><content type="html">&lt;p&gt;Some interesting tips and tricks for Mac &lt;span class="caps"&gt;OS&lt;/span&gt;&amp;nbsp;X  &lt;/p&gt;
&lt;p&gt;&lt;a href="http://apple.stackexchange.com/questions/5435/terminal-tips-and-tricks-for-mac-os-x"&gt;http://apple.stackexchange.com/questions/5435/terminal-tips-and-tricks-for-mac-os-x&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Mac Book Pro terminal prompt keeps changing</title><link href="https://www.nyayapati.com/srao/2011/05/mac-book-pro-terminal-prompt-keeps-changing/" rel="alternate"/><published>2011-05-03T11:00:00-04:00</published><updated>2011-05-03T11:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-05-03:/srao/2011/05/mac-book-pro-terminal-prompt-keeps-changing/</id><summary type="html">&lt;p&gt;It got really annoying for me to see how my terminal prompt kept
changing when I connected my Macbook from work. I know I can easily fix
this by setting my prompt in my .profile file, but I wanted to find out
why this was&amp;nbsp;happening.&lt;/p&gt;
&lt;p&gt;It turns out the …&lt;/p&gt;</summary><content type="html">&lt;p&gt;It got really annoying for me to see how my terminal prompt kept
changing when I connected my Macbook from work. I know I can easily fix
this by setting my prompt in my .profile file, but I wanted to find out
why this was&amp;nbsp;happening.&lt;/p&gt;
&lt;p&gt;It turns out the culprit is &lt;span class="caps"&gt;DHCP&lt;/span&gt;. By Default the hostname is determined
dynamically on your macbook. This setting can be controlled with your
/etc/hostconfig file. Here is what it looks like on my laptop&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="se"&gt;\#&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;This&lt;span class="w"&gt; &lt;/span&gt;file&lt;span class="w"&gt; &lt;/span&gt;is&lt;span class="w"&gt; &lt;/span&gt;going&lt;span class="w"&gt; &lt;/span&gt;away

&lt;span class="nv"&gt;AFPSERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-NO-&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;AUTHSERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-NO-&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;TIMESYNC&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-NO-&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;QTSSERVER&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;-NO-
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;To hard code a hostname, I just added &amp;#8220;&lt;span class="caps"&gt;HOSTNAME&lt;/span&gt;=MyMacBook&amp;#8221; (without the
quotes) to the end of the file.&lt;br&gt;
Some might consider the changing hostname a feature they might want.
Not me&amp;nbsp;;)&lt;/p&gt;</content><category term="software"/><category term="mac"/></entry><entry><title>Convert uploaded file with windows line ending to unix line ending using php</title><link href="https://www.nyayapati.com/srao/2011/04/convert-uploaded-file-with-windows-line-ending-to-unix-line-ending-using-php/" rel="alternate"/><published>2011-04-01T11:56:00-04:00</published><updated>2011-04-01T11:56:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-04-01:/srao/2011/04/convert-uploaded-file-with-windows-line-ending-to-unix-line-ending-using-php/</id><summary type="html">&lt;p&gt;I was working on a php project which involved in uploading a tab
delimited file and then processing it with php on a unix webserver to
insert data into a database. The file was produced on a windows machine
and so it had windows line endings. I used this trick …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I was working on a php project which involved in uploading a tab
delimited file and then processing it with php on a unix webserver to
insert data into a database. The file was produced on a windows machine
and so it had windows line endings. I used this trick to strip off the
carriage return and line feed characters from each line of the&amp;nbsp;file  &lt;/p&gt;
&lt;p&gt;Here is my html form&amp;nbsp;code  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt; &lt;span class="na"&gt;action&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;process.php&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;post&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;enctype&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;multipart/form-data&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;import_form&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;  
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;action&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;import&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;  
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;file&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;import_file&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;  
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;br&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;  
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;input&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;button&amp;quot;&lt;/span&gt; &lt;span class="na"&gt;value&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Import&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;  
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;form&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here is my code for&amp;nbsp;process.php  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="x"&gt;if(isset($_POST[&amp;#39;action&amp;#39;]) &amp;amp;&amp;amp; ($_POST[&amp;#39;action&amp;#39;] == &amp;#39;import&amp;#39;)) {  &lt;/span&gt;
&lt;span class="x"&gt;    if (is_uploaded_file($_FILES[&amp;#39;import_file&amp;#39;][&amp;#39;tmp_name&amp;#39;])) {&lt;/span&gt;

&lt;span class="x"&gt;        // Move the file into an accessible location.  &lt;/span&gt;
&lt;span class="x"&gt;        $buffer =&lt;/span&gt;
&lt;span class="x"&gt;        trim(implode(&amp;quot;&amp;quot;,file($_FILES[&amp;#39;import_file&amp;#39;][&amp;#39;tmp_name&amp;#39;])));&lt;/span&gt;

&lt;span class="x"&gt;        // Convert all line-endings to UNIX format  &lt;/span&gt;
&lt;span class="x"&gt;        $buffer = str_replace(&amp;quot;\r\n&amp;quot;, &amp;quot;\n&amp;quot;, $buffer);  &lt;/span&gt;
&lt;span class="x"&gt;        $buffer = str_replace(&amp;quot;\r&amp;quot;, &amp;quot;\n&amp;quot;, $buffer);&lt;/span&gt;

&lt;span class="x"&gt;        //code for processing $buffer&lt;/span&gt;

&lt;span class="x"&gt;    else {  &lt;/span&gt;
&lt;span class="x"&gt;        echo &amp;quot;&amp;lt;p class=\&amp;quot;Error\&amp;quot;&amp;gt;File Upload Failed.&amp;lt;/p&amp;gt;&amp;quot;;  &lt;/span&gt;
&lt;span class="x"&gt;    }  &lt;/span&gt;
&lt;span class="x"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="php"/><category term="tips"/></entry><entry><title>Argument list too long</title><link href="https://www.nyayapati.com/srao/2011/03/argument-list-too-long/" rel="alternate"/><published>2011-03-29T20:02:00-04:00</published><updated>2011-03-29T20:02:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-03-29:/srao/2011/03/argument-list-too-long/</id><summary type="html">&lt;p&gt;Ever tried to copy or move a bunch of files on unix/linux from one
location to another and see this error message spit out back at&amp;nbsp;you??  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;/var/www/*&lt;span class="w"&gt; &lt;/span&gt;/var/tmp&lt;span class="w"&gt;  &lt;/span&gt;
-bash:&lt;span class="w"&gt; &lt;/span&gt;/bin/cp:&lt;span class="w"&gt; &lt;/span&gt;Argument&lt;span class="w"&gt; &lt;/span&gt;list&lt;span class="w"&gt; &lt;/span&gt;too&lt;span class="w"&gt; &lt;/span&gt;long
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class="caps"&gt;UNIX&lt;/span&gt; find to the&amp;nbsp;rescue&amp;#8230;  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;find&lt;span class="w"&gt; &lt;/span&gt;/var/www&lt;span class="w"&gt; &lt;/span&gt;-type&lt;span class="w"&gt; &lt;/span&gt;f …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Ever tried to copy or move a bunch of files on unix/linux from one
location to another and see this error message spit out back at&amp;nbsp;you??  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;/var/www/*&lt;span class="w"&gt; &lt;/span&gt;/var/tmp&lt;span class="w"&gt;  &lt;/span&gt;
-bash:&lt;span class="w"&gt; &lt;/span&gt;/bin/cp:&lt;span class="w"&gt; &lt;/span&gt;Argument&lt;span class="w"&gt; &lt;/span&gt;list&lt;span class="w"&gt; &lt;/span&gt;too&lt;span class="w"&gt; &lt;/span&gt;long
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class="caps"&gt;UNIX&lt;/span&gt; find to the&amp;nbsp;rescue&amp;#8230;  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;find&lt;span class="w"&gt; &lt;/span&gt;/var/www&lt;span class="w"&gt; &lt;/span&gt;-type&lt;span class="w"&gt; &lt;/span&gt;f&lt;span class="w"&gt; &lt;/span&gt;-name&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;*&amp;#39;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-exec&lt;span class="w"&gt; &lt;/span&gt;cp&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;{}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;/var/tmp/.&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;problem&amp;nbsp;solved!&lt;/p&gt;</content><category term="software"/><category term="tips"/><category term="unix"/></entry><entry><title>MAMP - mysqlcheck: Got error: 1045</title><link href="https://www.nyayapati.com/srao/2011/03/mamp-mysqlcheck-got-error-1045/" rel="alternate"/><published>2011-03-28T13:18:00-04:00</published><updated>2011-03-28T13:18:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-03-28:/srao/2011/03/mamp-mysqlcheck-got-error-1045/</id><summary type="html">&lt;p&gt;I started seeing the following error every time I started &lt;span class="caps"&gt;MAMP&lt;/span&gt;. This
began after I changed the root password for my &lt;span class="caps"&gt;MAMP&lt;/span&gt; installation on my
&lt;span class="caps"&gt;MBP&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2011/03/Screen-shot-2011-03-28-at-1.10.32-PM.png"&gt;&lt;img alt="Mamp Error Msg" src="https://www.nyayapati.com/srao/wp-content/uploads/2011/03/Screen-shot-2011-03-28-at-1.10.32-PM-300x151.png" title="MAMP Error msg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access
denied for user &amp;#39;root&amp;#39;@&amp;#39;localhost&amp;#39; (using password: YES) when trying to
connect
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It turns out …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I started seeing the following error every time I started &lt;span class="caps"&gt;MAMP&lt;/span&gt;. This
began after I changed the root password for my &lt;span class="caps"&gt;MAMP&lt;/span&gt; installation on my
&lt;span class="caps"&gt;MBP&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2011/03/Screen-shot-2011-03-28-at-1.10.32-PM.png"&gt;&lt;img alt="Mamp Error Msg" src="https://www.nyayapati.com/srao/wp-content/uploads/2011/03/Screen-shot-2011-03-28-at-1.10.32-PM-300x151.png" title="MAMP Error msg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;/Applications/MAMP/Library/bin/mysqlcheck: Got error: 1045: Access
denied for user &amp;#39;root&amp;#39;@&amp;#39;localhost&amp;#39; (using password: YES) when trying to
connect
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It turns out that the default password is hard coded in different
scripts under &amp;#8216;/Applications/&lt;span class="caps"&gt;MAMP&lt;/span&gt;/bin&amp;#8217;. In my case the script
quickCheckMysqlUpgrade.sh. Just edit the script to have the correct
password and you wont see the annoying message&amp;nbsp;again.&lt;/p&gt;</content><category term="software"/><category term="php"/></entry><entry><title>Join multiple mpg files into one file</title><link href="https://www.nyayapati.com/srao/2011/03/join-multiple-mpg-files-into-one-file/" rel="alternate"/><published>2011-03-23T22:19:00-04:00</published><updated>2011-03-23T22:19:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-03-23:/srao/2011/03/join-multiple-mpg-files-into-one-file/</id><summary type="html">&lt;p&gt;I did not realize how easy it is to join mpeg files with just the
windows copy command or unix cat&amp;nbsp;command.&lt;/p&gt;
&lt;p&gt;On windows the trick is to copy the files while preserving the binary
format. Here is how you would do it&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;copy files1.mpg /b + files2.mpg /b …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;I did not realize how easy it is to join mpeg files with just the
windows copy command or unix cat&amp;nbsp;command.&lt;/p&gt;
&lt;p&gt;On windows the trick is to copy the files while preserving the binary
format. Here is how you would do it&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;copy files1.mpg /b + files2.mpg /b joinedfile.mpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You could also do the following if the files are named&amp;nbsp;consecutively  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;copy file*.mpg /b joinedfile.mpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;On &lt;span class="caps"&gt;UNIX&lt;/span&gt; it couldn&amp;#8217;t be any&amp;nbsp;simpler..  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cat&lt;span class="w"&gt; &lt;/span&gt;file1.mpg&lt;span class="w"&gt; &lt;/span&gt;file2.mpg&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;joinedfile.mpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;or  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;cat&lt;span class="w"&gt; &lt;/span&gt;file*.mpg&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;joinedfile.mpg
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="mpeg"/><category term="tips"/><category term="videos"/></entry><entry><title>SSH aliases</title><link href="https://www.nyayapati.com/srao/2011/03/ssh-aliases/" rel="alternate"/><published>2011-03-23T13:07:00-04:00</published><updated>2011-03-23T13:07:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2011-03-23:/srao/2011/03/ssh-aliases/</id><summary type="html">&lt;p&gt;I constantly connect to linux or unix machines using ssh and it can get
a little bothersome typing out the &lt;span class="caps"&gt;IP&lt;/span&gt; address repeatedly. Here is the
typical syntax to connect to a linux box (random &lt;span class="caps"&gt;IP&lt;/span&gt;&amp;nbsp;address)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;username@111.11.11.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now imagine typing this again and again …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I constantly connect to linux or unix machines using ssh and it can get
a little bothersome typing out the &lt;span class="caps"&gt;IP&lt;/span&gt; address repeatedly. Here is the
typical syntax to connect to a linux box (random &lt;span class="caps"&gt;IP&lt;/span&gt;&amp;nbsp;address)&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;username@111.11.11.1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now imagine typing this again and again. Thats where the ssh config file
comes to the rescue. You can create aliases to make your connections
easy. The template for the config file \~/.ssh/config&amp;nbsp;is&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Host&lt;span class="w"&gt; &lt;/span&gt;domain&lt;span class="w"&gt;  &lt;/span&gt;
HostName&lt;span class="w"&gt; &lt;/span&gt;domain.com&lt;span class="w"&gt;  &lt;/span&gt;
User&lt;span class="w"&gt; &lt;/span&gt;username
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The HostName can be either an &lt;span class="caps"&gt;IP&lt;/span&gt; address or an actual hostname. So for
our example above our config file \~/.ssh/config will&amp;nbsp;be  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Host&lt;span class="w"&gt; &lt;/span&gt;myserver&lt;span class="w"&gt;  &lt;/span&gt;
HostName&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;111&lt;/span&gt;.11.11.1&lt;span class="w"&gt;  &lt;/span&gt;
User&lt;span class="w"&gt; &lt;/span&gt;username
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So now all you have to do is type the following on your command prompt
to directly connect and get prompted for a&amp;nbsp;password.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;myserver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can create as many aliases as you want. You can also override the
settings of the config file on the command line. For instance if you
want to connect using a different user, you can do the&amp;nbsp;following  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;diff_user@myserver
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can also specify your &lt;span class="caps"&gt;SSH&lt;/span&gt; keys for the server in your config file
as shown below so you don&amp;#8217;t have to enter your&amp;nbsp;password  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Host&lt;span class="w"&gt; &lt;/span&gt;myserver&lt;span class="w"&gt;  &lt;/span&gt;
HostName&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;111&lt;/span&gt;.11.11.1&lt;span class="w"&gt;  &lt;/span&gt;
User&lt;span class="w"&gt; &lt;/span&gt;username&lt;span class="w"&gt;  &lt;/span&gt;
IdentityFile&lt;span class="w"&gt; &lt;/span&gt;~/.ssh/id_dsa
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Click &lt;a href="http://oreilly.com/pub/h/66"&gt;here&lt;/a&gt; or
&lt;a href="http://www.csua.berkeley.edu/~ranga/notes/ssh_nopass.html"&gt;here&lt;/a&gt; to
read how to generate and use &lt;span class="caps"&gt;SSH&lt;/span&gt;&amp;nbsp;keys.&lt;/p&gt;</content><category term="software"/><category term="cli"/><category term="tips"/><category term="unix"/></entry><entry><title>Unix tar tricks</title><link href="https://www.nyayapati.com/srao/2010/08/unix-tar-tricks/" rel="alternate"/><published>2010-08-31T10:10:00-04:00</published><updated>2010-08-31T10:10:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-08-31:/srao/2010/08/unix-tar-tricks/</id><summary type="html">&lt;p&gt;One of the most common programs on Linux systems for packaging files is
the venerable tar. tar is short for tape archive, and originally, it
would archive your files to a tape device. Now, you&amp;#8217;re more likely to
use a file to make your archive. To use a tarfile …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One of the most common programs on Linux systems for packaging files is
the venerable tar. tar is short for tape archive, and originally, it
would archive your files to a tape device. Now, you&amp;#8217;re more likely to
use a file to make your archive. To use a tarfile, use the command-line
option -f . To create a new tarfile, use the command-line option -c. To
extract files from a tarfile, use the option -x. You also can compress
the resulting tarfile via two methods. To use bzip2, use the -j option,
or for gzip, use the -z&amp;nbsp;option.&lt;/p&gt;
&lt;p&gt;Instead of using a tarfile, you can output your tarfile to stdout or
input your tarfile from stdin by using a hyphen (-). With these options,
you can tar up a directory and all of its subdirectories by&amp;nbsp;using:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;cf&lt;span class="w"&gt; &lt;/span&gt;archive.tar&lt;span class="w"&gt; &lt;/span&gt;dir
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Then, extract it in another directory&amp;nbsp;with:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;xf&lt;span class="w"&gt; &lt;/span&gt;archive.tar
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;When creating a tarfile, you can assign a volume name with the
option -V . You can move an entire directory structure with tar by&amp;nbsp;executing:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;cf&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;dir1&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;cd&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;dir2&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;tar&lt;span class="w"&gt; &lt;/span&gt;xf&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;You can go even farther and move an entire directory structure over the
network by&amp;nbsp;executing:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;cf&lt;span class="w"&gt; &lt;/span&gt;-&lt;span class="w"&gt; &lt;/span&gt;dir1&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;remote&lt;span class="se"&gt;\_&lt;/span&gt;host&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;( cd /path/to/dir2; tar xf - )&amp;quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;span class="caps"&gt;GNU&lt;/span&gt; tar includes an option that lets you skip the cd part, -C
/path/to/dest. You also can interact with tarfiles over the network by
including a host part to the tarfile name. For&amp;nbsp;example:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;cvf&lt;span class="w"&gt; &lt;/span&gt;username@remotehost:/path/to/dest/archive.tar&lt;span class="w"&gt; &lt;/span&gt;dir1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is done by using rsh as the communication mechanism. If you want
to use something else, like ssh, use the command-line
option &amp;#8212;rsh-command &lt;span class="caps"&gt;CMD&lt;/span&gt;. Sometimes, you also may need to give the path
to the rmt executable on the remote host. On some hosts, it won&amp;#8217;t be in
the default location /usr/sbin/rmt. So, all together, this would look&amp;nbsp;like:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;-c&lt;span class="w"&gt; &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;--rsh-command&lt;span class="w"&gt; &lt;/span&gt;ssh&lt;span class="w"&gt; &lt;/span&gt;--rmt-command&lt;span class="w"&gt; &lt;/span&gt;/sbin/rmt&lt;span class="w"&gt; &lt;/span&gt;-f&lt;span class="w"&gt; &lt;/span&gt;username@host:/path/to/dest/archive.tar&lt;span class="w"&gt; &lt;/span&gt;dir1
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Although tar originally used to write its archive to a tape drive, it
can be used to write to any device. For example, if you want to get a
dump of your current filesystem to a secondary hard drive,&amp;nbsp;use:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;-cvzf&lt;span class="w"&gt; &lt;/span&gt;/dev/hdd&lt;span class="w"&gt; &lt;/span&gt;/
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Of course, you need to run the above command as root. If you are
writing your tarfile to a device that is too small, you can tell tar to
do a multivolume archive with the -M option. For those of you who are
old enough to remember floppy disks, you can back up your home directory
to a series of floppy disks by&amp;nbsp;executing:  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;tar&lt;span class="w"&gt; &lt;/span&gt;-cvMf&lt;span class="w"&gt; &lt;/span&gt;/dev/fd0&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="se"&gt;\$&lt;/span&gt;HOME
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;If you are doing backups, you may want to preserve the file
permissions. You can do this with the -p option. If you have symlinked
files on your filesystem, you can dereference the symlinks with the -h
option. This tells tar actually to dump the file that the symlink points
to, not just the&amp;nbsp;symlink.&lt;/p&gt;
&lt;p&gt;Along the same lines, if you have several filesystems mounted, you can
tell tar to stick to only one filesystem with the option -l. Hopefully,
this gives you lots of ideas for ways to archive your&amp;nbsp;files.&lt;/p&gt;
&lt;p&gt;Source - &lt;a href="http://www.linuxjournal.com/content/stupid-tar-tricks"&gt;http://www.linuxjournal.com/content/stupid-tar-tricks&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="unix"/></entry><entry><title>Windows registry repair</title><link href="https://www.nyayapati.com/srao/2010/06/windows-registry-repair/" rel="alternate"/><published>2010-06-28T07:52:00-04:00</published><updated>2010-06-28T07:52:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-06-28:/srao/2010/06/windows-registry-repair/</id><summary type="html">&lt;p&gt;I found this wonderful free tool to repair registry problems.. It&amp;#8217;s just
simply called registry repair! Saw some good reviews and it is dead
simple to use.. Just scan your registry and you will see a list of
potential problems. You can then fix and repair the problem right …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I found this wonderful free tool to repair registry problems.. It&amp;#8217;s just
simply called registry repair! Saw some good reviews and it is dead
simple to use.. Just scan your registry and you will see a list of
potential problems. You can then fix and repair the problem right there.
Here is a link for it -
&lt;a href="http://www.glarysoft.com/rr.html"&gt;http://www.glarysoft.com/rr.html&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="windows"/></entry><entry><title>Best Gyro in Boston</title><link href="https://www.nyayapati.com/srao/2010/04/best-gyro-in-boston/" rel="alternate"/><published>2010-04-22T12:06:00-04:00</published><updated>2010-04-22T12:06:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-04-22:/srao/2010/04/best-gyro-in-boston/</id><summary type="html">&lt;p&gt;My quest for the best gyro sandwich is over!! Mick from
timony.com/mickzblog pointed me to Zo Boston after seeing my yelp
postings on other gyro places I had been to.&lt;br&gt;
I fell in love with the first bite. The sandwich is soo tasty!! Don&amp;#8217;t
know if it …&lt;/p&gt;</summary><content type="html">&lt;p&gt;My quest for the best gyro sandwich is over!! Mick from
timony.com/mickzblog pointed me to Zo Boston after seeing my yelp
postings on other gyro places I had been to.&lt;br&gt;
I fell in love with the first bite. The sandwich is soo tasty!! Don&amp;#8217;t
know if it is the tzatiki sauce or the fresh warm pita bread or the
tasty pork meat.. Maybe it&amp;#8217;s the combination of all the ingredients&amp;#8230;
It doesn&amp;#8217;t matter.. What matters is how tasty this sandwich&amp;nbsp;is!!&lt;/p&gt;
&lt;p&gt;Zo Boston is different from other gyro places.. The way they are
different is because of how they cook and add the meat to the sandwich.
Other places have strips of meat in their sandwich whereas Zo shreds
it&amp;#8217;s pork&amp;nbsp;meat!!&lt;/p&gt;
&lt;p&gt;The last time I was there, I found out that they also serve a chicken
and pork combination Gyro sandwich&amp;#8230; Man!! I love it when places have
secret menu items.. It makes the experiance even more fun!! I can&amp;#8217;t wait
to go back and try the chicken and pork combination&amp;nbsp;Gyro!!&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2010/04/p_1600_1200_8B099230-3A71-443D-89E9-A098081BBCBA.jpeg"&gt;&lt;img alt="Gyro" src="https://www.nyayapati.com/srao/wp-content/uploads/2010/04/p_1600_1200_8B099230-3A71-443D-89E9-A098081BBCBA.jpeg"&gt;&lt;/a&gt;&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>Rotini with cheese and cream</title><link href="https://www.nyayapati.com/srao/2010/03/rotini-with-cheese-and-cream/" rel="alternate"/><published>2010-03-29T20:08:00-04:00</published><updated>2010-03-29T20:08:00-04:00</updated><author><name>priya</name></author><id>tag:www.nyayapati.com,2010-03-29:/srao/2010/03/rotini-with-cheese-and-cream/</id><summary type="html">&lt;p&gt;Pasta is comfort food for me, specially white sauce pasta. I try to make
the cooking exciting by changing the recipe at times. Some times I add
tomato sauce to it or there are time when I have even tried to use
cooking wine to my white sauce. I came …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Pasta is comfort food for me, specially white sauce pasta. I try to make
the cooking exciting by changing the recipe at times. Some times I add
tomato sauce to it or there are time when I have even tried to use
cooking wine to my white sauce. I came across this recipe in one of the
abundant cook books we have at home. I changed a few things on it and
added few ingredients like garlic, chilly flakes etc to make it more&amp;nbsp;flavorful.&lt;/p&gt;
&lt;p&gt;The recipe goes like this&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;Ingredients&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Rotini                                             1&amp;nbsp;pound  &lt;/li&gt;
&lt;li&gt;Egg yolks&amp;nbsp;3  &lt;/li&gt;
&lt;li&gt;Freshly grated Parmesan cheese                     7&amp;nbsp;tablespoon  &lt;/li&gt;
&lt;li&gt;Ricotta Cheese                                     1&amp;nbsp;cup  &lt;/li&gt;
&lt;li&gt;Light Cream                                        4&amp;nbsp;tablespoon  &lt;/li&gt;
&lt;li&gt;Butter                                             3&amp;nbsp;tablespoon  &lt;/li&gt;
&lt;li&gt;Onion (sliced)&amp;nbsp;1  &lt;/li&gt;
&lt;li&gt;Green peppers&amp;nbsp;1  &lt;/li&gt;
&lt;li&gt;Salt, red chilly flakes and pepper per your&amp;nbsp;taste&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Method&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cook pasta as per&amp;nbsp;instruction&lt;/li&gt;
&lt;li&gt;Meanwhile mix the egg york, grated Parmesan and ricotta cheese in a
    bowl. Add the cream and mix it with a&amp;nbsp;fork.&lt;/li&gt;
&lt;li&gt;Melt butter in a pan. Saute garlic. Add onions and fry till golden&amp;nbsp;brown&lt;/li&gt;
&lt;li&gt;Add green pepper and salt. Cover and cook till the green peppers are&amp;nbsp;tender.&lt;/li&gt;
&lt;li&gt;Add the cream sauce and then add&amp;nbsp;pasta.&lt;/li&gt;
&lt;li&gt;You can add black pepper and red chilly flakes according to your&amp;nbsp;taste.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This pasta has to be eaten hot as soon as it is cooked. The sauce tend
to thicken if you&amp;nbsp;wait.&lt;/p&gt;</content><category term="recipes"/><category term="pasta"/></entry><entry><title>Convert AVCHD video to MPEG-2</title><link href="https://www.nyayapati.com/srao/2010/03/convert-avchd-video-to-mpeg-2/" rel="alternate"/><published>2010-03-29T09:00:00-04:00</published><updated>2010-03-29T09:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-29:/srao/2010/03/convert-avchd-video-to-mpeg-2/</id><summary type="html">&lt;p&gt;I have a Canon H100 video camera. This records high definition 1080p
videos in a digital video format called &lt;span class="caps"&gt;AVCHD&lt;/span&gt;. It has been a pain to
watch these videos. First of all, these videos don&amp;#8217;t even play properly
on my single core &lt;span class="caps"&gt;PC&lt;/span&gt;. My 3-4 year old &lt;span class="caps"&gt;PC&lt;/span&gt; is …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I have a Canon H100 video camera. This records high definition 1080p
videos in a digital video format called &lt;span class="caps"&gt;AVCHD&lt;/span&gt;. It has been a pain to
watch these videos. First of all, these videos don&amp;#8217;t even play properly
on my single core &lt;span class="caps"&gt;PC&lt;/span&gt;. My 3-4 year old &lt;span class="caps"&gt;PC&lt;/span&gt; is just not powerful enough.
The video is choppy and jittery.. It is completely unwatachable. I have
been watching these by copying the files to my camera and then connect
it to my &lt;span class="caps"&gt;TV&lt;/span&gt;. If I had a &lt;span class="caps"&gt;PS3&lt;/span&gt;, I could take my memory card and plug it
directly and watch these videos. But I don&amp;#8217;t have a &lt;span class="caps"&gt;PS3&lt;/span&gt;. I normally use
my legacy xbox which has &lt;span class="caps"&gt;XBMC&lt;/span&gt; installed, to watch and listen to my
media. It sucks big time that I can&amp;#8217;t watch my &lt;span class="caps"&gt;AVCHD&lt;/span&gt; videos through my&amp;nbsp;xbox.&lt;/p&gt;
&lt;p&gt;So the only way I can watch these &lt;span class="caps"&gt;AVCHD&lt;/span&gt; videos is to convert it to
either an &lt;span class="caps"&gt;MPEG&lt;/span&gt; or &lt;span class="caps"&gt;AVI&lt;/span&gt; format. I know.. I know.. I am loosing video
quality by down converting these videos&amp;#8230; but till the time I can find
a better way to watch these videos&amp;#8230; thats what I am going to do. I did
find a script at
&lt;a href="http://forum.videohelp.com/threads/267544-Viewing-AVCHD-format-on-PC"&gt;videohelp.com&lt;/a&gt;
which was using some freeware tools.. But in my opinion the process was
still painfull. My ideal tool would be to take these &lt;span class="caps"&gt;AVCHD&lt;/span&gt; files and
either convert them to &lt;span class="caps"&gt;AVI&lt;/span&gt;/&lt;span class="caps"&gt;MPEG&lt;/span&gt; or to burn them to a &lt;span class="caps"&gt;DVD&lt;/span&gt; directly. Did I
mention, I want this to be free too ;). You could also pay \$50.00 for
&lt;a href="http://www.vso-software.fr/products/convert_x_to_dvd/"&gt;ConvertXtoDVD&lt;/a&gt;which
does that for&amp;nbsp;you.&lt;/p&gt;
&lt;p&gt;Another option is to create an &lt;span class="caps"&gt;AVCHD&lt;/span&gt; &lt;span class="caps"&gt;DVD&lt;/span&gt; which will play directly on a
blue ray player or a &lt;span class="caps"&gt;PS3&lt;/span&gt;. Scott Johnson, &lt;span class="caps"&gt;CEO&lt;/span&gt; of AtTask has a script on
his
&lt;a href="http://saas-ppm.blogspot.com/2008/11/playing-avcdh-content-on-blu-ray.html"&gt;blog&lt;/a&gt;
which will create the &lt;span class="caps"&gt;DVD&lt;/span&gt; disc which will play on a blue ray&amp;nbsp;player.&lt;/p&gt;
&lt;p&gt;I got my camera in 2007 and in 2010 I have finally found a software
which does the video conversion for me. It&amp;#8217;s called &lt;a href="http://www.koyotesoft.com/indexEn.html"&gt;Free &lt;span class="caps"&gt;HD&lt;/span&gt; Converter
V1.6&lt;/a&gt;.&lt;br&gt;
The software works on my old machine.. It&amp;#8217;s not fast but I just batch
all the videos and a couple of hours later, I have the converted MpEG
files. I wish this tools would stitch the many generated mpeg files
together too. Maybe it does and I haven&amp;#8217;t found the setting! I can now
burn a &lt;span class="caps"&gt;DVD&lt;/span&gt; from the Mpeg files and send the videos of my new born to my
Mom or upload to YouTube&amp;nbsp;directly!!&lt;/p&gt;
&lt;p&gt;Next step is to convert all my &lt;span class="caps"&gt;AVCHD&lt;/span&gt; videos to &lt;span class="caps"&gt;MPEG&lt;/span&gt;. Now only if
somebody could just do that for me too&amp;nbsp;;)&lt;/p&gt;</content><category term="software"/><category term="tips"/><category term="videos"/></entry><entry><title>Wake up your PC from your xbox using xbmc</title><link href="https://www.nyayapati.com/srao/2010/03/wake-up-your-pc-from-your-xbox-using-xbmc/" rel="alternate"/><published>2010-03-26T08:00:00-04:00</published><updated>2010-03-26T08:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-26:/srao/2010/03/wake-up-your-pc-from-your-xbox-using-xbmc/</id><summary type="html">&lt;p&gt;I read an old
&lt;a href="http://lifehacker.com/348197/access-your-computer-anytime-and-save-energy-with-wake+on+lan"&gt;lifehacker&lt;/a&gt;
article on wake-on-lan the other day and decided I should try it on my
home network. After using the free tool &lt;a href="http://magicpacket.free.fr/"&gt;Magic Packet
Sender&lt;/a&gt; mentioned in the article
successfully, I thought how cool would it be to start my media server
from my xbox. I …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I read an old
&lt;a href="http://lifehacker.com/348197/access-your-computer-anytime-and-save-energy-with-wake+on+lan"&gt;lifehacker&lt;/a&gt;
article on wake-on-lan the other day and decided I should try it on my
home network. After using the free tool &lt;a href="http://magicpacket.free.fr/"&gt;Magic Packet
Sender&lt;/a&gt; mentioned in the article
successfully, I thought how cool would it be to start my media server
from my xbox. I use my xbox as my media center. I know&amp;#8230; using the xbox
is old news and it is not powerful enough for hi-definition videos&amp;#8230;
but still.. I like my xbox and am not willing to get rid of it yet. Till
something better and cheap comes along, I am going to continue using it.
My brother bought the Acer Aspire Revo (&lt;span class="caps"&gt;AR3610&lt;/span&gt;-U9022) which comes with
the Intel Atom 330 processor. I like it a lot and boxee and xbmc both
work really well. Streaming 1080p video works flawlessly. Hulu desktop
works too, but you have to use the adobe flash 10.1 beta drivers for the
video to work. let&amp;#8217;s see what path I&amp;nbsp;take.&lt;/p&gt;
&lt;p&gt;Going back to my little project, I thought I will study what is involved
in sending a wake-on-lan packet to a &lt;span class="caps"&gt;PC&lt;/span&gt; to wake it up. I read the
lifehacker article in detail and then googled for other resourses. I
came across a really nice &lt;a href="http://www.jibble.org/wake-on-lan/"&gt;resource&lt;/a&gt;
which explained how the wake-on-lan packet is constructed along with a
sample java program. I also found, I am not the only person who thought
about using this technology to start their media server from their xbox.
I found this script in the forums at xbmc.org. Here you go&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="c1"&gt;# Wake-On-LAN  &lt;/span&gt;
&lt;span class="c1"&gt;#  &lt;/span&gt;
&lt;span class="c1"&gt;# Copyright (C) 2002 by Micro Systems Marc Balmer  &lt;/span&gt;
&lt;span class="c1"&gt;# Written by Marc Balmer, marc@msys.ch, http://www.msys.ch/  &lt;/span&gt;
&lt;span class="c1"&gt;# This code is free software under the GPL&lt;/span&gt;

&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;struct&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;socket&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;WakeOnLan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ethernet_address&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;

&lt;span class="c1"&gt;# Construct a six-byte hardware address&lt;/span&gt;

&lt;span class="n"&gt;addr_byte&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ethernet_address&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;split&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;:&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;hw_addr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;struct&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;pack&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;BBBBBB&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr_byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  
&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr_byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  
&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr_byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  
&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr_byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  
&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr_byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;  
&lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;addr_byte&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# Build the Wake-On-LAN &amp;quot;Magic Packet&amp;quot;...&lt;/span&gt;

&lt;span class="n"&gt;msg&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;&lt;/span&gt;&lt;span class="se"&gt;\xff&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;hw_addr&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;

&lt;span class="c1"&gt;# ...and send it to the broadcast address using UDP&lt;/span&gt;

&lt;span class="n"&gt;s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AF_INET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SOCK_DGRAM&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;setsockopt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SOL_SOCKET&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;socket&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;SO_BROADCAST&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sendto&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;&amp;lt;broadcast&amp;gt;&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;  
&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;close&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="c1"&gt;# Example use  &lt;/span&gt;
&lt;span class="n"&gt;WakeOnLan&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;aa:bb:cc:dd:ee:ff&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# My PC&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The last line in the script is calling the WakeOnLan method and passing
the &lt;span class="caps"&gt;MAC&lt;/span&gt; address of the &lt;span class="caps"&gt;PC&lt;/span&gt; you are trying to wake up. You can get the &lt;span class="caps"&gt;MAC&lt;/span&gt;
address of your &lt;span class="caps"&gt;PC&lt;/span&gt; from a &lt;span class="caps"&gt;DOS&lt;/span&gt; command prompt by the command&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;c:\&amp;gt; ipconfig /all
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It will show up as Physical Address in the detailed listing. Read the
lifehacker article given above for more details. You can wake more than
1 by duplicating the WakeOnLan(&lt;span class="caps"&gt;MAC&lt;/span&gt;) line in the&amp;nbsp;script.&lt;/p&gt;
&lt;p&gt;You have a couple of options of executing this script. You could create
a sub-folder under the scripts folder in your &lt;span class="caps"&gt;XBMC&lt;/span&gt; install and place
this script there. In which case you can call it anything you want. I
have created a script for every &lt;span class="caps"&gt;PC&lt;/span&gt; I want to wake up in my network and
have the machine name as the script name. You could also start up all
your computers as soon as the xbox is switched on. Just name the file
autoexec.py and put it in &lt;span class="caps"&gt;XBMC&lt;/span&gt;/scripts. It&amp;#8217;s similar to how autoexec.bat
works for windows&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;I also put these scripts on every &lt;span class="caps"&gt;PC&lt;/span&gt; in my network, so I can start any
of them remotely. The pre-requisite is that you need python installed on
your &lt;span class="caps"&gt;PC&lt;/span&gt; for the script to work. You can either install python or just
use the python which comes with cygwin. I recommend that if you need a
decent command line on windows, just get cygwin and give mintty a try.
Andy Koppe the creator of mintty recommended it to me the other day and
I love it so far!! I have also further recommended it to my friends at
work. I just launch mintty to get a bash shell on my windows box and
execute the script this way&amp;nbsp;-&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;python&lt;span class="w"&gt; &lt;/span&gt;/path/to/WakeOnLan.py
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="cygwin"/><category term="python"/><category term="windows"/><category term="xbmc"/><category term="xbox"/></entry><entry><title>Same music album showing up multiple times on iPhone</title><link href="https://www.nyayapati.com/srao/2010/03/same-music-album-showing-up-multiple-times-on-iphone/" rel="alternate"/><published>2010-03-25T08:00:00-04:00</published><updated>2010-03-25T08:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-25:/srao/2010/03/same-music-album-showing-up-multiple-times-on-iphone/</id><summary type="html">&lt;p&gt;I created an album with different artists to listen on my iPhone. To my
horror all the songs showed up as separate albums. Cover flow showed up
the same album art for each of the songs. I hated this!! The fix is
pretty quick. You have to make sure of …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I created an album with different artists to listen on my iPhone. To my
horror all the songs showed up as separate albums. Cover flow showed up
the same album art for each of the songs. I hated this!! The fix is
pretty quick. You have to make sure of the following to make your songs
show up as one album&amp;nbsp;-&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;The Album name has to be the same for all the&amp;nbsp;songs&lt;/li&gt;
&lt;li&gt;The Album Artist name has to be the same for all the&amp;nbsp;songs&lt;/li&gt;
&lt;li&gt;All the songs should be set as a part of a&amp;nbsp;compilation.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Here is how you do it . Select all the songs in itunes you want to show
up as an album, then right click on one of  the chosen songs and click
&amp;#8216;get info&amp;#8217;&amp;nbsp;-&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Type in the Album Name and Album&amp;nbsp;Artist&lt;/li&gt;
&lt;li&gt;Under the options tab, make sure the &amp;#8216;Part of A Compilation&amp;#8217; is
    checked and set to&amp;nbsp;Yes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;That&amp;#8217;s it&amp;#8230; That will make sure the album shows up only once for the
entire&amp;nbsp;album&lt;/p&gt;</content><category term="software"/><category term="iphone"/><category term="itunes"/><category term="tips"/></entry><entry><title>Mutton Curry revisited</title><link href="https://www.nyayapati.com/srao/2010/03/mutton-curry-revisited/" rel="alternate"/><published>2010-03-24T08:00:00-04:00</published><updated>2010-03-24T08:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-24:/srao/2010/03/mutton-curry-revisited/</id><summary type="html">&lt;p&gt;I got about 5 pounds of goat leg from &lt;a href="http://www.yelp.com/biz/waltham-india-grocery-waltham-2"&gt;Waltham India
Grocer&lt;/a&gt;. It is
an Indian grocery store which also sells Halal meat. I normally get my
meat from &lt;a href="http://www.yelp.com/biz/cheema-supermarket-allston"&gt;Cheema
Supermarket&lt;/a&gt; but as
I was in the neighborhood, I just picked it up from&amp;nbsp;Waltham.&lt;/p&gt;
&lt;p&gt;I was making my usual …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I got about 5 pounds of goat leg from &lt;a href="http://www.yelp.com/biz/waltham-india-grocery-waltham-2"&gt;Waltham India
Grocer&lt;/a&gt;. It is
an Indian grocery store which also sells Halal meat. I normally get my
meat from &lt;a href="http://www.yelp.com/biz/cheema-supermarket-allston"&gt;Cheema
Supermarket&lt;/a&gt; but as
I was in the neighborhood, I just picked it up from&amp;nbsp;Waltham.&lt;/p&gt;
&lt;p&gt;I was making my usual Mutton Curry and half way through making this dish
I realized I did not have any crushed tomatoes.. so I had to improvise.
According to some purists Goat curry should not have any tomatoes. I
have always used tomatoes.. so this was a chance to try make this dish
without tomatoes&amp;#8230; Unfortunately I don&amp;#8217;t have a picture to show on how
this looks.  It was a big hit at the party and that&amp;#8217;s what counts&amp;nbsp;:)&lt;/p&gt;
&lt;p&gt;Here is how I did&amp;nbsp;it&amp;#8230;&lt;/p&gt;
&lt;p&gt;Ingredients&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Goat leg - cut into small pieces (1&amp;nbsp;inch)&lt;/li&gt;
&lt;li&gt;Onions chopped - 4 large onions&amp;nbsp;chopped&lt;/li&gt;
&lt;li&gt;cinnamon - one 2 inches&amp;nbsp;stick&lt;/li&gt;
&lt;li&gt;cardamom -&amp;nbsp;5-10&lt;/li&gt;
&lt;li&gt;cloves -&amp;nbsp;10-15&lt;/li&gt;
&lt;li&gt;curry leaves - 10-12&amp;nbsp;leaves&lt;/li&gt;
&lt;li&gt;green chillies - 4-5 cut into big&amp;nbsp;pieces&lt;/li&gt;
&lt;li&gt;garlic - 5-6 pods finely&amp;nbsp;diced&lt;/li&gt;
&lt;li&gt;ginger - finely diced - 2&amp;nbsp;inches&lt;/li&gt;
&lt;li&gt;turmeric - 1-2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;garam masala - 3&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;dhaniya powder - 4&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;lal mirch - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;degi mirch - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;jeera powder - 2&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;&lt;span class="caps"&gt;MDF&lt;/span&gt; Meat masala - 1&amp;nbsp;tsp&lt;/li&gt;
&lt;li&gt;Coconut milk - 1&amp;nbsp;can&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Method&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Heat oil and some ghee in a big flat bottom&amp;nbsp;vessel.&lt;/li&gt;
&lt;li&gt;Add Cinnamon, cardamom and&amp;nbsp;cloves&lt;/li&gt;
&lt;li&gt;Once it sputters, add onions and start frying it. Add the salt to
    taste and turmeric&amp;nbsp;immediately.&lt;/li&gt;
&lt;li&gt;Once it is slightly brown, add the chopped ginger and&amp;nbsp;garlic.&lt;/li&gt;
&lt;li&gt;Continue sauteing and add the chopped green chillies and curry&amp;nbsp;leaves.&lt;/li&gt;
&lt;li&gt;Add the mixed powdered&amp;nbsp;spices&lt;/li&gt;
&lt;li&gt;Make sure you don&amp;#8217;t burn the spices. Add a little ghee like maybe
    half a&amp;nbsp;teaspoon.&lt;/li&gt;
&lt;li&gt;Add the mutton and coat the onions and spices to all the&amp;nbsp;meat.&lt;/li&gt;
&lt;li&gt;Sear the meat so it cooks and changes color on all&amp;nbsp;sides.&lt;/li&gt;
&lt;li&gt;Add a can of coconut milk and mix everything together. After 5
    minutes transfer all to a pressure&amp;nbsp;cooker.&lt;/li&gt;
&lt;li&gt;Wash the vessel you used and use the water for the pressure cooker.
    Put enough to cover the&amp;nbsp;meat.&lt;/li&gt;
&lt;li&gt;Add a cut potato in the cooker. This helps bring some texture to the&amp;nbsp;gravy.&lt;/li&gt;
&lt;li&gt;Add 2 tsp of &lt;span class="caps"&gt;MDF&lt;/span&gt; Meat&amp;nbsp;masala.&lt;/li&gt;
&lt;li&gt;Add chopped cilantro and then pressure cook for 30-40&amp;nbsp;minutes.&lt;/li&gt;
&lt;li&gt;Once the pressure comes down, open and check if the meat is tender.
    If not tender, pressure cook for 10-15 more&amp;nbsp;minutes.&lt;/li&gt;
&lt;li&gt;Taste and adjust&amp;nbsp;salt&lt;/li&gt;
&lt;li&gt;Serve with&amp;nbsp;Rice&lt;/li&gt;
&lt;/ol&gt;</content><category term="recipes"/><category term="food"/><category term="goat"/><category term="mutton"/></entry><entry><title>First warm weekend of 2010</title><link href="https://www.nyayapati.com/srao/2010/03/first-warm-weekend-of-2010/" rel="alternate"/><published>2010-03-22T14:13:00-04:00</published><updated>2010-03-22T14:13:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-22:/srao/2010/03/first-warm-weekend-of-2010/</id><summary type="html">&lt;p&gt;What a phenomenal weekend! It was nice and sunny and the best part was
it was not too&amp;nbsp;hot!&lt;/p&gt;
&lt;p&gt;Food wise it was a great weekend too.. Friday night we went to
&lt;a href="http://www.aegeanrestaurants.com"&gt;Aegean&lt;/a&gt; in Framingham. Their bread
basket had fresh baked bread and Pita bread. This came with olive oil …&lt;/p&gt;</summary><content type="html">&lt;p&gt;What a phenomenal weekend! It was nice and sunny and the best part was
it was not too&amp;nbsp;hot!&lt;/p&gt;
&lt;p&gt;Food wise it was a great weekend too.. Friday night we went to
&lt;a href="http://www.aegeanrestaurants.com"&gt;Aegean&lt;/a&gt; in Framingham. Their bread
basket had fresh baked bread and Pita bread. This came with olive oil
and feta cheese. This combination was so tasty. The key here was their
Pita Bread&amp;#8230; Fresh!! For the main course I order their Lamb Youvetsi.
This was a Braised Lamb with &lt;a href="http://en.wikipedia.org/wiki/Orzo"&gt;Orzo&lt;/a&gt;
topped with grated cheese. My wife ordered the Mousaka. This was 
Layered eggplant, seasoned with ground meat, grated cheese and topped
with bechamel sauce (My wife is a sucker for white sauce!!). Both dishes
were very tasty and very very satisfying. My lamb was very succulent and
tender.. This was cooked with tomato sauce, spices and orzo. Did I
mention it was very satisfying! My wife&amp;#8217;s dish was good too&amp;#8230; It was
like a lasagna but instead of pasta, made with&amp;nbsp;eggplant.&lt;/p&gt;
&lt;p&gt;Saturday morning was bright and started out a little cold but it got
warmer and ultimately turned out to be a great day to spend outdoors. We
met our cousins in Waltham and spent a couple of hours in Waltham
Commons. Got coffee, coffee cake and cranberry scones from &lt;a href="http://www.yelp.com/biz/cafe-on-the-common-waltham"&gt;Cafe on the
Common&lt;/a&gt;. A very cute
place with some tasty baked goods. The place looked like an old school
coffee&amp;nbsp;shop.&lt;/p&gt;
&lt;p&gt;For lunch we ended up in &lt;a href="http://www.taqueriamexico.com/"&gt;Taqueria
Mexico&lt;/a&gt;. My Bro-in-law recommended it&amp;#8230;
looked like a whole in the wall..  the Food was very authentic and the
prices were not too high. Check out their menu and you will find some
traditional mexican dishes not available else where in and around
Boston. I wanted to get the Guisado De Carne De Puerco. This was slices
of pork cooked in green sauce with onions and peppers. Serverd with
rice, beans, salad and tortillas. I got chicken instead of the pork. My
Bro-in-law got the original dish and we both agreed the dish was better
with the chicken. The corn tortilas were fresh and went good with both
our dishes. My wife and my cousin got a chili reileno stuffed with
cheese, one green chicken enchilada with melted cheese and sour chream
on top. Served with rice, beans, saland. All dishes were&amp;nbsp;yummy.&lt;/p&gt;
&lt;p&gt;We then walked down Moody street to do some Indian Grocery Shopping at
&lt;a href="http://www.yelp.com/biz/patel-brothers-waltham"&gt;Patel Brothers&lt;/a&gt;. While
I was there I got 5 pounds of goat leg from waltham india grocery
planning to make mutton curry on sunday (will share the recipe). We then
stopped by &lt;a href="http://www.lizzysicecream.com/"&gt;Lizzy&amp;#8217;s Homemade Ice cream&lt;/a&gt;
:) where I got their orange pineapple ice cream, my Wife got a chocolate
frappe, my cousin got a cup of vanilla ice cream whereas my bro-in-law
got some green&amp;nbsp;tea.&lt;/p&gt;
&lt;p&gt;Sunday was another fabulous day. The Sri Laxmi temple in Ashland was
going to Host the Indian festival
&lt;a href="http://en.wikipedia.org/wiki/Holi"&gt;Holi&lt;/a&gt;. I guess the temple chose to
celebrate it on Sunday as it was really cold the weekend of the actual
day. I celebrated Holi after like 10 years. It was a lot of fun playing
with colors with your friends and family. The organizers did a good job
of arranging for food and Indian tea for everybody. I then invited my
cousin&amp;#8217;s family along with other family friends for an impromptu&amp;nbsp;dinner.&lt;/p&gt;
&lt;p&gt;Dinner was a big hit! I made mutton curry, Priya made okra fry. My
Cousin Vandana made an awesome dish with Cholle and Spinach. The family
friends made Channa Dal. It turned out to be a feast and a fitting end
to this awesome&amp;nbsp;weekend!!&lt;/p&gt;</content><category term="restaurants"/><category term="food"/></entry><entry><title>A better cygwin terminal - rxvt</title><link href="https://www.nyayapati.com/srao/2010/03/a-better-cygwin-terminal-rxvt/" rel="alternate"/><published>2010-03-22T09:00:00-04:00</published><updated>2010-03-22T09:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-22:/srao/2010/03/a-better-cygwin-terminal-rxvt/</id><summary type="html">&lt;p&gt;rxvt is so much more better than the default cygwin terminal. You will
thank me once you switch to using rxvt. To get rxvt working without
starting an X Server, just create a shortcut using the following&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;C:\cygwin\bin\rxvt.exe -fg green -bg black -fn &amp;quot;Lucida Console-14&amp;quot; -e …&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;rxvt is so much more better than the default cygwin terminal. You will
thank me once you switch to using rxvt. To get rxvt working without
starting an X Server, just create a shortcut using the following&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;C:\cygwin\bin\rxvt.exe -fg green -bg black -fn &amp;quot;Lucida Console-14&amp;quot; -e bash --login -i
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;This is assuming that cygwin is installed at c:\cygwin. You will get a
foreground of green on a black background. The font used is &amp;#8220;Lucida&amp;nbsp;Console-14&amp;#8221;.&lt;/p&gt;</content><category term="software"/><category term="cygwin"/><category term="windows"/></entry><entry><title>Grep for multiple stuff in one file</title><link href="https://www.nyayapati.com/srao/2010/03/grep-for-multiple-stuff-in-one-file/" rel="alternate"/><published>2010-03-19T08:00:00-04:00</published><updated>2010-03-19T08:00:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-19:/srao/2010/03/grep-for-multiple-stuff-in-one-file/</id><summary type="html">&lt;p&gt;Update: See the comments to see how to do this&amp;nbsp;correctly.&lt;/p&gt;
&lt;p&gt;the &lt;span class="caps"&gt;UNIX&lt;/span&gt; grep command is very powerful, but the egrep command is even
more powerful. You can grep for multiple strings in a file using the
egrep command. All you have to do is use the | (or) symbol and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Update: See the comments to see how to do this&amp;nbsp;correctly.&lt;/p&gt;
&lt;p&gt;the &lt;span class="caps"&gt;UNIX&lt;/span&gt; grep command is very powerful, but the egrep command is even
more powerful. You can grep for multiple strings in a file using the
egrep command. All you have to do is use the | (or) symbol and add as
many strings you want to look for. You have to make sure you escape the
pipe symbol. This is especially helpful when you are wading through log&amp;nbsp;files.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;egrep&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;string 1&amp;quot;&lt;/span&gt;&lt;span class="se"&gt;\|&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;string 2&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;file.log
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The above command will only display the lines from file.log that have a
reference of &amp;#8220;string 1&amp;#8221; and &amp;#8220;string&amp;nbsp;2&amp;#8221;&lt;/p&gt;</content><category term="software"/><category term="tips"/></entry><entry><title>Find user details on windows user in a domain</title><link href="https://www.nyayapati.com/srao/2010/03/find-user-details-on-windows-user-in-a-domain/" rel="alternate"/><published>2010-03-18T10:05:00-04:00</published><updated>2010-03-18T10:05:00-04:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-18:/srao/2010/03/find-user-details-on-windows-user-in-a-domain/</id><summary type="html">&lt;p&gt;Here is a quick tip - If you want to find out details on a user account
on windows inside a particular domain use the following command on a &lt;span class="caps"&gt;DOS&lt;/span&gt;&amp;nbsp;prompt  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;net user username /domain
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;where the username is the username of the account you want more
information on. You can …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Here is a quick tip - If you want to find out details on a user account
on windows inside a particular domain use the following command on a &lt;span class="caps"&gt;DOS&lt;/span&gt;&amp;nbsp;prompt  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;net user username /domain
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;where the username is the username of the account you want more
information on. You can get a lot of information with this simple
command. Some of the things you can find are&amp;nbsp;-&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Full Name&lt;br&gt;
 Account information - if active, if expires&lt;br&gt;
 Password - last set, expiry date etc&lt;br&gt;
 last logon date and time&lt;br&gt;
 group&amp;nbsp;memberships&lt;/p&gt;
&lt;/blockquote&gt;</content><category term="software"/><category term="windows"/></entry><entry><title>Hit by AV.EXE virus - Cannot run any programs</title><link href="https://www.nyayapati.com/srao/2010/03/hit-by-av-exe-virus/" rel="alternate"/><published>2010-03-09T20:58:00-05:00</published><updated>2010-03-09T20:58:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-09:/srao/2010/03/hit-by-av-exe-virus/</id><summary type="html">&lt;p&gt;I recently got hit by the &lt;span class="caps"&gt;AV&lt;/span&gt;.&lt;span class="caps"&gt;EXE&lt;/span&gt; virus. This was a really bad virus. I
got a pop up which looked as if it was a windows dialogue box telling me
to install this anti spyware/virus scanner. I knew I should not even
touch the popup box and …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I recently got hit by the &lt;span class="caps"&gt;AV&lt;/span&gt;.&lt;span class="caps"&gt;EXE&lt;/span&gt; virus. This was a really bad virus. I
got a pop up which looked as if it was a windows dialogue box telling me
to install this anti spyware/virus scanner. I knew I should not even
touch the popup box and not even try to close it. The best way was to
kill the process. I used System Explorer which is a really good task
manager replacement. It is available from
&lt;a href="http://systemexplorer.mistergroup.org/"&gt;http://systemexplorer.mistergroup.org/&lt;/a&gt;. Once killed, I wanted to make
sure I wasn&amp;#8217;t infected any further, so I started my spyware scanner
called &lt;a href="http://www.malwarebytes.org/"&gt;Malwarebytes&amp;#8217; Anti-Malware&lt;/a&gt;.&lt;br&gt;
Surprisingly the &lt;span class="caps"&gt;AV&lt;/span&gt;.&lt;span class="caps"&gt;EXE&lt;/span&gt; popup came back and on top of that, my
malwarebytes program didn&amp;#8217;t start. I killed the process once again and
tried starting malwarebytes again and the av.exe popup came back!! Damn
what was going on!! After killing the process once again I tried
Superantispyware and it too had the same fate&amp;#8230; I was now perplexed&amp;#8230;
I tried a random program and after seeing that too starting the popup,
finally realized that my registry had been compromised. The virus had
modified my registry in such a way that it would get enabled whenever I
would start any executable. I then thought I better do more research on
this before I screw up my machine even further. Here is what I&amp;nbsp;found&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;I had to right click the Malwarebytes program and use Run as.. to
    run the program as&amp;nbsp;administrator&lt;/li&gt;
&lt;li&gt;Update the program and run it and remove any instance of the&amp;nbsp;virus&lt;/li&gt;
&lt;li&gt;Cleaning the system broke my registry. I couldn&amp;#8217;t run any programs&amp;nbsp;anymore.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;The registry was fixed with the following file. Save the following
    in a file called&amp;nbsp;fixit.reg  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Windows Registry Editor Version 5.00

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\.EXE]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;exefile&amp;quot;  &lt;/span&gt;
&lt;span class="na"&gt;&amp;quot;Content Type&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;application/x-msdownload&amp;quot;&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\.EXE\PersistentHandler]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;{098f2470-bae0-11cd-b579-08002b30bfeb}&amp;quot;&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\exefile]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Application&amp;quot;  &lt;/span&gt;
&lt;span class="na"&gt;&amp;quot;EditFlags&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;38,07,00,00&lt;/span&gt;

&lt;span class="na"&gt;&amp;quot;FriendlyTypeName&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;hex(2)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;40,00,25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;

&lt;span class="err"&gt;00,6f,00,6f,00,74,00,25,00,5c,00,53,00,79,00,73,00,74,00,65,00,6d,00,33,00,\&lt;/span&gt;

&lt;span class="err"&gt;32,00,5c,00,73,00,68,00,65,00,6c,00,6c,00,33,00,32,00,2e,00,64,00,6c,00,6c,\&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="err"&gt;00,2c,00,2d,00,31,00,30,00,31,00,35,00,36,00,00,00&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\exefile\DefaultIcon]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;%1&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;HKEY_CLASSES_ROOT&lt;/span&gt;&lt;span class="k"&gt;\exefile\shell]&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\exefile\shell\open]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;&amp;quot;EditFlags&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;hex&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="m"&gt;00,00,00,00&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\exefile\shell\open\command]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;\&amp;quot;%1\&amp;quot; %*&amp;quot;  &lt;/span&gt;
&lt;span class="na"&gt;&amp;quot;IsolatedCommand&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;\&amp;quot;%1\&amp;quot; %*&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;HKEY_CLASSES_ROOT&lt;/span&gt;&lt;span class="k"&gt;\exefile\shell\runas]&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\exefile\shell\runas\command]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;\&amp;quot;%1\&amp;quot; %*&amp;quot;  &lt;/span&gt;
&lt;span class="na"&gt;&amp;quot;IsolatedCommand&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;\&amp;quot;%1\&amp;quot; %*&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="nb"&gt;HKEY_CLASSES_ROOT&lt;/span&gt;&lt;span class="k"&gt;\exefile\shellex]&lt;/span&gt;

&lt;span class="err"&gt;[HKEY_CLASSES_ROOT\exefile\shellex\DropHandler]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="na"&gt;@&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;{86C86720-42A0-1069-A2E8-08002B30309D}&amp;quot;&lt;/span&gt;

&lt;span class="k"&gt;[&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nb"&gt;HKEY_CURRENT_USER&lt;/span&gt;&lt;span class="k"&gt;\Software\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.exe\UserChoice]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Double click and execute this file. This fixes the&amp;nbsp;registry&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I think I should start browsing in a sandbox so I don&amp;#8217;t infect my pc. I
have a couple of options, but I think the easiest is to just use
Sandboxie which is available at &lt;a href="http://www.sandboxie.com/"&gt;http://www.sandboxie.com/&lt;/a&gt;. Other ways
I can protect myself is to use a limited user account instead of using
an admin account. Ohh&amp;nbsp;well&amp;#8230;&lt;/p&gt;</content><category term="software"/><category term="virus"/><category term="windows"/></entry><entry><title>How to go from Oracle to CSV</title><link href="https://www.nyayapati.com/srao/2010/03/how-to-go-from-oracle-to-csv/" rel="alternate"/><published>2010-03-04T02:37:00-05:00</published><updated>2010-03-04T02:37:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-04:/srao/2010/03/how-to-go-from-oracle-to-csv/</id><summary type="html">&lt;p&gt;Here is a trick to to create a comma delimited file from oracle. You can
create a csv file simply using &lt;span class="caps"&gt;SQL&lt;/span&gt;*Plus with any sql statement. Here it
is&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;feedback&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;underline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;colsep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;spool&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;table …&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</summary><content type="html">&lt;p&gt;Here is a trick to to create a comma delimited file from oracle. You can
create a csv file simply using &lt;span class="caps"&gt;SQL&lt;/span&gt;*Plus with any sql statement. Here it
is&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;feedback&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;heading&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;underline&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;set&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;colsep&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;,&amp;#39;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;spool&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="k"&gt;to&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;file&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="n"&gt;mysheet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;csv&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;select&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;table&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="n"&gt;spool&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;off&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Here are some other ways I found&amp;nbsp;online  &lt;/p&gt;
&lt;p&gt;&lt;a href="http://kpanchan.blogspot.com/2007/05/extract-csv-file-format-in-oracle-sql.html"&gt;http://kpanchan.blogspot.com/2007/05/extract-csv-file-format-in-oracle-sql.html&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.oracle-base.com/articles/9i/GeneratingCSVFiles.php"&gt;http://www.oracle-base.com/articles/9i/GeneratingCSVFiles.php&lt;/a&gt;  &lt;/p&gt;
&lt;p&gt;&lt;a href="http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:68212348056"&gt;http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:68212348056&lt;/a&gt;&lt;/p&gt;</content><category term="software"/><category term="oracle"/></entry><entry><title>Sending email with a body and attachment from UNIX</title><link href="https://www.nyayapati.com/srao/2010/03/sending-email-with-a-body-and-attachment-from-unix/" rel="alternate"/><published>2010-03-03T03:40:00-05:00</published><updated>2010-03-03T03:40:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-03-03:/srao/2010/03/sending-email-with-a-body-and-attachment-from-unix/</id><summary type="html">&lt;p&gt;It is easy to send a text file as the body of an email from &lt;span class="caps"&gt;UNIX&lt;/span&gt;. You
can do it using the command&amp;nbsp;below &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mail&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Email with file as body&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;email@domain.com&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;&lt;span class="w"&gt; &lt;/span&gt;message.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you want to send a file as an attachment, you would need …&lt;/p&gt;</summary><content type="html">&lt;p&gt;It is easy to send a text file as the body of an email from &lt;span class="caps"&gt;UNIX&lt;/span&gt;. You
can do it using the command&amp;nbsp;below &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mail&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Email with file as body&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;email@domain.com&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;&lt;span class="w"&gt; &lt;/span&gt;message.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now if you want to send a file as an attachment, you would need to use
uuencode piped to mail. This file can be a binary file or a text file.
The command&amp;nbsp;is  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;uuencode&lt;span class="w"&gt; &lt;/span&gt;file.dat&lt;span class="w"&gt; &lt;/span&gt;file.dat&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;mail&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Email with attachment&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;email@domain.com
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Suppose you want to send an email with a body and an attachement. Here
is the trick&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;First create the attachment file by using uuencode. Then join the
message file which is the body of the email along with the uuencoded
file which is going to be an attachment by using the cat&amp;nbsp;command.  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;uuencode&lt;span class="w"&gt; &lt;/span&gt;file.dat&lt;span class="w"&gt; &lt;/span&gt;file.dat&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;attachment.txt&lt;span class="w"&gt;  &lt;/span&gt;
cat&lt;span class="w"&gt; &lt;/span&gt;message.txt&lt;span class="w"&gt; &lt;/span&gt;attachment.txt&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;combined.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now all you need do is to send the email using the first method shown&amp;nbsp;here  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;mail&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Email with message body and attachment&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;email@domain.com&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;&lt;span class="w"&gt; &lt;/span&gt;combined.txt
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;*** Updated Feb 22, 2013&lt;br&gt;
Here is a script I wrote a while ago using the same concepts as
above&amp;#8230; I call it&amp;nbsp;mailfile.ksh&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="ch"&gt;#! /usr/bin/ksh&lt;/span&gt;

&lt;span class="nv"&gt;A_FLAG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;FALSE

&lt;span class="k"&gt;while&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;getopts&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;:a&lt;span class="w"&gt; &lt;/span&gt;OPTION&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;case&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;OPTION&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;in&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# -a as attachment  &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;a&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;shift&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="nv"&gt;A_FLAG&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;TRUE&lt;span class="p"&gt;;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="se"&gt;\?&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;print&lt;span class="w"&gt; &lt;/span&gt;-u2&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Usage: &lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;PROG_NAME&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; [-a] EMAIL MAILFILE SUBJECT&amp;quot;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;            &lt;/span&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;;&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;esac&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;

&lt;span class="nv"&gt;EMAIL&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# shift param one position  &lt;/span&gt;
&lt;span class="nb"&gt;shift&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="nv"&gt;MAILFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# shift param one position  &lt;/span&gt;
&lt;span class="nb"&gt;shift&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# copy rest of params to SUBJECT  &lt;/span&gt;
&lt;span class="nv"&gt;SUBJECT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$*&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="c1"&gt;# get rid of quotes  &lt;/span&gt;
&lt;span class="nv"&gt;SUBJECT&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;echo&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$SUBJECT&lt;/span&gt;&lt;span class="p"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;sed&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;s/&amp;quot;//g&amp;#39;&lt;/span&gt;&lt;span class="k"&gt;)&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$A_FLAG&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TRUE&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;then&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;ATTACHEDFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;basename&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MAILFILE&lt;/span&gt;&lt;span class="sb"&gt;`&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;/usr/bin/uuencode&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MAILFILE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$ATTACHEDFILE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;gt;&lt;span class="w"&gt; &lt;/span&gt;/tmp/&lt;span class="nv"&gt;$ATTACHEDFILE$$&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="nv"&gt;MAILFILE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;/tmp/&lt;span class="nv"&gt;$ATTACHEDFILE$$&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;

/usr/ucb/mail&lt;span class="w"&gt; &lt;/span&gt;-s&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="nv"&gt;$SUBJECT&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$EMAIL&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&amp;lt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$MAILFILE&lt;/span&gt;

&lt;span class="c1"&gt;# Cleanup  &lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$A_FLAG&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;TRUE&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;then&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;rm&lt;span class="w"&gt; &lt;/span&gt;/tmp/&lt;span class="nv"&gt;$ATTACHEDFILE$$&lt;/span&gt;&lt;span class="w"&gt;  &lt;/span&gt;
&lt;span class="k"&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The usage is the following if you want to attach a file as an&amp;nbsp;attachment  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mailfile.ksh&lt;span class="w"&gt; &lt;/span&gt;-a&lt;span class="w"&gt; &lt;/span&gt;email@example.com&lt;span class="w"&gt; &lt;/span&gt;yourfile.gz&lt;span class="w"&gt; &lt;/span&gt;Your&lt;span class="w"&gt; &lt;/span&gt;Subject
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;And if you want the file as the body, the usage is&amp;nbsp;-  &lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;$&lt;span class="w"&gt; &lt;/span&gt;mailfile.ksh&lt;span class="w"&gt; &lt;/span&gt;email@example.com&lt;span class="w"&gt; &lt;/span&gt;SomeFile.csv&lt;span class="w"&gt; &lt;/span&gt;Your&lt;span class="w"&gt; &lt;/span&gt;Subject
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;</content><category term="software"/><category term="unix"/></entry><entry><title>Chicken 65</title><link href="https://www.nyayapati.com/srao/2010/02/chicken-65/" rel="alternate"/><published>2010-02-28T05:02:00-05:00</published><updated>2010-02-28T05:02:00-05:00</updated><author><name>srini</name></author><id>tag:www.nyayapati.com,2010-02-28:/srao/2010/02/chicken-65/</id><summary type="html">&lt;p&gt;Chicken 65 - Any Hyderabadi&amp;#8217;s favorite dish! Well, I guess maybe after
the hyderabadi Biryani :)  I dont want to start any holy wars here but
today my post is about Chicken 65. A lot has been talked about this
dish&amp;#8217;s origin which can read on
&lt;a href="http://en.wikipedia.org/wiki/Chicken_65"&gt;wikipedia&lt;/a&gt;. I believe Sanjay …&lt;/p&gt;</summary><content type="html">&lt;p&gt;Chicken 65 - Any Hyderabadi&amp;#8217;s favorite dish! Well, I guess maybe after
the hyderabadi Biryani :)  I dont want to start any holy wars here but
today my post is about Chicken 65. A lot has been talked about this
dish&amp;#8217;s origin which can read on
&lt;a href="http://en.wikipedia.org/wiki/Chicken_65"&gt;wikipedia&lt;/a&gt;. I believe Sanjay
Thumma from &lt;a href="http://www.vahrehvah.com"&gt;vahrehvah.com&lt;/a&gt; got it right by
saying this chicken dish was the 65th item on a menu. As popularity rose
in the restaurant, it started being called Chicken&amp;nbsp;65.&lt;/p&gt;
&lt;p&gt;I was browsing the internet the other day and came across a friends
photo blog of his recent visit to India on facebook. Being a self
proclaimed foodie, watching the slideshow was very torturous, but it got
some really good memories of places to eat in New Delhi and Hyderabad. I
thought the best way to deal with this would be to cook this dish. I
called my cousins and we decided to meet up that day. I offered to make
chicken 65 as an appetizer and my cousin offered to make spaghetti in a
turkey meat sauce(yum) for dinner.  Ultimately I was very glad with the
results of my dish. I think this has been my best attempt so far in
making this dish. Here is the recipe&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;Ingredients&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Boneless skinless Chicken thighs -3 pounds&lt;br&gt;
 Green chillies - 5-6 slit and the cut in half&lt;br&gt;
 Ginger - grated 3-4 tsp&lt;br&gt;
 Garlic- grated 3-4 tsp&lt;br&gt;
 Curry leaves -10-15 leaves&lt;br&gt;
 One egg&lt;br&gt;
 Corn starch - 4-5 tsp&lt;br&gt;
 2 cups&amp;nbsp;yogurt&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Spices&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Salt - according to taste&lt;br&gt;
 Pepper - 1 tsp&lt;br&gt;
 Deghi mirch - 3 tsp&lt;br&gt;
 Lal mirch - 3 tsp (depending on how spicy you want it)&lt;br&gt;
 Garam masala - 1.5 tsp&lt;br&gt;
 Haldi - 1/2 tsp&lt;br&gt;
 &lt;span class="caps"&gt;MSG&lt;/span&gt; - 1/2&amp;nbsp;tsp&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Method&lt;/p&gt;
&lt;p&gt;Cut chicken in small cubes&lt;br&gt;
Marinate chicken for an hour in salt, pepper, deghi mirch 1.5 tsp, lal mirch 1.5 tsp,.5 tsp of &lt;span class="caps"&gt;MSG&lt;/span&gt;&lt;br&gt;
Mix the chicken in the marinate and while mixing add an egg to the chicken and then mix in corn starch&lt;br&gt;
Whisk  the rest of the spices in yogurt and keep aside&lt;br&gt;
Fry the chicken and make pakodas and keep aside&lt;br&gt;
Add 2 tbl spoon of oil in a wok, heat and then add Mustard seeds -
Add Ginger, garlic, green chillies and curry leaves.&lt;br&gt;
Once a little brown and dry, add the fried chicken and mix it well&lt;br&gt;
Add the whisked yogurt&lt;br&gt;
Cook till yogurt is dried&amp;nbsp;up&lt;/p&gt;
&lt;p&gt;Here is what it looked like after the pakoda&amp;#8217;s were made&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2010/02/IMG_6959.jpg"&gt;&lt;img alt="Chicken Pakoda" src="https://www.nyayapati.com/srao/wp-content/uploads/2010/02/IMG_6959.jpg" title="Chicken Pakoda"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is the finished product&amp;nbsp;-&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.nyayapati.com/srao/wp-content/uploads/2010/02/IMG_6960.jpg"&gt;&lt;img alt="Chicken 65" src="https://www.nyayapati.com/srao/wp-content/uploads/2010/02/IMG_6960.jpg" title="Chicken 65"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The reason this does not look red in color was because I did not use any
food&amp;nbsp;coloring.&lt;/p&gt;
&lt;p&gt;Enjoy&lt;/p&gt;</content><category term="recipes"/><category term="food chicken"/></entry></feed>