<?xml version="1.0"?>
<rss version="2.0"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:dcterms="http://purl.org/dc/terms/" >
<channel>
<title>blog</title>
<link>http://www.lunix.com.au/blog/</link>
<description>lunix</description>
<item>

	<title>Funny tech support email No.1</title>


	<guid>http://www.lunix.com.au/blog/Funny_tech_support_email_No.1/</guid>

	<link>http://www.lunix.com.au/blog/Funny_tech_support_email_No.1/</link>


	<category>tags/general</category>

	<category>tags/humour</category>

	<category>tags/sysadmin</category>


	<pubDate>Thu, 29 Jul 2010 18:34:15 -0400</pubDate>
	<dcterms:modified>2010-07-29T23:37:27Z</dcterms:modified>

	<description>&lt;h2&gt;Funny Tech Support Email Number 1&lt;/h2&gt;

&lt;p&gt;In the late 1990&#39;s we purchased a few small ISP&#39;s and whilst auditing their old servers (terrible mess) I come across this beauty. &lt;br /&gt;
I thought I&#39;d share this, plus &lt;a href=&quot;http://www.lunix.com.au/blog/./Funny_tech_support_email_No.2/&quot;&gt;one&lt;/a&gt; other, from another ISP, I found for this years System Administrator&#39;s Appreciation Day. &lt;br /&gt;
They both made me laugh back then and still make me laugh today. Oh how I miss the days of ISP land.  &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lunix.com.au/blog/../images/dear_root.jpg&quot;&gt;&lt;img src=&quot;http://www.lunix.com.au/blog/./Funny_tech_support_email_No.1/800x600-dear_root.jpg&quot; width=&quot;612&quot; height=&quot;600&quot; alt=&quot;dear root&quot; class=&quot;imgleft&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/Funny_tech_support_email_No.1/#comments</comments>

</item>
<item>

	<title>Funny tech support email No.2</title>


	<guid>http://www.lunix.com.au/blog/Funny_tech_support_email_No.2/</guid>

	<link>http://www.lunix.com.au/blog/Funny_tech_support_email_No.2/</link>


	<category>tags/general</category>

	<category>tags/humour</category>

	<category>tags/sysadmin</category>


	<pubDate>Thu, 29 Jul 2010 18:34:15 -0400</pubDate>
	<dcterms:modified>2010-07-29T23:34:52Z</dcterms:modified>

	<description>&lt;h2&gt;Funny Tech Support Email Number 2&lt;/h2&gt;

&lt;p&gt;In the mid 2000&#39;s whilst working at an ISP the following email arrived. &lt;br /&gt;
It gave us all a good laugh at the time and today I share with you all for System&#39;s Administrator Appreciation Day.  &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lunix.com.au/blog/../images/dear_hackers.jpg&quot;&gt;&lt;img src=&quot;http://www.lunix.com.au/blog/./Funny_tech_support_email_No.2/800x600-dear_hackers.jpg&quot; width=&quot;446&quot; height=&quot;600&quot; alt=&quot;dear hacker&quot; class=&quot;imgleft&quot; /&gt;&lt;/a&gt;&lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/Funny_tech_support_email_No.2/#comments</comments>

</item>
<item>

	<title>Self Serve Dev Environment</title>


	<guid>http://www.lunix.com.au/blog/SelfServeDevEnvironment/</guid>

	<link>http://www.lunix.com.au/blog/SelfServeDevEnvironment/</link>


	<category>tags/devops</category>

	<category>tags/general</category>

	<category>tags/sysadmin</category>


	<pubDate>Sat, 24 Jul 2010 03:12:11 -0400</pubDate>
	<dcterms:modified>2010-07-24T07:37:30Z</dcterms:modified>

	<description>&lt;h1&gt;Introduction&lt;/h1&gt;

&lt;p&gt;I am currently working in a web development shop. We develop and maintain a range of websites/webapps for customers. &lt;br /&gt;
At $WORK we have many varied customers each with their own unique Production Environments (&lt;em&gt;PE from here on in&lt;/em&gt;). &lt;br /&gt;
Our $DEVs are also free to run any *nix based OS on their workstations. &lt;br /&gt;
One of the challeges we have had in the past is making a copy of a customer&#39;s PE easily available to our $DEVS. &lt;br /&gt;
This used to require lodging a task in Redmine and waiting for a Systems Admin to build you a VM on a central VM server. &lt;br /&gt;
This post will show how we are now using common FOSS tools to give enable to $DEVS to have VM&#39;s on their own workstations that mimick a customer&#39;s PE.  &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Whilst I make mention of some specific tools in this post they can be swapped out in most places for alternates however I have not tested the &lt;br /&gt;
alternatives yet. ie: puppet/chef, mercurial/git, centos/ubuntu.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;Notes on the Challenge&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;needs to be simple not an obsticle - if it&#39;s slower than just getting a sysadmin to build it for you then its a fail  &lt;/li&gt;
&lt;li&gt;simplicity generally means easy to fix when something goes wrong in the wheel.&lt;/li&gt;
&lt;li&gt;self-serve - no waiting for sysadmins &lt;/li&gt;
&lt;li&gt;visability - everything in DVCS and &lt;a href=&quot;http://redmine.org&quot;&gt;Redmine&lt;/a&gt; (project managent software)  &lt;/li&gt;
&lt;li&gt;needed to be repeatable - $DEVs needed to easily be able to build, destroy and build again  &lt;/li&gt;
&lt;li&gt;relatively self documenting - read the kickstart or puppet manifests  &lt;/li&gt;
&lt;li&gt;I hate OS images - They&#39;re big, cumbersome and pain in my..err..storage  &lt;a href=&quot;http://madstop.com/2009/02/04/golden-image-or-foil-ball/&quot; title=&quot;Luke Kanies&quot;&gt;See - Golden Image or Foil Ball?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;After spending a fair amount of time on this and looking at many of the VM/cloud management solutions out there I have decided that while some are very nice and useful I do not believe they are suiteable for our situation. Most VM/cloud management tools are built around the &quot;OS Image&quot; and require each workstation to &#39;register&#39; as a &lt;em&gt;node&lt;/em&gt;.    &lt;/p&gt;

&lt;h1&gt;Current solution&lt;/h1&gt;

&lt;p&gt;After doing the full circle of research we are now using a simple collection of existing tools. &lt;br /&gt;
It was all there staring me in the face all along. &lt;em&gt;Libvirt, virt-install kickstart puppet, mercurial and a wiki entry.&lt;/em&gt; 
A $DEV just needs to make sure he/she has libvirt, virt-install, virt-viewer installed. &lt;br /&gt;
We are using KVM to provide the virtualisation layer but through the use of libvirt you should be able to use any libvirt compatible virtualisation provider.(virtual box etc)  &lt;/p&gt;

&lt;h2&gt;Technologies used&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;a httpd server (nginx, apache etc) - to serve kickstart + yum repos/mirror  &lt;/li&gt;
&lt;li&gt;Own yum repos + centos mirror ( again ubuntu mirror etc )  &lt;/li&gt;
&lt;li&gt;puppetmasterd ( or other CF tool ie: chef etc )  with autosign turned on (we have a separate puppetmaser for the $DEVS)  &lt;/li&gt;
&lt;li&gt;some kickstart files - I use one per customer and bootstrap puppet from the %POST section  &lt;/li&gt;
&lt;li&gt;libvirtd + KVM/qemu - could be any supported virtualisation software supported by libvirt  &lt;/li&gt;
&lt;li&gt;python-virtinst + virt-viewer&lt;/li&gt;
&lt;li&gt;dhcpd  &lt;/li&gt;
&lt;li&gt;forward and reverse dns - puppet will fail to work as expected without it  ( I use powerdns-recursor for demos as it exports /etc/hosts )&lt;/li&gt;
&lt;li&gt;redmine - we make use of Redmine&#39;s ACL&#39;s to visualize the repos for puppet and kickstart files per customer&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Devs&lt;/h2&gt;

&lt;p&gt;The following is the steps needed for a $DEV to deploy a customer&#39;s &lt;em&gt;PE&lt;/em&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check &lt;a href=&quot;http://www.lunix.com.au/blog/../SelfServeDevEnvironment/network/&quot;&gt;network&lt;/a&gt; page and grab an available network &lt;em&gt;mac&lt;/em&gt; to use (this is used for dhcp &amp;amp; dns so puppet works properly) &lt;br /&gt;
and the name of the customers kickstart file.  &lt;/li&gt;
&lt;li&gt;update wiki page to say that &lt;em&gt;network mac&lt;/em&gt; is in use.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;deploy a VM on their workstation. - See &lt;a href=&quot;http://www.lunix.com.au/blog/../SelfServeDevEnvironment/libvirt/&quot;&gt;Libvirt tips&lt;/a&gt;  &lt;/p&gt;

&lt;p&gt;virt-install --connect qemu:///system --accelerate -n  virt01 -m 54:52:00:37:2E:B9 -r 1024 --vcpus=1 --disk pool=lvm,bus=virtio,size=20 --vnc --os-type linux --os-variant=rhel5 --network=network:default -l http://192.168.1.250/os/CentOS/5.5/os/x86_64/ -x &quot;ks=http://192.168.1.250/ks/project_customer1.ks&quot;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This will take advantage of the fact that both CentOS and Ubuntu have the necessary PXE files stored in their mirrors for booting the installer.&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;wait approx 10 or so minutes and they have a clone of the customer&#39;s &lt;em&gt;PE&lt;/em&gt; on their workstation ready to deploy to and hack on.  &lt;em&gt;see notes in conclusion below&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;New customers&lt;/h2&gt;

&lt;p&gt;The following is what&#39;s involved in preparing for a new customer:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A new customer has a VM/server provisioned in a DC by a hosting company.&lt;/li&gt;
&lt;li&gt;I grab the current package list and make a &lt;a href=&quot;http://www.lunix.com.au/blog/../SelfServeDevEnvironment/ExampleKickstartFile/&quot;&gt;kickstart&lt;/a&gt; file to replicate the install locally&lt;/li&gt;
&lt;li&gt;Create a new &lt;code&gt;project_customer3&lt;/code&gt; in puppet and add details to bottom of the new kickstart file.&lt;/li&gt;
&lt;li&gt;publish new kickstart file and update wiki entry&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;Conclusion&lt;/h1&gt;

&lt;p&gt;I have reduced the time it takes for a dev to get a copy of a customers &lt;em&gt;PE&lt;/em&gt; down from days to minutes and its now a self serve solution. &lt;br /&gt;
There is still more to refine in this but it&#39;s already full of win as I now get to do more of &#39;stuff that matters&#39;  &lt;/p&gt;

&lt;p&gt;It&#39;s early days for us using this new setup and I am yet to work out an easy, effective way of notifying a $DEV when puppet has finished the buildout. Suggestions welcome.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;cucumber tests ?&lt;/li&gt;
&lt;li&gt;using libnotify via Dbus ? ( suggestion made at a recent &lt;a href=&quot;http://groups.google.com/group/devops-aus&quot; title=&quot;DevOps Sydney&quot;&gt;DevOps Sydney&lt;/a&gt; meetup )&lt;/li&gt;
&lt;li&gt;??&lt;/li&gt;
&lt;/ul&gt;
</description>


	<comments>http://www.lunix.com.au/blog/SelfServeDevEnvironment/#comments</comments>

</item>
<item>

	<title>migrating drupal6 to mercury</title>


	<guid>http://www.lunix.com.au/blog/migrating_drupal6_to_mercury/</guid>

	<link>http://www.lunix.com.au/blog/migrating_drupal6_to_mercury/</link>


	<category>tags/drupal</category>

	<category>tags/general</category>


	<pubDate>Tue, 13 Jul 2010 19:37:54 -0400</pubDate>
	<dcterms:modified>2010-07-14T00:00:41Z</dcterms:modified>

	<description>&lt;h1&gt;Migrating an existing Drupal6 site to Mercury&lt;/h1&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lunix.com.au/blog/../images/mercury-logo.jpg&quot;&gt;&lt;img src=&quot;http://www.lunix.com.au/blog/./migrating_drupal6_to_mercury/250x-mercury-logo.jpg&quot; width=&quot;250&quot; height=&quot;82&quot; alt=&quot;Mercury&quot; class=&quot;imgleft&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;Mercury is a very fast hosting solution for hosting Drupal sites. &lt;br /&gt;
The following quote from &lt;code&gt;http://getpantheon.com/mercury/what-is-mercury&lt;/code&gt; describes it perfectly.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Mercury is a drop-in replacement for your Drupal website hosting service that  
delivers break-through performance. Mercury can serve two-hundred times more  
pages per second and generate pages three times faster than standard hosting  
services.  
How is this possible?  
By standing on the shoulders of giants.  
We&#39;ve integrated, borrowed, tuned and tweaked the fastest open-source hosting  
technologies available so that they can at last work perfectly with Drupal at  
the click of a button.  
You can read all of the technical details here.  
The tools and techniques available in Mercury have been around for some time,  
but were expensive and tricky to integrate with Drupal in the past.  
Now, finally, they are available for everyone.  
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The following is a post on how I migrate my sites from a standard Drupal6 hosting server to a Mercury based hosting server. &lt;br /&gt;
We manage all our sites in GIT. You can read more about how we are doing it in another post - &lt;a href=&quot;http://www.lunix.com.au/blog/./drupal-git-workflow-pt1/&quot;&gt;drupal-git-workflow-pt1&lt;/a&gt; &lt;br /&gt;
One thing to mention here is that when we build a new Mercury server there is only 3 modules placed into &lt;code&gt;sites/all/modules&lt;/code&gt; &lt;br /&gt;
&lt;em&gt;cacherouter  memcache  varnish&lt;/em&gt;. The rest are kept as part of a sites individual repository. &lt;br /&gt;
This allows a site to be able to easily migrated between a Mercury and non-Mercury server.  &lt;/p&gt;

&lt;h2&gt;HOWTO&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Clone the site&#39;s repository into the sites/ folder: &lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;git clone gitosis@gitserver:example.com.au.git&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;Initialize submodules: &lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;git submodule init&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;Update submodules: &lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;git submodule update&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;Place existing site offline (on Drupal6 server) to stop any new changes to database happening (use drush)&lt;/li&gt;
&lt;li&gt;Dump the database and load up on Mercury server&lt;/li&gt;
&lt;li&gt;Copy &lt;code&gt;sites/example.com.au/files&lt;/code&gt; to the new Mercury server.(rsync or scp -r)&lt;/li&gt;
&lt;li&gt;Configure the settings.php file to point to the right database. (if necessary)&lt;/li&gt;
&lt;li&gt;add the following to the bottom of settings.php&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
    ##########################
    #
    # Mercury Settings
    #
    # Alter With Caution :)
    #
    ##########################
    # Varnish reverse proxy on localhost
    $conf[&#39;reverse_proxy&#39;] = TRUE;           
    $conf[&#39;reverse_proxy_addresses&#39;] = array(&#39;127.0.0.1&#39;); 
    # Memcached configuration
    $conf[&#39;cache_inc&#39;] = &#39;./sites/all/modules/memcache/memcache.inc&#39;;
    $conf[&#39;memcache_servers&#39;] = array(
      &#39;127.0.0.1:11211&#39; =&amp;gt; &#39;default&#39;,
    );
    $conf[&#39;memcache_key_prefix&#39;] = &#39;example.com.au&#39;;
    ### END Mercury settings
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Create an Apache vhost and restart apache  &lt;strong&gt;should already be done by &lt;a href=&quot;http://www.puppetlabs.com/&quot;&gt;puppet&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Setup caching modules for site&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
    DSITE=&quot;example.com.au&quot;
    drush -l $DSITE en cacherouter
    drush -l $DSITE vset --yes cache 3
    drush -l $DSITE vset --yes cache_lifetime 0
    drush -l $DSITE vset --yes page_cache_max_age 600
    drush -l $DSITE vset --yes block_cache 1
    drush -l $DSITE vset --yes preprocess_css 1
    drush -l $DSITE vset --yes preprocess_js 1
    drush -l $DSITE vset --yes page_compression 0
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;clear any Drupal cache entries &lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
drush -l $DSITE cache-clear all
&lt;/pre&gt;

&lt;ul&gt;
&lt;li&gt;test on port 9880 first then port 80 if successfull.&lt;/li&gt;
&lt;li&gt;install cron&lt;/li&gt;
&lt;/ul&gt;

&lt;pre&gt;
    0 * * * * /usr/bin/wget -O - -q -t 1 http://example.com.au:9880/cron.php
&lt;/pre&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;Please note that this is how we do the migration onto our own servers built following the Mercury install documents minus the Solr-search. Some adjustments may be necessary by you to follow these on a complete Mercury platform.  &lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/migrating_drupal6_to_mercury/#comments</comments>

</item>
<item>

	<title>drupal-git-workflow-pt1</title>


	<guid>http://www.lunix.com.au/blog/drupal-git-workflow-pt1/</guid>

	<link>http://www.lunix.com.au/blog/drupal-git-workflow-pt1/</link>


	<category>tags/drupal</category>

	<category>tags/general</category>


	<pubDate>Thu, 01 Jul 2010 02:34:25 -0400</pubDate>
	<dcterms:modified>2010-08-16T23:10:39Z</dcterms:modified>

	<description>&lt;h2&gt;Managing Drupal sites with git - Part 1&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lunix.com.au/blog/../images/drupal_logo.jpg&quot;&gt;&lt;img src=&quot;http://www.lunix.com.au/blog/./drupal-git-workflow-pt1/250x-drupal_logo.jpg&quot; width=&quot;250&quot; height=&quot;287&quot; alt=&quot;Drupal&quot; class=&quot;imgleft&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At $WORK we build and manage quite a few Drupal sites. &lt;br /&gt;
In an effort to streamline things we are trialling a new workflow when working on Drupal sites. &lt;br /&gt;
The goals we wanted to achieve was to have everything in GIT and to have each customers site &lt;em&gt;portable&lt;/em&gt;. &lt;br /&gt;
By &lt;em&gt;portable&lt;/em&gt; I mean that it can easily be moved between our different drupal servers and also between Drupal multisite and dedicated Drupal hosting. &lt;br /&gt;
We have GIT repos of all the Drupal modules we use and use GIT submodules to drag these modules in for a site. &lt;br /&gt;
Each night a tarball of the sites mysql and sites/example.com/files/ is sent to a central server that serves these out via HTTPS (with AUTH of course). &lt;br /&gt;
This makes it very easy for a developer to grab production data to develop with. &lt;br /&gt;
Below is an example of our current workflow. This is only a day old and not really been put to a lot of use but in testing it seems to flow ok. Time will tell.  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Setup a Drupal install if you don&#39;t have one: &lt;code&gt;git clone gitosis@gitserver:drupal6.git /var/www/drupal&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Clone the site&#39;s repository into the sites/ folder: &lt;code&gt;git clone gitosis@gitserver:example.com.au.git /var/www/drupal/sites/example.com&lt;/code&gt;
&lt;ul&gt;
&lt;li&gt;Change into freshly cloned sites folder &lt;code&gt;cd /var/www/drupal/sites/example.com&lt;/code&gt;  &lt;/li&gt;
&lt;li&gt;Initialize submodules: &lt;code&gt;git submodule init&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Update submodules: &lt;code&gt;git submodule update&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Download and install the latest database backup. Take care to remove the contained email addresses.&lt;/li&gt;
&lt;li&gt;Download the latest files folder backup and extract into the site&#39;s folder.&lt;/li&gt;
&lt;li&gt;Configure the settings.php file to point to the right database.&lt;/li&gt;
&lt;li&gt;Create an Apache vhost and /etc/hosts entry to point traffic to your local installation&lt;/li&gt;
&lt;li&gt;Make your modifications.&lt;/li&gt;
&lt;li&gt;Commit to your Git repository.&lt;/li&gt;
&lt;li&gt;Push to the main repository if you have write access, otherwise notify someone who does.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;Notes&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Everything is kept in the domains site folder(sites/example.com) and nothing goes in sites/all or sites/default  &lt;/li&gt;
&lt;li&gt;Sites must be self contained, i.e., they should not make reference to anything from another sites folder, including &lt;em&gt;sites/all&lt;/em&gt;.  &lt;/li&gt;
&lt;li&gt;All modules must be added as Git submodules.  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It&#39;s very early days using this new workflow so I am not sure how well it will go but so far it appears to be a big step in the right direction. &lt;br /&gt;
Once we have mastered this and converted all our sites over to GIT we will then look to finding a better way to handle sql changes progressing through the dev,test,staging,production lifecycle.  &lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/drupal-git-workflow-pt1/#comments</comments>

</item>
<item>

	<title>install-gitosis-on-centos5</title>


	<guid>http://www.lunix.com.au/blog/install-gitosis-on-centos5/</guid>

	<link>http://www.lunix.com.au/blog/install-gitosis-on-centos5/</link>


	<category>tags/general</category>

	<category>tags/git</category>


	<pubDate>Mon, 10 May 2010 19:51:46 -0400</pubDate>
	<dcterms:modified>2010-07-01T07:23:49Z</dcterms:modified>

	<description>&lt;h1&gt;Howto: Install git, gitosis &amp;amp; gitweb on CentOS 5&lt;/h1&gt;

&lt;h2&gt;Introduction&lt;/h2&gt;

&lt;p&gt;GIT is a powerful DVCS system. Gitweb is a Web-UI to visualize the repos. Gitosis takes the pain out of managing multiple GIT repos and all the ACL&#39;s. &lt;br /&gt;
It uses a git repos to manage the git repos with all connections done via a shared ssh/shell account and authentication is done via ssh private/public keys.&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;p&gt;In order to install git, gitweb &amp;amp; gitosis we need to add the &lt;a href=&quot;http://fedoraproject.org/wiki/EPEL/FAQ#howtouse&quot;&gt;EPEL&lt;/a&gt; yum repository:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once that is done we install git, git-web and gitosis:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;yum install git gitweb gitosis
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If all went well you should now have all three things installed. Now to setup gitosis to manage our repos. &lt;br /&gt;
At the core of gitosis is a &lt;em&gt;special&lt;/em&gt; git repos called &lt;strong&gt;gitosis-admin&lt;/strong&gt;  The contents of this will be explained soon.  &lt;/p&gt;

&lt;p&gt;To get started you will want to copy your ssh public key to a tmp place on the server &lt;em&gt;tmp/user.pub&lt;/em&gt; and then issue the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo -H -u gitosis gitosis-init &amp;lt; /tmp/user.pub  
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will setup gitosis ready to serve git repos from &lt;em&gt;/var/lib/gitosis/&lt;/em&gt; &lt;br /&gt;
On your local machine, you&#39;ll now be able to clone the gitosis admin repository with the following command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone gitosis@example.com:gitosis-admin.git
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The gitosis-admin repository contains a directory named keydir/ and a file named gitosis.conf.&lt;/p&gt;

&lt;p&gt;The &lt;em&gt;keydir/&lt;/em&gt; contains the SSH public keys for your users in files named in the convention of [username].pub. Each user of your git repositories will have their own file in &lt;em&gt;keydir/&lt;/em&gt; the username is for internal gitosis use, and needn&#39;t correspond with any shell username.  &lt;/p&gt;

&lt;p&gt;The &lt;em&gt;gitosis.conf&lt;/em&gt; file contains a set of access control rules that can be used to provide people access to a particular repository. An access control block looks like this:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[group devs-rw]
    writable = iphone-project wiki drupal7
    members = mick alex adam mary

[group devs-ro]
    readonly = iphone-project wiki drupal7
    members = john
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This block gives the users (e.g. keys in the keydir/) &quot;mick&quot;, &quot;alex&quot;, &quot;adam&quot; and &quot;mary&quot; write(push) access to the iphone-project, wiki &amp;amp; drupal repositories. Note that repositories in the &quot;writable&quot; list needn&#39;t exist before a user pushes to them, as &lt;em&gt;gitosis&lt;/em&gt; will create the new repositories if needed.
Also the user &quot;john&quot; has readonly(clone) access to the same 3 repos. He is not allowed to push.&lt;/p&gt;

&lt;p&gt;To create a new repository, just add it to the writable list of a gitosis group. All repositories will have &quot;clone&quot; or &quot;remote&quot; URLs in the following form:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;gitosis@example.com:&amp;#036;reponame.git
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You may have as many &quot;groups&quot; as you need to support your workflow.  &lt;/p&gt;

&lt;p&gt;You should now have a fully working gitosis &lt;em&gt;server&lt;/em&gt;. All that is left to do is to enable &lt;em&gt;gitweb&lt;/em&gt; so that you can visualize all of the repos in one place. &lt;br /&gt;
Lucky for us this is almost completely done with the yum install earlier. A simple apache restart and that&#39;s it. &lt;br /&gt;
The following URL should bring up a working gitweb instance. Of course it will be empty to start with.  &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;http://example.com/git/gitweb.cgi
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: &lt;em&gt;A repos created with gitosis above will not be visible by default in gitweb. A simple file permission change will take care of this.&lt;/em&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;chmod 755 /var/lib/gitosis/repositories/&amp;#036;REPOSNAME
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Conclusion&lt;/h2&gt;

&lt;p&gt;You should now have a fully working central &lt;em&gt;git&lt;/em&gt; server managed by gitosis and visualised by gitweb.&lt;/p&gt;

&lt;p&gt;Cheers
Mick&lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/install-gitosis-on-centos5/#comments</comments>

</item>
<item>

	<title>archlinux</title>


	<guid>http://www.lunix.com.au/blog/archlinux/</guid>

	<link>http://www.lunix.com.au/blog/archlinux/</link>


	<category>tags/general</category>


	<pubDate>Fri, 05 Mar 2010 04:25:43 -0500</pubDate>
	<dcterms:modified>2010-03-05T09:38:02Z</dcterms:modified>

	<description>&lt;h2&gt;Archlinux&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://archlinux.org&quot;&gt;Archlinux&lt;/a&gt; is my favourite personal workstation distribution.  &lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lunix.com.au/blog/../images/cleanscreen.jpg&quot;&gt;&lt;img src=&quot;http://www.lunix.com.au/blog/./archlinux/200x200-cleanscreen.jpg&quot; width=&quot;200&quot; height=&quot;124&quot; alt=&quot;Clean Screen&quot; /&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;evilwm + trayer + conky ( + xbindkeys )  &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href=&quot;http://www.lunix.com.au/blog/../images/busyscreen.jpg&quot;&gt;&lt;img src=&quot;http://www.lunix.com.au/blog/./archlinux/200x200-busyscreen.jpg&quot; width=&quot;200&quot; height=&quot;125&quot; alt=&quot;Busy Screen&quot; /&gt;&lt;/a&gt;  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;evilwm + trayer + conky + terminator ( + xbindkeys )  &lt;/li&gt;
&lt;/ul&gt;
</description>


	<comments>http://www.lunix.com.au/blog/archlinux/#comments</comments>

</item>
<item>

	<title>openssh and X11 forwarding</title>


	<guid>http://www.lunix.com.au/blog/openssh-and-x11-forwarding/</guid>

	<link>http://www.lunix.com.au/blog/openssh-and-x11-forwarding/</link>


	<category>tags/general</category>

	<category>tags/sysadmin</category>

	<category>tags/tips</category>


	<pubDate>Thu, 29 Jan 2009 06:17:00 -0500</pubDate>
	<dcterms:modified>2009-01-29T11:17:00Z</dcterms:modified>

	<description>&lt;p&gt;Occasionally you may come across times where you need to run an X application on a remote, headless server. &lt;br /&gt;
Today was one of those occasions for me. &lt;br /&gt;
Installing xorg etc to add X to the server is a reasonable amount of work and not really a choice. &lt;br /&gt;
openssh has an option to tunnel X11 connections and auto setup the $DISPLAY environment variable on the remote host. &lt;br /&gt;
This can be done either on the fly with a switch to the ssh client or a permenant setup by changing the config file for openssh.  &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[lunix@godzilla ~]&amp;#036; ssh -Y admin@10.20.1.254
admin@10.20.1.254&#39;s password:
Last login: Fri Jan 30 00:22:23 2009 from dynamic-20.home.lunix.com.au
/usr/bin/xauth:  creating new authority file /home/admin/.Xauthority
[admin@gateway01 ~]&amp;#036; echo &amp;#036;DISPLAY
localhost:10.0
[admin@gateway01 ~]&amp;#036;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This extract of ~/.ssh/config shows how to make the X11 forwarding more permenant.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;Host remotehost
ForwardX11 yes
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once this has been done and the $DISPLAY env. variable is set you should be able to fire up an application that displays its output via X.  &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[lunix@godzilla ~]&amp;#036; wireshark
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This will then fire up wireshark sending its output to X via localhost:10.0 which will tunnel it across ssh to your local screen. &lt;br /&gt;
Remeber this may be a bit slower than running it locally but it works.&lt;/p&gt;

&lt;p&gt;I ran into problems this morning the first time I logged in with ssh -Y with the $DISPLAY env variable not being set. &lt;br /&gt;
To diagnose this I retried the ssh command with the extra options of -vv. Here is a snippet of the output.  &lt;/p&gt;

&lt;pre&gt;&lt;code&gt;[lunix@godzilla ~]&amp;#036; ssh -vv -Y admin@10.20.1.254
admin@10.20.1.254&#39;s password:
...
debug2: x11_get_proto: /usr/bin/xauth  list :0 2&amp;gt;/dev/null
debug1: Requesting X11 forwarding with authentication spoofing.
..
..
debug1: Remote: No xauth program; cannot forward with spoofing.
..
Last login: Fri Jan 30 06:48:28 2009 from dynamic-20.home.lunix.com.au
[admin@gateway01 ~]&amp;#036; echo &amp;#036;DISPLAY

[admin@gateway01 ~]&amp;#036;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;$DISPLAY wasn&#39;t set. In my case the debug1: line mentioning a missing xauth program was the problem. &lt;br /&gt;
A simple &lt;em&gt;yum install xorg-x11-xauth&lt;/em&gt; fixed this. ( centos 5 )&lt;/p&gt;

&lt;p&gt;Hope this helps.&lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/openssh-and-x11-forwarding/#comments</comments>

</item>
<item>

	<title>Usefull strace primer</title>


	<guid>http://www.lunix.com.au/blog/usefull-strace-primer/</guid>

	<link>http://www.lunix.com.au/blog/usefull-strace-primer/</link>


	<category>tags/general</category>

	<category>tags/sysadmin</category>

	<category>tags/tips</category>


	<pubDate>Thu, 08 Jan 2009 23:09:00 -0500</pubDate>
	<dcterms:modified>2009-01-09T04:09:00Z</dcterms:modified>

	<description>&lt;p&gt;&lt;em&gt;I&#39;m posting this here for both future use by myself and in the hope it&#39;s usefull to anyone else.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Have you ever racked your brain to find that bug? You know, the bug that you can&#39;t find in the source code, &lt;br /&gt;
but which appears with deliberate consistency when your code is compiled and run. &lt;br /&gt;
Hacker, meet &lt;strong&gt;strace&lt;/strong&gt;. &lt;br /&gt;
strace is a utility that allows you to trace system calls and signals for a given command and its arguments. &lt;/p&gt;

&lt;p&gt;Full article is over at the &lt;a href=&quot;http://www.redhat.com/magazine/010aug05/features/strace/&quot;&gt;Redhat Magazine&lt;/a&gt;&lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/usefull-strace-primer/#comments</comments>

</item>
<item>

	<title>Simple portscanning with bash and netcat</title>


	<guid>http://www.lunix.com.au/blog/simple-portscanning-with-bash-and-netcat/</guid>

	<link>http://www.lunix.com.au/blog/simple-portscanning-with-bash-and-netcat/</link>


	<category>tags/general</category>

	<category>tags/sysadmin</category>

	<category>tags/tips</category>


	<pubDate>Tue, 30 Dec 2008 20:05:00 -0500</pubDate>
	<dcterms:modified>2008-12-31T01:05:00Z</dcterms:modified>

	<description>&lt;p&gt;Today I was presented with the need to find all the machines on a network that have port 22 open. &lt;br /&gt;
This can easily be achieved with nmap.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo nmap -sS -p22 192.168.1.0/24
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;However the only box I had was a &#39;linux router&#39; with a minimalistic linux install and no access to install extra packages. &lt;br /&gt;
What I ended up using was a very simple shell script with nothing more than a for loop and netcat.&lt;/p&gt;

&lt;pre class=&quot;hl&quot;&gt;    &lt;span class=&quot;hl slc&quot;&gt;#!/bin/bash&lt;/span&gt;
    &lt;span class=&quot;hl kwa&quot;&gt;for&lt;/span&gt; h &lt;span class=&quot;hl kwa&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl num&quot;&gt;2&lt;/span&gt;.&lt;span class=&quot;hl num&quot;&gt;.254&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;};&lt;/span&gt;
    &lt;span class=&quot;hl kwa&quot;&gt;do&lt;/span&gt;
            nc &lt;span class=&quot;hl sym&quot;&gt;-&lt;/span&gt;z &lt;span class=&quot;hl num&quot;&gt;192.168.111&lt;/span&gt;.&lt;span class=&quot;hl kwb&quot;&gt;$h&lt;/span&gt; &lt;span class=&quot;hl num&quot;&gt;22&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;hl kwa&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;[&lt;/span&gt; $? &lt;span class=&quot;hl sym&quot;&gt;-&lt;/span&gt;eq &lt;span class=&quot;hl num&quot;&gt;0&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;];&lt;/span&gt; &lt;span class=&quot;hl kwa&quot;&gt;then&lt;/span&gt;
                    &lt;span class=&quot;hl kwb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;hl sym&quot;&gt;-&lt;/span&gt;e &lt;span class=&quot;hl str&quot;&gt;&amp;quot;192.168.111.$h&lt;/span&gt;&lt;span class=&quot;hl esc&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;hl str&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl sym&quot;&gt;;&lt;/span&gt;
            &lt;span class=&quot;hl kwa&quot;&gt;fi&lt;/span&gt;
    &lt;span class=&quot;hl kwa&quot;&gt;done&lt;/span&gt;
&lt;/pre&gt;

&lt;p&gt;The -z flag to nc ( netcat ) tells it &#39;no io&#39; then I just test for the exit code it gives. &lt;br /&gt;
Simple. &lt;/p&gt;
</description>


	<comments>http://www.lunix.com.au/blog/simple-portscanning-with-bash-and-netcat/#comments</comments>

</item>

</channel>
</rss>
