<?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>Development &#8211; Costigator</title>
	<atom:link href="https://costigator.com/category/development/feed/" rel="self" type="application/rss+xml" />
	<link>https://costigator.com</link>
	<description>Tech Passion</description>
	<lastBuildDate>Fri, 30 Sep 2016 17:36:47 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.5.2</generator>
	<item>
		<title>How to activate/deactivate a hue sensor automatically with a scheduled task on Synology</title>
		<link>https://costigator.com/development/programming-languages/how-to-activatedeactivate-a-hue-sensor-automatically-with-a-scheduled-task-on-synology/</link>
					<comments>https://costigator.com/development/programming-languages/how-to-activatedeactivate-a-hue-sensor-automatically-with-a-scheduled-task-on-synology/#respond</comments>
		
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Fri, 30 Sep 2016 17:27:39 +0000</pubDate>
				<category><![CDATA[Programming Languages]]></category>
		<category><![CDATA[home automation]]></category>
		<category><![CDATA[motion]]></category>
		<category><![CDATA[philips hue]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[synology]]></category>
		<guid isPermaLink="false">http://costigator.com/?p=830</guid>

					<description><![CDATA[Last week I bought some philips hue bulbs and LED strips to automate the lights at home. For motion detection I also bought the hue sensor to automatically turn on/off the lights when I go in my bedroom or when I stand up in the night to go to the wc. I have configured the sensor, that it turns the lights on and off automatically after 3 minutes. The problem The problem is, that during the day the sensor, after no motion for 3 minutes is detected, turns the lights off. That means, that in the evening when my lights are [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Last week I bought some philips hue bulbs and LED strips to automate the lights at home. For motion detection I also bought the hue sensor to automatically turn on/off the lights when I go in my bedroom or when I stand up in the night to go to the wc.</p>
<p>I have configured the sensor, that it turns the lights on and off automatically after 3 minutes.</p>
<h2>The problem</h2>
<p>The problem is, that during the day the sensor, after no motion for 3 minutes is detected, turns the lights off. That means, that in the evening when my lights are turned on and I go to the bedroom to take something, after 3 minutes all the lights (not only in the bedroom) are automatically turned off.</p>
<p>Unfortunately, with the <a href="https://itunes.apple.com/us/app/philips-hue/id1055281310?mt=8" target="_blank" rel="nofollow">hue app</a>, there is no option to activate/deactivate the sensor during the day (for example between 7 am &#8211; 11 pm).</p>
<h2>The solution</h2>
<p>The hue lights in combination with the hue bridge offers RESTful API for automation with scripts. All what you need is a server (like Synology or another linux/windows server) that is running permanently to execute your scripts.</p>
<h2>The code</h2>
<p>The first thing to do is to follow these instructions to get access to your hue bridge: <a href="http://www.developers.meethue.com/documentation/getting-started" target="_blank" rel="nofollow">Getting started with hue API</a> (login required to see all the documentation)</p>
<p>After this, we can scan the hue network to get all sensors (with a GET command):</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="c">/api/&lt;username&gt;/sensors</code></pre>
<p>Now you need to search through the sensor list and find the sensor that match your label (in my case it is the sensor id 10).</p>
<p>To automate it you need to create a script. For example a bash script to turn the sensor off (power_off_motion_sensor.sh):</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">#!/bin/bash<br />
curl &#8211;header &#8220;Content-Type: application/json&#8221; &#8211;request PUT &#8211;data &#8216;{&#8220;on&#8221;: false}&#8217;  http://&lt;bridge_ip&gt;/api/&lt;username&gt;/sensors/10/config</code></pre>
<p>Or turn it on (power_on_motion_sensor.sh):</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">#!/bin/bash<br />
curl &#8211;header &#8220;Content-Type: application/json&#8221; &#8211;request PUT &#8211;data &#8216;{&#8220;on&#8221;: true}&#8217;  http://&lt;bridge_ip&gt;/api/&lt;username&gt;/sensors/10/config</code></pre>
<p>After this you need only to automate it with a scheduled task. With synology you can create it under the control panel -&gt; job tasks. Here you can define when the scripts should run.</p>
<h2>Conclusion</h2>
<p>I use it since some weeks without problems. The philips hue lights are really a good product for people, who like to automate their houses! In combination with IFTTT there are also some intresting automations, for example turn the lights on at the sunset.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://costigator.com/development/programming-languages/how-to-activatedeactivate-a-hue-sensor-automatically-with-a-scheduled-task-on-synology/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Linux fork bomb and how to prevent it</title>
		<link>https://costigator.com/development/programming-languages/linux-fork-bomb-and-how-to-prevent-it/</link>
					<comments>https://costigator.com/development/programming-languages/linux-fork-bomb-and-how-to-prevent-it/#respond</comments>
		
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Sat, 04 Jun 2016 07:38:23 +0000</pubDate>
				<category><![CDATA[Programming Languages]]></category>
		<category><![CDATA[fork bomb]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell]]></category>
		<guid isPermaLink="false">http://costigator.com/?p=799</guid>

					<description><![CDATA[A fork bomb is a piece of code that defines a function and runs it repetitively, until the system has no more computing resources. The system will also become unresponsive and the only solution to get it working again is reboot the system. The code The fork bomb code is (for example) like this one: Explanation First of all you define a function called &#8220;:&#8221;. The Syntax of the function is &#8220;:(){};&#8221;. Now in the function you will call the function itself recursively and send the output again to itself &#8220;:&#124;:&#8221;. The &#8220;&#38;&#8221; runs the function in the background. Now the [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>A fork bomb is a piece of code that defines a function and runs it repetitively, until the system has no more computing resources. The system will also become unresponsive and the only solution to get it working again is reboot the system.</p>
<h2>The code</h2>
<p>The fork bomb code is (for example) like this one:</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">:(){:|:&amp;};:</code></pre>
<h2>Explanation</h2>
<p>First of all you define a function called &#8220;:&#8221;. The Syntax of the function is &#8220;:(){};&#8221;. Now in the function you will call the function itself recursively and send the output again to itself &#8220;:|:&#8221;. The &#8220;&amp;&#8221; runs the function in the background. Now the fork bomb is done and you only need to call it with &#8220;:&#8221; at the end.</p>
<h2>Live demonstration</h2>
<p>For a live demonstration I have found a YouTube video:<br />
<iframe title="Linux Fork Bomb &quot;Virus&quot;" width="500" height="281" src="https://www.youtube.com/embed/Q9Mdy7H8Qmc?feature=oembed" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></p>
<h2>How to prevent it</h2>
<p>Preventing it is quite simple. You need to modify the system resources limits. Login to the server via SSH or open a new terminal window and edit the limits.conf file as root:</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">sudo vi /etc/security/limits.conf</code></pre>
<p>Set a limit for the processes number for a specific user or a group:</p>
<pre><code class="eckosc eckosc_syntax_theme_dark" data-language="shell">username hard nproc 100<br />
@groupname hard nproc 100</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://costigator.com/development/programming-languages/linux-fork-bomb-and-how-to-prevent-it/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>How to create an iOS App and publish it on the App Store</title>
		<link>https://costigator.com/development/mobile-apps/how-to-create-an-ios-app-and-publish-it-on-the-app-store/</link>
					<comments>https://costigator.com/development/mobile-apps/how-to-create-an-ios-app-and-publish-it-on-the-app-store/#respond</comments>
		
		<dc:creator><![CDATA[Luca]]></dc:creator>
		<pubDate>Fri, 08 Jan 2016 21:15:00 +0000</pubDate>
				<category><![CDATA[Mobile Apps]]></category>
		<category><![CDATA[game]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[school]]></category>
		<category><![CDATA[tutorial]]></category>
		<guid isPermaLink="false">http://costigator.com/?p=718</guid>

					<description><![CDATA[I&#8217;m proud to present my first App that I have made for iOS. It is a reskin of the &#8220;unblock me&#8221; strategic game. The app is named &#8220;Gian&#8217;s Jewels&#8221; and consists helping Gian, a swiss ibex, to get the purple jewel. The game In this beautiful game you will improve your logical and problem-solving skills. This puzzle game has hundreds of levels. Suited for kids 8 and above. You can get it here, enjoy it! How to play Touch and slide a jewel to move it. The goal is to get the purple jewel out of the board, You need [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m proud to present my first App that I have made for iOS. It is a reskin of the &#8220;unblock me&#8221; strategic game. The app is named &#8220;Gian&#8217;s Jewels&#8221; and consists helping Gian, a swiss ibex, to get the purple jewel.</p>
<h3>The game</h3>
<p>In this beautiful game you will improve your logical and problem-solving skills. This puzzle game has hundreds of levels. Suited for kids 8 and above.</p>
<p>You can get it here, enjoy it!</p>
<p><a href="https://itunes.apple.com/us/app/gians-jewels/id1069885427?mt=8" target="_blank"><img decoding="async" class="alignnone size-medium wp-image-719" src="http://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-300x105.png" alt="available-on-appstore-png" width="300" height="105" srcset="https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-300x105.png 300w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-200x70.png 200w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-768x269.png 768w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-860x301.png 860w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-680x238.png 680w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-400x140.png 400w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png-50x18.png 50w, https://costigator.com/wp-content/uploads/2016/01/available-on-appstore-png.png 902w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
<h3>How to play</h3>
<ul>
<li>Touch and slide a jewel to move it. The goal is to get the purple jewel out of the board, You need to move other jewels to clear the path.</li>
<li>Horizontal jewels (including the purple jewel) can only move horizontally.</li>
<li>Vertical blocks can only move vertically.</li>
</ul>
<h3>How I did it</h3>
<p>All the instructions that you need are available in a course on Udemy. You just only need to follow the instructions and get your app ready in 1 &#8211; 2 days. If you are interested, please take a look here &#8220;<a href="https://www.udemy.com/reskinning-create-and-publish-unblock-me-ios-game-in-1-day/" target="_blank">iOS 9 Reskinning: Create and Publish Unblock Me iOS game</a>&#8221;</p>
<p>If you are also interested in a more deep course how to code with Swift 2 and Xcode 7, I suggest you also this great course &#8220;<a href="https://www.udemy.com/the-complete-ios-9-developer-course/" target="_blank">The Complete iOS 9 Developer Course &#8211; Build 18 Apps</a>&#8220;.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://costigator.com/development/mobile-apps/how-to-create-an-ios-app-and-publish-it-on-the-app-store/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
