<?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>Programming, creativity and humans</title>
	<atom:link href="http://gasparchilingarov.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://gasparchilingarov.com</link>
	<description>Unstructured diary of polymath</description>
	<lastBuildDate>Fri, 26 May 2017 10:26:41 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.7.5</generator>
<site xmlns="com-wordpress:feed-additions:1">106263455</site>	<item>
		<title>Setting Maximal Memory in Docker and Docker Compose</title>
		<link>http://gasparchilingarov.com/2017/05/26/setting-maximal-memory-in-docker-and-docker-compose/</link>
		<pubDate>Fri, 26 May 2017 10:26:41 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=175</guid>
		<description><![CDATA[As usual, Docker is causing tons on problems in production because of missing documentation. So today&#8217;s problem is how to limit memory usage for process in Docker container if you <a class="more-link" href="http://gasparchilingarov.com/2017/05/26/setting-maximal-memory-in-docker-and-docker-compose/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>As usual, Docker is causing tons on problems in production because of missing documentation. So today&#8217;s problem is how to limit memory usage for process in Docker container if you use Docker Compose.</p>
<p>Setting memory limit for whole container requires cgroups support and can be used only with Docker Compose services mode. Usually we run just only single process in each container, so limiting memory on single process should be equivalent to limiting whole containers usage.</p>
<p>If you want to run <strong>docker-compose up</strong> you have only <strong>ulimits</strong> available to you. Other options like &#8216;mem_limit&#8217; or &#8216;deploy&#8217; options are not supported in that mode.</p>
<p>Fortunately, Docker does not limit option names you can put in ulimits section in <strong>docker-compose.yaml</strong> file (see <a href="https://github.com/moby/moby/blob/69c35dad8e7ec21de32d42b9dd606d3416ae1566/daemon/oci_linux.go#L168">here</a> basically any option will be translated into corresponding <strong>setrlimit</strong> call)</p>
<p>This allows usage of <a href="https://linux.die.net/man/2/setrlimit">RLIMIT_AS</a> option.</p>
<p>Putting following in your docker-compose.yaml file will effectively limit memory usage of each process in container.</p>
<pre>  ulimits:
    as:
      soft: 1300000000
      hard: 1300000000
</pre>
<p>Size is specified in bytes. Other settigns (RSS, DATA, STACK) do not let you effectively limit process memory usage.</p>
<p>Bad part is that this is not visible through normal Linux kernel <strong>procfs</strong> and you cannot check it in run-time.</p>
<p>What causes most pain for me, that this is NOT DOCUMENTED anywhere in Docker documentation at all.</p>
<h3>Additional info on checking resource usage on processes/groups.</h3>
<p>/proc/NNN/status shows single process&#8217;es status and memory usage<br />
/proc/NNN/limits shows single process limits (but does not show Address space <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f641.png" alt="&#x1f641;" class="wp-smiley" style="height: 1em; max-height: 1em;" /> )</p>
<p>to get PID from docker you can run:<br />
<strong>docker ps</strong> and note container ID, then run <strong>docker top ID8a718a717</strong> and note process ID from there.</p>
<p>You can look up current cgroup settings under <strong>/sys/fs/cgroup/*/docker/containerID/</strong></p>
<p>Memory settings, for example, are located under <strong>/sys/fs/cgroup/memory/docker/containerID/memory.stat</strong> .</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">175</post-id>	</item>
		<item>
		<title>“Ship Small Diffs”</title>
		<link>http://gasparchilingarov.com/2017/02/26/ship-small-diffs/</link>
		<pubDate>Sun, 26 Feb 2017 20:04:19 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=166</guid>
		<description><![CDATA[Here is a useful article how to organize your code release process. In short Code not running in production is not ‘production quality’ code. Even if you tested it thoroughly, <a class="more-link" href="http://gasparchilingarov.com/2017/02/26/ship-small-diffs/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>Here is a useful article how to organize your code release process. In short</p>
<ul>
<li>Code not running in production is not ‘production quality’ code. Even if you tested it thoroughly, it does mean nothing until it runs in production.</li>
<li>Commit to releasing small pieces of code &#8211; a few dozen lines at once, not a huge commits.</li>
<li>Monitor system behavior after each release &#8211; you’ll notice problems occurring fast and correlate it to specific release. The small is the release &#8211; the easier is reviewing it.</li>
</ul>
<p>Read <a href="https://blog.skyliner.io/ship-small-diffs-741308bec0d1#.k10d3nhcp">here</a>.  (5 minute read)</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">166</post-id>	</item>
		<item>
		<title>How to stop waiting each other and start working</title>
		<link>http://gasparchilingarov.com/2017/02/23/how-to-stop-waiting-each-other-and-start-working/</link>
		<pubDate>Thu, 23 Feb 2017 20:09:30 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=168</guid>
		<description><![CDATA[“Depend less on each other” How to improve performance in the teams. If your work depends on your colleague input there are good chances that you will spend time waiting <a class="more-link" href="http://gasparchilingarov.com/2017/02/23/how-to-stop-waiting-each-other-and-start-working/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p><strong>“Depend less on each other”</strong></p>
<p>How to improve performance in the teams. If your work depends on your colleague input there are good chances that you will spend time waiting for it. Choosing prices of work so that they will be loosely dependent on each other is important to keep development at full speed. Read <a href="https://m.signalvnoise.com/depend-less-on-each-other-507fe0e23e4b#.l3dhksjxt">here.</a> (3 min)</p>
<p>Below is also research about Google’s code base in a single repository. It sounds as a strange idea until you realize it has advantages of letting people be less dependent on each others’ input. Everything is visible, re-usable and you can make changes for any code and it’s dependencies by yourself.</p>
<p>Main take-aways:</p>
<ul>
<li>Simplified <strong>organization</strong></li>
<li>Simplified dependency management</li>
<li>Tooling is more simple</li>
<li>Cross-project changes are easier</li>
</ul>
<p>Read deeper <a href="https://danluu.com/monorepo/">overview </a> (2 min) and the <a href="http://cacm.acm.org/magazines/2016/7/204032-why-google-stores-billions-of-lines-of-code-in-a-single-repository/fulltext">original article</a> (10 min).</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">168</post-id>	</item>
		<item>
		<title>How to fix &#8220;error: VM is paused due to host power management&#8221; error</title>
		<link>http://gasparchilingarov.com/2016/08/24/how-to-fix-error-vm-is-paused-due-to-host-power-management-error/</link>
		<pubDate>Wed, 24 Aug 2016 06:55:26 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=126</guid>
		<description><![CDATA[Sometimes, when Vagrant VM in Virtualbox can stuck in this state and you cannot resume execution at all. Turns our it happens only when your host machine hibernated or suspended while Vagrant <a class="more-link" href="http://gasparchilingarov.com/2016/08/24/how-to-fix-error-vm-is-paused-due-to-host-power-management-error/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>Sometimes, when Vagrant VM in Virtualbox can stuck in this state and you cannot resume execution at all.</p>
<p>Turns our it happens only when your host machine hibernated or suspended while Vagrant VM was running. And that also should co-oncide with Ubuntu&#8217;s systemd missing some dbus event.</p>
<p>You can notice that after such failed restore your network is also missing and you need to restart it manually.</p>
<p>The solution?</p>
<p>Easy &#8211; suspend and wake up your host once again and VMs will be in a running state automatically.</p>
<p><a href="https://www.virtualbox.org/ticket/15378?cversion=0&amp;cnum_hist=1" target="_blank">Here is more discussion</a>.</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">126</post-id>	</item>
		<item>
		<title>How to Run Fullscreen Games In Linux With Dual Monitors</title>
		<link>http://gasparchilingarov.com/2016/08/05/how-to-run-fullscreen-games-in-linux-with-dual-monitors/</link>
		<pubDate>Fri, 05 Aug 2016 08:58:37 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=100</guid>
		<description><![CDATA[Sometimes video games under Linux go crazy and full screen mode starts on totally wrong monitor. And basically there is no way to tell wine which monitor to use. This work <a class="more-link" href="http://gasparchilingarov.com/2016/08/05/how-to-run-fullscreen-games-in-linux-with-dual-monitors/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>Sometimes video games under Linux go crazy and full screen mode starts on totally wrong monitor. And basically there is no way to tell wine which monitor to use.</p>
<p>This work around worked for me</p>
<ol>
<li>disable monitor which you do NOT want to be used</li>
<li>start game in full screen mode and let window manager/wine/whatever remember it&#8217;s position</li>
<li>enable second monitor back</li>
<li>fix display positions</li>
</ol>
<p>&nbsp;</p>
<h2>Visual way</h2>
<p>On Ubuntu just go to &#8216;System configuration&#8217;/&#8217;Displays&#8217;, display your monitor you do not want game to use and then run game. After it remembers settings, turn monitor on back again.</p>
<h2>Command line way</h2>
<p>Some people like it hard way, so here is how to do it from command line.</p>
<h3>Step 1</h3>
<p>To find our which monitors do you have just run <strong>xrandr</strong> command</p>
<blockquote><p>Screen 0: minimum 320 x 200, current 3520 x 1080, maximum 8192 x 8192<br />
<strong>LVDS</strong> connected primary 1600&#215;900+0+0 (normal left inverted right x axis y axis) 0mm x 0mm<br />
1600&#215;900 60.1*+<br />
&#8230;.<br />
<strong>HDMI-0</strong> disconnected (normal left inverted right x axis y axis)<br />
<strong>VGA-0</strong> connected 1920&#215;1080+1600+0 (normal left inverted right x axis y axis) 510mm x 290mm<br />
1920&#215;1080 60.0*+<br />
&#8230;.</p></blockquote>
<p>You are interested to find display names &#8211; they are in bold.</p>
<p>Then issue following command to turn off the monitor</p>
<blockquote><p>xrandr &#8211;output VGA-0 &#8211;off</p></blockquote>
<h3>Step 2</h3>
<p>Run game as usual in fullscreen mode.</p>
<h3>Step 3</h3>
<p>Turn monitors back and assign primary/secondary roles</p>
<blockquote><p>xrandr &#8211;output VGA-0 &#8211;noprimary &#8211;auto<br />
xrandr &#8211;output LVDS &#8211;primary</p></blockquote>
<p>&#8211;auto argument tells xrandr to fidn mode suitable for monitor best and turn it on.</p>
<h3>Step 4</h3>
<p>You may need to run &#8216;System configuration&#8217;/&#8217;Display&#8217; control panel to fix display mirroring/position.</p>
<p>Afterwards the game should start on correct display.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">100</post-id>	</item>
		<item>
		<title>Listing Google Container Registry images and tags</title>
		<link>http://gasparchilingarov.com/2016/06/15/listing-google-container-registry-images-and-tags/</link>
		<pubDate>Wed, 15 Jun 2016 06:18:09 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[docker]]></category>
		<category><![CDATA[google-cloud]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=68</guid>
		<description><![CDATA[Docker is amazing tool when it works and supports what you need. And it is a living hell, when it does not. It takes some amount of trying and searching <a class="more-link" href="http://gasparchilingarov.com/2016/06/15/listing-google-container-registry-images-and-tags/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>Docker is amazing tool when it works and supports what you need. And it is a living hell, when it does not. It takes some amount of trying and searching to find working solution <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f642.png" alt="&#x1f642;" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Docker get integrated with Google Cloud and allows you to push and pull images to private repositories. But there is no easily found, documented way to list images that you have in a project in Google Cloud and what tags you have for each image.</p>
<p>You can see that information from Google Console, but there is no build-in docker command to do that.</p>
<h2>Fetching image information from Google Container Registry</h2>
<p>You need to have gcloud installed and authenticated.</p>
<p>Replace</p>
<ul>
<li>ZONE &#8211; with zone where your images are hosted (eu, us, asia)</li>
<li>PROJECT_NAME &#8211; name of your project</li>
<li>IMAGE_NAME &#8211; name of the docker image you want to explore</li>
</ul>
<h3>Getting list of images from GCR</h3>
<blockquote><p>curl -u &#8220;oauth2accesstoken:`gcloud auth print-access-token`&#8221; https://<em>ZONE</em>.gcr.io/v2/<em>PROJECT_NAME</em>/tags/list | json child | json -a</p></blockquote>
<h3>Getting list of tags for specific image from GCR</h3>
<blockquote><p>curl -u &#8220;oauth2accesstoken:`gcloud auth print-access-token`&#8221; https://<em>ZONE</em>.gcr.io/v2/<em>PROJECT_NAME</em>/<em>IMAGE_NAME</em>/tags/list | json tags | json -a</p></blockquote>
<p>You will need to install utility <em><a href="https://github.com/trentm/json" target="_blank">json</a> </em>beforehand</p>
<blockquote><p>npm install -g json</p></blockquote>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">68</post-id>	</item>
		<item>
		<title>Updates to the blog</title>
		<link>http://gasparchilingarov.com/2016/05/09/updates-to-the-blog/</link>
		<pubDate>Mon, 09 May 2016 11:11:53 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Personal development]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=26</guid>
		<description><![CDATA[I recently deleted this blog entirely because there is so much things happening, so I do not think previous one was relevant to me anymore. I finally feel free to say <a class="more-link" href="http://gasparchilingarov.com/2016/05/09/updates-to-the-blog/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>I recently deleted this blog entirely because there is so much things happening, so I do not think previous one was relevant to me anymore.</p>
<p>I finally feel free to say that I&#8217;m interested and involved in so much different domains. It includes programming and IT, which I love and continue my involvment in. It includes design and art &#8211; I <a href="http://gasparsmiles.com/">was painting</a> for some time and now I&#8217;m more into product design &#8211; we launched leather goods &#8216;<a href="http://www.smiles-bags.com/" target="_blank">Smiles Bags</a>&#8216; company  with my wife and I design products and also doing a lot of designs for our brand. It includes psychology and people communication &#8211; which I will cover in this blog more deeply. This list is anywhere far from complete, so it will grow over the time <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f642.png" alt="&#x1f642;" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">26</post-id>	</item>
		<item>
		<title>SOLVED fglrx on ubuntu 14.04 and wine problems</title>
		<link>http://gasparchilingarov.com/2016/05/08/solved-fglrx-on-ubuntu-14-04-and-wine-problems/</link>
		<pubDate>Sun, 08 May 2016 19:16:11 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=18</guid>
		<description><![CDATA[If you have fglrx display driver, run 64-bit system and run 32-programs under wine you may face problem with OpenGL. Sometimes 32-bit windows programs (under wine) which use OpenGL stop <a class="more-link" href="http://gasparchilingarov.com/2016/05/08/solved-fglrx-on-ubuntu-14-04-and-wine-problems/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>If you have fglrx display driver, run 64-bit system and run 32-programs under wine you may face problem with OpenGL.</p>
<p>Sometimes 32-bit windows programs (under wine) which use OpenGL stop working giving criptic error messages.</p>
<p>The problem is that they lost correct 32-bit Mesa driver. Following commands fix the problem:</p>
<blockquote><p>rm /usr/lib/i386-linux-gnu/mesa/libGL.so.1<br />
ln -s /usr/lib32/fglrx/libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so.1</p></blockquote>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">18</post-id>	</item>
		<item>
		<title>Making Dropbox and DejaDup friendly</title>
		<link>http://gasparchilingarov.com/2016/02/16/making-dropbox-and-dejadup-friendly/</link>
		<pubDate>Tue, 16 Feb 2016 05:25:34 +0000</pubDate>
		<dc:creator><![CDATA[gadmin]]></dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://gasparchilingarov.com/?p=7</guid>
		<description><![CDATA[Is your Ubuntu works slow just after the login or when your backups running? it&#8217;s may be because Dropbox or DejaDup (called &#8216;Backup&#8217; in Ubuntu) are doing a lot of raeding from a drive. <a class="more-link" href="http://gasparchilingarov.com/2016/02/16/making-dropbox-and-dejadup-friendly/">Continue Reading →</a>]]></description>
				<content:encoded><![CDATA[<p>Is your Ubuntu works slow just after the login or when your backups running?</p>
<p>it&#8217;s may be because Dropbox or DejaDup (called &#8216;Backup&#8217; in Ubuntu) are doing a lot of raeding from a drive.</p>
<p>This two commands solve all the issues, making both programs run with as low priority as possible.</p>
<p>Making Dropbox friendly (especially if you have over million files in your Dropbox folder):</p>
<pre>ionice -c 3 -p `pgrep dropbox`
renice 20 `pgrep dropbox`</pre>
<p>Making DejaDup/duplicity  friendly</p>
<pre>renice 20 `pgrep duplicity` `pgrep deja-dup`
ionice -c idle -p `pgrep duplicity`
ionice -c idle -p `pgrep deja-dup`</pre>
<p>Have fun! and fast working computer <img src="https://s.w.org/images/core/emoji/2.2.1/72x72/1f642.png" alt="&#x1f642;" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
]]></content:encoded>
		<post-id xmlns="com-wordpress:feed-additions:1">7</post-id>	</item>
	</channel>
</rss>
