Archive for June, 2011

git check for changes on remote repository

June 30, 2011 Leave a comment
git fetch # get latest code from upstream
git diff --quiet master..origin/master -- foo/ || echo 'directory differ'
Categories: git

unfuddle – git repository, I don’t want to type in my passphrase on each commit

June 25, 2011 Leave a comment

Want to push changes to a remote git repo, but don’t want to enter in your passphrase every time? This example is on ubuntu.

  1. eval `ssh-agent`
  2. ssh-add ~/.ssh/id_rsa

    Add the private key


Categories: bash, Linux Tags:

vmware and turnkeylinux mount shared folders from windows7 host to ubuntu guest

June 25, 2011 3 comments

I spent about a day on this, so hopefully these notes will help someone else.  I’m running VMware workstation on windows7.  I’m using the TurnkeyLinux LAMP VM as the guest. I spent almost a full day messing with VMware’s guest tools and all that nonsense.  What a waste. None of that seemed to work, and yet seemed so simple, because when I installed the TurnkeyLinux LAMP on VirtualBox, the shared folders features worked as advertised, and the Shared Folders defined in the VM options showed right up in the /media folder on the ubuntu guest… very sweet.  Unfortunately, the environment I need to plug into is a VMware based development environment.  But since VMware offers a similar feature, I figured it would be just as simple.  I’m probably missing something, or maybe there was a different toolset I needed to install, however, in the end, I went with a simpler CIFS mount from within the ubuntu guest.

So here it is step by step:

  1. apt-get install samba smbfs smbclient

    -L : put the name of the windows7 machine here
    -U : Is the username on the machine, this is what tripped me up a bit, since the laptop is on a domain, the username option needs to be in the format “DOMAIN/Username”, if you’re not on a domain I guess you can just use Username.
    This command will list all the available shared “Disk” mount points available on the window7 host.

  3. mount -t cifs //WINDOWS7-MACHINE/swshare /mnt/  \
    -o username=DOMAIN/Username,password=**********

    For the item above, I have a shared folder on the host windows7 machine at C:\swshare. After the command above, I can now see all the files in C:\swshare on the ubuntu guest at /mnt.

For further reading:

Categories: Linux Tags: , , , , ,

postfix : warning: SASL authentication failure: No worthy mechs found

June 25, 2011 1 comment

This post is a little off-topic, but when setting up a development box, I needed to have a neutral smtp server setup, so I used for outbound test emails.

Important step 1 is this (running on ubuntu)

apt-get install libsasl2-modules

Step 2. is to follow this tutorial:

Categories: shell scripting Tags: ,

Recursively remove all .svn directories

June 24, 2011 Leave a comment
find . -name .svn -print0 | xargs -0 rm -rf
Categories: bash