<?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>Linux | LogikDevelopment</title>
	<atom:link href="https://www.logikdev.com/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.logikdev.com</link>
	<description>&#34;Il n&#039;y a pas de problème, il n&#039;y a que des solutions. L&#039;esprit de l&#039;homme invente ensuite le problème.&#34; André Gide</description>
	<lastBuildDate>Tue, 25 Apr 2017 13:57:14 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>
	<item>
		<title>Remove DOS carriage return</title>
		<link>https://www.logikdev.com/2012/09/26/remove-dos-carriage-return/</link>
					<comments>https://www.logikdev.com/2012/09/26/remove-dos-carriage-return/#comments</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Wed, 26 Sep 2012 22:36:53 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[carriage return]]></category>
		<category><![CDATA[DOS]]></category>
		<category><![CDATA[fileformat]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[Windows]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1884</guid>

					<description><![CDATA[<p>After writing a shell script on Windows and trying to execute it on Linux, I got the following error message: The problem is obviously because the return line character on Windows and Linux are different. But how to fix it in order to execute it on Linux? I firstly tried to open it, copy the [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2012/09/26/remove-dos-carriage-return/">Remove DOS carriage return</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>After writing a shell script on Windows and trying to execute it on Linux, I got the following error message:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
/bin/sh^M: bad interpreter: No such file or directory
</pre>
<p>The problem is obviously because the return line character on Windows and Linux are different. But how to fix it in order to execute it on Linux?<br />
I firstly tried to open it, copy the content of the file and paste it in a new file using only Linux command line, but it didn&#8217;t work. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f641.png" alt="🙁" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>However, I found the following thread which fixed the problem:<br />
<a href="http://www.reachdba.com/showthread.php?335-bin-sh-M-bad-interpreter-No-such-file-or-directory-apps11i-Instalation" target="_blank">http://www.reachdba.com/showthread.php?335-bin-sh-M-bad-interpreter-No-such-file-or-directory-apps11i-Instalation</a></p>
<p>Here is what you need to do:</p>
<ol>
<li>Open your file using <strong>vi</strong></li>
<li>Write the command <code>:set fileformat=unix</code></li>
<li>Save the file using <code>:wq</code></li>
</ol>
<p>The file should now run on Linux. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p><p>The post <a href="https://www.logikdev.com/2012/09/26/remove-dos-carriage-return/">Remove DOS carriage return</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2012/09/26/remove-dos-carriage-return/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>CP2102 on DNS-323</title>
		<link>https://www.logikdev.com/2012/08/09/cp2102-on-dns-323/</link>
					<comments>https://www.logikdev.com/2012/08/09/cp2102-on-dns-323/#comments</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Thu, 09 Aug 2012 16:36:57 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[CP2101]]></category>
		<category><![CDATA[CP2102]]></category>
		<category><![CDATA[D-Link]]></category>
		<category><![CDATA[dmesg]]></category>
		<category><![CDATA[DNS-313]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[Silicon Labs]]></category>
		<category><![CDATA[USB to RS232 converter]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1834</guid>

					<description><![CDATA[<p>In one of my personal projects, I needed to connect and use a USB to RS232 (Serial) converter on my D-Link DNS-323. Weird requirements, I know. Anyway&#8230; 😐 Plenty of these converters exist out there, but I choose to go for a CP2102: Innocently, I first tried to compile the code source of this module [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2012/08/09/cp2102-on-dns-323/">CP2102 on DNS-323</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>In one of my personal projects, I needed to connect and use a USB to RS232 (Serial) converter on my D-Link DNS-323. Weird requirements, I know. Anyway&#8230; 😐<br />
Plenty of these converters exist out there, but I choose to go for a <a href="http://www.silabs.com/Support%20Documents/TechnicalDocs/cp2102.pdf" target="_blank"><strong>CP2102</strong></a>:</p>
<p><img decoding="async" class="aligncenter size-medium wp-image-1844" title="CP2102" src="https://www.logikdev.com/wp-content/uploads/2012/08/CP2102-300x125.jpg" alt="" width="300" height="125" srcset="https://www.logikdev.com/wp-content/uploads/2012/08/CP2102-300x125.jpg 300w, https://www.logikdev.com/wp-content/uploads/2012/08/CP2102.jpg 458w" sizes="(max-width: 300px) 100vw, 300px" /></p>
<p>Innocently, I first tried to compile the code source of this module which can be found on the following page:<br />
<a href="http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx" target="_blank">http://www.silabs.com/products/mcu/Pages/USBtoUARTBridgeVCPDrivers.aspx</a></p>
<p>After a few painful and unsuccessful tries, I decided to look around for the already-compiled module. 😉<br />
While wondering why I didn&#8217;t think of that before, I used the instructions below to install the required modules on my NAS:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
cd /mnt/HD_a2/ffp/lib/
mkdir modules
mkdir modules/2.6.12.6-arm1
cd modules/2.6.12.6-arm1
wget http://dev.skcserver.de/dns323/modules_v1.03/kernel/drivers/usb/serial/usbserial.ko
wget http://dev.skcserver.de/dns323/modules_v1.03/kernel/drivers/usb/serial/cp2101.ko
chmod 755 usbserial.ko
chmod 755 cp2101.ko
</pre>
<p>Once the modules are installed, the next step is to initialize them.<br />
I wrote the following script for this purpose so you can execute it anytime you need it:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh

insmod /ffp/lib/modules/2.6.12.6-arm1/usbserial.ko
insmod /ffp/lib/modules/2.6.12.6-arm1/cp2101.ko
mknod /dev/ttyUSB0 c 188 0
chmod 0666 /dev/ttyUSB0
</pre>
<p>At this point in time, you should have your module initialized on your D-Link DNS-323.<br />
You can check the kernel ring buffer using the <strong>dmesg</strong> command to verify it loaded properly.<br />
This is a snapshot of what I have in my kernel ring buffer after I ran the script above:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
usbcore: registered new driver usbserial
drivers/usb/serial/usb-serial.c: USB Serial support registered for Generic
usbcore: registered new driver usbserial_generic
drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
drivers/usb/serial/usb-serial.c: USB Serial support registered for CP2101
CP2101 1-1:1.0: CP2101 converter detected
usb 1-1: reset full speed USB device using ehci_platform and address 5
usb 1-1: CP2101 converter now attached to ttyUSB0
usbcore: registered new driver CP2101
drivers/usb/serial/cp2101.c: Silicon Labs CP2101/CP2102 RS232 serial adaptor driver v0.04
</pre>
<p>Finally, you can test the communication with your USB to RS232 converter by connecting a LED between the RXD and 3V outputs and running the following script:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh

while &#x5B; true ]
do
echo &quot;hello world!!!&quot; &gt; /dev/ttyUSB0
echo &quot;sent&quot;
sleep 1
done
</pre>
<p>If you see the LED blinking, it means you succeed! 😀</p><p>The post <a href="https://www.logikdev.com/2012/08/09/cp2102-on-dns-323/">CP2102 on DNS-323</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2012/08/09/cp2102-on-dns-323/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>Ubuntu on Mac Mini PowerPC</title>
		<link>https://www.logikdev.com/2012/06/08/ubuntu-on-mac-mini-powerpc/</link>
					<comments>https://www.logikdev.com/2012/06/08/ubuntu-on-mac-mini-powerpc/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Fri, 08 Jun 2012 15:35:43 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mac Mini PowerPC]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[netboot]]></category>
		<category><![CDATA[Open Firmware]]></category>
		<category><![CDATA[PPC]]></category>
		<category><![CDATA[tftp]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1814</guid>

					<description><![CDATA[<p>The other day, I got an old Mac Mini PowerPC from 2005. And I decided to install Linux on it instead of using an old version of Mac OSX. Fun, ins&#8217;t it? The first thing I did was to download the ISO image of the last version of Ubuntu and burn it on CD. But [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2012/06/08/ubuntu-on-mac-mini-powerpc/">Ubuntu on Mac Mini PowerPC</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>The other day, I got an old Mac Mini PowerPC from 2005. And I decided to install Linux on it instead of using an old version of Mac OSX. Fun, ins&#8217;t it?</p>
<p>The first thing I did was to download the ISO image of the last version of Ubuntu and burn it on CD. But unfortunately, I discovered that the CD player wasn&#8217;t working anymore. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f610.png" alt="😐" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
I then tried to put Ubuntu on a USB key and boot on it. But it didn&#8217;t work either&#8230; This machine didn&#8217;t seem to be able to boot from a USB stick.</p>
<p>So how am I going to install Linux without a CD player and USB?<br />
FireWire? Maybe, but I don&#8217;t have anything on FireWire.<br />
The answer is <a href="http://en.wikipedia.org/wiki/NetBoot" target="_blank"><strong>netboot</strong></a>! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f600.png" alt="😀" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Indeed, my last chance was to install it via netboot.</p>
<p>Here are the steps I followed:</p>
<ol>
<li>Install <a href="http://fr.wikipedia.org/wiki/Trivial_File_Transfer_Protocol" target="_blank"><strong>tftp</strong></a> on another Linux machine in your local network</li>
<li>Configure tftp. Please find below the configuration file I used:
<pre class="brush: bash; title: ; notranslate">
#
# ftp://ftp.kernel.org/pub/software/network/tftp/
#
service tftp
{
       flags            = REUSE
       socket_type      = dgram
       protocol         = udp
       instances        = 30
       wait             = yes
       user             = root
       server           = /opt/sbin/in.tftpd
       server_args      = -s /mnt/tftpboot
       cps              = 100 2
       log_on_success   = HOST PID
       log_on_failure   = HOST
       disable          = no
}
</pre>
</li>
<li>Put the Ubuntu files in the folder <code>/mnt/tftpboot</code> (in my case). I copied the files of the last version of Ubuntu &#8220;Quantal&#8221;: <a href="http://ports.ubuntu.com/ubuntu-ports/dists/quantal/main/installer-powerpc/current/images/powerpc/netboot/" target="_blank">http://ports.ubuntu.com/ubuntu-ports/dists/quantal/main/installer-powerpc/current/images/powerpc/netboot/</a></li>
<li>Reboot the Mac Mini and enter the Open Firmware by holding &#8220;Option&#8221;+&#8221;Command&#8221;+&#8221;o&#8221;+&#8221;f&#8221;</li>
<li>Type the following command to start the install:
<pre class="brush: bash; light: true; title: ; notranslate">
boot enet:192.168.2.100,yaboot
</pre>
<p>With 192.168.2.100 the IP address of the machine where tftp is installed.</li>
<li>Follow the Ubuntu installation steps and enjoy! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></li>
</ol><p>The post <a href="https://www.logikdev.com/2012/06/08/ubuntu-on-mac-mini-powerpc/">Ubuntu on Mac Mini PowerPC</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2012/06/08/ubuntu-on-mac-mini-powerpc/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Redirect traffic to a specific network</title>
		<link>https://www.logikdev.com/2012/05/06/redirect-traffic-to-a-specific-network/</link>
					<comments>https://www.logikdev.com/2012/05/06/redirect-traffic-to-a-specific-network/#comments</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Sun, 06 May 2012 12:29:22 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Tricks]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[network]]></category>
		<category><![CDATA[route]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1707</guid>

					<description><![CDATA[<p>This is a little trick which can be useful in some very specific case. For example, you could have a machine with two network cards. One of the network is behind a proxy and the other one is connected directly to the internet. You might want to forward all the traffic for google.com to the [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2012/05/06/redirect-traffic-to-a-specific-network/">Redirect traffic to a specific network</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is a little trick which can be useful in some very specific case.</p>
<p>For example, you could have a machine with two network cards. One of the network is behind a proxy and the other one is connected directly to the internet.<br />
You might want to forward all the traffic for google.com to the network which doesn&#8217;t have a proxy.</p>
<p>To do this, I am using the command <a href="http://linux.die.net/man/8/route" target="_blank"><strong>route</strong></a>:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
route add &lt;hostname&gt; &lt;target network&gt;
</pre>
<p>For example:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
route add google.com 192.168.101.1
</pre>
<p>Note that this command is available on both Linux and Mac.</p><p>The post <a href="https://www.logikdev.com/2012/05/06/redirect-traffic-to-a-specific-network/">Redirect traffic to a specific network</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2012/05/06/redirect-traffic-to-a-specific-network/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Install s3fs on Amazon Clouds</title>
		<link>https://www.logikdev.com/2012/04/03/install-s3fs-on-amazon-clouds/</link>
					<comments>https://www.logikdev.com/2012/04/03/install-s3fs-on-amazon-clouds/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Tue, 03 Apr 2012 21:38:02 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[FUSE filesystem]]></category>
		<category><![CDATA[hard links]]></category>
		<category><![CDATA[libfuse]]></category>
		<category><![CDATA[libxml]]></category>
		<category><![CDATA[mount]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[s3fs]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1710</guid>

					<description><![CDATA[<p>s3fs is a FUSE filesystem that allows you to mount an Amazon S3 bucket as a local filesystem. It stores files natively and transparently in S3 (i.e., you can use other programs to access the same files). The following instructions detail the steps to install the program s3fs on an Amazon&#160;EC2 running Debian&#160;5.0.5. Install libfuse [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2012/04/03/install-s3fs-on-amazon-clouds/">Install s3fs on Amazon Clouds</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<blockquote><p>
s3fs is a FUSE filesystem that allows you to mount an Amazon S3 bucket as a local filesystem. It stores files natively and transparently in S3 (i.e., you can use other programs to access the same files).
</p></blockquote>
<p>The following instructions detail the steps to install the program <a href="http://code.google.com/p/s3fs/" target="_blank"><strong>s3fs</strong></a> on an Amazon&nbsp;EC2 running Debian&nbsp;5.0.5.</p>
<ol>
<li><strong>Install libfuse</strong><br />
First, you need to install the package libfuse manually as the one provided via apt-get is too old (s3fs needs a version greater than or equal to 2.8.4).</p>
<pre class="brush: bash; light: true; title: ; notranslate">
wget http://downloads.sourceforge.net/project/fuse/fuse-2.X/2.8.7/fuse-2.8.7.tar.gz
tar xzf fuse-2.8.7.tar.gz
cd fuse-2.8.7
./configure --prefix=/usr
make install
</pre>
</li>
<li><strong>Install libxml</strong><br />
You can simply install the package provided by apt-get:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
apt-get install libxml2-dev
</pre>
</li>
<li><strong>Upgrade mount</strong><br />
Because of a problem between fuse and mount, you need to upgrade the version of mount:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
wget http://www.kernel.org/pub/linux/utils/util-linux/v2.21/util-linux-2.21-rc1.tar.gz
tar xzf util-linux-2.21-rc1.tar.gz
./configure --prefix=/usr --without-ncurses
make install
</pre>
<p>For more information about this issue, please go to the following page: <a href="http://code.google.com/p/s3fs/issues/detail?id=228" target="_blank" title="Issue 228:	/bin/mount: unrecognized option '--no-canonicalize'">http://code.google.com/p/s3fs/issues/detail?id=228</a>
</li>
<li><strong>Install s3fs</strong><br />
You can now install s3fs using the following commands:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
wget http://s3fs.googlecode.com/files/s3fs-1.61.tar.gz
tar xvzf s3fs-1.61.tar.gz
cd s3fs-1.61/
./configure --prefix=/usr
make install
</pre>
</li>
</ol>
<p>Note that I wanted to use s3fs to create incremental snapshot-style backups with rsync. Unfortunately, as mentioned on the following page, it didn&#8217;t work because s3fs doesn&#8217;t support <a href="http://en.wikipedia.org/wiki/Hard_link" target="_blank">hard links</a>: <a href="http://code.google.com/p/s3fs/issues/detail?id=46" target="_blank" title="Issue 46:	Does s3fs support hard links?">http://code.google.com/p/s3fs/issues/detail?id=46</a></p><p>The post <a href="https://www.logikdev.com/2012/04/03/install-s3fs-on-amazon-clouds/">Install s3fs on Amazon Clouds</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2012/04/03/install-s3fs-on-amazon-clouds/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Samba access problem with Mac OS X 10.6+</title>
		<link>https://www.logikdev.com/2011/12/13/samba-access-problem-with-mac-os-x-10-6/</link>
					<comments>https://www.logikdev.com/2011/12/13/samba-access-problem-with-mac-os-x-10-6/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Tue, 13 Dec 2011 21:31:15 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[D-Link]]></category>
		<category><![CDATA[DNS-313]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Samba]]></category>
		<category><![CDATA[security mode]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1653</guid>

					<description><![CDATA[<p>This is a problem I encountered when I upgraded Mac OS X from the version 10.5 (Leopard) to 10.6 (Snow Leopard). One of my friend also got a similar problem when she upgraded to the version 10.7 (Lion). This issue was affecting the access to the network shares set up with Samba (version 3.0.24) on [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2011/12/13/samba-access-problem-with-mac-os-x-10-6/">Samba access problem with Mac OS X 10.6+</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is a problem I encountered when I upgraded Mac OS X from the version 10.5 (Leopard) to 10.6 (Snow Leopard). One of my friend also got a similar problem when she upgraded to the version 10.7 (Lion).<br />
This issue was affecting the access to the network shares set up with <strong>Samba</strong> (version 3.0.24) on my D-Link DNS-323. For some reason, I wasn&#8217;t able to authenticate on the shares as soon as I upgraded to Snow Leopard!</p>
<p>Here is the error message I was getting:<br />
<a href="https://www.logikdev.com/wp-content/uploads/2011/12/samba-access-problem.png"><img fetchpriority="high" decoding="async" src="https://www.logikdev.com/wp-content/uploads/2011/12/samba-access-problem-300x271.png" alt="" title="Samba authentication problem on Mac OS X" width="300" height="271" class="alignnone size-medium wp-image-1669" srcset="https://www.logikdev.com/wp-content/uploads/2011/12/samba-access-problem-300x271.png 300w, https://www.logikdev.com/wp-content/uploads/2011/12/samba-access-problem.png 438w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<p>After browsing a few forums on the web, I finally found a solution. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
I simply had to change the security mode in the Samba configuration file (<code>smb.conf</code>) to read:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
security = USER
</pre>
<p>Note that this property can be found under the <code>[global]</code> section.</p>
<p>For more information about the Samba security mode, please read the following article by Jack Wallen:<br />
<a href="http://www.ghacks.net/2010/03/17/understanding-samba-security-modes/" title="Understanding Samba security modes" target="_blank">Understanding Samba security modes</a></p><p>The post <a href="https://www.logikdev.com/2011/12/13/samba-access-problem-with-mac-os-x-10-6/">Samba access problem with Mac OS X 10.6+</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2011/12/13/samba-access-problem-with-mac-os-x-10-6/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>S3 command failed if the time is not synced</title>
		<link>https://www.logikdev.com/2011/12/06/s3-command-failed-if-time-not-synced/</link>
					<comments>https://www.logikdev.com/2011/12/06/s3-command-failed-if-time-not-synced/#comments</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Tue, 06 Dec 2011 23:11:43 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[ntpdate]]></category>
		<category><![CDATA[s3sync]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[system date]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1610</guid>

					<description><![CDATA[<p>This is already the second post about the s3sync ruby program. The first article was focused on monitoring s3sync with Zabbix. I will talk on this one about an error I got when running the S3 synchronisation: S3 command failed: list_bucket prefix /data max-keys 200 delimiter / With result 403 Forbidden S3 ERROR: # s3sync.rb:290:in [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2011/12/06/s3-command-failed-if-time-not-synced/">S3 command failed if the time is not synced</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>This is already the second post about the <a href="https://forums.aws.amazon.com/thread.jspa?threadID=11975&amp;start=0&amp;tstart=0" target="_blank"><strong>s3sync</strong></a> ruby program. The first article was focused on <a title="Monitor s3sync with Zabbix" href="https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/">monitoring s3sync with Zabbix</a>.</p>
<p>I will talk on this one about an error I got when running the S3 synchronisation:</p>
<pre>
S3 command failed:
list_bucket prefix /data max-keys 200 delimiter /
With result 403 Forbidden
S3 ERROR: #
s3sync.rb:290:in `+': can't convert nil into Array (TypeError)
	from s3sync.rb:290:in `s3TreeRecurse'
	from s3sync.rb:346:in `main'
	from ./thread_generator.rb:79:in `call'
	from ./thread_generator.rb:79:in `initialize'
	from ./thread_generator.rb:76:in `new'
	from ./thread_generator.rb:76:in `initialize'
	from s3sync.rb:267:in `new'
	from s3sync.rb:267:in `main'
	from s3sync.rb:735
</pre>
<p>As you can see, this error is not very human-friendly! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62e.png" alt="😮" class="wp-smiley" style="height: 1em; max-height: 1em;" /> The only thing we know is that the S3 command failed because of the error <code>can't convert nil into Array</code>. It looks to me like an internal error within s3sync&#8230;</p>
<p>But after some investigation, it appears it is simply because the system date on the server is not correct. I cannot tell you how much time I spent on this one!  <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62f.png" alt="😯" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Anyway, if you are doing automatic backups as describe on <a href="http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/" target="_blank">John Eberly&#8217;s blog</a>, you need to add the following code at the top of your <code>upload.sh</code> script:</p>
<pre class="brush: bash; title: ; notranslate">
# update the system date
/usr/sbin/ntpdate 3.uk.pool.ntp.org 2.uk.pool.ntp.org 1.uk.pool.ntp.org 0.uk.pool.ntp.org
</pre>
<p><strong>NB:</strong> please find below the command lines I use to install <a href="http://www.eecis.udel.edu/~mills/ntp/html/ntpdate.html" target="_blank"><strong>ntpdate</strong></a> on a Debian server:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
apt-get install ntpdate
dpkg-reconfigure tzdata
</pre><p>The post <a href="https://www.logikdev.com/2011/12/06/s3-command-failed-if-time-not-synced/">S3 command failed if the time is not synced</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2011/12/06/s3-command-failed-if-time-not-synced/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Monitor s3sync with Zabbix</title>
		<link>https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/</link>
					<comments>https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Thu, 24 Nov 2011 22:28:53 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amazon S3]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[Monitoring]]></category>
		<category><![CDATA[s3sync]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[synchronisation]]></category>
		<category><![CDATA[Zabbix]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1566</guid>

					<description><![CDATA[<p>s3sync is a ruby program that easily transfers directories between a local directory and an S3 bucket:prefix. It behaves somewhat, but not precisely, like the rsync program. I am using this tool to automatically backup the important data from Debian servers to Amazon S3. I am not going to explain here how to install s3sync [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/">Monitor s3sync with Zabbix</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><a href="https://forums.aws.amazon.com/thread.jspa?threadID=11975&#038;start=0&#038;tstart=0" target="_blank"><strong>s3sync</strong></a> is a ruby program that easily transfers directories between a local directory and an S3 bucket:prefix. It behaves somewhat, but not precisely, like the <strong>rsync</strong> program.</p>
<p>I am using this tool to automatically backup the important data from Debian servers to Amazon S3. I am not going to explain here how to install s3sync as it is not the purpose of this article. However, you can read this very useful article from John Eberly&#8217;s blog: <a href="http://blog.eberly.org/2006/10/09/how-automate-your-backup-to-amazon-s3-using-s3sync/" target="_blank">How I automated my backups to Amazon S3 using s3sync</a>.</p>
<p>If you followed the steps from John Eberly&#8217;s post, you should have an <code>upload.sh</code> script and a crontab job which executes this script periodically.</p>
<p>From this point, here is what you need to do to monitor the success of the synchronisation with <a href="http://www.zabbix.com/" target="_blank"><strong>Zabbix</strong></a>:</p>
<ol>
<li>Add the following code at the end of your <code>upload.sh</code> script:
<pre class="brush: bash; title: ; notranslate">
# print the exit code
RETVAL=$?
&#x5B; $RETVAL -eq 0 ] &amp;&amp; echo &quot;Synchronization succeed&quot;
&#x5B; $RETVAL -ne 0 ] &amp;&amp; echo &quot;Synchronization failed&quot;
</pre>
</li>
<li>Log the output of the cron script as follow:
<pre class="brush: bash; light: true; title: ; notranslate">
30 2 * * sun /path/to/upload.sh &gt; /var/log/s3sync.log 2&gt;&amp;1
</pre>
</li>
<li>On Zabbix, create a new item which will check the existence of the sentence &#8220;Synchronization failed&#8221; in the file <code>/var/log/s3sync.log</code>:<br />
<a href="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item.png"><img decoding="async" src="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item-297x300.png" alt="" title="Create a new item on Zabbix to monitor s3sync" width="297" height="300" class="aligncenter size-medium wp-image-1569" srcset="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item-297x300.png 297w, https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_item.png 641w" sizes="(max-width: 297px) 100vw, 297px" /></a><br />
Item key: <code>vfs.file.regmatch[/var/log/s3sync.log,Synchronization failed]</code><br />

</li>
<li>Still on Zabbix, define a new trigger for the previously created item:<br />
<a href="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger.png"><img loading="lazy" decoding="async" src="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger-300x160.png" alt="" title="Define a new trigger on Zabbix to monitor s3sync" width="300" height="160" class="aligncenter size-medium wp-image-1570" srcset="https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger-300x160.png 300w, https://www.logikdev.com/wp-content/uploads/2011/11/zabbix_s3sync_trigger.png 665w" sizes="auto, (max-width: 300px) 100vw, 300px" /></a><br />
Trigger expression: <code>{Template_AmazonCloud_Debian:vfs.file.regmatch[/var/log/s3sync.log,Synchronization failed].last(0)}=1</code>
</li>
</ol>
<p>With these few steps, you should now receive Zabbix alerts when a backup on S3 fails. 🙂</p><p>The post <a href="https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/">Monitor s3sync with Zabbix</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2011/11/24/monitor-s3sync-with-zabbix/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Refresh GeoIP automatically</title>
		<link>https://www.logikdev.com/2011/11/07/refresh-geoip-automatically/</link>
					<comments>https://www.logikdev.com/2011/11/07/refresh-geoip-automatically/#comments</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Mon, 07 Nov 2011 22:55:09 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[GeoIP]]></category>
		<category><![CDATA[IP address]]></category>
		<category><![CDATA[MaxMind]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1440</guid>

					<description><![CDATA[<p>GeoIP is a very useful tool provided by MaxMind. It can determine which country, region, city, postal code, and area code the visitor is coming from in real-time. For more information, visit MaxMind website. This tool is also coming with an Apache module allowing to redirect users depending on their location. For example, we could [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2011/11/07/refresh-geoip-automatically/">Refresh GeoIP automatically</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p><strong>GeoIP</strong> is a very useful tool provided by MaxMind. It can determine which country, region, city, postal code, and area code the visitor is coming from in real-time. For more information, visit <a href="http://www.maxmind.com/app/ip-locate" target="_blank">MaxMind website</a>.</p>
<p>This tool is also coming with an Apache module allowing to redirect users depending on their location. For example, we could redirect all users from France to the French home page of a multi-language website, or we could block the traffic to users from a specific country.</p>
<p>To install this module on a Debian server, you simply need to run the following command:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
apt-get install libapache2-mod-geoip
</pre>
<p>But, how does this module work? How does it know where the user comes from?  <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62f.png" alt="😯" class="wp-smiley" style="height: 1em; max-height: 1em;" /><br />
It is actually quite simple: GeoIP is using a mapping file of IP address by country. On Debian, this file is stored in the folder <code>/usr/share/GeoIP</code> and is named <code>GeoIP.dat</code>.</p>
<p>However, the IP addresses are something which change all the time. So this file will get out-of-date very quickly. This is why MaxMind provides an updated file at the beginning of each month for free. To read the installation instructions, please click the following link: <a href="http://www.maxmind.com/app/installation" target="_blank">http://www.maxmind.com/app/installation</a></p>
<p>This is good and well, but who will remember or even have the time to update this file every month? And imagine if you have to do this on hundreds of servers?<br />
The solution is to use a shell script which will download, extract and install the updated GeoIP file automatically once a month:</p>
<pre class="brush: bash; title: ; notranslate">
#!/bin/sh

# Go in the GeoIP folder
cd /usr/share/GeoIP

# Remove the previous GeoIP file (if present)
rm GeoIP.dat.gz

# Download the new GeoIP file
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz

# Remove the previous GeoIP backup file
rm GeoIP.dat.bak

# Backup the existing GeoIP file
mv GeoIP.dat GeoIP.dat.bak

# Extract the new GeoIP file
gunzip GeoIP.dat.gz

# Change the permission of the GeoIP file
chmod 644 GeoIP.dat

# Reload Apache
service apache2 reload
</pre>
<p>You can place this file in your root folder and set up the following crontab job:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
0 0 3 * * /root/update_geoip.sh
</pre>
<p>This will execute the script automatically on the third day of every month.</p><p>The post <a href="https://www.logikdev.com/2011/11/07/refresh-geoip-automatically/">Refresh GeoIP automatically</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2011/11/07/refresh-geoip-automatically/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>Differences between Amazon instances</title>
		<link>https://www.logikdev.com/2011/07/17/differences-between-amazon-instances/</link>
					<comments>https://www.logikdev.com/2011/07/17/differences-between-amazon-instances/#respond</comments>
		
		<dc:creator><![CDATA[smoreau]]></dc:creator>
		<pubDate>Sun, 17 Jul 2011 21:36:50 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Amazon Cloud]]></category>
		<category><![CDATA[CPU capacity]]></category>
		<category><![CDATA[cpuinfo]]></category>
		<category><![CDATA[EC2 Compute Units]]></category>
		<guid isPermaLink="false">https://www.logikdev.com/?p=1374</guid>

					<description><![CDATA[<p>It has now been more than a year I am using Amazon Cloud for websites hosting. I have to admit that it works pretty well and I am quite happy about their services. However, I got a strange problem a few days ago. I was deploying an application on two different large instances of Amazon [&#8230;]</p>
<p>The post <a href="https://www.logikdev.com/2011/07/17/differences-between-amazon-instances/">Differences between Amazon instances</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>It has now been more than a year I am using Amazon Cloud for websites hosting. I have to admit that it works pretty well and I am quite happy about their services.<br />
However, I got a strange problem a few days ago.</p>
<p>I was deploying an application on two different large instances of Amazon Cloud, one would be the UAT (User Acceptance Testing) server and the other one would be the Production server.<br />
Strangely enough, the version running on the Production server was running <strong>slower</strong> than on the UAT server! <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f62f.png" alt="😯" class="wp-smiley" style="height: 1em; max-height: 1em;" /> Why?</p>
<p>At first, I thought I missed something with the server configurations. But no, everything was absolutely identical! So where does this difference of speed come from?</p>
<p>After some more investigation, I had the brilliant idea to execute the following command:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
cat /proc/cpuinfo
</pre>
<p>On the Production server, this command was returning the following:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 15
model		: 65
model name	: Dual-Core AMD Opteron(tm) Processor 2218 HE
stepping	: 3
cpu MHz		: 2599.998
cache size	: 1024 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips	: 5202.40
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 15
model		: 65
model name	: Dual-Core AMD Opteron(tm) Processor 2218 HE
stepping	: 3
cpu MHz		: 2599.998
cache size	: 1024 KB
physical id	: 1
siblings	: 1
core id		: 0
cpu cores	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 1
wp		: yes
flags		: fpu tsc msr pae mce cx8 apic mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt rdtscp lm 3dnowext 3dnow up pni cx16 lahf_lm cmp_legacy svm extapic cr8_legacy
bogomips	: 5202.40
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts fid vid ttp tm stc
</pre>
<p>And on the UAT server, it was returning the following:</p>
<pre class="brush: bash; light: true; title: ; notranslate">
processor	: 0
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping	: 10
cpu MHz		: 2666.762
cache size	: 6144 KB
physical id	: 0
siblings	: 1
core id		: 0
cpu cores	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc pni ssse3 cx16 lahf_lm
bogomips	: 5337.55
clflush size	: 64
cache_alignment	: 64
address sizes	: 38 bits physical, 48 bits virtual
power management:

processor	: 1
vendor_id	: GenuineIntel
cpu family	: 6
model		: 23
model name	: Intel(R) Xeon(R) CPU           E5430  @ 2.66GHz
stepping	: 10
cpu MHz		: 2666.762
cache size	: 6144 KB
physical id	: 1
siblings	: 1
core id		: 0
cpu cores	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 13
wp		: yes
flags		: fpu de tsc msr pae cx8 apic sep cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall nx lm constant_tsc up pni ssse3 cx16 lahf_lm
bogomips	: 5337.55
clflush size	: 64
cache_alignment	: 64
address sizes	: 38 bits physical, 48 bits virtual
power management:
</pre>
<p>As you can see, these two servers actually don&#8217;t have the same CPU model name. But the biggest difference is probably the CPU MHz (2666.762 on UAT and 2599.998 on Production) and the cache size (6MB on UAT and only 1MB on Production).</p>
<p>So what does that mean? Two large instances of Amazon Cloud actually don&#8217;t have the same power?</p>
<p>The answer of this question is actually on the Amazon instance types description (<a href="http://aws.amazon.com/ec2/instance-types/" target="_blank">http://aws.amazon.com/ec2/instance-types/</a>) under the &#8216;Measuring Compute Resources&#8217; chapter:</p>
<blockquote><p>Amazon EC2 uses a variety of measures to provide each instance with a consistent and predictable amount of CPU capacity. In order to make it easy for developers to compare CPU capacity between different instance types, we have defined an Amazon EC2 Compute Unit. The amount of CPU that is allocated to a particular instance is expressed in terms of these EC2 Compute Units. We use several benchmarks and tests to manage the consistency and predictability of the performance of an EC2 Compute Unit. One EC2 Compute Unit provides the equivalent CPU capacity of a 1.0-1.2 GHz 2007 Opteron or 2007 Xeon processor.</p></blockquote>
<p>In conclusion, two identical instance types of Amazon Cloud have the same number of EC2 Compute Units but because a EC2 Compute Unit is equivalent to a CPU capacity between 1.0Ghz and 1.2Ghz, the actual speed of the instance will be slightly different!<br />
<em>Mystery solved.</em> <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p><p>The post <a href="https://www.logikdev.com/2011/07/17/differences-between-amazon-instances/">Differences between Amazon instances</a> first appeared on <a href="https://www.logikdev.com">LogikDevelopment</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://www.logikdev.com/2011/07/17/differences-between-amazon-instances/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
