<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="https://www.stress-free.co.nz"  xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>stressfree - linux</title>
 <link>https://www.stress-free.co.nz/tech/linux</link>
 <description></description>
 <language>en</language>
<item>
 <title>Tuning Ubuntu&#039;s software RAID</title>
 <link>https://www.stress-free.co.nz/tuning_ubuntus_software_raid</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;Recently I encountered an issue where the read/write performance of Ubuntu&#039;s software RAID configuration was relatively poor. Fortunately, others have encountered this problem and have documented a potential cause and solution here:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://randomitblog.blogspot.com/2009/10/ubuntu-raid-tweak.html&quot;&gt;Ubuntu RAID Tweak&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href=&quot;http://peterkieser.com/2009/11/29/raid-mdraid-stripe_cache_size-vs-write-transfer/&quot;&gt;Linux RAID mdraid &quot;stripe_cache_size&quot; vs. transfer rate&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;The short story is that Ubuntu uses some very conservative defaults for RAID caching. Whilst this may ensure reliable behavior across a range of hardware, it does mean that for many read/write performance will be lacklustre. The solution to this problem is to define a more aggressive caching options on any software RAID partitions that are in use.&lt;/p&gt;&lt;!--break--&gt;&lt;h3&gt;Setting the stripe_cache_size and read ahead caches&lt;/h3&gt;&lt;p&gt;The following example assumes that the Ubuntu server has two software-based RAID-5 partitions, &lt;strong&gt;/dev/md0&lt;/strong&gt; (the root partition) and &lt;strong&gt;/dev/md1&lt;/strong&gt; (the /var partition).&lt;/p&gt;&lt;p&gt;Set the stripe_cache_size and read ahead caches in the &lt;strong&gt;/etc/rc.local&lt;/strong&gt; script. In the example below the stripe_cache_size is set to 8192, and the read ahead cache 4096:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;#!/bin/sh -e&lt;br /&gt;#&lt;br /&gt;# rc.local&lt;br /&gt;#&lt;br /&gt;# This script is executed at the end of each multiuser runlevel.&lt;br /&gt;# Make sure that the script will &quot;exit 0&quot; on success or any other&lt;br /&gt;# value on error.&lt;br /&gt;#&lt;br /&gt;# In order to enable or disable this script just change the execution bits.&lt;br /&gt;#&lt;br /&gt;# By default this script does nothing.&lt;br /&gt;&lt;br /&gt;# Tune the RAID5 configuration&lt;br /&gt;echo 8192 &amp;gt; /sys/block/md0/md/stripe_cache_size&lt;br /&gt;echo 8192 &amp;gt; /sys/block/md1/md/stripe_cache_size&lt;br /&gt;&lt;br /&gt;blockdev --setra 4096 /dev/md0&lt;br /&gt;blockdev --setra 4096 /dev/md1&lt;br /&gt;&lt;br /&gt;exit 0&lt;/p&gt;&lt;p&gt;Restart Ubuntu to apply these settings.&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; It is possible to apply these changes without a restart by executing each directive at the command line.&lt;/p&gt;&lt;p&gt;The pages linked to above explain how to test the influence of these cache changes. In general I have found that the parameters given in the example above have improved performance without influencing the reliability of the system, or the data stored on it. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/raid&quot;&gt;raid&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ubuntu&quot;&gt;ubuntu&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Fri, 23 Apr 2010 03:04:31 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">556 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>USB devices with VMWare Server 2.0 on Ubuntu</title>
 <link>https://www.stress-free.co.nz/usb_devices_with_vmware_server_20_on_ubuntu</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/usb-logo.png&quot; alt=&quot;&quot; width=&quot;90&quot; height=&quot;91&quot; /&gt;&lt;/div&gt;
&lt;p&gt;One of the nice features of &lt;a href=&quot;http://www.vmware.com/products/server/&quot;&gt;VMWare Server 2.0&lt;/a&gt; is that it supports the forwarding of USB devices to virtual machines. Unfortunately when it comes to Linux the VMWare team have leveraged an old method (/proc/bus/usb) for scanning the USB bus which newer distributions, such as &lt;a href=&quot;https://bugs.launchpad.net/ubuntu/%2Bbug/157843&quot;&gt;Ubuntu Server 8.04 no longer support&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To resolve this problem the &quot;old&quot; method for scanning for USB devices must be enabled in the underlying operating system. In the case of Ubuntu Server 8.04 this is a case of editing the file &lt;strong&gt;/etc/init.d/mountdevsubfs.sh&lt;/strong&gt; and uncommenting the following section:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#&lt;br /&gt; # Magic to make /proc/bus/usb work&lt;br /&gt; #&lt;br /&gt; mkdir -p /dev/bus/usb/.usbfs&lt;br /&gt; domount usbfs &quot;&quot; /dev/bus/usb/.usbfs -obusmode=0700,devmode=0600,listmode=0644&lt;br /&gt; ln -s .usbfs/devices /dev/bus/usb/devices&lt;br /&gt; mount --rbind /dev/bus/usb /proc/bus/usb&lt;/p&gt;
&lt;p&gt;Reboot the server and /proc/bus/usb should be functional once more.&lt;/p&gt;
&lt;h2&gt;Activating a USB device within a virtual machine&lt;/h2&gt;
&lt;p&gt;Once the underlying USB subsystem is configured the USB device needs to be associated with a virtual machine. For this to occur the virtual machine must have the USB Controller added to its virtual hardware configuration. If the controller is not already part of the virtual machine&#039;s configuration shutdown the VM, add the device and restart.&lt;/p&gt;
&lt;div class=&quot;centeredimage&quot;&gt;&lt;a href=&quot;/sites/default/files/u63/vmware-usb-lg.jpg&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/vmware-usb-sm.jpg&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;227&quot; /&gt;&lt;br /&gt;The VMWare web console with USB device selection (click to enlarge)&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;Assuming there are USB devices attached to the server, once the virtual machine boots a small USB icon will appear within the VMWare web management console. Click on the icon and select the relevant USB device to attach it to the running virtual machine.&lt;/p&gt;
&lt;p&gt;All going well the USB device will appear within the virtual machine as an accessible device. VMWare Server remembers this selection, so the next time the virtual machine (or server itself) is restarted the USB device will automatically be attached to the running VM.&lt;/p&gt;
&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/virtualisation&quot;&gt;virtualisation&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ubuntu&quot;&gt;ubuntu&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/usb&quot;&gt;usb&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/vmware&quot;&gt;vmware&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Mon, 17 Aug 2009 05:17:18 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">548 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>VMWare Server 2.0 optimisations</title>
 <link>https://www.stress-free.co.nz/vmware_server_20_optimisations</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/vmware_logo.png&quot; alt=&quot;&quot; width=&quot;150&quot; height=&quot;43&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.vmware.com/products/server/&quot;&gt;VMWare Server 2.0&lt;/a&gt; is emerging as a capable, zero cost alternative to VMWare ESX when used in combination with Ubuntu Server 8.04LTS. Unfortunately &quot;out of the box&quot; performance can be a little disappointing, especially when running guest Windows virtual machines. What follows are a few system tweaks that can improve performance without hampering overall system stability. I have not come up with these myself, instead they are pruned from the following pages:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://vmfaq.com/?View=entry&amp;amp;EntryID=25&quot;&gt;VMWare FAQ: I need more performance out of my VMware environment&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://communities.vmware.com/thread/171343&quot;&gt;VMWare Communities: Performance tuning in Server 2.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://kuparinen.org/martti/comp/ubuntu/en/server.html&quot;&gt;Ubuntu Server Installation with VMware Server&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Kernel parameters&lt;/h2&gt;
&lt;p&gt;In addition to the default Ubuntu Server kernel parameters, the following should be appended to the end of &lt;strong&gt;/etc/sysctl.conf&lt;/strong&gt;.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;vm.swappiness=0&lt;br /&gt; vm.overcommit_memory=1&lt;br /&gt; vm.dirty_background_ratio=5&lt;br /&gt; vm.dirty_ratio=10&lt;br /&gt; vm.dirty_expire_centisecs=1000&lt;br /&gt; dev.rtc.max-user-freq=1024&lt;/p&gt;
&lt;p&gt;Once added reboot the server to ensure their application is successful and permanent.&lt;/p&gt;
&lt;h2&gt;Create an in-memory temp drive&lt;/h2&gt;
&lt;p&gt;In the host&#039;s /tmp directory create a new directory named vmware (e.g. /tmp/vmware). This will be used as the mount point for a tmpfs (in-memory) partition for storing VM related, temporary files.&lt;/p&gt;
&lt;p&gt;Edit &lt;strong&gt;/etc/fstab&lt;/strong&gt; and add the /tmp/vmware partition to your list of mount points:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;tmpfs /tmp/vmware tmpfs defaults,size=100% 0 0&lt;/p&gt;
&lt;p&gt;Now if you execute the following command the tmpfs filesystem will be mounted at /tmp/vmware:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;sudo mount /tmp/vmware&lt;/p&gt;
&lt;p&gt;If successful, reboot the Ubuntu server to ensure the tmpfs partition is mounted at boot time.&lt;/p&gt;
&lt;h2&gt;VMWare Server configuration&lt;/h2&gt;
&lt;p&gt;Edit the /etc/vmware/config file and ensure the following configuration declarations are set:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;prefvmx.minVmMemPct = &quot;100&quot;&lt;br /&gt; prefvmx.useRecommendedLockedMemSize = &quot;TRUE&quot;&lt;br /&gt; mainMem.partialLazySave = &quot;TRUE&quot;&lt;br /&gt; mainMem.partialLazyRestore = &quot;TRUE&quot;&lt;br /&gt; tmpDirectory = &quot;/tmp/vmware&quot;&lt;br /&gt; mainMem.useNamedFile = &quot;FALSE&quot;&lt;br /&gt; sched.mem.pshare.enable = &quot;FALSE&quot;&lt;br /&gt; MemTrimRate = &quot;0&quot;&lt;br /&gt; MemAllowAutoScaleDown = &quot;FALSE&quot;&lt;/p&gt;
&lt;p&gt;These configuration declarations instruct VMWare Server to keep all virtual machines in memory and not to write unused blocks to disk. It also sets the temporary directory to the newly created tmpfs partition at /tmp/vmware.&lt;br /&gt;Restart the VMWare Server process (sudo /etc/init.d/vmware restart) or reboot the server for these changes to take effect. The net result should be notably smoother virtual machine performance, especially when it comes to Windows guests.&lt;/p&gt;
&lt;h2&gt;Virtual machine tips&lt;/h2&gt;
&lt;ul&gt;&lt;li&gt;Always use fully allocated disk images.&lt;/li&gt;
&lt;li&gt;Do not use snapshots as they are approximately 20% slower.&lt;/li&gt;
&lt;li&gt;Always install the VMWare Tools package.&lt;/li&gt;
&lt;li&gt;If running Linux make sure the kernel is compiled for running within a VM, or is using the &lt;a href=&quot;http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&amp;amp;cmd=displayKC&amp;amp;externalId=1006427&quot;&gt;correct boot time parameters&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt; &lt;/p&gt;
&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/virtualisation&quot;&gt;virtualisation&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ubuntu&quot;&gt;ubuntu&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/vmware&quot;&gt;vmware&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Sun, 19 Jul 2009 08:42:08 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">546 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Fixing yum&#039;s &quot;Metadata file does not match checksum&quot; error</title>
 <link>https://www.stress-free.co.nz/fixing_yums_metadata_file_does_not_match_checksum_error</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;&lt;a href=&quot;http://centos.org/&quot;&gt;Centos&lt;/a&gt; is a &quot;free&quot; distribution of Red Hat Enterprise Linux which I enjoy using. Whilst it does not have Debian&#039;s apt-get for package management it does have &lt;a href=&quot;http://yum.baseurl.org/&quot;&gt;yum&lt;/a&gt;, which is not as fast but still works pretty well in most circumstances. Unfortunately today I ran into a problem in a clean install of Centos 5.3 where yum was returning the following error:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Error Message: Metadata file does not match checksum&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A quick look around &quot;&lt;a href=&quot;http://www.theonion.com/content/news_briefs/google_launches_the_google&quot;&gt;the Google&lt;/a&gt;&quot; turned up the relatively simple solution; at the terminal execute as root:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;yum clean all&lt;br /&gt; yum makecache&lt;br /&gt; yum update&lt;/p&gt;
&lt;p&gt;This process will take a little time, but the end result should be a nice, clean yum repository cache, complete with no annoying meta-data errors.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tutorials&quot;&gt;software tutorials&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/centos&quot;&gt;centos&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Mon, 13 Apr 2009 10:21:30 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">542 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Transparent Squid Authentication to eDirectory</title>
 <link>https://www.stress-free.co.nz/transparent_squid_authentication_to_edirectory</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/squid-edirectory.jpg&quot; alt=&quot;&quot; width=&quot;180&quot; height=&quot;59&quot; /&gt;&lt;/div&gt;
&lt;p&gt;This post explains how to setup a &lt;a id=&quot;le.n&quot; title=&quot;Squid HTTP proxy&quot; href=&quot;http://www.squid-cache.org/&quot;&gt;Squid HTTP proxy&lt;/a&gt; to transparently authenticate users against a &lt;a id=&quot;tlih&quot; title=&quot;Novell eDirectory&quot; href=&quot;http://www.novell.com/products/edirectory/&quot;&gt;Novell eDirectory&lt;/a&gt;. In the Novell eco-system &lt;a id=&quot;n-02&quot; title=&quot;Border Manager&quot; href=&quot;http://www.novell.com/products/bordermanager/&quot;&gt;Border Manager&lt;/a&gt; is the venerable choice for an internal firewall and proxy but it is showing its age. This guide is based on this &lt;a id=&quot;yett&quot; title=&quot;Novell Cool Solution&quot; href=&quot;http://www.novell.com/coolsolutions/feature/17777.html&quot;&gt;Novell Cool Solution&lt;/a&gt;. Unlike Border Manager, which requires the &lt;a id=&quot;y9j9&quot; title=&quot;CLNTRUST&quot; href=&quot;http://www.novell.com/coolsolutions/tip/7761.html&quot;&gt;CLNTRUST&lt;/a&gt; client-side tool, the setup described works without the need for any desktop client software.&lt;/p&gt;
&lt;h2&gt;How it works&lt;/h2&gt;
&lt;p&gt;Within a Novell managed network the eDirectory stores authenticated user&#039;s I.P. addresses. Squid performs an LDAP search against eDirectory using the incoming I.P. address of the client. If successful the authenticated username is returned and a proxy session established. If the search comes up empty Squid prompts the client to manually enter their credentials for authentication against the eDirectory. If this too fails the proxy request is denied.&lt;/p&gt;
&lt;h2&gt;eDirectory 8.8 incompatability&lt;/h2&gt;
&lt;p&gt;This solution currently only works with eDirectory &amp;lt; 8.8 because Novell has slightly changed the format they store network addresses in newer versions. At the time of writing I have not been able to test against eDirectory 8.8 so I cannot determine the required code changes or test results. Hopefully in the near future this situation will change.&lt;/p&gt;
&lt;h2&gt;Squid&#039;s external_acl_type option&lt;/h2&gt;
&lt;p&gt;Transparent authentication is made possible thanks to Squid&#039;s &lt;em&gt;external_acl_type &lt;/em&gt;configuration option. This allows external identities and groups to be identified via any external script. Once Squid is installed setting up transparent eDirectory authentication is a two step process:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt; Create and tweak the &lt;strong&gt;squid_edir_iplookup.pl&lt;/strong&gt; file. &lt;/li&gt;
&lt;li&gt; Edit the &lt;strong&gt;squid.conf&lt;/strong&gt; configuration file &lt;/li&gt;
&lt;/ol&gt;&lt;!--break--&gt;&lt;h2&gt;The engine room: squid_edir_iplookup.pl&lt;/h2&gt;
&lt;p&gt;To begin create a file named squid_edir_iplookup.pl. This file can be anywhere on your system as long as the Squid process can access it. In this example I have created the file in /usr/lib/squid/ as this is where Red Hat stores all of Squid&#039;s authentication related scripts.&lt;/p&gt;
&lt;h3&gt;/usr/lib/squid/squid_edir_iplookup.pl&lt;/h3&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#!/usr/bin/perl&lt;br /&gt; use Net::LDAP;&lt;br /&gt; use Net::LDAP::LDIF;&lt;br /&gt; use File::Path qw(rmtree);&lt;br /&gt; use File::Basename qw(basename);&lt;br /&gt;&lt;br /&gt; $HOST = &#039;your.edirectory.server&#039;;&lt;br /&gt; $PORT = 389;&lt;br /&gt; $ADMIN = &quot;cn=squid,ou=tech,o=company&quot;;&lt;br /&gt; $PASSWD = &quot;squidpassword&quot;;&lt;br /&gt; $BASEDN = &quot;o=company&quot;;&lt;br /&gt; @SITES = qw(ou=groups);&lt;br /&gt;&lt;br /&gt; $|=1;&lt;br /&gt;&lt;br /&gt; START: while (&amp;lt;&amp;gt;) {&lt;br /&gt;&lt;br /&gt; ($IP,$GROUP) = split(/ /,$_);&lt;br /&gt; # $SITE =~ tr/\n//d;&lt;br /&gt; $GROUP =~ tr/\n//d;&lt;br /&gt; $group_filter_string=&quot;&quot;;&lt;br /&gt; for $site (@SITES) {&lt;br /&gt; $group_filter_string=$group_filter_string.&quot;(groupMembership=cn=$GROUP,${site},$BASEDN)&quot;;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; $netaddress = &quot;1\#&quot;;&lt;br /&gt; @octets = split(/\./,$IP);&lt;br /&gt; foreach $octet (@octets) {&lt;br /&gt; # The IP address is stored in eDirectory as four unsigned chars. ASCII 40, 41, 42 and&lt;br /&gt; # 92 are characters ( ) *\ which are known tokens in LDAP search filters If you dont&lt;br /&gt; # escape these with a backslash they will cause LDAP errors and he script will fail.&lt;br /&gt; if ((($octet &amp;gt;= 40) &amp;amp;&amp;amp; ($octet &amp;lt;= 42)) || ($octet == 92)) {&lt;br /&gt; $netaddress = $netaddress.sprintf(&quot;\\%c&quot;,$octet)&lt;br /&gt; } else {&lt;br /&gt; $netaddress= $netaddress.sprintf(&quot;%c&quot;,$octet);&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; $filter=&quot;(&amp;amp;(objectclass=user)(|$group_filter_string)(networkAddress=$netaddress))&quot;;&lt;br /&gt; $attnames=[&#039;CN&#039;];&lt;br /&gt;&lt;br /&gt; #connect to the server&lt;br /&gt; until($ldap = Net::LDAP-&amp;gt;new($HOST, port =&amp;gt; $PORT)) {&lt;br /&gt; die &quot;Can not connect to ldap://$HOST:$PORT/&quot; if ++$count &amp;gt; 10;&lt;br /&gt; sleep 1;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; $r = $ldap-&amp;gt;start_tls();&lt;br /&gt;&lt;br /&gt; $r = $ldap-&amp;gt;bind($ADMIN, password =&amp;gt; $PASSWD, version=&amp;gt;2);&lt;br /&gt; die $r-&amp;gt;error if $r-&amp;gt;code;&lt;br /&gt;&lt;br /&gt; $r = $ldap-&amp;gt;search(base =&amp;gt; $BASEDN,&lt;br /&gt; scope =&amp;gt; &#039;sub&#039;,&lt;br /&gt; filter =&amp;gt; $filter,&lt;br /&gt; attrs =&amp;gt; $attnames);&lt;br /&gt;&lt;br /&gt; $count = $r-&amp;gt;count;&lt;br /&gt; if ($count == 0) {&lt;br /&gt; print &quot;ERR\n&quot;;&lt;br /&gt; } else {&lt;br /&gt; foreach my $entry ($r-&amp;gt;entries){&lt;br /&gt; my @values = $entry-&amp;gt;get_value(CN);&lt;br /&gt; foreach $value (@values) {&lt;br /&gt; # Many users in eDirectory have multiple CN values - usually from the user template&lt;br /&gt; # used to create them - sometimes their maiden name is noted in the Other Name&lt;br /&gt; # attribute in ConsoleOne we want to report the proper CN to squid not these bogus&lt;br /&gt; # values.&lt;br /&gt; if ($value =~ m/template|previously/i) {&lt;br /&gt; next;&lt;br /&gt; } else {&lt;br /&gt; $value =~ tr/- //d;&lt;br /&gt; print &quot;OK user=$value\n&quot;;&lt;br /&gt; next START;&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; }&lt;br /&gt; $ldap-&amp;gt;unbind;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;At the beginning of this file you want to change the $HOST, $PORT, $ADMIN, $PASSWD and $BASEDN parameters to ones that are relevant for your internal network. The @SITES array is not important as this is used in the &lt;a id=&quot;r7.2&quot; title=&quot;Cool Solution example&quot; href=&quot;http://www.novell.com/coolsolutions/feature/17777.html&quot;&gt;Cool Solution example&lt;/a&gt; to define different groups of users (something we are not concerned about here).&lt;/p&gt;
&lt;p&gt;Once you have saved the file make it executable:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;chmod a+x /usr/lib/squid/squid_edir_iplookup.pl&lt;/p&gt;
&lt;p&gt;The trickiest step is making sure you have the correct Perl libraries installed on your system for the script to run. These libraries are defined at the top of the file (the USE statements). The easiest way of testing whether the script is working is to run it:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;/usr/lib/squid/squid_edir_iplookup.pl&lt;/p&gt;
&lt;p&gt;The Perl interpreter will soon tell you if something is not right. If a required library is missing you will need to install it using your system&#039;s package management tool or directly from source (&lt;a id=&quot;rghv&quot; title=&quot;CPAN&quot; href=&quot;http://www.cpan.org/&quot;&gt;CPAN&lt;/a&gt; is useful).&lt;/p&gt;
&lt;p&gt;All going well when the script is run you will be presented with a new, blank line. Test the LDAP lookup by typing an I.P. address and pressing enter. After a brief delay a success/fail message will be returned:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;/usr/lib/squid/squid_edir_iplookup.pl&lt;br /&gt; 192.168.1.10&lt;br /&gt; ERR&lt;/p&gt;
&lt;p&gt;In the above example no valid user was found in the eDirectory at this I.P. address. If the look-up was successful the relevant username will be returned. To quit the script press &lt;em&gt;CTRL+C&lt;/em&gt;.&lt;/p&gt;
&lt;h2&gt;Editing squid.conf&lt;/h2&gt;
&lt;p&gt;With the squid_edir_iplookup.pl script in place and working it is now time to edit the Squid configuration. The exact location of this file will vary depending on your operating system, but in the case of Red Hat this is:&lt;/p&gt;
&lt;h3&gt;/etc/squid/squid.conf&lt;/h3&gt;
&lt;p class=&quot;codesnippet&quot;&gt;http_port 3128&lt;br /&gt; http_port 8080&lt;br /&gt; hierarchy_stoplist cgi-bin ?&lt;br /&gt; acl QUERY urlpath_regex cgi-bin \?&lt;br /&gt; cache deny QUERY&lt;br /&gt; acl apache rep_header Server ^Apache&lt;br /&gt; broken_vary_encoding allow apache&lt;br /&gt; access_log /var/log/squid/access.log squid&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;external_acl_type IPUser ttl=3600 %SRC /usr/lib/squid/squid_edir_iplookup.pl&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;auth_param basic program /usr/lib/squid/squid_ldap_auth -b &quot;ou=users,o=company&quot; -u cn your.edirectory.server&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;auth_param basic children 5&lt;br /&gt; auth_param basic realm Squid Web Proxy&lt;br /&gt; auth_param basic credentialsttl 1 hours&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; # Used to pull LDAP group membership based on a supplied username - not currently used&lt;br /&gt; # external_acl_type ldap_group %LOGIN /usr/lib/squid/squid_ldap_group -D cn=squid,ou=tech,o=company -w squidpassword -b o=company -s sub -f &quot;(&amp;amp;(objectclass=inetOrgPerson)(cn=%u)(groupMembership=%g))&quot; -h your.edirectory.server&lt;br /&gt;&lt;br /&gt; refresh_pattern ^ftp: 1440 20% 10080&lt;br /&gt; refresh_pattern ^gopher: 1440 0% 1440&lt;br /&gt; refresh_pattern . 0 20% 4320&lt;br /&gt;&lt;br /&gt; acl all src 0.0.0.0/0.0.0.0&lt;br /&gt; acl manager proto cache_object&lt;br /&gt; acl localhost src 127.0.0.1/255.255.255.255&lt;br /&gt; acl localnet src 192.168.1.0/255.255.255.0&lt;br /&gt; acl to_localhost dst 127.0.0.0/8&lt;br /&gt; acl SSL_ports port 443&lt;br /&gt; acl Safe_ports port 80 # http&lt;br /&gt; acl Safe_ports port 21 # ftp&lt;br /&gt; acl Safe_ports port 443 # https&lt;br /&gt; acl Safe_ports port 70 # gopher&lt;br /&gt; acl Safe_ports port 210 # wais&lt;br /&gt; acl Safe_ports port 1025-65535 # unregistered ports&lt;br /&gt; acl Safe_ports port 280 # http-mgmt&lt;br /&gt; acl Safe_ports port 488 # gss-http&lt;br /&gt; acl Safe_ports port 591 # filemaker&lt;br /&gt; acl Safe_ports port 777 # multiling http&lt;br /&gt; acl CONNECT method CONNECT&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;acl edirectory_users external IPUser Everyone&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;acl authenticated_users proxy_auth REQUIRED localnet&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt; http_access allow manager localhost&lt;br /&gt; http_access deny manager&lt;br /&gt; http_access deny !Safe_ports&lt;br /&gt; http_access deny CONNECT !SSL_ports&lt;br /&gt; http_access deny to_localhost&lt;br /&gt;&lt;br /&gt; http_access allow edirectory_users&lt;br /&gt; http_access allow authenticated_users&lt;br /&gt; http_access allow localhost&lt;br /&gt; # http_access allow localnet&lt;br /&gt; http_access deny all&lt;br /&gt;&lt;br /&gt; http_reply_access allow all&lt;br /&gt;&lt;br /&gt; icp_access allow all&lt;br /&gt;&lt;br /&gt; coredump_dir /var/spool/squid&lt;br /&gt;&lt;br /&gt; debug_options ALL,1&lt;br /&gt; # For debugging ACLs&lt;br /&gt; # debug_options ALL,1 33,2 28,9&lt;/p&gt;
&lt;p&gt;You will need to change the relevant parts in this file to suit your eDirectory and internal network settings (i.e. the localnet setting).&lt;/p&gt;
&lt;p&gt;The Squid configuration file is a tricky beast, but what is listed above is fairly standard. The first highlighted section is where the external squid_edir_iplookup.pl script is referenced. If this check fails an LDAP-backed HTTP BASIC authentication request is made.&lt;/p&gt;
&lt;p&gt;The second highlighted area identifies two Access Control Lists, the first based on the result of the eDirectory I.P. lookup and the second on the HTTP BASIC authentication response. If the incoming request is from someone authenticated within the eDirectory OR by the HTTP BASIC process then outbound access is granted.&lt;/p&gt;
&lt;p&gt;It is possible to use LDAP group information to form ACLs that further limit Web access. The above example does not utilise this functionality, but the Novell Cool Solution goes into it in further detail. My advice is get the Squid/eDirectory authentication working at a very basic level and then make it more complicated. Starting at the most complicated scenario will only lead to failure and frustration.&lt;/p&gt;
&lt;p&gt;If you are encountering authentication issues then enable the debugging options at the bottom of the configuration file. This is fairly verbose but can be very useful in identifying configuration mistakes.&lt;/p&gt;
&lt;h2&gt;Reviewing HTTP access logs with Webmin &amp;amp; SARG&lt;/h2&gt;
&lt;p&gt;&lt;a id=&quot;ny.x&quot; title=&quot;SARG&quot; href=&quot;http://sarg.sourceforge.net/&quot;&gt;SARG&lt;/a&gt; (Squid Analysis Report Generator) is a handy tool for reviewing Squid access files. There is a very good &lt;a id=&quot;t18l&quot; title=&quot;Webmin&quot; href=&quot;http://www.webmin.com/&quot;&gt;Webmin&lt;/a&gt; module for this application, so rather than struggling with the command line install Webmin on the proxy. By the way, while you are at it install &lt;a id=&quot;f0tq&quot; title=&quot;my Webmin theme&quot; href=&quot;/webmin-theme&quot;&gt;my Webmin theme&lt;/a&gt;, your eyes will thank you for it.&lt;/p&gt;
&lt;div class=&quot;centeredimage&quot;&gt;&lt;a href=&quot;/sites/default/files/u63/squid-sarg_lg.jpg&quot;&gt; &lt;img src=&quot;/sites/default/files/u63/squid-sarg_sm.jpg&quot; alt=&quot;&quot; width=&quot;400&quot; height=&quot;216&quot; /&gt;&lt;br /&gt; The SARG module within Webmin (click to enlarge)&lt;/a&gt;&lt;/div&gt;
&lt;p&gt; &lt;/p&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tutorials&quot;&gt;software tutorials&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/novell&quot;&gt;novell&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/squid&quot;&gt;squid&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Tue, 07 Oct 2008 10:36:45 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">526 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Building a webcam with an old laptop, Canon camera and Linux</title>
 <link>https://www.stress-free.co.nz/building_a_webcam_with_an_old_laptop_canon_camera_and_linux</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;Recently I put together a webcam for the &lt;a href=&quot;http://www.aorangi.org&quot;&gt;Aorangi Ski Club&#039;s&lt;/a&gt; lodge on Ruapehu. The system consists of a second-hand laptop, an old Canon camera and Ubuntu Linux. Images are automatically captured every hour, timestamped and posted to Flickr. The end result is a pretty impressive looking &lt;a href=&quot;http://www.flickr.com/photos/28875691@N05&quot;&gt;Flickr slideshow&lt;/a&gt;:&lt;/p&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;iframe align=&quot;center&quot; src=&quot;http://www.flickr.com/slideShow/index.gne?user_id=28875691@N05&quot; frameborder=&quot;0&quot; width=&quot;350&quot; scrolling=&quot;no&quot; height=&quot;350&quot;&gt;&lt;/iframe&gt;
&lt;/div&gt;
&lt;p&gt;To put a similar setup together follow these steps.&lt;/p&gt;
&lt;h2&gt;Step 1: Get the gear&lt;/h2&gt;
&lt;p&gt;Find a Linux compatible laptop and a Canon camera compatible with the &lt;a href=&quot;http://capture.sourceforge.net/&quot;&gt;Capture software&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Step 2: Install Linux&lt;/h2&gt;
&lt;p&gt;I installed &lt;a href=&quot;http://www.ubuntu.com/&quot;&gt;Ubuntu 8.04&lt;/a&gt; on the laptop because from my experience it has the best &#039;out of the box&#039; support for laptop hardware. It didn&#039;t prove me wrong when installing onto the four year old Toshiba, it even detected the winmodem.&lt;/p&gt;
&lt;h2&gt;Step 3: Internet connectivity&lt;/h2&gt;
&lt;p&gt;The problem of getting Internet connectivity will vary depending on where your webcam is located. In my case it was in a relatively isolated position half-way up one of New Zealand&#039;s largest mountains. That meant the only Internet connection available was via the phone line.&lt;/p&gt;
&lt;p&gt;Unfortunately in this day and age winmodems are not supported that well by the popular Linux distributions. Your best bet is to get a hardware modem rather than relying on a cheaper &#039;winmodem&#039; alternative. For me however budget was a driving factor so the winmodem had to stay. Fortunately the Conexant winmodem in the laptop did have a binary kernel driver available.&lt;/p&gt;
&lt;p&gt;Setting up a modem in Linux will vary depending on your distribution, but if all else fails read the &lt;a href=&quot;http://tldp.org/HOWTO/PPP-HOWTO/&quot;&gt;PPP howto&lt;/a&gt; and edit the configuration files directly.&lt;/p&gt;
&lt;h2&gt;Step 4: Install the software requirements&lt;/h2&gt;
&lt;p&gt;At this point it is a good idea to plug your laptop into your LAN and perform a full software update (i.e. apt-get update or yum update). Once that is complete install &lt;a href=&quot;http://www.imagemagick.org/&quot;&gt;Imagemagick&lt;/a&gt;, &lt;a href=&quot;http://capture.sourceforge.net/&quot;&gt;Capture&lt;/a&gt; and the Perl library &lt;a href=&quot;http://search.cpan.org/~cpb/Flickr-Upload/flickr_upload&quot;&gt;flickr_upload&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Imagemagick is very popular and should be just a case of running apt-get install imagemagick (or yum install imagemagick). Unfortunately it is highly unlikely you will find prebuilt .deb or .rpm packages for Capture or flickr_upload. In both cases it is best to download the source code and follow the compile/installation instructions. Both these packages have dependencies which you will need to track down and install, but trust me, both do compile and install on Ubuntu 8.04.&lt;/p&gt;
&lt;h2&gt;Step 5: Test your camera&lt;/h2&gt;
&lt;p&gt;At this point you should have all the prerequisits in place to start writing your webcam script.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; For simplicity these scripts will run as root. This gets around all the permissions issues when accessing modems and USB devices. Also the fact that this will be a standalone device doing non-mission critical work means it isn&#039;t a huge problem.&lt;/p&gt;
&lt;p&gt;Create a directory somewhere (say /usr/local/webcam) and create a file called capture.sh.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;nano capture.sh&lt;/p&gt;
&lt;p&gt;Give it the following contents:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#!/bin/bash&lt;br /&gt;# Get the new image from the camera&lt;br /&gt;capture &#039;start&#039;&lt;br /&gt;capture &#039;flash off&#039;&lt;br /&gt;capture &#039;zoom 1&#039;&lt;br /&gt;capture &#039;metering spot&#039;&lt;br /&gt;capture &#039;focuspoint center&#039;&lt;br /&gt;capture &#039;capture raw.jpg&#039;&lt;br /&gt;capture &#039;detach&#039;&lt;/p&gt;
&lt;p&gt;Set the execute properties on this script.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;chmod a+x&lt;/p&gt;
&lt;p&gt;Plug the camera in to the laptop via a USB cable, turn it on and execute this script.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;./capture.sh&lt;/p&gt;
&lt;p&gt;All going well the camera should come alive, focus itself, take a photo and download it to the current directory (i.e. /usr/local/webcam) with a filename of raw.jpg.&lt;/p&gt;
&lt;p&gt;If things do not work Google the error message, check the cable connections and try again. I tried the Capture application with a couple of supported Canon cameras and they all worked fine.&lt;/p&gt;
&lt;h2&gt;Step 6: Setup Flickr API access&lt;br /&gt;&lt;/h2&gt;
&lt;p&gt;Assuming your camera is happily taking photos when directed by your laptop you can go ahead and setup Flickr.&lt;/p&gt;
&lt;p&gt;Sign up for a Flickr account (they are free). This will be where your webcam photos are sent to. Next sign up for a Flickr API key here: &lt;a href=&quot;http://www.flickr.com/services/api/keys/apply/&quot;&gt;http://www.flickr.com/services/api/keys/apply/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Record the &lt;strong&gt;Flickr API key and secret&lt;/strong&gt; that you are provided at the end of this process.&lt;/p&gt;
&lt;p&gt;In the /usr/local/webcam directory create a file named flickr-auth.pl.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;nano flickr-auth.pl&lt;/p&gt;
&lt;p&gt;Give the file the following contents &lt;em&gt;(replace YOUR_FLICKR_KEY/SECRET with your actual key and secret)&lt;/em&gt;:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#!/usr/bin/perl&lt;br /&gt;&lt;br /&gt;use Flickr::API;&lt;br /&gt;use Flickr::Upload;&lt;br /&gt;&lt;br /&gt;my $flickr_key = &#039;YOUR_FLICKR_KEY&#039;;&lt;br /&gt;my $flickr_secret = &#039;YOUR_FLICKR_SECRET&#039;;&lt;br /&gt;&lt;br /&gt;my $ua = Flickr::Upload-&amp;gt;new(&lt;br /&gt;{&lt;br /&gt;&#039;key&#039; =&amp;gt; $flickr_key,&lt;br /&gt;&#039;secret&#039; =&amp;gt; $flickr_secret&lt;br /&gt;});&lt;br /&gt;$ua-&amp;gt;agent( &quot;perl upload&quot; );&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;my $frob = getFrob( $ua );&lt;br /&gt;print &quot;FROB:$frob;\n&quot;;&lt;br /&gt;&lt;br /&gt;my $url = $ua-&amp;gt;request_auth_url(&#039;write&#039;, $frob);&lt;br /&gt;print &quot;1. Enter the following URL into your browser\n\n&quot;,&lt;br /&gt;&quot;$url\n\n&quot;,&lt;br /&gt;&quot;2. Follow the instructions on the web page\n&quot;,&lt;br /&gt;&quot;3. Hit when finished.\n\n&quot;;&lt;br /&gt;&lt;br /&gt;&amp;lt;&amp;gt;;&lt;br /&gt;&lt;br /&gt;my $auth_token = getToken( $ua, $frob );&lt;br /&gt;die &quot;Failed to get authentication token!&quot; unless defined $auth_token;&lt;br /&gt;&lt;br /&gt;print &quot;Token is $auth_token\n&quot;;&lt;br /&gt;&lt;br /&gt;sub getFrob {&lt;br /&gt;my $ua = shift;&lt;br /&gt;&lt;br /&gt;my $res = $ua-&amp;gt;execute_method(&quot;flickr.auth.getFrob&quot;);&lt;br /&gt;return undef unless defined $res and $res-&amp;gt;{success};&lt;br /&gt;&lt;br /&gt;return $res-&amp;gt;{tree}-&amp;gt;{children}-&amp;gt;[1]-&amp;gt;{children}-&amp;gt;[0]-&amp;gt;{content};&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;sub getToken {&lt;br /&gt;my $ua = shift;&lt;br /&gt;my $frob = shift;&lt;br /&gt;&lt;br /&gt;my $res = $ua-&amp;gt;execute_method(&quot;flickr.auth.getToken&quot;,&lt;br /&gt;{ &#039;frob&#039; =&amp;gt; $frob ,&lt;br /&gt;&#039;perms&#039; =&amp;gt; &#039;write&#039;} );&lt;br /&gt;return undef unless defined $res and $res-&amp;gt;{success};&lt;br /&gt;&lt;br /&gt;return $res-&amp;gt;{tree}-&amp;gt;{children}-&amp;gt;[1]-&amp;gt;{children}-&amp;gt;[1]-&amp;gt;{children}-&amp;gt;[0]-&amp;gt;{content};&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Set the execute permissions for the file and run the script.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;chmod a+x flickr-auth.pl &lt;br /&gt;./flickr-auth.pl&lt;/p&gt;
&lt;p&gt;Follow the onscreen instructions. You will be directed to open a browser window to the location specified, and accept the request. Once accepted press enter on the laptop and the script with return your Flickr auth token. Write this token down somewhere as it will be needed in a moment.&lt;/p&gt;
&lt;h2&gt;Step 7: Setup the Flickr upload script&lt;/h2&gt;
&lt;p&gt;Create a file named flickr-upload.pl and give it the following contents &lt;em&gt;(again replace YOUR_FLICKR_KEY/SECRET/TOKEN with your actual key, secret and token)&lt;/em&gt;:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#!/usr/bin/perl&lt;br /&gt;use strict;&lt;br /&gt;&lt;br /&gt;use Flickr::Upload;&lt;br /&gt;&lt;br /&gt;my $flickr_key = &quot;YOUR_FLICKR_KEY&quot;;&lt;br /&gt;my $flickr_secret = &quot;YOUR_FLICKR_SECRET&quot;;&lt;br /&gt;my $auth_token = &quot;YOUR_FLICKR_TOKEN&quot;;&lt;br /&gt;&lt;br /&gt;my $photograph = &quot;&quot;;&lt;br /&gt;foreach my $arg (@ARGV) {&lt;br /&gt; $photograph = $arg;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;my $ua = Flickr::Upload-&amp;gt;new(&lt;br /&gt; {&lt;br /&gt; &#039;key&#039; =&amp;gt; $flickr_key,&lt;br /&gt; &#039;secret&#039; =&amp;gt; $flickr_secret&lt;br /&gt; });&lt;br /&gt;&lt;br /&gt;$ua.agent =&amp;gt; ( &quot;perl upload&quot; );&lt;br /&gt;&lt;br /&gt;$ua-&amp;gt;upload(&lt;br /&gt; &#039;photo&#039; =&amp;gt; $photograph,&lt;br /&gt; &#039;auth_token&#039; =&amp;gt; $auth_token,&lt;br /&gt; &#039;tags&#039; =&amp;gt; &#039;webcam&#039;,&lt;br /&gt; &#039;is_public&#039; =&amp;gt; 1,&lt;br /&gt; &#039;is_friend&#039; =&amp;gt; 1,&lt;br /&gt; &#039;is_family&#039; =&amp;gt; 1&lt;br /&gt;) or die &quot;Failed to upload image&quot;;&lt;/p&gt;
&lt;p&gt;You can also edit the last couple of lines to define the tags applied to the uploaded photo and its privacy settings.&lt;/p&gt;
&lt;h2&gt;Step 8: The webcam script&lt;/h2&gt;
&lt;p&gt;Create a file named process.sh and give it the following contents:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#!/bin/bash&lt;br /&gt;TEMP=&quot;/usr/local/webcam&quot;&lt;br /&gt;DATESTRING=`date +%l:%M%P\ on\ %A,\ %d\ %B\ %Y`&lt;br /&gt;RAWFILE=&quot;raw.jpg&quot;&lt;br /&gt;RESIZEDFILE=&quot;resized.jpg&quot;&lt;br /&gt;STAMPEDFILE=&quot;stamped.jpg&quot;&lt;br /&gt;UPLOADFILE=&quot;Webcam $DATESTRING.jpg&quot;&lt;br /&gt;&lt;br /&gt;logger &quot;Webcam process initiated&quot;&lt;br /&gt;&lt;br /&gt;# Change to the temp directory&lt;br /&gt;cd $TEMP&lt;br /&gt;&lt;br /&gt;# Get the new image from the camera&lt;br /&gt;echo &quot;Taking photograph...&quot;&lt;br /&gt;./capture.sh&lt;br /&gt;&lt;br /&gt;# Connect to the Internet&lt;br /&gt;pon&lt;br /&gt;&lt;br /&gt;# Convert and stamp the photograph&lt;br /&gt;echo &quot;...converting image for the web&quot;&lt;br /&gt;convert -resize 1024x768 $RAWFILE $RESIZEDFILE&lt;br /&gt;convert -fill &quot;#333333&quot; -draw &quot;rectangle 0,722 1024,768&quot; $RESIZEDFILE $STAMPEDFILE&lt;br /&gt;convert -fill &quot;#eeeeee&quot; -draw &quot;rectangle 0,723 1024,768&quot; $STAMPEDFILE $STAMPEDFILE&lt;br /&gt;convert -font &quot;Helvetica&quot; -pointsize 28 -fill &quot;#111111&quot; -draw &quot;text 25, 755 &#039;$DATESTRING&#039;&quot; $STAMPEDFILE $STAMPEDFILE&lt;br /&gt;&lt;br /&gt;# Wait for connection&lt;br /&gt;echo &quot;Connecting to the Internet...&quot;&lt;br /&gt;sleep 45&lt;br /&gt;&lt;br /&gt;# Update the system time&lt;br /&gt;ntpdate nz.pool.ntp.org&lt;br /&gt;&lt;br /&gt;# Upload the photograph&lt;br /&gt;echo &quot;Uploading photograph&quot;&lt;br /&gt;# echo $UPLOADFILE&lt;br /&gt;cp $STAMPEDFILE &quot;$UPLOADFILE&quot;&lt;br /&gt;./flickr-upload.pl &quot;$UPLOADFILE&quot;&lt;br /&gt;&lt;br /&gt;# Disconnect&lt;br /&gt;echo &quot;Disconnecting...&quot;&lt;br /&gt;sleep 5&lt;br /&gt;poff&lt;br /&gt;echo &quot;...complete&quot;&lt;br /&gt;&lt;br /&gt;# Clean up - delete working files (if they exist)&lt;br /&gt;rm *.jpg&lt;br /&gt;&lt;br /&gt;logger &quot;Webcam process complete&quot;&lt;/p&gt;
&lt;p&gt;This script ties everything together:&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;it executes the capture.sh script and takes a photo&lt;/li&gt;
&lt;li&gt; connects the modem to the Internet&lt;/li&gt;
&lt;li&gt;syncs the system time with a nearby NTP server&lt;/li&gt;
&lt;li&gt;resizes and stamps the photograph with the current date and time&lt;/li&gt;
&lt;li&gt;uploads the resized image to your Flickr account&lt;/li&gt;
&lt;li&gt;disconnects from the Internet&lt;/li&gt;
&lt;li&gt;removes the temporary image files&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; You will probably want to edit parts of this script. For example you could use different image names or temp directories or a time server pool for your country.&lt;/p&gt;
&lt;p&gt;Set the execute permissions of the file, set the camera up and run the script.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;chmod a+x process.sh&lt;br /&gt; ./process.sh&lt;/p&gt;
&lt;p&gt;All going well your laptop and camera should run through the routine outlined above. If you experience any errors it is just a case of debugging and trying again.&lt;/p&gt;
&lt;h2&gt;Step 9: Setup the cron job&lt;/h2&gt;
&lt;p&gt;Once the script is working as expected setup a cron job to run on a regular basis. How often is semi-dependent on your daylight hours and available Flickr bandwidth. A free Flickr account has limited upload bandwidth per month so you want to be careful your webcam does not take too many photographs. In the case of the Aorangi webcam it takes a photo once per hour between 7:30am and 4:30pm.&lt;/p&gt;
&lt;p&gt;Create a file in &lt;strong&gt;/etc/cron.d&lt;/strong&gt; named webcam and give it the following contents:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;30 7-15 * * * root /usr/local/webcam/process.sh&lt;/p&gt;
&lt;p&gt;Restart cron and you should find everything runs like clockwork from that point forward.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/ubuntu&quot;&gt;ubuntu&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Fri, 22 Aug 2008 09:51:03 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">518 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Mounting CIFS shares at login with SELinux enabled</title>
 <link>https://www.stress-free.co.nz/mounting_cifs_shares_at_login_with_selinux_enabled</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/selinux.jpg&quot; title=&quot;undefined&quot; width=&quot;100&quot; height=&quot;100&quot; onmouseover=&quot;undefined&quot; onmouseout=&quot;undefined&quot; /&gt;&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;http://www.nsa.gov/selinux/&quot;&gt;SELinux&lt;/a&gt; is as painful to use sometimes as it is powerful when it comes to locking down server permissions. Unfortunately even with distributions such as Red Hat which &lt;a href=&quot;http://www.redhat.com/security/innovative/selinux/&quot;&gt;supports SELinux out of the box&lt;/a&gt;, you will still experience problems. &lt;/p&gt;&lt;p&gt;One such issue I came across recently was automounting CIFS shares on boot using &lt;a href=&quot;http://www.hscripts.com/tutorials/linux-services/netfs.html&quot;&gt;netfs&lt;/a&gt;. At startup the netfs service was returning an &quot;error 13 - error opening credentials file&quot; when attempting to mount the CIFS shares. The problem was the SELinux was not allowing the netfs script to access the file that contained the CIFS authorisation details.&lt;/p&gt;&lt;p&gt;For example, my &lt;strong&gt;/etc/fstab&lt;/strong&gt; had the following entry:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;//WINDOWSSERVER/SHARE          /mnt/windowsshare             cifs    credentials=/etc/samba/auth.cifs        0 0&lt;/p&gt;&lt;p&gt;And in the &lt;strong&gt;/etc/samba/auth.cifs&lt;/strong&gt; file were the following details:&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;username=windowsuser&lt;br /&gt;password=windowspassword&lt;/p&gt;&lt;p&gt;The solution to the problem was to change a SELinux boolean parameter with the following command (&lt;a href=&quot;http://www.engardelinux.org/modules/index/list_archives.cgi?list=fedora-selinux&amp;amp;page=0189.html&amp;amp;month=2008-02&quot;&gt;found here&lt;/a&gt;):&lt;/p&gt;&lt;p class=&quot;codesnippet&quot;&gt;setsebool -P allow_mount_anyfile 1&lt;/p&gt;&lt;p&gt;This lets the mount command open any referenced file, effectively side-stepping the netfs error. Sure it is not 100% secure but it works without having to completely disable SELinux which seems to be most people&#039;s answer to any problems.&lt;/p&gt;&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/samba&quot;&gt;samba&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/selinux&quot;&gt;selinux&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Sat, 17 May 2008 02:36:57 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">508 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Installing VMWare Server 1.0 on Ubuntu 6.06LTS</title>
 <link>https://www.stress-free.co.nz/installing_vmware_server_10_on_ubuntu_606lts</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img title=&quot;undefined&quot; onmouseover=&quot;undefined&quot; onmouseout=&quot;undefined&quot; src=&quot;/sites/default/files/u63/vmware-ubuntu.jpg&quot; alt=&quot;&quot; width=&quot;214&quot; height=&quot;90&quot; /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href=&quot;http://www.ubuntu.com/products/WhatIsUbuntu/serveredition&quot;&gt;Ubuntu 6.06LTS&lt;/a&gt; is a useful platform for VMWare because it has a small footprint by todays standards and is supported by Canonical until 2011. Unfortunately installing VMWare Server 1.0 can be a little painful given there are no binary kernel modules for Ubuntu in this release.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;Fortunately there are some excellent guides for installing VMWare on this platform such as &lt;a style=&quot;text-decoration: none; color: #336699&quot; href=&quot;http://www.howtoforge.com/ubuntu_vmware_server&quot;&gt;this one from HowtoForge&lt;/a&gt;. What follows is an installation script based on the HowtoForge guide that saves the administrator a lot of time and solves a bug along the way.&lt;/p&gt;
&lt;!--break--&gt;
&lt;h2 style=&quot;margin-bottom: 0.5em; font-size: 1.2em&quot;&gt;Build your Ubuntu server&lt;br /&gt;&lt;/h2&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;A basic install of 6.06LTS is pretty light weight and by default doesn&#039;t have anything running that isn&#039;t needed. A few things that you may want to install is the openssh-server package for remote access and ntp-server for keeping your system clock accurate.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;sudo apt-get install openssh-server ntp-server&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;By default Ubuntu 6.06 configures its network via DHCP which is fine for a desktop system but probably not ideal for a server. To set a static IP address edit the &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold&quot;&gt;/etc/network/interfaces&lt;/span&gt; file and set the relevant static network interface and address parameters. For example:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;iface eth0 inet static&lt;br /&gt;address 192.168.1.10&lt;br /&gt;netmask 255.255.255.0&lt;br /&gt;network 192.168.1.0&lt;br /&gt;broadcast 192.168.1.255&lt;br /&gt;gateway 192.168.1.1&lt;/p&gt;
&lt;p&gt;Also check the &lt;span class=&quot;Apple-style-span&quot; style=&quot;font-weight: bold&quot;&gt;/etc/resolv.conf&lt;/span&gt; file contains the correct DNS server details before restarting the network interfaces with:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;sudo /etc/init.d/network restart&lt;/p&gt;
&lt;h2 style=&quot;margin-bottom: 0.5em; font-size: 1.2em&quot;&gt;The VMWare Installation Script&lt;br /&gt;&lt;/h2&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;1. Create a vmware directory somewhere handy to store the installation files, your home directory is a good place. Once the installation is complete you can remove this directory although it is worth making a backup should you wish to install VMWare again.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;2.Download the Linux tar archives of VMWare Server 1.0 and the Management User Interface (MUI) from the &lt;a href=&quot;http://www.vmware.com/download/server/&quot;&gt;VMWare website&lt;/a&gt;. The current stable release of VMWare Server at the time of writing was version 1.0.4-56528. Also as you are downloading remember to record your serial code as this will be needed during the installation process.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;3. In the same directory where you have downloaded these install archives create a new file named &lt;span style=&quot;font-weight: bold&quot;&gt;rundir.httpd.vmware&lt;/span&gt; with the following contents:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#! /bin/sh&lt;br /&gt;# /var/run gets purged at every reboot!&lt;br /&gt;&lt;br /&gt;RUNDIR=&quot;/var/run/vmware/httpd&quot;&lt;br /&gt;OWNER=&quot;www-data&quot;&lt;br /&gt;GROUP=&quot;www-data&quot;&lt;br /&gt;&lt;br /&gt;/usr/bin/test -d &quot;$RUNDIR&quot; || \&lt;br /&gt;/bin/mkdir -p &quot;$RUNDIR&quot; &amp;amp;&amp;amp; /bin/chown &quot;$OWNER:$GROUP&quot; &quot;$RUNDIR&quot;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;This file is copied to the /etc/init.d/ directory by the installation script and overcomes an permissions issue which stops the VMWare MUI from loading.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;4. Now create a file called &lt;span style=&quot;font-weight: bold&quot;&gt;install-vmare.sh&lt;/span&gt; with the following contents:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;#! /bin/sh&lt;br /&gt;TMP=&quot;/tmp&quot;&lt;br /&gt;VERSION=&quot;1.0.4-56528&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;Installing VMware Server for Ubuntu 6.06&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;Installing application requirements&quot;&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;echo &quot;Installing dev headers and xinetd...&quot;&lt;br /&gt;sudo apt-get -y install libx11-6 libx11-dev libxtst6 xlibs-dev xinetd wget&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;Installing Linux Kernel headers...&quot;&lt;br /&gt;sudo apt-get -y install linux-headers-`uname -r` build-essential&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;Installing build utilities...&quot;&lt;br /&gt;sudo apt-get -y install gcc binutils-doc cpp-doc make manpages-dev autoconf \&lt;br /&gt;automake1.9 libtool flex bison gdb gcc-doc gcc-4.0-doc libc6-dev-amd64 lib64gcc1&lt;br /&gt;&lt;br /&gt;# Install VMWare Server&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;echo &quot;Uncompressing the VMware Server $VERSION archive...&quot;&lt;br /&gt;&lt;br /&gt;# Copy files to revelant locations&lt;br /&gt;cp VMware-server-$VERSION.tar.gz $TMP&lt;br /&gt;cp VMware-mui-$VERSION.tar.gz $TMP&lt;br /&gt;sudo cp rundir.httpd.vmware /etc/init.d/&lt;br /&gt;&lt;br /&gt;cd $TMP&lt;br /&gt;tar -xzf VMware-server-$VERSION.tar.gz&lt;br /&gt;rm VMware-server-$VERSION.tar.gz&lt;br /&gt;&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;echo &quot;Installing VMware Server $VERSION...&quot;&lt;br /&gt;cd vmware-server-distrib&lt;br /&gt;sudo ./vmware-install.pl&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;# Install the VMWare web management console&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;Uncompressing the VMware MUI $VERSION archive...&quot;&lt;br /&gt;&lt;br /&gt;cd $TMP&lt;br /&gt;tar -xzf VMware-mui-$VERSION.tar.gz&lt;br /&gt;rm VMware-mui-$VERSION.tar.gz&lt;br /&gt;&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;echo &quot;Installing VMware MUI $VERSION...&quot;&lt;br /&gt;&lt;br /&gt;# Configure the MUI rundir fix&lt;br /&gt;sudo chmod 755 /etc/init.d/rundir.httpd.vmware&lt;br /&gt;sudo ln -s /etc/init.d/rundir.httpd.vmware /etc/rc2.d/S90rundir.httpd.vmware&lt;br /&gt;&lt;br /&gt;cd vmware-mui-distrib&lt;br /&gt;sudo ./vmware-install.pl&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;echo &quot;Cleaning up...&quot;&lt;br /&gt;cd $TMP&lt;br /&gt;rm -rf vmware-server-distrib&lt;br /&gt;rm -rf vmware-mui-distrib&lt;br /&gt;echo &quot;---------------------------------------------------&quot;&lt;br /&gt;echo &quot;VMWare installation complete&quot;&lt;br /&gt;&lt;br /&gt;echo &quot;&quot;&lt;br /&gt;echo &quot;To administer VMWare you will need to either:&quot;&lt;br /&gt;echo &quot;1. Enable root logon access (sudo passwd root)&quot;&lt;br /&gt;echo &quot;2. Set set the uid of a designated user to 0 (sudo nano /etc/passwd)&quot;&lt;br /&gt;echo &quot;&quot;&lt;br /&gt;echo &quot;&quot;&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;This is the script that handles installation of all the required dependencies, kernel sources and VMWare packages.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;&lt;span style=&quot;font-weight: bold&quot;&gt;NOTE:&lt;/span&gt; You may need to tweak the TMP and VERSION variables to suit your server environment and downloaded VMWare version.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;5. Finally enable execute permissions on this file and run the script:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;chmod a+x install-vmware.sh./install-vmware.sh&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;The script will prompt you for your password in order to gain administrator privileges (sudo). It will then install all the required packages via apt before copying the rundir.http.vmware file into the correct location and running the VMWare installers.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;For the most part the default VMWare install options can be accepted without much thought. The only settings that may need tweaking is the location of the VMWare images (default /var/lib/vmware/Virtual Machines) and the MUI&#039;s default login time of 60 minutes which seems a little long for my liking (15 minutes would seem more appropriate).&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;All going well at the end of the process you should have a fully functional VMWare Server with a web management console operating at https://server-ip-address:8333/. Whilst you cannot create or install virtual machines via the web console you can download the Windows or Linux VMWare Console installers which will get you going.&lt;/p&gt;
&lt;h2&gt;Kernel Updates&lt;/h2&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;Be aware that each time you upgrade the Ubuntu kernel to a different version the VMWare kernel module must be recompiled. After upgrading your kernel and rebooting the system you will find VMWare fails to load. At this point do not panic, it only takes a few steps to rectify the situation.&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;1. First download the headers for your current kernel.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;sudo apt-get install linux-headers-`uname -r`&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;2. Now run the vmware-config.pl script, accept the default settings and rebuild the VMWare kernel module.&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;sudo vmware-config.pl&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt;Once this script completes VMWare should once again be operational. The only thing left to do is remove the old kernel headers if you feel you won&#039;t be needing them again:&lt;/p&gt;
&lt;p class=&quot;codesnippet&quot;&gt;sudo apt-get remove linux-headers-(old kernel version)&lt;/p&gt;
&lt;p style=&quot;margin-top: 0.5em; margin-bottom: 0.9em&quot;&gt; &lt;/p&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tutorials&quot;&gt;software tutorials&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/virtualisation&quot;&gt;virtualisation&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/vmware&quot;&gt;vmware&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Wed, 23 Jan 2008 09:04:58 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">476 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Google outflanks Sun with Android</title>
 <link>https://www.stress-free.co.nz/google_outflanks_sun_with_android</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;https://www.stress-free.co.nz/sites/default/files/u63/android_logo.jpg&quot; title=&quot;undefined&quot; width=&quot;170&quot; height=&quot;62&quot; /&gt;&lt;/div&gt;
&lt;p&gt;Google recently released the highly anticipated &lt;a href=&quot;http://code.google.com/android/&quot;&gt;Android mobile phone platform&lt;/a&gt; to developers. Android promises to be a more consistent and powerful environment for mobile applications compared to what currently exists in the fragmented mobile market. Whilst many people were disappointed that Android was not a Google-branded iphone; from a developers perspective if it can gain broad adoption it will make the developing powerful, Internet-centric mobile applications significantly easier.&lt;/p&gt;
&lt;p&gt;One of the most interesting aspects of Android is that it is released under the &lt;a href=&quot;http://www.apache.org/licenses/LICENSE-2.0.html&quot;&gt;Apache v2 software license&lt;/a&gt;. This license grants obligation-free use of the code to any party. This is different to other popular open-source licenses like the GPL which requires source-code modifications to be made publically available. In the competitive mobile phone market such an obligation is problematic which is why Sun releases the &lt;a href=&quot;http://java.sun.com/javame/&quot;&gt;Java Mobile Edition (ME)&lt;/a&gt; under different open and closed source licenses.&lt;/p&gt;
&lt;p&gt;A question that was hanging around Android was how Google had managed to release a Java mobile platform under the Apache license given that the licenses Sun release JavaME under are not compatible. &lt;a href=&quot;http://www.betaversion.org/~stefano/linotype/news/110/&quot;&gt;Stefano Mazzocchi points out on his blog&lt;/a&gt; that Google have outflanked Sun by releasing a platform that supports the Java language but does not use Sun&amp;#39;s Java compiler or the Java byte-code at its core. Instead Google have created &lt;a href=&quot;http://code.google.com/android/what-is-android.html&quot;&gt;Dalvik&lt;/a&gt;, a virtual machine released under the Apache license which understands how to compile Java source code into its own byte-code for execution.&lt;/p&gt;
&lt;p&gt;This move outflanks Sun&amp;#39;s licensing policies, essentially cutting them out of the Android equation. It is a gutsy move by Google but it does free them to focus on developing a platform they have complete control over rather than working in partnership with Sun. From the perspective of Java as a language this move wouldn&amp;#39;t seem to pose any problems as the mobile and desktop/server worlds have always been quite distinct. Plus if anything Google&amp;#39;s use of the &lt;a href=&quot;http://harmony.apache.org/&quot;&gt;Apache Harmony JavaSE libraries&lt;/a&gt; may actually make developing for the mobile and desktop more consistent than Sun&amp;#39;s distinct JavaME and JavaSE implementations.&lt;/p&gt;
&lt;p&gt;All things considered this news has made Android more interesting from my perspective. Before I heard this it was just another JavaME implementation but now it sounds like Google will have the capability to do some really interesting things. What has yet to be seen is what level of support (if any) this platform will have on the iPhone. Google and Apple have a strong relationship there and it would seem like Dalvik runtime would be a natural fit on the device if it is lightweight, fast and provides developers with the ability to write applications for both Android and the iPhone. &lt;/p&gt;
&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/java&quot;&gt;java&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/mobile&quot;&gt;mobile&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Tue, 13 Nov 2007 23:44:44 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">472 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Apple purchases CUPS to ward off GPL3 requirements?</title>
 <link>https://www.stress-free.co.nz/apple_purchases_cups_to_ward_off_gpl3_requirements</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/cups_logo.jpg&quot; width=&quot;110&quot; height=&quot;131&quot; /&gt;&lt;/div&gt;
&lt;p&gt;Today the lead developer of the &lt;a href=&quot;http://www.cups.org/&quot;&gt;CUPS&lt;/a&gt; (Common Unix Printing System) project announced that &lt;a href=&quot;http://www.cups.org/articles.php?L475&quot;&gt;in February 2007 Apple purchased the CUPS source code&lt;/a&gt; and took him on as a staff member. CUPS is significant within the *NIX world because it is arguably the most well supported and feature-rich printing system available. Apple has used it within OSX from the outset and personally I feel it is the best implementation of CUPS available thanks to the Aqua interface and the fact that the majority of printers just work without any effort.&lt;/p&gt;
&lt;p&gt;There would seem to be no immediate danger of CUPS code being completely closed sourced considering it is currently released under the GPL2 license. What the code purchase suggests is that Apple probably plans on internally re-licensing the code under a closed source license for many, if not all of the platforms that could make use of it, i.e. Mac, AirPort and the iPhone. &lt;/p&gt;
&lt;p&gt;Dual licensing such as this is not uncommon by vendors who control the rights to GPL code. It is a good way of benefiting from an open source development model and community whilst still being able to ship a modified version of the code on closed devices or only binary form. License flexibility such as this will become increasingly important as the GPL3 license is adopted as it resolves many of the loopholes vendors used to ship GPL code in what effect were closed devices (&lt;a href=&quot;http://en.wikipedia.org/wiki/Tivoization&quot;&gt;Tivoization&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Now that Apple does have a formal stake in CUPS my biggest hope is that they can spare a graphic designer to give the website and the CUPS interface with a much needed aesthetic overhaul and maybe a better logo... &lt;/p&gt;
&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/apple&quot;&gt;apple&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/printing&quot;&gt;printing&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Fri, 13 Jul 2007 02:57:24 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">463 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Eben Moglen on the threat of patent agreements</title>
 <link>https://www.stress-free.co.nz/eben_moglen_on_the_threat_of_patent_agreements</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;&lt;a href=&quot;http://emoglen.law.columbia.edu/&quot;&gt;Eben Moglen&lt;/a&gt; of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Software_Freedom_Law_Center&quot;&gt;Software Freedom Law Centre&lt;/a&gt; is a great public speaker and he demonstrates this skill exceptionally well in his ability to answer what the risk to the Free Software community is when deals such as last years &lt;a href=&quot;/how_things_are_shaping_up_with_the_novell_microsoft_deal&quot;&gt;Novell - Microsoft agreement&lt;/a&gt; take place.&lt;/p&gt;
&lt;div style=&quot;text-align: center&quot;&gt;
&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/6YExl9ojclo&quot; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;menu&quot; value=&quot;false&quot; /&gt;&lt;param name=&quot;wmode&quot; value=&quot;&quot; /&gt;&lt;embed src=&quot;http://www.youtube.com/v/6YExl9ojclo&quot; wmode=&quot;&quot; quality=&quot;high&quot; menu=&quot;false&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;
&lt;p&gt;If you like his response to this quesiton then I believe you will find his &lt;a href=&quot;http://www.twit.tv/floss13&quot;&gt;interview on FLOSS Weekly&lt;/a&gt; about Free Software and the GPL not only good to listen to but educational at the same time. &lt;/p&gt;
&lt;!--break--&gt;&lt;/p&gt;
  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/microsoft&quot;&gt;microsoft&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/gpl&quot;&gt;gpl&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Tue, 15 May 2007 22:37:34 +0000</pubDate>
 <dc:creator>admin</dc:creator>
 <guid isPermaLink="false">435 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>Mount Microsoft makes more patent rumblings</title>
 <link>https://www.stress-free.co.nz/mount_microsoft_makes_more_patent_rumblings</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;Microsoft&amp;#39;s General Counsel Brad Smith placed the number of patent violations by Free &amp;amp; Open Source Software (FOSS) at 235 in an &lt;a href=&quot;http://money.cnn.com/magazines/fortune/fortune_archive/2007/05/28/100033867/&quot;&gt;interview with Fortune magazine&lt;/a&gt; this week. Considering these suposed violoations cover everything from the kernel through to office applications I am somewhat surprised that the theoretical total is not more considering the huge number of patents Microsoft has recently aquired. Tim Bray of Sun&amp;#39;s response in his blog was short but to the point, &lt;a href=&quot;http://www.tbray.org/ongoing/When/200x/2007/05/13/Four-Words&quot;&gt;&amp;#39;litigate or shut up&amp;#39;&lt;/a&gt;. &lt;/p&gt;
&lt;p&gt;Unfortunately the chances of Microsoft actually litigating are slim to none considering the damage it would do to their image and the potential problems it would cause from counter-suits from the likes of IBM. Instead the threat of legal action looks like it will continue to remain just that in the vain belief that by simply placing a cloud over Free software&amp;#39;s head it will deter existing Microsoft customers from jumping ship. Whether or not such a strategy will be successful only time will tell, but forcing potential customers to buy your product through fear of what would happen if they did not does not seem like the kind of image one would want to portray. &lt;/p&gt;
&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/microsoft&quot;&gt;microsoft&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Mon, 14 May 2007 11:05:29 +0000</pubDate>
 <dc:creator>admin</dc:creator>
 <guid isPermaLink="false">434 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>A funny little video from Novell</title>
 <link>https://www.stress-free.co.nz/a_funny_little_video_from_novell</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;With &lt;a href=&quot;http://www.novell.com/news/press/pressroom/presskit/brainshare2007/index.html&quot;&gt;Novell&#039;s Brainshare&lt;/a&gt; well underway they have released a very unique &#039;will it blend?&#039; video onto YouTube. &lt;a href=&quot;http://reverendted.wordpress.com/&quot;&gt;Ted Haeger&#039;s&lt;/a&gt; been talking about this for a while now and I can see why, it does a very good job of simulatanoeously being funny whilst remaining stuffy enough to be instantly identified as a Novell video. Sure it is no Apple advert but it is good to see even if you are just interested what would happen if you put a Windows CD, a Mighty Mouse and a helping of Red Bull into an industrial strength blender...&lt;/p&gt;&lt;div style=&quot;text-align: center&quot;&gt;&lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; codebase=&quot;http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/XVqtruQSHEM&quot; /&gt;&lt;param name=&quot;quality&quot; value=&quot;high&quot; /&gt;&lt;param name=&quot;menu&quot; value=&quot;false&quot; /&gt;&lt;param name=&quot;wmode&quot; value=&quot;&quot; /&gt;&lt;embed src=&quot;http://www.youtube.com/v/XVqtruQSHEM&quot; wmode=&quot;&quot; quality=&quot;high&quot; menu=&quot;false&quot; pluginspage=&quot;http://www.macromedia.com/go/getflashplayer&quot; type=&quot;application/x-shockwave-flash&quot; width=&quot;425&quot; height=&quot;350&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;br /&gt;&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/novell&quot;&gt;novell&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Tue, 20 Mar 2007 10:58:16 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">428 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>&#039;The Code Linux&#039; documentary</title>
 <link>https://www.stress-free.co.nz/the_code_linux_documentary</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;div class=&quot;image&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/linux.png&quot; width=&quot;120&quot; height=&quot;132&quot; /&gt;&lt;/div&gt;&lt;p&gt;If you are new to the ideas of open source and Linux then this documentary is well worth watching:&lt;/p&gt;&lt;h1&gt;&lt;a href=&quot;http://video.google.com/videoplay?docid=-3498228245415745977&quot;&gt;The Code Linux - (available on Google Video)&lt;/a&gt;&lt;/h1&gt;&lt;p&gt;Even if you are fairly versed in the subject matter it is good to see some prominent open source personalities such as Linus Torvalds, Jon &quot;Maddog&quot; Hall and Eric S Raymond. Well worth watching online or downloading for a rainy Sunday afternoon.&lt;/p&gt;&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/open_source&quot;&gt;open source&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Sat, 17 Mar 2007 03:54:04 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">427 at https://www.stress-free.co.nz</guid>
</item>
<item>
 <title>A great example of Windows&#039; evolutionary drawbacks</title>
 <link>https://www.stress-free.co.nz/a_great_example_of_windows_evolutionary_drawbacks</link>
 <description>
  &lt;div class=&quot;field-body&quot;&gt;
    &lt;p&gt;If you have ever tried working through an &lt;a href=&quot;http://www.nsa.gov/snac/downloads_miis.cfm?MenuID=scg10.3.1.4&quot;&gt;NSA guide&lt;/a&gt; on securing Microsoft IIS you will appreciate how many internal systems exists under the hood of Windows and their many deficiencies. For those that have been fortunate to not go through the experience &lt;a href=&quot;http://blogs.zdnet.com/threatchaos/?p=311&quot;&gt;Richard Stiennon uses some compelling visuals&lt;/a&gt; by &lt;a href=&quot;http://www.sanasecurity.com/&quot;&gt;Sana Security&lt;/a&gt; to explain why Windows is less secure than Linux because of its long evolutionary history. This history has seen one set of functionality bolted in place over another with little or no thought to the clarity of the overarching  system architecture. Consequently whilst Windows works what goes on under the hood is not pretty and very difficult to secure.&lt;/p&gt;&lt;div style=&quot;text-align: center&quot;&gt;&lt;a href=&quot;http://blogs.zdnet.com/threatchaos/?p=311&quot;&gt;&lt;img src=&quot;/sites/default/files/u63/iis_apache_systemcalls.png&quot; alt=&quot;&quot; width=&quot;580&quot; height=&quot;242&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;!--break--&gt;  &lt;/div&gt;

&lt;ul class=&quot;field-taxonomy-vocabulary-1&quot;&gt;

      &lt;li&gt;
      &lt;a href=&quot;/tech/linux&quot;&gt;linux&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/apache&quot;&gt;apache&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/windows&quot;&gt;windows&lt;/a&gt;    &lt;/li&gt;
      &lt;li&gt;
      &lt;a href=&quot;/tech/iis&quot;&gt;iis&lt;/a&gt;    &lt;/li&gt;
  
&lt;/ul&gt;
</description>
 <pubDate>Sat, 03 Feb 2007 01:11:28 +0000</pubDate>
 <dc:creator>David</dc:creator>
 <guid isPermaLink="false">395 at https://www.stress-free.co.nz</guid>
</item>
</channel>
</rss>
