<?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>Pario TechnoBlob &#187; Photo etc</title>
	<atom:link href="http://pario.no/category/photo-etc/feed/" rel="self" type="application/rss+xml" />
	<link>http://pario.no</link>
	<description>A cronological documentation test project, nothing serious, really!</description>
	<lastBuildDate>Thu, 02 Feb 2012 13:17:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>IP address change notifier script</title>
		<link>http://pario.no/2009/01/21/ip-address-change-notifier-script/</link>
		<comments>http://pario.no/2009/01/21/ip-address-change-notifier-script/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 12:57:16 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ifconfig]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[sed]]></category>

		<guid isPermaLink="false">http://pario.no/?p=922</guid>
		<description><![CDATA[This is a simple bash script that is run by crontab every 5 minutes on a linux box. It e-mails me the new address when a change of IP address is detected. The script (ipchangemail.sh) #!/bin/bash # Check if IP-address has changed. If a change has occured, mail me the new address # Add the [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple bash script that is run by crontab every 5 minutes on a linux box.<br />
It e-mails me the new address when a change of IP address is detected.</p>
<p>The script (ipchangemail.sh)</p>
<pre>
#!/bin/bash 

# Check if IP-address has changed. If a change has occured, mail me the new address
# Add the following line to crontab if you would like it to be run every 5 minutes:
# */5 * * * * ./ipchangemail.sh

# The network interface I want to monitor
NET_INTERFACE=eth0

# File to keep the latest IP address
IP_FILE=myip.txt

# Mail to this address when a change occur
MAILTO=mail@example.com

# Read the previous IP address from file
source $IP_FILE

CURRENT_IP=`/sbin/ifconfig $NET_INTERFACE | sed -n "/inet addr:.*255.255.25[0-5].[0-9]/{s/.*inet addr://; s/ .*//; p}"`

if [ "$CURRENT_IP" != "$OLD_IP" ]
then
        # Send email about address change
        `echo "New IP address detected: $CURRENT_IP" | mail -s "New IP address" $MAILTO`

        # Write new address to file
        `echo "OLD_IP=$CURRENT_IP" > $IP_FILE`
fi
</pre>
<p>The script can be downloaded <a href="http://pario.no/wp-content/uploads/2009/01/ipchangemail.sh">here</a>.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDkvMDEvMjEvaXAtYWRkcmVzcy1jaGFuZ2Utbm90aWZpZXItc2NyaXB0Lzx3cHRiPklQIGFkZHJlc3MgY2hhbmdlIG5vdGlmaWVyIHNjcmlwdDx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2009/01/21/ip-address-change-notifier-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Enable query caching in mysql</title>
		<link>http://pario.no/2008/09/13/enable-query-caching-in-mysql/</link>
		<comments>http://pario.no/2008/09/13/enable-query-caching-in-mysql/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 11:15:36 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://pario.no/?p=624</guid>
		<description><![CDATA[Query caching is a way to increase the performance of mysql by caching database queries. It&#8217;s quite easy to do and only requires to edit one file, in Debian it&#8217;s called /etc/mysql/my.cnf Add the following lines in the mysqld section [mysqld] query-cache-type = 1 query-cache-size = 10M restart the mysql daemon # /etc/init.d/mysql restart Verify [...]]]></description>
			<content:encoded><![CDATA[<p>Query caching is a way to increase the performance of mysql by caching database queries.<br />
It&#8217;s quite easy to do and only requires to edit one file, in Debian it&#8217;s called <b>/etc/mysql/my.cnf</b></p>
<p>Add the following lines in the mysqld section</p>
<pre>
[mysqld]
query-cache-type = 1
query-cache-size = 10M</pre>
<p>restart the mysql daemon</p>
<pre>
# /etc/init.d/mysql restart</pre>
<h2>Verify that query caching is enabled</h2>
<pre>
# mysql -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 33499
Server version: 5.0.32-Debian_7etch6-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> SHOW VARIABLES LIKE '%query_cache%';
+------------------------------+----------+
| Variable_name                | Value    |
+------------------------------+----------+
| have_query_cache             | YES      |
| query_cache_limit            | 1048576  |
| query_cache_min_res_unit     | 4096     |
| query_cache_size             | 10485760 |
| query_cache_type             | ON       |
| query_cache_wlock_invalidate | OFF      |
+------------------------------+----------+
6 rows in set (0.00 sec)
</pre>
<p>If you see something like the out above, caching is enabled.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDkvMTMvZW5hYmxlLXF1ZXJ5LWNhY2hpbmctaW4tbXlzcWwvPHdwdGI%2BRW5hYmxlIHF1ZXJ5IGNhY2hpbmcgaW4gbXlzcWw8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/09/13/enable-query-caching-in-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a PDF document from man page</title>
		<link>http://pario.no/2008/09/05/create-a-pdf-document-from-man-page/</link>
		<comments>http://pario.no/2008/09/05/create-a-pdf-document-from-man-page/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 06:39:44 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[ps2pdf]]></category>

		<guid isPermaLink="false">http://pario.no/?p=595</guid>
		<description><![CDATA[man -t passwd &#124; ps2pdf -> passwd.pdf]]></description>
			<content:encoded><![CDATA[<pre>
man -t passwd | ps2pdf -> passwd.pdf</pre>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDkvMDUvY3JlYXRlLWEtcGRmLWRvY3VtZW50LWZyb20tbWFuLXBhZ2UvPHdwdGI%2BQ3JlYXRlIGEgUERGIGRvY3VtZW50IGZyb20gbWFuIHBhZ2U8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/09/05/create-a-pdf-document-from-man-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rename files by wildcard pattern and correct the EXIF timestamp metadata</title>
		<link>http://pario.no/2008/09/02/rename-files-by-wildcard-pattern-and-correct-the-exif-timestamp-metadata/</link>
		<comments>http://pario.no/2008/09/02/rename-files-by-wildcard-pattern-and-correct-the-exif-timestamp-metadata/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 16:05:58 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[Network]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[EXIF]]></category>
		<category><![CDATA[exiv2]]></category>
		<category><![CDATA[jhead]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[mmv]]></category>
		<category><![CDATA[NEF]]></category>
		<category><![CDATA[Nikon]]></category>
		<category><![CDATA[rename]]></category>
		<category><![CDATA[Sony]]></category>

		<guid isPermaLink="false">http://pario.no/?p=467</guid>
		<description><![CDATA[This is a little script I&#8217;ve written to correct all my image files since the EXIF timestamp information is one hour out of sync. The filenames have been renamed to comply to the EXIF information and has to be renamed again because of the one hour scew. The filename can look something like this 20080102-1201_DSC_0910.JPG [...]]]></description>
			<content:encoded><![CDATA[<p>This is a little script I&#8217;ve written to correct all my image files since the EXIF timestamp information is one hour out of sync. The filenames have been renamed to comply to the EXIF information and has to be renamed again because of the one hour scew. The filename can look something like this 20080102-1201_DSC_0910.JPG where the name is built up like YYYYMMDD-HHMM_Original_Filename.JPG<br />
<strong>Remember to backup your imagefiles before you continue. You have been warned!</strong></p>
<h2>Rename files using wildcard pattern</h2>
<p>This is the files we are going to rename</p>
<pre>
20080102-1201_DSC_0910.JPG
20080105-1923_DSC_1006.JPG
20080111-1220_DSC00189.JPG
20080122-0929_DSC00190.JPG</pre>
<p>The <strong>mmv</strong> command is a command that lets you move/copy/append/link multiple files by wildcard patterns. It can be installed in Debian (or Debian based distributions like Ubuntu) by issuing the command</p>
<pre>
# aptitude install mmv</pre>
<p>Now rename the files back to their original name</p>
<pre>
# mmv "*_DSC*" "DSC#2"</pre>
<p>The result after this operation looks like this</p>
<pre>
DSC_0910.JPG
DSC_1006.JPG
DSC_1179.JPG
DSC_1302.JPG
DSC_1587.JPG</pre>
<h2>Correct the EXIF timestamp using exiv2</h2>
<p>Next adjust the EXIF information stored in the image files to fix the one hour difference. This can be done using different EXIF tools like <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/">exiftool</a>, but I will show you how it can be done using <a href="http://www.sentex.net/~mwandel/jhead/">jhead</a> and <a href="http://www.exiv2.org">exiv2</a>. The advantage with <strong>exiv2</strong> is that it can also handle Nikon NEF files while <strong>jhead</strong> only can prosess JPG. </p>
<p>The current timestamp can be determined as follows</p>
<pre>
# exiftool DSC_0910.JPG | grep "File Mo"</pre>
<p>The result in this case is</p>
<pre>
File Modification Date/Time : 2008:01:02 08:34:09</pre>
<h3>Adjust EXIF time info one hour forward using exiftool</h3>
<pre>
# exiftool -AllDates+=1 DSC_0910.JPG</pre>
<h3>Other tools that could have done the job</h3>
<h4>Adjust EXIF time info one hour forward using jhead</h4>
<pre>
# jhead -ta +1 DSC_0910.JPG</pre>
<p>Install the <strong>jhead</strong> package using aptitude as mentioned earlier for the mmv package</p>
<h4>Adjust EXIF time info one hour forward using exiv2</h4>
<pre>
# exiv2 ad -a 1 DSC_0910.JPG</pre>
<h2>Rename files back to YYYYMMDD-HHMM_Original_Filename.JPG</h2>
<p>It is now time to rename the files back to the YYYYMMDD-HHMM_Original_Filename.JPG format I used before this operation. This operation has been describe in a previous post named <a href="http://pario.no/2008/01/14/rename-image-files-according-to-exif-date/">Rename image files according to EXIF date</a></p>
<pre>
exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls D*)</pre>
<h2>The script</h2>
<pre>
#!/bin/bash -x
# Needed software:
# exiftool
# exiv2
# mmv

# Script tested on Nikon D80 and Sony Cybershot DSC-W12 files

# Make a printout of how the files look like now
ls -l > repair_name_and_exif_before.txt

# Rename files to remove date formatting back to original name
mmv "*_DSC*" "DSC#2"

# Change EXIF info on JPG files (order is important)
exiftool -overwrite_original -AllDates+=1 D*.JPG
# Preserve date/time of original file when writing
exiftool -overwrite_original '-DateTimeOriginal>FileModifyDate' D*.JPG

# Change EXIF info on NEF files (order is important)
exiftool -overwrite_original -AllDates+=1 '-DateTimeOriginal>FileModifyDate' D*.NEF
# Preserve date/time of original file when writing
exiftool -overwrite_original '-DateTimeOriginal>FileModifyDate' D*.NEF

# Rename files back to date formatting (YYYYMMDD-HHMM_Filename) based on the new EXIF info
exiv2 -r'%Y%m%d-%H%M_:basename:' rename $(ls D*)

# Make a printout of how the files look like after conversion
ls -l > repair_name_and_exif_after.txt
</pre>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/www.sno.phy.queensu.ca\/~phil\/exiftool\/","http:\/\/www.sentex.net\/~mwandel\/jhead\/","http:\/\/www.exiv2.org"];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDkvMDIvcmVuYW1lLWZpbGVzLWJ5LXdpbGRjYXJkLXBhdHRlcm4tYW5kLWNvcnJlY3QtdGhlLWV4aWYtdGltZXN0YW1wLW1ldGFkYXRhLzx3cHRiPlJlbmFtZSBmaWxlcyBieSB3aWxkY2FyZCBwYXR0ZXJuIGFuZCBjb3JyZWN0IHRoZSBFWElGIHRpbWVzdGFtcCBtZXRhZGF0YTx3cHRiPmh0dHA6Ly9wYXJpby5ubzx3cHRiPlBhcmlvIFRlY2hub0Jsb2I%3D";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/09/02/rename-files-by-wildcard-pattern-and-correct-the-exif-timestamp-metadata/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color channel swapping in Photoshop</title>
		<link>http://pario.no/2008/06/09/color-channel-swapping-in-photoshop/</link>
		<comments>http://pario.no/2008/06/09/color-channel-swapping-in-photoshop/#comments</comments>
		<pubDate>Mon, 09 Jun 2008 22:40:47 +0000</pubDate>
		<dc:creator>Hans-Henry Jakobsen</dc:creator>
				<category><![CDATA[Misc]]></category>
		<category><![CDATA[Photo etc]]></category>
		<category><![CDATA[D80]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[infrared]]></category>
		<category><![CDATA[IR]]></category>
		<category><![CDATA[Nikon]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://pario.no/?p=459</guid>
		<description><![CDATA[This is a little HOWTO (or tutorial) about swapping/inverting two color channels. I will swap the red and the blue color channel using Adobe Photoshop CS 3 to create a more &#8220;normal&#8221; looking picture with a blue sky on my infrared photo taken with my Nikon D80 and a Hoya R72 67mm IR-filter. I will [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><img class="alignleft size-thumbnail wp-image-463" title="20080608-1515_dsc_4992_resized_color_space_swapped_adjusted_resized_480" src="http://pario.no/wp-content/uploads/2008/06/20080608-1515_dsc_4992_resized_color_space_swapped_adjusted_resized_480-150x150.jpg" alt="" width="150" height="150" />This is a little HOWTO (or tutorial) about swapping/inverting two color channels. I will swap the red and the blue color channel using Adobe Photoshop CS 3 to create a more &#8220;normal&#8221; looking picture with a blue sky on my infrared photo taken with my Nikon D80 and a Hoya R72 67mm IR-filter. I will not describe how to take a IR photo and I will assume you have access to such a filter and know how to use it properly.</p>
<p style="text-align: left;">The result after this HOWTO should look something like this spring image taken some days ago. Not one of my best photos but it will do the job in this post.</p>
<ol style="text-align: left;">
<li>Open the IR photo file in Photoshop, presumeably a RAW file. In my case a Nikon NEF-file.</li>
<li>Open the file whith the White Balance set &#8220;As shot&#8221;.</li>
<li>
<p style="text-align: left;">The photo might look something like this</p>
<table border="0">
<tbody>
<tr>
<td><img class="size-full wp-image-462" title="20080608-1515_dsc_4992_resized_500_resized_480" src="http://pario.no/wp-content/uploads/2008/06/20080608-1515_dsc_4992_resized_500_resized_480.jpg" alt="" width="480" height="322" /></td>
</tr>
</tbody>
</table>
</li>
<li>Go to the menu and choose <strong>Image &#8211;&gt; Adjustments &#8211;&gt; Channel Mixer&#8230;</strong> Now you can change the Red Output Channel and set the value for Red to 0% and change the Blue value to 100%. On the Blue Output Channel you set the blue Source Channel to 0% and Red to 100%.<br />
<table border="0">
<tbody>
<tr>
<td><img class="alignnone size-full wp-image-464" title="photoshop_channel_mixer" src="http://pario.no/wp-content/uploads/2008/06/photoshop_channel_mixer.jpg" alt="" width="414" height="384" /></td>
</tr>
</tbody>
</table>
</li>
<li>Now we will let Photoshop adjust the levels and colors using the menu <strong>Image &#8211;&gt; Adjustments &#8211;&gt; Auto Levels</strong> followed by <strong>Image &#8211;&gt; Adjustments &#8211;&gt; Auto Color</strong>.</li>
<li>The result image should look something like this<br />
<table border="0">
<tbody>
<tr>
<td><img class="alignnone size-full wp-image-463" title="20080608-1515_dsc_4992_resized_color_space_swapped_adjusted_resized_480" src="http://pario.no/wp-content/uploads/2008/06/20080608-1515_dsc_4992_resized_color_space_swapped_adjusted_resized_480.jpg" alt="" width="480" height="322" /></td>
</tr>
</tbody>
</table>
</ol>
<p style="text-align: left;">Thats all that is needed to swap or invert two color channels in Photoshop CS3.</p>
<p style="text-align: left;">This HOWTO has not been tested on on earlier versions of Photoshop but I guess the features I&#8217;ve used aren&#8217;t new.</p>
<script type="text/javascript">var wordpress_toolbar_urls = [];var wordpress_toolbar_url = "http://pario.no/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "n";var wordpress_toolbar_hash = "aHR0cDovL3BhcmlvLm5vLzIwMDgvMDYvMDkvY29sb3ItY2hhbm5lbC1zd2FwcGluZy1pbi1waG90b3Nob3AvPHdwdGI%2BQ29sb3IgY2hhbm5lbCBzd2FwcGluZyBpbiBQaG90b3Nob3A8d3B0Yj5odHRwOi8vcGFyaW8ubm88d3B0Yj5QYXJpbyBUZWNobm9CbG9i";</script>]]></content:encoded>
			<wfw:commentRss>http://pario.no/2008/06/09/color-channel-swapping-in-photoshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

