Using git to develop sites (developers only)

We have recently moved our Drupal and WordPress repositories to git. We will also be putting our databases and static site filesystems there too, so we can generate test sites locally with a simple script. Here’s how to get started with developing sites:

Installing and configuring Git

  • Mac OS X: Go to download page and download the latest version.
  • On Windows: Go to download page and download Git-{version}-preview{release date}.exe

To configure git, there are some nice instructions here…

(VS Users: Aparajita has supplied in ticket SYSADM-610 to configure your git install: just download it, use Terminal to go to the directory where the script is, and type sh git_setup.sh. You will be asked for full name and email address.)

Using git

To create a version of the Drupal or wordpress repository on your local site, create a directory. Open Terminal, go to that directory and use:

git clone git@{servername}.vasudevaserver.net:drupal.git
or
git clone git@{servername}.vasudevaserver.net:wordpress.git

This will put the contents of the repository in that folder. Note: If the repository uses gitolite to control access via ssh, you must have the appropriate ssh keys on your machine to do this. In addition, you need to have these lines in your .ssh/config file


host gitolite
user git
hostname {server}.vasudevaserver.net
port {port_name}

To make changes to the repository, you have a few options:

  • Use the command line ๐Ÿ™‚
  • There is a git client called SmartGit which is free for non-commercial purposes. We are still in the initial stages of testing it, but right now it seems to have everything we need
  • There is a application called GitX which has a very nice interface that shows all commits and lets you commit to your local version of the repository. However (at the moment) you still need to use the command line to update your local filesystem from the server repository (using Terminal, go to the directory and type git pull) and then push your changes back to the server repository (git push)

Prague Joy Sprint

Recently, six members of Vasudeva Server visited Prague to sample the local cuisines and work on various projects.

vasudevaserver

Eating Pizza.

vasudevaserver

Villiam and Atmasamarpan

vasudevaserver

Manavasu and Tejvan tuck into some pasta

vasudevaserver

Nirbhasa blinded by the light.

It wasn’t just pasta and non-alcoholic beer. During the weekend, with help of Atmasamarpan we set up a new server. Villiam showed us his great progress on the new Library site. Manavasu helped the site admin of the new Centre site and fixed the Czech Centre. Petr worked on various scripts to import a Plone site into a drupal site. And Nirbhasa worked on various issues about migration of new centre site. A great weekend and much thanks to our hosts and Madal Bal offices, Prague.

Finding Images in Public Domain

If you wish to use images, you need to be careful of copyright. These sources make sure that the images you use are in the public domain and free to use. However, you still need to check licence agreement, you will probably need to acknowledge source e.t.c.

1. Wikipedia Commons

If you wish to find an image of a person or place which is in public domain, Wikipedia or Commons Wikipedia is a good source.

E.g. for Nelson Mandela :

2. Flickr Creative Commons

If you visit advanced search at Flickr You can search through images which are licensed under a creative commons licence. Just click the box ‘search by creative commons’

vasudevaserver

N.B. Creative Commons means you need to still acknowledge author.

3. EveryStock Photo

Everystock Photo – searches through different public domain sources. But, you still need to check licence and rules for each image and site.

Fair Use of Images

Generally, using images does not fall into the category of ‘fair use’. However, under certain criteria images of dead people can fall into this criteria.

Royalty Free

Royalty Free means under a certain restrictions you can use the image without having to pay. But, note that the license may be restrictive for certain purposes.

Vasudeva Server in NY and Italy

Vasudeva Server show when it comes to making signs, you can’t beat old fashioned pen and paper. The Four Muskateers, Tejvan, Nirbhasa, Jwalanta and Atmasamarpan.

Nirbhasa tries to convince he comes into Panaroma Cafe ‘to get things done’ rather than for the tea and chocolate cake.

In Italy

Priyadarshan in great shape by Lake Garda

During our three days, we pondered great and weighty issues –

  • mysql vs posgres databases
  • managed dedicated hosting vs VPS,
  • and of course how to choose 3 different ice cream varieties….
  • We did our share of testing as well. Here Tejvan does his testing of Italiano ice cream.

    Embed Video

    
    <object width="400" height="274">
    <embed src="http://www.srichinmoybio.co.uk/movies/preview320.m4a" 
    href="http://www.srichinmoy.tv/c_/video/tv/75/75-1-2.mp4" target="myself"
     type="application/quicktime" wmode="transparent" width="400" height="274">
    </embed></object>
    
    

    gives

    to show a different video change the video url http://www.srichinmoy.tv/c_/video/tv/76/76-1-2.mp4

    Show all Draft Posts Plugin for WordPress MU

    This plugin will show the draft posts created in all your WPMU blogs. To activate, just download the PHP file and put it in your wp-content/mu-plugins folder. The file can be downloaded here….

    To view all posts, click on ‘Site Admin’ and then on the ‘Posts for moderation’ submenu.

    To do: make ‘view’ and ‘edit’ links, a bit like the WordPress ‘manage’ interface actually. In any case, it’s probably best if each theme you supply has an ‘Edit this post’ link, so the moderator can first view the post and then edit it if necessary without going back to admin screen.

    Use cases for the JW Media Player

    Playing an album list

    
    <embed
    src="http://www.srichinmoy.tv/c_/player/mediaplayer.swf"
    width="300" height="380"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="height=380&width=300&displayheight=0&showstop=true
    &showicons=false&repeat=list&backcolor=0xCCCCFF
    &frontcolor=0x000066&lightcolor=0x3333FF&screencolor=0x6666FF&thumbsinplaylist=false
    &file=http://www.radiosrichinmoy.org/c_/audio/radio/102/playlist-102.xml"
    >
    
    

    gives you

    As you can see, the playlist is stored in the same filesystem location as the music files (see sample playlist here).

    The flashvars set all the tweakable aspects – color, positioning ect. You can view all available flashvars here on Jeroen Wijering’s site, and there is also a setup wizard where you can throw in various combinations and see how the code turns out

    Playing a video – with youtube-like recommendations!

    
    <embed
    src="http://www.srichinmoy.tv/c_/player/mediaplayer.swf"
    width="300"
    height="220"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="height=220&width=300
    &file=http://www.srichinmoy.tv/c_/video/tv/260/260-1-2.mp4
    &showicons=false&image=http://www.srichinmoy.tv/images/tv/260-1.jpg
    &displayheight=200&searchbar=false
    &recommendations=http://www.srichinmoy.tv/c_/player/recommendations/rec-lifevoices.xml"
    />
    

    gives

    When the video is finished, a list of recommended videos are displayed. Just like the playlists above, the recommendations are also generated from an xml file (see sample).

    Note:

    • The front preview image and the recommendation images already exist on the site. The Flash Player allows them to be jpgs instead of having to convert to mp4
    • Again, the colour of the controlbar at the bottom can be modified by playing with the flashvars
    • The controlbar is on the bottom because we set the displayheight 20px less than the height. If they are the same there is a nicer effect where the controlbar is inline, but then it gets in the way of the recommendations if you want to include them

    Custom playlist from different albums

    
    <embed
    src="http://www.srichinmoy.tv/c_/player/mediaplayer.swf"
    width="300" height="200"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="height=200&width=300&displayheight=0&showstop=true
    &showicons=false&repeat=list&backcolor=0xCCCCFF
    &frontcolor=0x000066&lightcolor=0x3333FF&screencolor=0x6666FF&thumbsinplaylist=true
    &file=http://www.radiosrichinmoy.org/c_/audio/custom_playlists/playlist1.xml"
    >
    
    

    gives you

    Here is the link to this playlist – note how we now have a ‘creator’ and ‘album’ tag added. We have also switched the thumbsinplaylist flashvar to true to include creator

    Custom TV playlist

    
    <embed
    src="http://www.srichinmoy.tv/c_/player/mediaplayer.swf"
    width="300" height="400"
    allowscriptaccess="always"
    allowfullscreen="true"
    flashvars="height=400&width=300&displayheight=200&showstop=true
    &showicons=true&repeat=list&backcolor=0xCCCCFF
    &frontcolor=0x000066&lightcolor=0x3333FF&screencolor=0x6666FF&thumbsinplaylist=true
    &file=http://www.srichinmoy.tv/c_/custom_playlists/playlist1.xml"
    >
    
    

    gives you

    Here is the link to this playlist – the ‘image tag allows images to be displayed in listing, I just used images already on site.

    Thanks to Jeroen Wijering for creating such a great player

    Google Analytics

    There are many statistics programmes which track web visitors. Google analytics is one of the best free statistics programmes.

    To add Google analytics

    1. Visit Google analytics – you will be instructed to get a google account.
    2. Add your site and then add the code they give you into your web pages.

    Blogger Template.

    If you have a blogger (blogspot.domain). You would edit the blogger template and add the code.

    WordPress Template.

    In a wordpress, it is good to add the analytic code into the footer file

    It will look like:

    <script type="text/javascript">
    var pageTracker = _gat._getTracker("UA-17xxxxxx-6");
    pageTracker._initData();
    pageTracker._trackPageview();
    </script>
    </body>
    </html>
    

    6. Giving Access to Others

    Click on access manager, when you have logged in. This allows others to have access to your stats.

    With Google Analytics You Can

    1. Track unique visitors, page loads.
    2. Find sites sending you traffic.
    3. Find the keyword searches that are sending people to your site.
    4. Find which countries people are coming from.
    5. Where People enter your site, how long they stay and where they exit.
    6. Many other features.