<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>sr128.org</title>
	<atom:link href="http://sr128.org/blog/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://sr128.org/blog</link>
	<description>Just another weblog - thoughts, hints, reminders</description>
	<lastBuildDate>Fri, 09 Dec 2011 13:15:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Setting up Moodle on Centos 5.7</title>
		<link>http://sr128.org/blog/?p=158</link>
		<comments>http://sr128.org/blog/?p=158#comments</comments>
		<pubDate>Fri, 09 Dec 2011 12:48:28 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=158</guid>
		<description><![CDATA[I had to install Moodle on running in a virtual machine to test what we can do with it. These are the steps I followed: Install Centos 5.7 with Apache and PHP and MySQL. Start Apache from a terminal: sudo /etc/init.d/httpd restart Check Apache is working Open http://localhost in a browser on that machine. Get [...]]]></description>
			<content:encoded><![CDATA[<p>I had to install Moodle on running in a virtual machine to test what we can do with it. These are the steps I followed:</p>
<p>Install Centos 5.7 with Apache and PHP and MySQL.<br />
Start Apache from a terminal:<br />
<code>sudo /etc/init.d/httpd restart</code><br />
Check Apache is working<br />
Open http://localhost in a browser on that machine.</p>
<p>Get Apache to start automatically at runlevels 3 and 5:<br />
<code>sudo /sbin/chkconfig --level 35 httpd on</code></p>
<p>Create PHP &#8216;display config&#8217; file:<br />
<code>sudo sh -c "echo '<!--?php phpinfo(); ?-->' &gt;&gt; /var/www/html/index.php"</code></p>
<p>Check that PHP works and the version number etc. in a browser:</p>
<p>http://localhost/index.php</p>
<p>Download Moodle from:</p>
<p>http://download.moodle.org/</p>
<p>In the Terminal unpack Moodle into directory:<br />
<code>sudo tar -xvzf ~/Downloads/Moodle/moodle-latest-22.tgz</code></p>
<p>In the Terminal remove old MySQL:<br />
<code>yum remove mysql-server<br />
yum remove mysql</code></p>
<p>Install the latest version of MySQL that&#8217;s in the repositories:<br />
<code>yum install mysql-server<br />
yum install mysql<br />
yum install mysql-devel</code></p>
<p>Install php-MySQL connector:<br />
<code>yum install php-mysql</code></p>
<p>Start MySQL:<br />
<code>sudo /etc/init.d/mysqld restart</code></p>
<p>Configure MySQL to start automatically at run levels 3 and 5:<br />
<code>sudo /sbin/chkconfig --level 35 mysqld on</code></p>
<p>Secure MySQL a little bit<br />
Connect to MySQL:<br />
<code>mysql -u root</code></p>
<p>See what usernames exist and if the password field is blank:<br />
<code>mysql&gt; select user, host, password from mysql.user;</code></p>
<p>Set the root users&#8217; passwords:<br />
<code>mysql&gt; UPDATE mysql.user SET Password = PASSWORD('newpassword') WHERE User = 'root';<br />
mysql&gt; FLUSH PRIVILEGES;</code></p>
<p>Set passwords for anonymous users (only required if you&#8217;re going to keep the anonymous users which isn&#8217;t recommended):<br />
<code>mysql&gt; UPDATE mysql.user SET Password = PASSWORD('newpassword') WHERE User = '';<br />
mysql&gt; FLUSH PRIVILEGES;</code></p>
<p>Remove anonymous users:<br />
<code>DELETE FROM mysql.user WHERE User = '';</code></p>
<p>Drop Test database:<br />
<code>mysql&gt; DROP DATABASE test;</code></p>
<p>Create Moodle database:<br />
<code>mysql&gt; CREATE DATABASE moodle;</code></p>
<p>Change character set for moodle database &#8211; we need UTF-8 for Moodle:<br />
<code>mysql&gt; ALTER DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;</code></p>
<p>Create Moodle database user and grant permissions &#8211; note password and change it!<br />
<code>mysql&gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,DROP,INDEX,ALTER ON moodle.* TO moodleuser@localhost IDENTIFIED BY '&lt;newpassword&gt;';<br />
mysql&gt; FLUSH PRIVILEGES;</code></p>
<p>Quit Mysql:<br />
<code>mysql&gt; quit</code></p>
<p>Create Moodle data directory:<br />
<code>sudo mkdir /var/www/moodledata</code></p>
<p>Secure access to the Moodle data directory:<br />
<code>sudo chown -R nobody:apache /var/www/moodledata</code></p>
<p>Install Moodle by visiting the URL in a browser:<br />
<code>http://localhost/moodle/install.php</code></p>
<p>Follow all the instructions, if you need to update PHP, go into YUM and remove the standard PHP items and install the ones that look like php53-&lt;blah&gt;_el5_7.3.i386, make sure you restart Apache after this installation as per previous instructions so it recognises the changes.</p>
<p>Once you get to the end, you&#8217;ll be able to enter the Admin password you entered during the installation process and login to moodle at http://localhost/moodle.</p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=158</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Guest Additions in Centos on VirtualBox</title>
		<link>http://sr128.org/blog/?p=151</link>
		<comments>http://sr128.org/blog/?p=151#comments</comments>
		<pubDate>Wed, 16 Nov 2011 16:41:21 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=151</guid>
		<description><![CDATA[Once You&#8217;ve installed Centos on VirtualBox, you will want to install Guest Additions to make Centos integrate a lot better with your host OS. You should install a package called dkms first so you don&#8217;t have to go through this every time there&#8217;s a kernel update. We need to install a package called rpm-forge first [...]]]></description>
			<content:encoded><![CDATA[<p>Once You&#8217;ve installed Centos on VirtualBox, you will want to install Guest Additions to make Centos integrate a lot better with your host OS.</p>
<p>You should install a package called <code>dkms</code> first so you don&#8217;t have to go through this every time there&#8217;s a kernel update.</p>
<p>We need to install a package called rpm-forge first to enable us to do this. There are good instructions on the  <a href="http://wiki.centos.org/AdditionalResources/Repositories/RPMForge">Centos Wiki</a></p>
<p>Once you have followed their instructions then you should be able to do the following:</p>
<p><code>yum install dkms</code></p>
<p>Once this has worked, then do an update of all your current packages:</p>
<p><code>yum update</code></p>
<p>Then reboot the system (in case the kernel has been updated). </p>
<p>Mount the VirtualBox Guest Additions iso by clicking on Devices|Install Guest Additions. Then open a terminal and run the appropriate guest additions package. For Centos on Mac OS X, I ran the following in a terminal:<br />
<code>/media/VBOXADDITIONS_4.1.6_74713/VBoxLinuxAdditions.run </code></p>
<p>Then one more reboot is needed and your guest window resolution should update as you resize it, the mouse should no longer get trapped in your guest machine and the clipboards should be shared. </p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=151</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting up Centos behind an authenticating NTLM proxy</title>
		<link>http://sr128.org/blog/?p=140</link>
		<comments>http://sr128.org/blog/?p=140#comments</comments>
		<pubDate>Wed, 16 Nov 2011 14:42:16 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=140</guid>
		<description><![CDATA[Periodically, we end up needing to test something on Linux. Normally at home, I would use Ubuntu, but since the standard here at work is Red Hat Enterprise, I tend to use Centos on the basis that if there is a problem, I&#8217;m more likely to find it sooner. The problem is that being on [...]]]></description>
			<content:encoded><![CDATA[<p>Periodically, we end up needing to test something on Linux. Normally at home, I would use Ubuntu, but since the standard here at work is Red Hat Enterprise, I tend to use Centos on the basis that if there is a problem, I&#8217;m more likely to find it sooner.</p>
<p>The problem is that being on a corporate network, it takes a few &#8216;tweaks&#8217; to get it working properly. Particularly with tools like Yum (I want to patch the thing before I start fiddling and also for installation of packages as well as thing like adding rpmforge so that I can install some other packages.</p>
<p>There are also some other items that need to be &#8216;fixed&#8217; like installing the Guest Additions on Virtualbox to allow me to use the VM as an application on my computer. I&#8217;ll post that separately.</p>
<p>Anyway, here are a few things that I need to remember to do:</p>
<p>The first thing to do is enable the Yum repositories.<br />
<code>vi /etc/yum.repos.d/CentOS-Base.repo</code></p>
<p>And remove all the # from the lines that say<br />
<code>#baseurl</code><br />
I&#8217;m pretty sure you could do it like this:<br />
<code>sed –i’.old’ s/\#baseurl/baseurl/g /etc/yum.repos.d/CentOS-Base.repo</code></p>
<p>The second thing I need to do is tell it what the proxy is. There are several places this might need to be done. It&#8217;s more complicated for me because we have an authenticating proxy and that means that we have a username and password which makes things a pain since the password expires regularly and I don&#8217;t want this machine locking out my internet access!</p>
<p>The easiest way to do this is to set the environment variable <code>HTTP_PROXY</code> I don&#8217;t know if it needs to be in caps, but it seems to work better with some programs that way.<br />
<code>export HTTP_PROXY=http://server.dns:8080</code></p>
<p><code>export FTP_PROXY=http://server.dns:8080</code><br />
Yes, you do need that <code>http://</code> at the front of it. Obviously, you need to know the name and port of your proxy server.<br />
If you have an authenticating proxy server like we have here, then it looks like this:<br />
<code>export HTTP_PROXY=http://username:password@server.dns:8080</code></p>
<p><code>export FTP_PROXY=http://username:password@server.dns:8080</code></p>
<p>So, now we have repositories and we have setup the proxy. Woohoo!</p>
<p>Let&#8217;s test it as root: <code>yum check-update</code><br />
If this works, you should get a lot of reporting onscreen telling you that it&#8217;s found things that need updating.</p>
<p>If you want to run an update now do this (it will ask you before downloading a huge chunk of stuff):<br />
<code>yum update</code></p>
<p>The RPM package manager makes use of the environment variables we setup earlier, so it should work fine.</p>
<p>If you want to make these changes permanently, you can put the following in /etc/yum.conf:<br />
<code>http_proxy=http://server.dns:8080<br />
proxy_username=username<br />
proxy_password=password</code></p>
<p>You may also need to make similar changes for wget &#8211; which is used to retrieve packages sometimes. If so, then change /etc/wgetrc and add:<br />
<code>http_proxy=http://username:password@server.dns:8080</code></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=140</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rebuild Sky+ planner</title>
		<link>http://sr128.org/blog/?p=137</link>
		<comments>http://sr128.org/blog/?p=137#comments</comments>
		<pubDate>Sun, 14 Aug 2011 12:38:44 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[+]]></category>
		<category><![CDATA[planner]]></category>
		<category><![CDATA[plus]]></category>
		<category><![CDATA[rebuild]]></category>
		<category><![CDATA[sky]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=137</guid>
		<description><![CDATA[Press Services on remote Go Right to Settings Press Select Press 0,1, Select to access hidden menu Go right to Rebuild Press Select Wait while box does its thing Once Sky+ box is in standby wait for 60 seconds, then turn on with remote]]></description>
			<content:encoded><![CDATA[<ol>
<li>Press Services on remote</li>
<li>Go Right to Settings</li>
<li>Press Select</li>
<li>Press 0,1, Select to access hidden menu</li>
<li>Go right to Rebuild</li>
<li>Press Select</li>
<li>Wait while box does its thing</li>
<li>Once Sky+ box is in standby wait for 60 seconds, then turn on with remote</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=137</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recovering RAID array after an Ubuntu update</title>
		<link>http://sr128.org/blog/?p=127</link>
		<comments>http://sr128.org/blog/?p=127#comments</comments>
		<pubDate>Sun, 17 Apr 2011 14:11:44 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fstab]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mdadm]]></category>
		<category><![CDATA[raid]]></category>
		<category><![CDATA[recover]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=127</guid>
		<description><![CDATA[When I update Ubuntu from release to release on my home server running Ubuntu desktop with a raid array, it seems to lose my config file and can&#8217;t find the array. Eek! So, these are the commands I used to recover it. The commands are prefixed by this &#8216;#&#8216; because I&#8217;m root (the administrator) for [...]]]></description>
			<content:encoded><![CDATA[<p>When I update Ubuntu from release to release on my home server running Ubuntu desktop with a raid array, it seems to lose my config file and can&#8217;t find the array. Eek!</p>
<p>So, these are the commands I used to recover it. The commands are prefixed by this &#8216;<code>#</code>&#8216; because I&#8217;m root (the administrator) for the duration of what I&#8217;m doing here. Be careful!<br />
To become root issue this command: <code>sudo su -</code></p>
<p>Now, onto business&#8230;</p>
<p>Check I have mdadm installed:<br />
<code># which mdadm</code><br />
This should return the path of mdadm, if it&#8217;s installed e.g. <code>/sbin/mdadm</code> If not, go and install it via synaptic package manager or issue this command: <code>sudo apt-get install mdadm</code><br />
Make sure you have the right files especially mdadm.conf<br />
<code># ls /etc/mdadm</code><br />
Assuming we do, then we change to that directory (to save a bit of typing)<br />
<code># cd /etc/mdadm</code><br />
Backup the existing config file:<br />
<code># cp mdadm.conf mdadm.conf.orig</code><br />
Then we need to get the system to scan for the array and put the file into a config file it can use later:<br />
<code># mdadm --examine --scan --config=/etc/mdadm/mdadm.conf</code><br />
Just to make sure we like the look of the file &#8211; and to get some information:<br />
<code># cat mdadm.conf</code><br />
Make sure you pay attention to the line that looks like this:<br />
<code>ARRAY /dev/md0 level=raid5 num-devices=4 UUID=e0c</code><br />
The information we need is just after the word &#8216;<code>ARRAY</code>&#8216; and before the word &#8216;<code>level</code>&#8216;. in this case, it&#8217;s the &#8216;<code>/dev/md0</code>&#8216;. This is the name of the device we&#8217;re going to want the OS to mount on boot.<br />
Now we have the config file, we need to do some other things to make sure it mounts at boot.<br />
<code># cd /etc</code><br />
Backup the fstab file (which describes which volumes to mount at boot):<br />
<code># cp fstab fstab.orig</code><br />
Check I have the right directories to mount this volume<br />
<code># ls /media</code><br />
I don&#8217;t, so I&#8217;ll create it<br />
<code># mkdir /media/store1</code><br />
Now we&#8217;ll edit the file /etc/fstab to make sure it includes the new volume. Open the file in vi (or your editor of choice &#8211; pico or something might be easier if you&#8217;re not used to vi).<br />
<code># vi /etc/fstab</code><br />
This is the line I added at the bottom of that file:<br />
<code>/dev/md0    /media/store1    auto    defaults    0    3</code><br />
You can see the headers of each column at the top of the file:<br />
<code># &lt;file system&gt; &lt;mount point&gt;   &lt;type&gt;  &lt;options&gt;       &lt;dump&gt;  &lt;pass&gt;</code><br />
In this instance, I&#8217;m mounting the file system &#8216;<code>/dev/md0</code>&#8216; as &#8216;<code>/media/store1</code>&#8216; it will automatically detect the filesystem, use the default mount options, not backup the filesystem using a  utility callled dump and if a filesystem check (fsck) is needed, check the filesystem (fsck) after checking all filesystems with a &#8216;<code>pass</code>&#8216; number of less than 3 first and those with a number higher than 4 after this one if a filesystem check is needed.<br />
When I&#8217;ve done all this, I can easily check to see if it works by asking mount to mount the filesystem the way it will at boot i.e. use the entry I&#8217;ve just created:<br />
<code># mount /dev/md0</code><br />
Then check to see if I can see it<br />
<code># ls /media/store1</code><br />
There are the files I&#8217;m expecting. Success!</p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Find average file size in *nix</title>
		<link>http://sr128.org/blog/?p=124</link>
		<comments>http://sr128.org/blog/?p=124#comments</comments>
		<pubDate>Wed, 09 Feb 2011 12:28:11 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[average]]></category>
		<category><![CDATA[file]]></category>
		<category><![CDATA[filesize]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[size]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=124</guid>
		<description><![CDATA[Here&#8217;s how to find the average file size in a directory in *nix in one command. The result is presented in bytes. ls -l &#124; awk '{print $5}' &#124; awk 'BEGIN{i=0;}{i+=$1;}END{print i/NR;}']]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how to find the average file size in a directory in *nix in one command. The result is presented in bytes.</p>
<p><code>ls -l |  awk '{print $5}' |  awk 'BEGIN{i=0;}{i+=$1;}END{print i/NR;}'</code></p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=124</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Testing SMTP from the command line</title>
		<link>http://sr128.org/blog/?p=120</link>
		<comments>http://sr128.org/blog/?p=120#comments</comments>
		<pubDate>Wed, 12 Aug 2009 09:34:15 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[25]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[port]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smtp]]></category>
		<category><![CDATA[telnet]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=120</guid>
		<description><![CDATA[So, a friend of mine needed to test an email (SMTP) mail server and was writing something to do this in java when I mentioned that it could be tested via telnet. Here are some of the commands that I&#8217;ve used previously: Telnet to the mail server on the correct port (by default port 25) [...]]]></description>
			<content:encoded><![CDATA[<p>So, a friend of mine needed to test an email (SMTP) mail server and was writing something to do this in java when I mentioned that it could be tested via telnet.</p>
<p>Here are some of the commands that I&#8217;ve used previously:</p>
<ol>
<li>Telnet to the mail server on the correct port (by default port 25) e.g. <code>telnet mailhost 25</code></li>
<li>Type <strong>EHLO</strong> &lt;domain name&gt; and press enter e.g. <code>EHLO test.com</code></li>
<li>Type <strong>MAIL FROM:</strong>&lt;valid sending email address&gt; e.g. <code>MAIL FROM:tester1@test.com</code></li>
<li>Type <strong>RCPT TO:</strong>&lt;valid receiving mailbox to which you have access&gt; e.g. <code>RCPT TO:tester2@test.com</code></li>
<li>Type <strong>DATA</strong> and press enter</li>
<li>(Optional) Type Subject: &lt;subject of the test email&gt; e.g. <code>Subject:This is a test email via telnet to port 25 on mailhost</code></li>
<li>Press Enter to leave a blank line</li>
<li>Enter the text of the message e.g. <code>This is a test message sent at 10:33 on 12/08/2009</code></li>
<li>Press Enter, then a full-stop/period, then Enter again to end the message</li>
<li>Type <strong>QUIT</strong> to disconnect from the mail server</li>
<li>Exit Telnet as normal.</li>
</ol>
<p>I&#8217;ve put the commands in the text in bold so that they&#8217;re easier to spot, but if you follow the examples, you should be fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Troubleshooting a Mac that won&#8217;t start</title>
		<link>http://sr128.org/blog/?p=116</link>
		<comments>http://sr128.org/blog/?p=116#comments</comments>
		<pubDate>Fri, 07 Aug 2009 10:32:10 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[fsck]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[safe]]></category>
		<category><![CDATA[single]]></category>
		<category><![CDATA[start]]></category>
		<category><![CDATA[target]]></category>
		<category><![CDATA[user]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=116</guid>
		<description><![CDATA[Recently, I had to go through this process to work out what to do when my friend&#8217;s Macbook wouldn&#8217;t start. Here&#8217;s a reminder of the things I tried: Start in Safe Mode. Do this by holding down the Shift key while starting. Release Shift when you see the Apple logo and this spinning thing. Start [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I had to go through this process to work out what to do when my friend&#8217;s Macbook wouldn&#8217;t start.</p>
<p>Here&#8217;s a reminder of the things I tried:</p>
<ol>
<li>Start in Safe Mode. Do this by holding down the Shift key while starting. Release Shift when you see the Apple logo and this spinning thing.</li>
<li>Start in Single User mode. Do this by holding down Command-S while you start your Mac. This should bring you to a terminal. The first thing to try is fsck -f to see how many problems there are. (You can do fsck -fy which will run fsck and fix any problems automatically, but you may cause serious problems if your disk has major issues. Be careful if you choose this option and understand what you&#8217;re doing!) Run this repeatedly until no further problems are reported.</li>
<li>Start your Mac with the OS X disk in the drive. If you have a drive with a tray, hold down the left-mouse button while starting to eject it. If not, insert it as soon as possible. Either way, hold down the &#8216;C&#8217; key while booting until the apple logo and the spinning thing shows up. Then, go to Utilities, Disk Utilities. Choose to Repair Disk and keep doing this until there are no more errors. Once this has happened, click on Repair Permissions to fix those too.</li>
<li>If you have no luck with either of the above, then boot your machine in target disk mode by holding down the T button during boot until the Apple logo and spinning thing show up. Then connect it to a working Mac and run step 3 from the working Mac. Consider backing up the failing Mac from the good one at this point. At least you&#8217;ll get your data back.</li>
<li>Call Apple or take it into one of their stores.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=116</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CVS server failing (looping)</title>
		<link>http://sr128.org/blog/?p=113</link>
		<comments>http://sr128.org/blog/?p=113#comments</comments>
		<pubDate>Fri, 12 Jun 2009 06:45:19 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cvs]]></category>
		<category><![CDATA[failing]]></category>
		<category><![CDATA[looping]]></category>
		<category><![CDATA[nowait]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=113</guid>
		<description><![CDATA[I came across this problem when we were doing a big merge between branches in CVS. Although it doesn&#8217;t look like it, the client is making LOTS of connections &#8211; they can be seen in /var/log/syslog (on linux) &#8211; and there is a limit on the number of connections that can be made in one [...]]]></description>
			<content:encoded><![CDATA[<p>I came across this problem when we were doing a big merge between branches in CVS. Although it doesn&#8217;t look like it, the client is making LOTS of connections &#8211; they can be seen in /var/log/syslog (on linux) &#8211; and there is a limit on the number of connections that can be made in one minute.</p>
<p>This is the sort of entry you&#8217;ll see in /var/log/syslog</p>
<p><em>&lt;hostname&gt;</em> inetd[<em>&lt;pid&gt;</em>]: cvs/tcp server failing (looping), service terminated</p>
<p>To fix this, edit inetd.conf (normally in /etc) to increase the number of connections allowed in a minute e.g.</p>
<p>cvs stream tcp nowait.400 cvs /usr/bin/cvs &#8230;</p>
<p>nowait.400 allows 400 connections per minute which should enough! We saw a connection rate of about 180/minute when merging a BIG branch&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=113</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Editing files in place with sed</title>
		<link>http://sr128.org/blog/?p=95</link>
		<comments>http://sr128.org/blog/?p=95#comments</comments>
		<pubDate>Tue, 31 Mar 2009 06:38:35 +0000</pubDate>
		<dc:creator>Stuart</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bind]]></category>
		<category><![CDATA[dns]]></category>
		<category><![CDATA[edit]]></category>
		<category><![CDATA[in]]></category>
		<category><![CDATA[place]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://sr128.org/blog/?p=95</guid>
		<description><![CDATA[If you want to edit a bunch of files – for dns updates on bind for example, do this: sed –i s/&#60;text to replace&#62;/&#60;text to replace with&#62;/g filename_to_change If you’re concerned about backups, then you can do this: sed –i’&#60;orginal backup file extension&#62;’ s/&#60;text to replace&#62;/&#60;replacement text&#62;/g filename_to_change e.g. if we want to edit a [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to edit a bunch of files – for dns updates on bind for example, do this:</p>
<p><code>sed –i s/&lt;text to replace&gt;/&lt;text to replace with&gt;/g filename_to_change<br />
</code></p>
<p>If you’re concerned about backups, then you can do this:</p>
<p><code>sed –i’&lt;orginal backup file extension&gt;’ s/&lt;text to replace&gt;/&lt;replacement text&gt;/g filename_to_change</code></p>
<p>e.g. if we want to edit a file and keep the original with a .old extension the following would work</p>
<p><code>sed –i’.old’ s/&lt;text to replace&gt;/&lt;replacement text&gt;/g filename_to_change<br />
</code></p>
<p>Notice the single quotes after the ‘i’. This will produce a file with an extension of .old as a backup.</p>
]]></content:encoded>
			<wfw:commentRss>http://sr128.org/blog/?feed=rss2&#038;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

