<?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>MrBrown blob</title>
	<atom:link href="https://charles.lescampeurs.org/feed" rel="self" type="application/rss+xml" />
	<link>https://charles.lescampeurs.org</link>
	<description>random bits.</description>
	<lastBuildDate>Tue, 25 Jul 2017 09:10:06 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.9</generator>
	<item>
		<title>AWS Cookbook</title>
		<link>https://charles.lescampeurs.org/2017/07/25/aws-cookbook</link>
		<comments>https://charles.lescampeurs.org/2017/07/25/aws-cookbook#comments</comments>
		<pubDate>Tue, 25 Jul 2017 09:07:43 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Adminsys]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1635</guid>
		<description><![CDATA[<p>How to secure an Amazon S3 bucket 2017-07-18</p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2017/07/25/aws-cookbook">AWS Cookbook</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<ul>
<li><a href="https://read.acloud.guru/how-to-secure-an-s3-bucket-7e2dbd34e81b">How to secure an Amazon S3 bucket</a> <em>2017-07-18</em></li>
</ul>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1635" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2017/07/25/aws-cookbook">AWS Cookbook</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2017/07/25/aws-cookbook/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nginx: unknown directive &#8220;rewrite_by_lua&#8221;</title>
		<link>https://charles.lescampeurs.org/2016/11/23/nginx-unknown-directive-rewrite_by_lua</link>
		<comments>https://charles.lescampeurs.org/2016/11/23/nginx-unknown-directive-rewrite_by_lua#respond</comments>
		<pubDate>Wed, 23 Nov 2016 16:30:52 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Nginx]]></category>
		<category><![CDATA[lua]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1565</guid>
		<description><![CDATA[<p>&#8220;unknown directive rewrite_by_lua&#8221; : How to fix this error? When you work with Nginx, a powerful feature is to take advantage of Lua scripting language directly in your configuration files. You can come across solutions that involve Lua scripting. If your setup doesn&#8217;t include Lua module, you&#8217;ll get an error message like this in nginx <a class="read-more" href="https://charles.lescampeurs.org/2016/11/23/nginx-unknown-directive-rewrite_by_lua">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2016/11/23/nginx-unknown-directive-rewrite_by_lua">Nginx: unknown directive &#8220;rewrite_by_lua&#8221;</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>&#8220;unknown directive rewrite_by_lua&#8221; : How to fix this error?</p>
<p>When you work with <a href="https://www.nginx.com/">Nginx</a>, a powerful feature is to take advantage of <a href="https://www.lua.org/about.html">Lua scripting language</a> directly in your configuration files.</p>
<p>You can come across solutions that involve Lua scripting. If your setup doesn&#8217;t include Lua module, you&#8217;ll get an error message like this in nginx error.log :</p>
<pre>2016/11/23 09:51:58 [emerg] 12730#0: unknown directive "rewrite_by_lua" in /etc/nginx/sites-enabled/v3.conf:59</pre>
<p>Lua is available with nginx through <em>ngx_http_lua_module. </em>This module is installed with <strong>nginx-extras package</strong> (nginx web/proxy server (extended version))</p>
<p>$ apt-get install nginx-extras</p>
<p>Remember that this package contains a full working version of nginx server, it will remove packages like <em>nginx-full</em> or <em>nginx-light</em>.</p>
<p>Also you can find source code and documentation on github : <a href="https://github.com/openresty/lua-nginx-module"><em>ngx_http_lua_module</em> &#8211; Embed the power of Lua into Nginx HTTP Servers</a>.</p>
<p>&nbsp;</p>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1565" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2016/11/23/nginx-unknown-directive-rewrite_by_lua">Nginx: unknown directive &#8220;rewrite_by_lua&#8221;</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2016/11/23/nginx-unknown-directive-rewrite_by_lua/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nginx: mass permanent redirects</title>
		<link>https://charles.lescampeurs.org/2016/06/07/nginx-mass-permanent-redirects</link>
		<comments>https://charles.lescampeurs.org/2016/06/07/nginx-mass-permanent-redirects#respond</comments>
		<pubDate>Tue, 07 Jun 2016 15:47:39 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[Nginx]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1543</guid>
		<description><![CDATA[<p>When I say &#8220;mass&#8221;, I mean reasonable amount of redirects, like a couple of thousands. I had to migrate a blog to a new URL structure. This migration led to create about 600+ unique redirects without any shared patterns. To solve this, I used a nginx configuration file containing all the redirects and I included <a class="read-more" href="https://charles.lescampeurs.org/2016/06/07/nginx-mass-permanent-redirects">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2016/06/07/nginx-mass-permanent-redirects">Nginx: mass permanent redirects</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>When I say &#8220;mass&#8221;, I mean reasonable amount of redirects, like a couple of thousands.</p>
<p>I had to migrate a blog to a new URL structure. This migration led to create about 600+ unique redirects without any shared patterns.<br />
To solve this, I used a nginx configuration file containing all the redirects and I included it in my vhost configuration like this :</p>
<ul>
<li><strong>/etc/nginx/site-enabled/v3.conf</strong></li>
</ul>
<pre>server {
    listen 443 ssl;
    [...]
    include /etc/nginx/conf.d/v3.redirects
    [...]
    location / {
    [...]
    }
}</pre>
<p>&nbsp;</p>
<ul>
<li><strong>/etc/nginx/conf.d/v3.redirects</strong></li>
</ul>
<pre>[...]
rewrite ^/le-stress(.*) /conseils/relaxation/le-stress$1 permanent;
[...]</pre>
<p>The <strong>v3.redirects</strong> file has been generated with a command line script.</p>
<p>It works like a charm for this amount of redirects. If you need to manage a lot more of them, take a look at <a href="http://www.agileweboperations.com/supporting-millions-of-pretty-url-rewrites-in-nginx-with-lua-and-redis">lua and redis</a>.</p>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1543" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2016/06/07/nginx-mass-permanent-redirects">Nginx: mass permanent redirects</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2016/06/07/nginx-mass-permanent-redirects/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android: center text horizontally and vertically in a TextView</title>
		<link>https://charles.lescampeurs.org/2016/06/01/android-center-text-horizontally-and-vertically-in-a-textview</link>
		<comments>https://charles.lescampeurs.org/2016/06/01/android-center-text-horizontally-and-vertically-in-a-textview#respond</comments>
		<pubDate>Wed, 01 Jun 2016 12:00:33 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1538</guid>
		<description><![CDATA[<p>By default, text appears on the top left of a TextView. To center it vertically, you need to use the gravity property : In your xml layout file, add the following property : android:gravity="center_vertical" To center the text vertically and horizontally : Use the following property : android:gravity="center" To do it programmatically, use the following syntax : <a class="read-more" href="https://charles.lescampeurs.org/2016/06/01/android-center-text-horizontally-and-vertically-in-a-textview">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2016/06/01/android-center-text-horizontally-and-vertically-in-a-textview">Android: center text horizontally and vertically in a TextView</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>By default, text appears on the top left of a TextView.</p>
<p><a href="http://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview.png"><img class="aligncenter size-full wp-image-1541" src="http://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview.png" alt="android-centrer-textview" width="488" height="925" srcset="https://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview.png 488w, https://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-158x300.png 158w" sizes="(max-width: 488px) 100vw, 488px" /></a></p>
<p>To center it vertically, you need to use the gravity property :</p>
<p><a href="http://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically.png"><img class="aligncenter size-full wp-image-1540" src="http://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically.png" alt="android-centrer-textview-vertically" width="518" height="916" srcset="https://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically.png 518w, https://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically-170x300.png 170w" sizes="(max-width: 518px) 100vw, 518px" /></a></p>
<p>In your xml layout file, add the following property :</p>
<pre>android:gravity="center_vertical"</pre>
<p>To center the text vertically and horizontally :</p>
<p><a href="http://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically-horizontally.png"><img class="aligncenter size-full wp-image-1539" src="http://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically-horizontally.png" alt="android-centrer-textview-vertically-horizontally" width="502" height="912" srcset="https://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically-horizontally.png 502w, https://charles.lescampeurs.org/wp-content/uploads/2016/06/android-centrer-textview-vertically-horizontally-165x300.png 165w" sizes="(max-width: 502px) 100vw, 502px" /></a></p>
<p>Use the following property :</p>
<pre>android:gravity="center"</pre>
<p>To do it programmatically, use the following syntax :</p>
<pre>MyTextView.setGravity(Gravity.CENTER)</pre>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1538" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2016/06/01/android-center-text-horizontally-and-vertically-in-a-textview">Android: center text horizontally and vertically in a TextView</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2016/06/01/android-center-text-horizontally-and-vertically-in-a-textview/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install gem as user on OSX 10.10 Yosemite</title>
		<link>https://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite</link>
		<comments>https://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite#comments</comments>
		<pubDate>Wed, 25 Feb 2015 21:08:41 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Command line]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1523</guid>
		<description><![CDATA[<p>Use case : install a specific version of capistrano to deploy stuff somewhere Let&#8217;s say you need to install capistrano 2.* to be able to use your deploy scripts. In this case, I&#8217;m running a fresh Yosemite install. Let&#8217;s say we&#8217;ll need to setup a specific ruby version with a specific gem version. To do <a class="read-more" href="https://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite">Install gem as user on OSX 10.10 Yosemite</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p><em>Use case : install a specific version of capistrano to deploy stuff somewhere</em></p>
<p>Let&#8217;s say you need to install capistrano 2.* to be able to use your deploy scripts. In this case, I&#8217;m running a fresh Yosemite install.</p>
<p>Let&#8217;s say we&#8217;ll need to setup a specific ruby version with a specific gem version. To do that, we use <a href="http://brew.sh/" target="_blank">homebrew</a> and <a href="https://github.com/sstephenson/rbenv" target="_blank">rbenv</a>.</p>
<h2>Install homebrew</h2>
<pre>ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"</pre>
<p>Follow instructions and refer to homebrew <a href="http://brew.sh/" target="_blank">website</a> for more details.</p>
<h2>Install rbenv</h2>
<pre>brew install rbenv ruby-build</pre>
<p>Update your shell setup to use rbenv when you open a new terminal</p>
<pre>echo 'if which rbenv &gt; /dev/null; then eval "$(rbenv init -)"; fi' &gt;&gt; ~/.bash_profile</pre>
<p>Refresh your current session</p>
<pre>source ~/.bash_profile</pre>
<p>List available ruby versions</p>
<pre>rbenv install -l</pre>
<p>Install a specific version of ruby</p>
<pre>rbenv install 2.1.5
rbenv global 2.1.5</pre>
<p>Check your ruby version</p>
<pre class="p1"><span class="s1">ruby -v
</span>ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-darwin14.0]</pre>
<p>Install your gem</p>
<pre class="p1"><span class="s1">gem install capistrano -v "=2.15.5"</span></pre>
<p class="p1">You&#8217;re done!</p>
<pre class="p1"><span class="s1">cap --version
</span>Capistrano v2.15.5</pre>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1523" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite">Install gem as user on OSX 10.10 Yosemite</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2015/02/25/install-gem-as-user-on-osx-10-10-yosemite/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Ubuntu: start sphinxsearch with specific options</title>
		<link>https://charles.lescampeurs.org/2015/01/05/ubuntu-start-sphinxsearch-with-specific-options</link>
		<comments>https://charles.lescampeurs.org/2015/01/05/ubuntu-start-sphinxsearch-with-specific-options#respond</comments>
		<pubDate>Mon, 05 Jan 2015 09:59:44 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Distro]]></category>
		<category><![CDATA[sphinxsearch]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1519</guid>
		<description><![CDATA[<p>By default, on Ubuntu, SphinxSearch is using /etc/sphinxsearch/sphinx.conf and /etc/default/sphinxsearch to start/stop daemon. If you need to use specific command line options (like -c ), you need to update your /etc/init.d/sphinxsearch In the do_start() function, change the line : start-stop-daemon --start --pidfile $PIDFILE --chuid www-data --exec ${DAEMON} with start-stop-daemon --start --pidfile $PIDFILE --chuid www-data --exec ${DAEMON} <a class="read-more" href="https://charles.lescampeurs.org/2015/01/05/ubuntu-start-sphinxsearch-with-specific-options">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2015/01/05/ubuntu-start-sphinxsearch-with-specific-options">Ubuntu: start sphinxsearch with specific options</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>By default, on Ubuntu, SphinxSearch is using <strong>/etc/sphinxsearch/sphinx.conf</strong> and <strong>/etc/default/sphinxsearch</strong> to start/stop daemon.</p>
<p>If you need to use specific command line options (like -c ), you need to update your <strong>/etc/init.d/sphinxsearch</strong></p>
<p>In the <strong>do_start()</strong> function, change the line :</p>
<pre>start-stop-daemon --start --pidfile $PIDFILE --chuid www-data --exec ${DAEMON}</pre>
<p>with</p>
<pre>start-stop-daemon --start --pidfile $PIDFILE --chuid www-data --exec ${DAEMON} -- ${DAEMON_OPTS}</pre>
<p>Set the <strong>DAEMON_OPTS</strong> variable at the beginning of the file. For example :</p>
<pre>CONFIG=/var/www/udg/app/config/sphinx.conf
DAEMON_OPTS="-c ${CONFIG}"</pre>
<p>I&#8217;ve also updated all <strong>/etc/sphinxsearch/sphinx.conf</strong> occurrences to <strong>${CONFIG}</strong></p>
<p>&nbsp;</p>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1519" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2015/01/05/ubuntu-start-sphinxsearch-with-specific-options">Ubuntu: start sphinxsearch with specific options</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2015/01/05/ubuntu-start-sphinxsearch-with-specific-options/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install a specific version of sphinxsearch on Ubuntu 14.04</title>
		<link>https://charles.lescampeurs.org/2014/12/09/install-a-specific-version-of-sphinxsearch-on-ubuntu-14-04</link>
		<comments>https://charles.lescampeurs.org/2014/12/09/install-a-specific-version-of-sphinxsearch-on-ubuntu-14-04#respond</comments>
		<pubDate>Tue, 09 Dec 2014 17:30:27 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Distro]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1515</guid>
		<description><![CDATA[<p>Current version of sphinx on Ubuntu 14.04 is 2.0.* If you need a more recent version, you can find a .deb package directly on Sphinx website : http://sphinxsearch.com/downloads/release/ Pick-up your package and install it locally : $ wget http://sphinxsearch.com/files/sphinxsearch_2.2.6-release-0ubuntu12~trusty_amd64.deb $ dpkg -i sphinxsearch_2.2.6-release-0ubuntu12~trusty_amd64.deb $ searchd -h Sphinx 2.2.6-id64-release (r4843) Copyright (c) 2001-2014, Andrew Aksyonoff Copyright <a class="read-more" href="https://charles.lescampeurs.org/2014/12/09/install-a-specific-version-of-sphinxsearch-on-ubuntu-14-04">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/12/09/install-a-specific-version-of-sphinxsearch-on-ubuntu-14-04">Install a specific version of sphinxsearch on Ubuntu 14.04</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Current version of sphinx on <em>Ubuntu 14.04</em> is <em>2.0.*</em></p>
<p>If you need a more recent version, you can find a <em>.deb</em> package directly on Sphinx website : <a href="http://sphinxsearch.com/downloads/release/">http://sphinxsearch.com/downloads/release/</a></p>
<p>Pick-up your package and install it locally :</p>
<pre>$ wget http://sphinxsearch.com/files/sphinxsearch_2.2.6-release-0ubuntu12~trusty_amd64.deb

$ dpkg -i sphinxsearch_2.2.6-release-0ubuntu12~trusty_amd64.deb

$ searchd -h
Sphinx 2.2.6-id64-release (r4843)
Copyright (c) 2001-2014, Andrew Aksyonoff
Copyright (c) 2008-2014, Sphinx Technologies Inc (http://sphinxsearch.com)
...</pre>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1515" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/12/09/install-a-specific-version-of-sphinxsearch-on-ubuntu-14-04">Install a specific version of sphinxsearch on Ubuntu 14.04</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2014/12/09/install-a-specific-version-of-sphinxsearch-on-ubuntu-14-04/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure HTTPS/SSL under Apache and OSX</title>
		<link>https://charles.lescampeurs.org/2014/04/01/how-to-configure-httpsssl-under-apache-and-osx</link>
		<comments>https://charles.lescampeurs.org/2014/04/01/how-to-configure-httpsssl-under-apache-and-osx#respond</comments>
		<pubDate>Tue, 01 Apr 2014 09:21:21 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[http]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[ssl]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1507</guid>
		<description><![CDATA[<p>My setup : OSX : 10.8.5 Apache : # httpd -V Server version: Apache/2.2.26 (Unix) Server built: Dec 10 2013 22:06:35 Server's Module Magic Number: 20051115:33 Server loaded: APR 1.4.5, APR-Util 1.3.12 Compiled using: APR 1.4.5, APR-Util 1.3.12 Architecture: 64-bit Server MPM: Prefork threaded: no forked: yes (variable process count) Server compiled with.... -D APACHE_MPM_DIR="server/mpm/prefork" <a class="read-more" href="https://charles.lescampeurs.org/2014/04/01/how-to-configure-httpsssl-under-apache-and-osx">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/04/01/how-to-configure-httpsssl-under-apache-and-osx">How to configure HTTPS/SSL under Apache and OSX</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>My setup :</p>
<ul>
<li>OSX : 10.8.5</li>
<li>Apache :</li>
</ul>
<pre># httpd -V
Server version: Apache/2.2.26 (Unix)
Server built: Dec 10 2013 22:06:35
Server's Module Magic Number: 20051115:33
Server loaded: APR 1.4.5, APR-Util 1.3.12
Compiled using: APR 1.4.5, APR-Util 1.3.12
Architecture: 64-bit
Server MPM: Prefork
 threaded: no
 forked: yes (variable process count)
Server compiled with....
 -D APACHE_MPM_DIR="server/mpm/prefork"
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_FLOCK_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT="/usr"
 -D SUEXEC_BIN="/usr/bin/suexec"
 -D DEFAULT_PIDLOG="/private/var/run/httpd.pid"
 -D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
 -D DEFAULT_LOCKFILE="/private/var/run/accept.lock"
 -D DEFAULT_ERRORLOG="logs/error_log"
 -D AP_TYPES_CONFIG_FILE="/private/etc/apache2/mime.types"
 -D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"</pre>
<p><strong>openssl :</strong></p>
<p># openssl version<br />
OpenSSL 0.9.8y 5 Feb 2013</p>
<p><strong>Generate a self-signed certificate :</strong></p>
<p>As root :</p>
<pre># cd /etc/apache
# mkdir ssl
# cd ssl</pre>
<pre># openssl req -new -newkey rsa:2048 -nodes \
 -out www_192_168_90_25_xip_io.csr \
 -keyout www_192_168_90_25_xip_io.key \
 -subj "/C=FR/ST=FRANCE/L=PARIS/O=MyProject/OU=The Team/CN=www.192.168.90.25.xip.io"</pre>
<pre># ls -l
 total 16
 -rw-r--r-- 1 root wheel 1050 Apr 1 10:15 www_192_168_90_25_xip_io.csr
 -rw-r--r-- 1 root wheel 1675 Apr 1 10:15 www_192_168_90_25_xip_io.key</pre>
<pre># openssl x509 -req -days 730 -in www_192_168_90_25_xip_io.csr -signkey www_192_168_90_25_xip_io.key -out www_192_168_90_25_xip_io.crt
 Signature ok
 subject=/C=FR/ST=FRANCE/L=PARIS/O=MyProject/OU=The Team/CN=www.192.168.90.25.xip.io
 Getting Private key</pre>
<pre># ls -l
 total 24
 -rw-r--r-- 1 root wheel 1294 Apr 1 10:23 www_192_168_90_25_xip_io.crt
 -rw-r--r-- 1 root wheel 1050 Apr 1 10:15 www_192_168_90_25_xip_io.csr
 -rw-r--r-- 1 root wheel 1675 Apr 1 10:15 www_192_168_90_25_xip_io.key</pre>
<p><strong>Configure Apache</strong></p>
<p>In <strong>extra/httpd-ssl.conf</strong> add the following NameVirtualHost directive :</p>
<pre>NameVirtualHost *:443
 Listen 443</pre>
<p>Also configure your default virtualhost :</p>
<pre>&lt;VirtualHost _default_:443&gt;
    DocumentRoot "/Users/charles/Sites"
    ServerName localhost:443
    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
    SSLCertificateFile "/private/etc/apache2/ssl/www_192_168_90_25_xip_io.crt"
    SSLCertificateKeyFile "/private/etc/apache2/ssl/www_192_168_90_25_xip_io.key"
 &lt;/VirtualHost&gt;</pre>
<p>In <strong>httpd.conf</strong> enable ssl (by default, it&#8217;s commented out) :</p>
<pre>Include /private/etc/apache2/extra/httpd-ssl.conf</pre>
<p>You can now connect on your <a href="https://localhost"><strong>https://localhost</strong></a></p>
<p>To setup a new virtualhost, enable ssl in your vhost directive :</p>
<pre>&lt;VirtualHost *:443&gt;
    ServerAlias www.192.168.90.25.xip.io
    DocumentRoot "/Users/charles/Sites/project
    &lt;Directory /Users/charles/Sites/project&gt;
        Options FollowSymLinks Indexes
        AllowOverride All
    &lt;/Directory&gt;
    SSLEngine on
    SSLProtocol all -SSLv2
    SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5
    SSLCertificateFile "/private/etc/apache2/ssl/www_192_168_90_25_xip_io.crt"
    SSLCertificateKeyFile "/private/etc/apache2/ssl/www_192_168_90_25_xip_io.key"
&lt;/VirtualHost&gt;</pre>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1507" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/04/01/how-to-configure-httpsssl-under-apache-and-osx">How to configure HTTPS/SSL under Apache and OSX</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2014/04/01/how-to-configure-httpsssl-under-apache-and-osx/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Create a chrooted ssh user with Ubuntu and jailkit</title>
		<link>https://charles.lescampeurs.org/2014/03/05/create-a-chrooted-ssh-user-with-ubuntu-and-jailkit</link>
		<comments>https://charles.lescampeurs.org/2014/03/05/create-a-chrooted-ssh-user-with-ubuntu-and-jailkit#respond</comments>
		<pubDate>Wed, 05 Mar 2014 09:34:16 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[Distro]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1494</guid>
		<description><![CDATA[<p>I have a website hosted in /var/www/mydomain I want to create a chrooted ssh account to give access to a shell to my developers to execute commands and check logs. This is just a raw transcript how I did it with jailkit : $ apt-get install build-essential autoconf automake libtool flex bison debhelper binutils-gold $ <a class="read-more" href="https://charles.lescampeurs.org/2014/03/05/create-a-chrooted-ssh-user-with-ubuntu-and-jailkit">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/03/05/create-a-chrooted-ssh-user-with-ubuntu-and-jailkit">Create a chrooted ssh user with Ubuntu and jailkit</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>I have a website hosted in /var/www/mydomain</p>
<p>I want to create a chrooted ssh account to give access to a shell to my developers to execute commands and check logs.</p>
<p>This is just a raw transcript how I did it with jailkit :</p>
<pre>$ apt-get install build-essential autoconf automake libtool flex bison debhelper binutils-gold</pre>
<pre>$ cd /usr/local/src/
$ wget http://olivier.sessink.nl/jailkit/jailkit-2.17.tar.bz2
$ tar -xjvf jailkit-2.17.tar.bz2
$ cd jailkit-2.17/
$ ./debian/rules binary
$ dpkg -i jailkit_2.17-1_amd64.deb
$ jk_init -j /var/www/mydomain jk_lsh
$ jk_init -j /var/www/mydomain sftp
$ jk_init -j /var/www/mydomain scp
$ jk_init -j /var/www/mydomain git
$ jk_init -j /var/www/mydomain extendedshell
$ jk_init -j /var/www/mydomain editors
$ jk_jailuser myuser</pre>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1494" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/03/05/create-a-chrooted-ssh-user-with-ubuntu-and-jailkit">Create a chrooted ssh user with Ubuntu and jailkit</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2014/03/05/create-a-chrooted-ssh-user-with-ubuntu-and-jailkit/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Symfony and xip.io in dev environment</title>
		<link>https://charles.lescampeurs.org/2014/02/12/using-symfony-and-xip-io-in-dev-environment</link>
		<comments>https://charles.lescampeurs.org/2014/02/12/using-symfony-and-xip-io-in-dev-environment#respond</comments>
		<pubDate>Wed, 12 Feb 2014 08:20:26 +0000</pubDate>
		<dc:creator><![CDATA[CharlyBr]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Symfony]]></category>
		<category><![CDATA[xip.io]]></category>

		<guid isPermaLink="false">http://charles.lescampeurs.org/?p=1487</guid>
		<description><![CDATA[<p>The default app_dev.php in symfony only allow connexion from localhost. Code is as follow: if (isset($_SERVER['HTTP_CLIENT_IP']) &#124;&#124; isset($_SERVER['HTTP_X_FORWARDED_FOR']) &#124;&#124; !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1')) ) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); } If you want to use xip.io to test your local instance with devices <a class="read-more" href="https://charles.lescampeurs.org/2014/02/12/using-symfony-and-xip-io-in-dev-environment">&#8230;&#160;<span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/02/12/using-symfony-and-xip-io-in-dev-environment">Using Symfony and xip.io in dev environment</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The default app_dev.php in symfony only allow connexion from localhost. Code is as follow:</p>
<pre>if (isset($_SERVER['HTTP_CLIENT_IP'])
 || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
 || !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}</pre>
<p>If you want to use <a href="http://xip.io/">xip.io</a> to test your local instance with devices for example, access is forbidden by default.</p>
<p>You can add a condition to if statement to allow connexion from your local subnet. Let&#8217;s say your subnet is 192.168.90.* and your vhost like www.192.168.90.42.xip.io, the following code will do the trick (from web/app_dev.php) :</p>
<pre>if (isset($_SERVER['HTTP_CLIENT_IP'])
 || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
 || (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
     &amp;&amp; !preg_match('/192\.168\.90\./', @$_SERVER['REMOTE_ADDR']))
) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}</pre>
<p>Happy coding!</p>
 <img src="https://charles.lescampeurs.org/?feed-stats-post-id=1487" width="1" height="1" style="display: none;" /><p>The post <a rel="nofollow" href="https://charles.lescampeurs.org/2014/02/12/using-symfony-and-xip-io-in-dev-environment">Using Symfony and xip.io in dev environment</a> appeared first on <a rel="nofollow" href="https://charles.lescampeurs.org">MrBrown blob</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://charles.lescampeurs.org/2014/02/12/using-symfony-and-xip-io-in-dev-environment/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
