<?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></title>
	<atom:link href="http://www.tomhayman.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tomhayman.co.uk</link>
	<description>Mainly Linux</description>
	<lastBuildDate>Sat, 21 Apr 2012 10:29:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Install Puppet with Passenger on Centos 6 – Part Three</title>
		<link>http://www.tomhayman.co.uk/linux/install-puppet-dashboard-stored-configs-centos-6-part/</link>
		<comments>http://www.tomhayman.co.uk/linux/install-puppet-dashboard-stored-configs-centos-6-part/#comments</comments>
		<pubDate>Sat, 21 Apr 2012 10:14:03 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=462</guid>
		<description><![CDATA[Today we will get Puppet Dashboard working. We'll configure this on the same server as Passenger. So let's get started. Getting stored configs working with MySQL Install Rails: [root@puppet]# gem install rails -v 2.2.2 Install MySQL server and the MySQL gem: [root@puppet]# yum install mysql mysql-devel mysql-server [root@puppet]# gem install mysql -- --with-mysql-config=/usr/bin/mysql_config Create the [...]]]></description>
			<content:encoded><![CDATA[<p>Today we will get Puppet Dashboard working. We'll configure this on the same server as Passenger.</p>
<p>So let's get started.</p>
<p><span style="text-decoration: underline;"><strong>Getting stored configs working with MySQL</strong></span></p>
<p>Install Rails:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# gem install rails -v 2.2.2</span></strong></p>
<p>Install MySQL server and the MySQL gem:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# yum install mysql mysql-devel mysql-server</span></strong></p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# gem install mysql -- --with-mysql-config=/usr/bin/mysql_config</span></strong></p>
<p>Create the puppet database:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# mysql -u root -p</span></strong></p>
<p><code>mysql&gt; create database puppet;<br />
mysql&gt; grant all privileges on puppet.* to puppet@localhost<br />
identified by 'password'; </code></p>
<p>Add table index:</p>
<p><code>mysql&gt; create index exported_restype_title on resources (exported,<br />
restype, title(50));</code></p>
<p>Edit your puppet.conf:</p>
<p><code>storeconfigs = true<br />
dbadapter = mysql<br />
dbname = puppet<br />
dbuser = puppet<br />
dbpassword = password<br />
dbserver = localhost<br />
dbsocket = /var/lib/mysql/mysql.sock</code></p>
<p>To check it's working:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;"> mysql -u puppet -p -D puppet -e 'select name,last_compile from hosts;'</span></strong></p>
<p>This should output hosts and last compile time. You may need to run a Puppet agent against the server to see this updating.</p>
<p><span style="text-decoration: underline;"><strong>Getting Puppet Dashboard working</strong></span></p>
<p>Install the Puppet Dashboard rpm:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# rpm -ivf http://downloads.puppetlabs.com/dashboard/puppet-dashboard-1.2.2-1.el6.noarch.rpm</span></strong></p>
<p>Now, let's configure Dashboard:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# cd /usr/share/puppet-dashboard/config</span></strong></p>
<p>Configure settings.yml with your favourite text editor:</p>
<p><code>a_server: 'puppet.tomhayman.co.uk'</code></p>
<p>Then configure database.yml, keeping the database details the same as above:</p>
<p><code>production:<br />
database: puppet<br />
username: puppet<br />
password: password<br />
encoding: utf8<br />
adapter: mysql</p>
<p>development:<br />
database: puppet<br />
username: puppet<br />
password: password<br />
encoding: utf8<br />
adapter: mysql</p>
<p>test:<br />
database: puppet<br />
username: puppet<br />
password: password<br />
encoding: utf8<br />
adapter: mysql<br />
</code><br />
Create the Dashboard database schema, so go up a level to here (/usr/share/puppet-dashboard)</p>
<p>Then run:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# rake db:migrate</span></strong></p>
<p>Copy the Apache vhost config file from the example Puppet Dashboard gives you:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# cp /usr/share/puppet-dashboard/ext/passenger/dashboard-vhost.conf /etc/httpd/conf.d/puppetdashboard.conf</span></strong></p>
<p>You will need to alter a few things inside that conf file. Mine is like this but you may want to tune some parameters, depending on your needs.</p>
<p><code><br />
PassengerHighPerformance on<br />
PassengerMaxPoolSize 12<br />
PassengerPoolIdleTime 1500<br />
PassengerStatThrottleRate 120<br />
RailsAutoDetect On<br />
ServerName puppetdashboard.tomhayman.co.uk<br />
DocumentRoot /usr/share/puppet-dashboard/public/<br />
#SetEnv RAILS_ENV production<br />
#RackBaseURI </p>
<p>Options None<br />
AllowOverride AuthConfig<br />
Order allow,deny<br />
allow from all</p>
<p>ErrorLog /var/log/httpd/dashboard.example.com_error.log<br />
LogLevel warn<br />
CustomLog /var/log/httpd/dashboard.example.com_access.log combined<br />
</code><br />
Check the Apache config reports no errors by checking the config:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# apachectl -t -f /etc/httpd/conf.d/puppetdashboard.conf</span></strong></p>
<p>Any problems you will obviously need to fix before you restart Apache.</p>
<p>Create logs for Dashboard:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# touch /usr/share/ puppet-dashboard/log/production.log</span></strong></p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# chmod 0666 /usr/share/ puppet-dashboard/log/production.log</span></strong></p>
<p>To enable inventory support, first check what you need to do at <a href="http://docs.puppetlabs.com/dashboard/inventory_support.html">Puppetlabs</a>.</p>
<p>In a nutshell, you need to change just a few settings. Go to settings.yml and change:<br />
<code><br />
enable_inventory_service: true</code></p>
<p>Create the SSL certificates:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# rake cert:create_key_pair RAILS_ENV=production</span></strong></p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# rake cert:request RAILS_ENV=production</span></strong></p>
<p>Then sign it:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# puppetca -s dashboard</span></strong></p>
<p>A little mistake I ran into was the certificates need to be owned by the dashboard user. So, change the ownership of the certs directory so that the puppet-dashboard user can access them:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# chown puppet-dashboard:puppet-dashboard -R certs/</span></strong></p>
<p>Add this to /etc/puppet/auth.conf<br />
<code><br />
path /facts<br />
auth any<br />
method find, search<br />
allow *</code></p>
<p>Then, restart Apache:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# apachectl restart</span></strong></p>
<p>Start the Dashboard workers:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# /etc/init.d/puppet-dashboard-workers start</span></strong></p>
<p>You may need to run the puppet agent on a node first to see puppet Facts appear on the Puppet Dashboard.</p>
<p>That's it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/install-puppet-dashboard-stored-configs-centos-6-part/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Install Puppet with Passenger on Centos 6 &#8211; Part Two</title>
		<link>http://www.tomhayman.co.uk/linux/install-puppet-passenger-centos-6-part/</link>
		<comments>http://www.tomhayman.co.uk/linux/install-puppet-passenger-centos-6-part/#comments</comments>
		<pubDate>Fri, 30 Dec 2011 17:49:51 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=413</guid>
		<description><![CDATA[Last time we got our Puppet server embedded in a WEBrick server. Today I'll show how to go one step further by installing Passenger (mod_rails). By enabling Apache to serve our Puppet clients we will benefit from performance gains like being able to handle concurrent connections. Getting Passenger working Add the following into your puppet.conf: [...]]]></description>
			<content:encoded><![CDATA[<p>Last time we got our Puppet server embedded in a WEBrick server. Today I'll show how to go one step further by installing <a title="Passenger" href="http://docs.puppetlabs.com/guides/passenger.html">Passenger </a>(mod_rails). By enabling Apache to serve our Puppet clients we will benefit from performance gains like being able to handle concurrent connections.</p>
<p><strong><span style="text-decoration: underline;">Getting Passenger working</span></strong></p>
<p>Add the following into your puppet.conf:</p>
<p><code>[master]<br />
ssl_client_header = SSL_CLIENT_S_D<br />
ssl_client_verify_header = SSL_CLIENT_VERIFY</code></p>
<p>Install the following on our Puppet server:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# yum install gcc-c++ httpd-devel apr-devel ruby-devel ruby-rdoc</span></strong></p>
<p>Install some gems:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# gem install -v=1.0.1 rack </span></strong></p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# gem install -v=2.3.5 activerecord </span></strong></p>
<p>And Passenger:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# gem install -v=2.2.11 passenger </span></strong></p>
<p>And:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# passenger-install-apache2-module </span></strong></p>
<p>If this final install of Passenger fails it will tell you where it went wrong so fix as and if needed.</p>
<p>Install mod_ssl:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# yum install mod_ssl </span></strong></p>
<p>Create the document root:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# mkdir -p /usr/share/puppet/rack/puppetmasterd/public </span></strong></p>
<p>Now we need to create the Apache configuration in /etc/httpd/conf.d/puppet.conf:</p>
<p><code>LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11/ext/apache2/mod_passenger.so<br />
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.11<br />
PassengerRuby /usr/bin/ruby</code></p>
<p>Listen 8140</p>
<p>SSLEngine on<br />
SSLCipherSuite SSLv2:-LOW:-EXPORT:RC4+RSA<br />
SSLCertificateFile /var/lib/puppet/ssl/certs/test.tomhayman.co.uk.pem<br />
SSLCertificateKeyFile /var/lib/puppet/ssl/private_keys/test.tomhayman.co.uk.pem<br />
SSLCertificateChainFile /var/lib/puppet/ssl/ca/ca_crt.pem<br />
SSLCACertificateFile /var/lib/puppet/ssl/ca/ca_crt.pem<br />
# CRL checking should be enabled; if you have problems withApache complaining about the CRL, disable the next line<br />
SSLCARevocationFile /var/lib/puppet/ssl/ca/ca_crl.pem<br />
SSLVerifyClient optional<br />
SSLVerifyDepth 1<br />
SSLOptions +StdEnvVars</p>
<p># The following client headers allow the same configuration to work with Pound.<br />
RequestHeader set X-SSL-Subject %{SSL_CLIENT_S_DN}e<br />
RequestHeader set X-Client-DN %{SSL_CLIENT_S_DN}e<br />
RequestHeader set X-Client-Verify %{SSL_CLIENT_VERIFY}e</p>
<p>RackAutoDetect On<br />
DocumentRoot /usr/share/puppet/rack/puppetmasterd/public/</p>
<p>Options None<br />
AllowOverride None<br />
Order allow,deny<br />
allow from all</p>
<p>Check the Apache configuration with an <em>apachectl configtest</em> and again fix any errors you encounter.</p>
<p>Now, copy the Rack config:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# cp /usr/share/puppet/ext/rack/files/config.ru /usr/share/puppet/rack/puppetmasterd/ </span></strong></p>
<p>Give Puppet correct permission to access the Rack config:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# chown puppet:puppet /usr/share/puppet/rack/puppetmasterd/config.ru </span></strong></p>
<p>Stop the Puppet server with a <em>service puppetmaster stop</em> so it won't interfere with Passenger. Remember to deactivate the puppetmaster service via <em>chkconfig </em>too. Then start Apache and you should have Passenger working.</p>
<p>To check from our Puppet client:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@pclient]# puppetd --noop --test --server <strong>puppet.tomhayman.co.uk </strong>--port 8140 </span></strong></p>
<p>In part three we will get <a title="stored configs" href="http://projects.puppetlabs.com/projects/1/wiki/Using_Stored_Configuration">stored configurations</a> working and also <a title="Puppet Dashboard" href="http://puppetlabs.com/puppet/related-projects/dashboard/">Puppet Dashboard</a>. I hope this has helped and if you run into any problems let me know and I'll try and give you a hand.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/install-puppet-passenger-centos-6-part/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Install Puppet with Passenger on Centos 6 &#8211; Part One</title>
		<link>http://www.tomhayman.co.uk/linux/install-puppet-modpassenger-mysql-stored-procs-centos-6-rhel6/</link>
		<comments>http://www.tomhayman.co.uk/linux/install-puppet-modpassenger-mysql-stored-procs-centos-6-rhel6/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 18:14:18 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=385</guid>
		<description><![CDATA[This is part one on how to install a Puppet 2.76 Server using Passenger (mod_passenger) with MySQL (for stored configurations) on Centos 6 or Red Hat Enterprise 6.  In this first part we will get a Puppet/WEBrick server serving a single Puppet client. Firstly, ensure the FQDN (i.e. puppet.tomhayman.co.uk) is set up properly on the [...]]]></description>
			<content:encoded><![CDATA[<p>This is part one on how to install a <a href="http://projects.puppetlabs.com/">Puppet</a> 2.76 Server using Passenger (mod_passenger) with MySQL (for stored configurations) on Centos 6 or Red Hat Enterprise 6.  In this first part we will get a Puppet/WEBrick server serving a single Puppet client.</p>
<p>Firstly, ensure the FQDN (i.e. puppet.tomhayman.co.uk) is set up properly on the server otherwise your Puppet clients will not be able to connect.</p>
<p>In this example, we're going to have the following setup:</p>
<p><strong>puppet.tomhayman.co.uk</strong> 192.168.1.10 = Puppet server</p>
<p><strong>pclient.tomhayman.co.uk</strong> 192.168.1.20 = Puppet client</p>
<p>Next, add a puppet.repo to /etc/yum.repos.d/ on both server and client:</p>
<p><code>[puppetlabs]<br />
name=Puppet Labs Packages<br />
baseurl=http://yum.puppetlabs.com/el/6/products/x86_64/<br />
enabled=1<br />
gpgcheck=0<br />
[puppetlabs2]<br />
name=Puppet Labs Packages Deps<br />
baseurl=http://yum.puppetlabs.com/el/6/dependencies/x86_64/<br />
enabled=1<br />
gpgcheck=0</code></p>
<p>Also, add the <a href="https://fedoraproject.org/wiki/EPEL">EPEL</a> repository.</p>
<p>Now, install Puppet server on the server:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# yum install puppet-server</span></strong></p>
<p>And install the Puppet client on the client:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@pclient]# yum install puppet</span></strong></p>
<p>Start the Puppet server to generate the SSL certificates:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# service puppetmaster start</span></strong></p>
<p>Check the SSL certificates have been generated by verifying their existence in /var/lib/puppet/ssl.</p>
<p>Let's see if the Puppet server and client can communicate with each other.  Note, you may need to open up your firewall for this to work, so open port 8140 on the Puppet server to allow the Puppet client access.   For iptables:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# iptables -I INPUT -s 192.168.1.20 -m tcp -p tcp --dport 8140 -j ACCEPT</span></strong></p>
<p>Save the iptables and restart the service.</p>
<p>Next, on the client, generate a SSL certificate request:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@pclient]# puppetd --waitforcert 30 --server puppet.tomhayman.co.uk -v</span></strong></p>
<p>On the server check whether it has received the request:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# puppetca -l</span></strong></p>
<p>If it has worked, the output should be similar to:</p>
<p>pclient.tomhayman.co.uk xxxxxxxxxxxxxxxx</p>
<p>Then sign the request:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@puppet]# puppetca -s pclient.tomhayman.co.uk </span></strong></p>
<p>If you run into any problems with generating or signing the certificates, check in the /var/lib/puppet/ssl directory and remove them if necessary.  You can also run <em>puppetca -c pclient.tomhayman.co.uk</em> which revokes the certificate.</p>
<p>Check if everything is working by running this on the client:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@pclient]# puppetd  --debug --server puppet.tomhayman.co.uk</span></strong></p>
<p>This will output any errors if there are any.</p>
<p>Now you should have a working Puppet server communicating with a Puppet client, in <a href="http://www.tomhayman.co.uk/linux/install-puppet-passenger-centos-6-part/">part two</a> we will get Passenger installed.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/install-puppet-modpassenger-mysql-stored-procs-centos-6-rhel6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yum install packages from text file</title>
		<link>http://www.tomhayman.co.uk/linux/yum-install-text-file/</link>
		<comments>http://www.tomhayman.co.uk/linux/yum-install-text-file/#comments</comments>
		<pubDate>Fri, 05 Aug 2011 10:49:12 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=342</guid>
		<description><![CDATA[If you want to install packages from a text file using YUM, from server1 to server2, follow the steps below. Let's create the text file with the listed packages on server1: [root@server1]# rpm -qa > installed.txt Then let's copy installed.txt from server1 using scp to server2, like this: [root@server1]# scp installed.txt tom@server2:/home/tom Now ssh to [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to install packages from a text file using <a href="http://yum.baseurl.org/" title="YUM">YUM</a>, from server1 to server2, follow the steps below.  </p>
<p>Let's create the text file with the listed packages on server1:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@server1]# rpm -qa > installed.txt</span></strong></p>
<p>Then let's copy installed.txt from server1 using <em>scp </em> to server2, like this:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@server1]# scp installed.txt tom@server2:/home/tom</span></strong></p>
<p>Now <em>ssh </em>to server2 and do this:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">[root@server2 tom]# yum -y install $(cat installed.txt)</span></strong></p>
<p>This will now install all the packages listed in installed.txt on server2.  This has helped me out a few times and hope it helps anyone else out there too.</p>
<p>(N.B. This example was carried out on two Centos 5.6 servers but could easily work on other distributions.  However, it goes without saying that each server will need to have the same architecture and distribution for this to work properly.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/yum-install-text-file/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to mount NTFS partition in Ubuntu</title>
		<link>http://www.tomhayman.co.uk/linux/howto-mount-ntfs-partition-ubuntu/</link>
		<comments>http://www.tomhayman.co.uk/linux/howto-mount-ntfs-partition-ubuntu/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 16:38:08 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=304</guid>
		<description><![CDATA[If you need read and write access to a NTFS partition from Ubuntu you can add an entry into /etc/fstab so that every time you boot up, the NTFS partition automatically mounts for you. First, create a directory where the partition will be mounted: mkdir /media/ntfs Find the UUID of the NTFS partition: sudo blkid [...]]]></description>
			<content:encoded><![CDATA[<p>If you need read and write access to a NTFS partition from Ubuntu you can add an entry into /etc/fstab so that every time you boot up, the NTFS partition automatically mounts for you.  </p>
<p>First, create a directory where the partition will be mounted:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">mkdir /media/ntfs</span></strong></p>
<p>Find the UUID of the NTFS partition:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">sudo blkid</span></strong></p>
<p>This will output something similar to:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">/dev/sda1: UUID="B070ED7770DD452A" TYPE="ntfs"</span></strong></p>
<p>If you have multiple NTFS partitions you will need to work out which one you want to automatically mount each time you boot.</p>
<p>Backup your fstab configuration (just in case you break something):</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">cp /etc/fstab /home/you/backup</span></strong></p>
<p>Then add this line to /etc/fstab changing the UUID:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">UUID=B070ED7770DD452A /media/ntfs                         ntfs    rw,auto, uid=1234, umask=0027, nls=utf8 0 0</span></strong></p>
<p>You can also set the "uid" to your own user id (uid=1234 is the example used here) and you can find this out by issuing <em>id -u</em> at the command line.  Mounting file systems with specific user (or group) ids can be useful for the security of your system.<br />
Umask = 0027 means you can read, write, or execute any files in the NTFS partition.  </p>
<p>Check if it works:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">sudo mount /media/ntfs &#038;& df</span></strong></p>
<p>This should output various file systems including your newly mounted NTFS partition: </p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">/dev/sda1    1        70226940  58935140  11291800  84% /media/ntfs</span></strong></p>
<p>The next time you reboot the NTFS partition will automatically mount.  To add more than one partition (or disk) just repeat the steps above, adding a new line for every additional partition into the fstab configuration file.  </p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/howto-mount-ntfs-partition-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>vCenter cannot add domain account users &#8211; fixed</title>
		<link>http://www.tomhayman.co.uk/vmware/virtualcenter-add-domain-account-users-fixed/</link>
		<comments>http://www.tomhayman.co.uk/vmware/virtualcenter-add-domain-account-users-fixed/#comments</comments>
		<pubDate>Tue, 02 Nov 2010 13:34:28 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=276</guid>
		<description><![CDATA[Recently I had to reinstall vCenter 4.1 and came across a problem with adding domain users via the permissions tab. The problem was when I selected the domain; the list of users from the global address list was coming up blank.  As shown here: I logged into the vCenter server, then into the vSphere client [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I had to reinstall vCenter 4.1 and came across a problem with adding domain users via the permissions tab.  The problem was when I selected the domain; the list of users from the global address list was coming up blank.  As shown here:</p>
<p><a href="http://www.tomhayman.co.uk/wp-content/uploads/2010/11/add_permissions_vCenter2.jpg"><img class="aligncenter size-full wp-image-283" title="VirtualCenter cannot add domain account users" src="http://www.tomhayman.co.uk/wp-content/uploads/2010/11/add_permissions_vCenter2.jpg" alt="" width="384" height="362" /></a></p>
<p>I logged into the vCenter server, then into the vSphere client with the domain administrator account and the same problem occurred.  I carried out a few troubleshooting steps to see if anything was obviously at fault.  First of all I used telnet to log into one of the domain controllers on the LDAP port (389) and received a successful response.  I checked the event logs on the domain controllers and didn't see any issues so I began some more tests.</p>
<p>It was only when I stopped the VirtualCenter Server service and checked the logon account that I noticed it was using the local administrator's account.  When I changed the logon account to the domain administrator, restarted the services,  it came up with the full global address list first time.    Sometimes a simple fix is the best kind.</p>
<p>I haven't managed to find any VMware Knowledge Base articles about this problem yet but I’m sure other people have come across this issue.    I hope this post helps anyone suffering from the same problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/vmware/virtualcenter-add-domain-account-users-fixed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Using Netdom to query FSMO roles</title>
		<link>http://www.tomhayman.co.uk/windows/netdom-query-domain-controllers/</link>
		<comments>http://www.tomhayman.co.uk/windows/netdom-query-domain-controllers/#comments</comments>
		<pubDate>Mon, 11 Oct 2010 08:24:21 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=256</guid>
		<description><![CDATA[Netdom is a Windows server tool which lets you do all sorts of administrative tasks such as adding computers to a domain, managing computer accounts, renaming computer accounts (it's even possible to rename domain controllers), resetting a computer accounts password, etc. To query the FSMO (Flexible Single Master of Operation...) roles do the following command [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Netdom" href="http://technet.microsoft.com/en-us/library/cc772217%28WS.10%29.aspx" target="_self">Netdom </a>is a Windows server tool which lets you do all sorts of administrative tasks such as adding computers to a domain, managing computer accounts, renaming computer accounts (it's even possible to rename domain controllers), resetting a computer accounts password, etc.</p>
<p>To query the FSMO (Flexible Single Master of Operation...) roles do the following command on an elevated command prompt:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">netdom query fsmo</span></strong></p>
<p>This will query the FSMO roles on the domain that the server belongs.</p>
<p>To specify another domain issue this command:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">netdom query /d:tomhayman fsmo</span></strong></p>
<p>To specify the server which performs the query:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">netdom query /s:myserver fsmo</span></strong></p>
<p>To find out more about netdom, type:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">netdom/help</span></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/windows/netdom-query-domain-controllers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setup cups</title>
		<link>http://www.tomhayman.co.uk/linux/setup-cups/</link>
		<comments>http://www.tomhayman.co.uk/linux/setup-cups/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 14:10:17 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=232</guid>
		<description><![CDATA[Recently I learnt how to setup Cups (as part of the RHCE requirements).  I'm not sure when I would use Cups but there you go. This is how I did it on a spare Centos server. Install cups: yum groupinstall printing Start cups: service cups start Activate automatic startup: chkconfig cups on The main conf [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I learnt how to setup <a title="Cups" href="http://www.cups.org/" target="_self">Cups</a> (as part of the RHCE requirements).  I'm not sure when I would use Cups but there you go.</p>
<p>This is how I did it on a spare Centos server.</p>
<p>Install cups:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">yum groupinstall printing<br />
</span></strong></p>
<p>Start cups:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">service cups start</span></strong></p>
<p>Activate automatic startup:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">chkconfig cups on</span></strong></p>
<p>The main conf files are kept in the usual places:</p>
<p>/etc/cups/classes.conf = configure groups of printers<br />
/etc/cups/client.conf = default server<br />
/etc/cups/cupsd.conf = main conf file</p>
<p>To configure the web based gui for Cups, edit /etc/cups/cupsd.conf and add:</p>
<p>Listen 192.168.2.1:631<br />
Listen /var/run/cups/cups.sock</p>
<p>(N.B. 192.168.2.1 is the IP of the server)</p>
<p>Add these to all location directives:</p>
<p>Allow localhost<br />
Allow 192.168.2.*</p>
<p>For example:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">"Location /admin/conf<br />
Encryption Required<br />
Order allow,deny<br />
<span style="font-weight: bold;">Allow localhost<br />
<span style="font-weight: bold;"> Allow 192.168.2.*</span></span></span></strong></p>
<p>You will need to restart cups to make these changes take effect:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">service cups restart</span></strong></p>
<p>Then go to:</p>
<p>http://192.168.2.1:631</p>
<p>And you're all set with a brand new cups server.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/setup-cups/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Recover files using lsof</title>
		<link>http://www.tomhayman.co.uk/linux/lsof/</link>
		<comments>http://www.tomhayman.co.uk/linux/lsof/#comments</comments>
		<pubDate>Tue, 21 Sep 2010 16:16:41 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=202</guid>
		<description><![CDATA[lsof is a Linux tool which can show open files and network connections, and even recover deleted files. If you have ever deleted a file by mistake; been clearing up log files, or just used rm without thinking, there is a way of recovering that deleted file. For example, to recover a missing error_log or [...]]]></description>
			<content:encoded><![CDATA[<p>lsof is a Linux tool which can show open files and network connections, and even recover deleted files.</p>
<p>If you have ever deleted a file by mistake; been clearing up log files, or just used <em>rm </em>without thinking, there is a way of recovering that deleted file.  For example, to recover a missing error_log or access_log used by Apache you can search for it via this command:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">lsof | grep access_log</span></strong></p>
<p>Which outputs:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">httpd     26120    apache   42w      REG      253,0       5852   12222531 /apachelogs/access_log (deleted)</span></strong></p>
<p>The key word to look for here is <em>deleted</em> in brackets.  The good news is a process (26120) still has the file open and without this process keeping the file open we would have lost the file permanently.  So, with the Apache daemon helping us out we can view the missing info by looking inside the proc filesystem, the process id (26120), and finally in the file descriptor (fd):</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">cat /proc/26120/fd/42</span></strong></p>
<p>This outputs the contents of my deleted access_log which shows the data is still there. All you need to do now is simply redirect the contents back to /apachelogs/access_log, like this:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">cat /proc/26120/fd/42 > /apachelogs/access_log</span></strong></p>
<p>Now you have recovered your access_log with all the data back to its original location.  (You should also restart Apache).  lsof can do much more, however, this is one example which could save the day.  </p>
<p>Does anyone know any other examples of lsof?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/linux/lsof/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Using vSphere PowerCLI to find unused snapshots</title>
		<link>http://www.tomhayman.co.uk/vmware/vsphere-powercli-find-unused-snapshots/</link>
		<comments>http://www.tomhayman.co.uk/vmware/vsphere-powercli-find-unused-snapshots/#comments</comments>
		<pubDate>Wed, 15 Sep 2010 13:18:36 +0000</pubDate>
		<dc:creator>Tom Hayman</dc:creator>
				<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://www.tomhayman.co.uk/?p=184</guid>
		<description><![CDATA[A simple and effective way of finding all your unused virtual machine snapshots by using vSphere PowerCLI. Open vSphere PowerCLI and connect to your vCenter Server: Connect-VIServer -Server 192.168.2.2 When prompted enter your username and password. Then: Get-VM * &#124; Get-Snapshot This will output the name, description, and powerstate of all virtual machines snapshots. You [...]]]></description>
			<content:encoded><![CDATA[<p>A simple and effective way of finding all your unused virtual machine snapshots by using vSphere PowerCLI.</p>
<p>Open vSphere PowerCLI and connect to your vCenter Server:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">Connect-VIServer -Server 192.168.2.2</span></strong></p>
<p>When prompted enter your username and password.</p>
<p>Then: </p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">Get-VM * | Get-Snapshot</span></strong></p>
<p>This will output the name, description, and powerstate of all virtual machines snapshots.</p>
<p>You need to disconnect when you have finished:</p>
<p style="background-color: #2e2e2e;"><strong><span style="color: #ffffff;">Disconnect-VIServer 192.168.2.2</span></strong></p>
<p>This is just one example of vSphere PowerCLI but this shows how effective and time saving it can be.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomhayman.co.uk/vmware/vsphere-powercli-find-unused-snapshots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
