<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Keeps Me Busy]]></title><description><![CDATA[Keeps Me Busy]]></description><link>http://keepsbusy.azurewebsites.net/</link><generator>Ghost 0.6</generator><lastBuildDate>Sun, 19 Apr 2026 02:37:14 GMT</lastBuildDate><atom:link href="http://keepsbusy.azurewebsites.net/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[Busy with versioning MSSQL Stored Proc in TFS]]></title><description><![CDATA[Via a trigger the stored procedures are sotred in a temp table. From this table, the stored procedures are added to the TFS via a console application scheduled with Windows Scheduler.]]></description><link>http://keepsbusy.azurewebsites.net/2016/07/02/busy-with-adding-stored-procedures-into-tfs/</link><guid isPermaLink="false">6e1e6658-8e1d-4593-a890-ca9ea2b75715</guid><category><![CDATA[T-SQL Stored Procedures]]></category><category><![CDATA[TFS]]></category><category><![CDATA[Versioning]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Sat, 02 Jul 2016 15:40:44 GMT</pubDate><content:encoded><![CDATA[<p>Having many Databases with tons of stored procedure I thought it might be a good idea to have them in a Source Control repository. Having programmatic experience with TFS and a bit of time on my hands I decided to give it a shot.</p>

<p>These where my requirements for the applications: <br>
1) As integrated as possible <br>
2) No additional tools to be installed (avoid additional configuration on a different pc) <br>
3) Avoid performance issues <br>
4) Multi-user enabled <br>
5) Scalable and extendable</p>

<p>After a few try-outs and experience from other users in forums I decided to use a trigger which is fired after the create/update of a stored procedure. This trigger should then put the stored procedure into the Source Repository.</p>

<p>Having googled the best possible approach, I identified these limitations: <br>
1) It is not a good idea to call a Web service directly via T-SQL. <br>
2) It is not recommended to register a DLL when the processing might take some time. </p>

<p>I always design my applications multi-tier where each application has its specific and dedicated function. So here is how I did it:</p>

<h4 id="applicationdesign">Application design</h4>

<p>On all my database servers I have database called COMMON. Here I created a table called SQL_OBJECT: <br>
<code>CREATE TABLE SQL_OBJECT (
SOL_NUM INT PRIMARY KEY NOT NULL, <br>
SOL_DATA NVARCHAR(MAX) NOT NULL, <br>
SOL_USERNAME NVARCHARE(500) <br>
SOL_DATETIME datetime NOT NULL, <br>
SOL_TREATED bool NOT NULL)</code></p>

<p>From here, I created a stored procedure which handles the insert of the SQL text. <br>
<code>CREATE PROC PCMN001_I_InsertSQLText_001
@sText NVARCHAR(MAX), @sUsername NVARCHAR(500)
AS <br>
BEGIN <br>
INSERT INTO SQL_OBJECT <br>
SELECT @Text, @sUsername, GETDATE(), 0 <br>
END</code></p>

<p>This stored procedure is called via a trigger. This trigger is registered to execute on create/update of a stored procedure.</p>

<p><code>CREATE TRIGGER TMAIN001_StoredSPInTemp_001 on  database 
    for     CREATE_PROCEDURE,  ALTER_PROCEDURE
as begin <br>
    Declare @data xml
            set @data=Eventdata()
exec PCMN001_I_InsertSQLText_001 @data.value('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]','nvarchar(MAX)'), <br>
@data.value('(/EVENT_INSTANCE/LoginName)[1]','nvarchar(500)'))
END</code></p>

<p>Now the stored procedures are inserted in the SQL_OBJECT when you create/update your code.</p>

<blockquote>
  <p>The trigger stores the code and the username in the COMMON.dbo.SQL_OBJECT</p>
</blockquote>

<p>Next up we will get all the lines in the SQL_OBJECT which have not yet been treated. To avoid false loading, we need additional handling: <br>
<code>CREATE PROC PCMN002_SU_GetSQLObjects_001
AS <br>
BEGIN <br>
create table #tempids <br>
(
    ids int
)</code></p>

<p><code>INSERT INTO #tempids
SELECT SOL_NUM <br>
FROM SQL_OBJECT <br>
WHERE SOL_TREATED = 0</code></p>

<p><code>SELECT SOL_TEXT, SOL_USERNAME
FROM SQL_OBJECT <br>
WHERE SOL_NUM IN (SELECT ids FROM #tempids)</code></p>

<p><code>UPDATE SQL_OBJECT
SET SOL_TREATED = 1 <br>
WHERE SOL_NUM IN (SELECT ids FROM #tempids) <br>
END</code></p>

<p>I call this stored procedure in a Console application which adds them into the Code Repository.</p>

<p>The console application is called via a Windows Scheduled job.</p>

<blockquote>
  <p>This kept me busy for 2 hours</p>
</blockquote>]]></content:encoded></item><item><title><![CDATA[Busy with Long Range Communication - Software]]></title><description><![CDATA[Overview on what a tracking softwrae should be able to do.]]></description><link>http://keepsbusy.azurewebsites.net/2015/12/15/busy-with-long-range-communication-software/</link><guid isPermaLink="false">893a6e0f-c62e-45e8-89dc-a771e24a16e5</guid><category><![CDATA[Long Range Communication]]></category><category><![CDATA[emergency communication]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Tue, 15 Dec 2015 12:44:19 GMT</pubDate><content:encoded><![CDATA[<p>The CP would have a PC to display the relevant information. The requirements of the application is very complex as well:</p>

<ul>
<li>Store all the GPS position and voice communication</li>
<li>Keeps track of the teams in the field
o    How is the team setup? <br>
o    How long have they been out?  </li>
<li>Keep track of the equipment used in the mission
o    What is available? <br>
o    What is used in the field?  </li>
<li>Emergency button
o    A team should be able to request help <br>
o    Teammates are alerted and know where to go  </li>
<li>On the boats 
o    Display current location on a map <br>
o    An arrow indicated the direction to return to the base <br>
o    Display teammates location <br>
o    Display the location the team should go to  </li>
<li>Replay a mission</li>
<li>Manage the base camp
o    Missions assigned to persons <br>
    Who is charge of the base camp security?
    Who is in charge of the food?</li>
<li>Commander interface
o    Web based <br>
o    Assign mission to team <br>
o    See their current location <br>
o    Overview on the teams</li>
</ul>

<p>All the mission information is stored on a server in the command post. A Wifi access point allows the commander to move freely in the command post while assigning tasks via a tablet.</p>

<p><code>This kept me busy for: 50 hours</code></p>]]></content:encoded></item><item><title><![CDATA[Busy with Long Range Communication - Setup]]></title><description><![CDATA[<p>A teammate came up with the idea to contact LARU (www.laru.lu). These guys specialised in emergency Radio communication and they have a wide knowledge in the topic. What followed were a few meetings where we discussed a possible solution. </p>

<p>The complex set of requirements demands a hybrid solution</p>]]></description><link>http://keepsbusy.azurewebsites.net/2015/12/15/busy-with-long-range-communication-setup/</link><guid isPermaLink="false">34834621-d25e-459a-b085-aa8021ed8e26</guid><category><![CDATA[Long Range Communication]]></category><category><![CDATA[emergency communication]]></category><category><![CDATA[LARU]]></category><category><![CDATA[DMR]]></category><category><![CDATA[APRS]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Tue, 15 Dec 2015 12:39:07 GMT</pubDate><content:encoded><![CDATA[<p>A teammate came up with the idea to contact LARU (www.laru.lu). These guys specialised in emergency Radio communication and they have a wide knowledge in the topic. What followed were a few meetings where we discussed a possible solution. </p>

<p>The complex set of requirements demands a hybrid solution for the data transfer (GPS coordinates) and Vocal transmission. So LARU proposed the following solution:</p>

<ul>
<li>APRS protocol for GPS coordinates</li>
<li>DMR for vocal</li>
</ul>

<p>Having the protocols defined for sending and receiving the data, we following solution was proposed to transfer the data to all peers. The initial idea was the following: <br>
In the first phase we would deploy an antenna in an elevated position (EPA) which will cover most of the terrain. A communication is established between the command post (CP) and the Antenna (EPA). The people working in the field (WRK) should not be have additional heavy equipment with them. For this reason the boats (BOT) will act as repeaters.</p>

<p><img src="http://keepsbusy.azurewebsites.net/content/images/2015/12/Schema.png" alt=""></p>

<p>The WRK act in pairs. One will have the handle the radio, the other will be equipped with the TinyTrack. The indicated setup ensures that area is always fully covered. </p>

<p>In a more advanced setup, the boats would have a small server which would temporary store the data if the communication with the EPA would get lost.</p>

<p>Time to setup: 1 hour <br>
Equipment needed:</p>

<ul>
<li>EPA
o    APRS Repeater <br>
o    DMR Repeater  </li>
<li>CP
o    APRS Repeater <br>
o    DMR Repeater <br>
o    DMR mobile device (voice communication)  </li>
<li>BOT
o    Navigation Tool with APRS <br>
o    DMR mobile device (voice communication) <br>
o    Relais antenna  </li>
<li>WRK
o    TinyTrack <br>
o    DMR mobile device (voice communication)</li>
</ul>

<p>Now that we discussed how the communication is established, let’s see what we can display the data. </p>

<p>Next up: <a href="http://www.keepsmebusy.net/2015/12/15/busy-with-long-range-communication-software/">Tracking software</a></p>]]></content:encoded></item><item><title><![CDATA[Busy with Long Range Communication - Introduction]]></title><description><![CDATA[Establishing a voice and data communication with no LoS over 2 km. ]]></description><link>http://keepsbusy.azurewebsites.net/2015/12/15/busy-with-long-range-communication-introduction/</link><guid isPermaLink="false">28b373d6-701b-427f-a6c1-7447d036ab93</guid><category><![CDATA[Long Range Communication]]></category><category><![CDATA[emergency communication]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Tue, 15 Dec 2015 12:35:40 GMT</pubDate><content:encoded><![CDATA[<p>A special Team called HIT (Humanitarian Intervention Team) was created a few years ago by the Luxembourgish Government. The members of the HIT are sent abroad in areas where a natural disaster occurred to help with their expertise. One footprint of HIT is establishing communication via Satellite.</p>

<p>I’m trained in the area of Flood Rescue and Rescue Diver. So basically I'm sent out when there is an intervention in with water. During an intervention, communication between the members is very important. On an international intervention, parts of the countries communication systems were inactive due to the heavy rainfall. So we had no possibility to communicate with the teams in the field.</p>

<p>During this mission, I started to think of a solution. It should be a quickly deployable system which allows us to communicate on a long range. Exchanging with my teammates, I quickly gathered the following set of requirements which the system had to meet:</p>

<ul>
<li>Communication range more than 2 km</li>
<li>No Line of Sight</li>
<li>Easy to setup</li>
<li>Send GPS coordinates</li>
<li>Central management interface</li>
<li>Adaptable Frequencies for the Radiotelephone</li>
<li>Scalable</li>
<li>Inexpensive</li>
<li>Portable</li>
<li>Easy to Transport</li>
</ul>

<p>My first shot was to use Wifi as a medium to transmit data. Unfortunately, the range of the standard Wifi modules does not reach more than 1 km without LoS (Line of Sight).</p>

<p>Next up: <a href="http://www.keepsmebusy.net/2015/12/15/busy-with-long-range-communication-introduction/">Technical solution (still challenged)</a></p>]]></content:encoded></item><item><title><![CDATA[Busy with Apache Usergrid 1 on Microsoft Azure]]></title><description><![CDATA[This post explains how to clean install Apache Usergrid 1 on a Azure VM running on Ubuntu.]]></description><link>http://keepsbusy.azurewebsites.net/2015/09/28/busy-with-apache-usergrid/</link><guid isPermaLink="false">77c16367-a0f9-441d-82cf-b794483f8d25</guid><category><![CDATA[Apache Usergrid]]></category><category><![CDATA[Installation]]></category><category><![CDATA[Ubuntu]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Mon, 28 Sep 2015 15:27:33 GMT</pubDate><content:encoded><![CDATA[<p>Lately I was asked to analyze a "Back-end as a Service Tool" called Apache Usergrid (I will call it AU now). Well, first of all it runs on Linux OS (as a Microsoft guy, this was not very promising) with a Cassandra database (NoSQL) as back-end. AU is web based and runs in a Tomcat. For more information about AU, please visit <a href="http://usergrid.apache.org/">http://usergrid.apache.org/</a>.</p>

<p>AU requires technologies with which I have never worked so far. I spent a lot of time creating a clean installation procedure for myself so I decided to share my knowledge.</p>

<h6 id="azurevm">Azure VM</h6>

<p>For the setup I chose the image “Ubuntu Server 14.04 LTS” running on an "A3" machine (4 Cores, 7 GB RAM). <br>
Authentication type was set to “Password”. <br>
The IP was set to Fix.</p>

<p>Add the "Tomcat" End point: <br>
Public Port: 8080 <br>
Private port: 8080</p>

<h6 id="java">Java</h6>

<p>First of all, we need to install Java 8. (Call each line individually)  </p>

<pre><code>sudo add-apt-repository ppa:webupd8team/java  
sudo apt-get update  
sudo apt-get install oracle-java8-installer  
</code></pre>

<p>Accept the license agreement and continue installation. <br>
Make sure the Java 1.8 installed: <br>
<code>java -version</code>
-> has to 1.8</p>

<p>Now we need to add Java Home to the environment variables. <br>
<code>sudo nano /etc/environment</code></p>

<p>Add the following line at the end of the file <br>
<code>JAVA_HOME="/usr/lib/jvm/java-8-oracle"</code>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/SetJavaHome.png" alt="">
Ctrl+X to exit and Y to save file.</p>

<p>Load the file <code>source /etc/environment</code></p>

<p>Test: <code>echo $JAVA_HOME</code> <br>
The result should be "/usr/lib/jvm/java-8-oracle"</p>

<h6 id="tomcat">Tomcat</h6>

<p>Next up, lets install Tomcat: <br>
<code>sudo apt-get install tomcat7</code>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/TomcatFail.png" alt="">
Uups, something went wrong. We need to set the JAVA home path: <br>
<code>sudo nano /etc/default/tomcat7</code>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/UpdateTomcat.png" alt="">
uncomment line the #JAVA_HOME and set to "/usr/lib/jvm/java-8-oracle". <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/newTomcatConfig.png" alt="">
Restart the Tomcat <br>
<code>sudo service tomcat7 restart</code>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/TomcatRestart-1.png" alt=""></p>

<p>Open a browser and navigate to <a href="http://xxx.cloudapp.net:8080">http://xxx.cloudapp.net:8080</a>. The result should look similar to this: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/TomcatOK.png" alt=""></p>

<h6 id="cassandrafromhttpwikiapacheorgcassandradebianpackaging">Cassandra (from <a href="http://wiki.apache.org/cassandra/DebianPackaging">http://wiki.apache.org/cassandra/DebianPackaging</a>)</h6>

<p>AU requires Cassandra 1.2 to be installed. <br>
To do so, some additional steps need to be made: <br>
<code>sudo nano /etc/apt/sources.list</code></p>

<p>At the end, add the following 2 lines: <br>
deb <a href="http://www.apache.org/dist/cassandra/debian">http://www.apache.org/dist/cassandra/debian</a> 12x main <br>
deb-src <a href="http://www.apache.org/dist/cassandra/debian">http://www.apache.org/dist/cassandra/debian</a> 12x main <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/SourcelistCassandra.png" alt="">
Now we need to trust the new sources. (Call each line individually)  </p>

<pre><code>gpg --keyserver pgp.mit.edu --recv-keys F758CE318D77295D  
gpg --export --armor F758CE318D77295D | sudo apt-key add -

gpg --keyserver pgp.mit.edu --recv-keys 2B5C1B00  
gpg --export --armor 2B5C1B00 | sudo apt-key add -

gpg --keyserver pgp.mit.edu --recv-keys 0353B12C  
gpg --export --armor 0353B12C | sudo apt-key add -  
</code></pre>

<p>Now we are ready to install Cassandra:  </p>

<pre><code>sudo apt-get update  
sudo apt-get install cassandra  
</code></pre>

<h6 id="mavenfromhttpwwwmkyongcommavenhowtoinstallmaveninubuntu">Maven(from <a href="http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/">http://www.mkyong.com/maven/how-to-install-maven-in-ubuntu/</a>)</h6>

<p>AU needs to be compiled on the machine. For this purpose we will install Maven. <br>
<code>sudo apt-get install maven</code></p>

<p>The version should be above 3.0 <br>
<code>mvn -version</code></p>

<h6 id="apacheusergridpartlyfromhttpusergridapacheorgdocsinstallationug2deploytotomcathtmlandmanythankstojeffreywest">Apache Usergrid (partly from <a href="http://usergrid.apache.org/docs/installation/ug2-deploy-to-tomcat.html">http://usergrid.apache.org/docs/installation/ug2-deploy-to-tomcat.html</a> and many thanks to Jeffrey West)</h6>

<p>Finally Apache Usergrid can be installed. First of, we need to get the version 1.x from Git:  </p>

<pre><code>sudo apt-get install git git-core  
git clone -b 1.x https://github.com/apache/usergrid.git  
</code></pre>

<p>Update the configuration file and change the default username and password. <br>
<code>nano usergrid/stack/config/src/main/resources/usergrid-default.properties</code></p>

<blockquote>
  <p>It is very important to set login.allowed to "true"</p>
</blockquote>

<p>Press Ctrl+W and search for Admin. Update the default username and password. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/au_config.png" alt=""></p>

<p>Let's build the stack (Call each line individually)  </p>

<pre><code>cd  
cd usergrid/stack  
sudo mvn clean install -DskipTests  
</code></pre>

<p>During the build process a new file called ROOT.war was created. This file needs to be deployed in the root folder of Tomcat. The following lines will delete the current ROOT folder and copy the ROOT.war to the Tomcat server. By restarting Tomcat, the .war file is deployed. (Call each line individually)  </p>

<pre><code>cd  
sudo rm -R /var/lib/tomcat7/webapps/ROOT  
sudo cp usergrid/stack/rest/target/ROOT.war /var/lib/tomcat7/webapps/ROOT.war  
sudo service tomcat7 restart  
</code></pre>

<p>Now let's setup the database and user. Open a new browser and call the urls ONE BY ONE. (These commands take some time to complete). <br>
<a href="http://xxxxxx.cloudapp.net:8080/system/database/setup">http://xxxxxx.cloudapp.net:8080/system/database/setup</a> (where xxxxxx is the servername) <br>
<a href="http://xxxxxx.cloudapp.net:8080/system/superuser/setup">http://xxxxxx.cloudapp.net:8080/system/superuser/setup</a> (where xxxxxx is the servername)</p>

<p>You should get a status OK. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/install_ok.png" alt=""></p>

<h6 id="apacheusergridportal">Apache Usergrid Portal</h6>

<p>The admin portal really helps you configuring and working with AU. Follow these steps to compile and deploy the admin portal.</p>

<p>First we need to get a few sources:  </p>

<pre><code>sudo apt-get install nodejs-legacy  
sudo apt-get install npm  
sudo apt-get install phantomjs  
</code></pre>

<p>Let's compile the portal (this takes some time).  </p>

<pre><code>cd usergrid/portal  
sudo ./build.sh -dev  
</code></pre>

<p>Let's deploy the admin portal. Basically we copy the .jar file to the Tomcat server, extract the .jar file and copy the content into the new portal folder. (Call each line individually)  </p>

<pre><code>cd

sudo cp usergrid/portal/dist/usergrid-portal.tar /var/lib/tomcat7/webapps/usergrid-portal.tar

cd /var/lib/tomcat7/webapps  
sudo tar -xvf usergrid-portal.tar  
sudo mkdir portal  
sudo mv usergrid-portal.2.0.17/* portal  
sudo rm -R usergrid-portal.2.0.17  
</code></pre>

<h6 id="additonnalconfigurations">Additonnal configurations</h6>

<p>After having deployed the admin portal, some additional configurations need to be done. Please execute the following commands from the Tomcat webapps directory:  </p>

<pre><code>cd portal  
sudo nano config.js  
</code></pre>

<p>Update the usergrid.overrideUrl from localhost to the Azure servername: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/09/overrdide.png" alt="">
where xxxxx is the DNS server name.</p>

<p>Restart Tomcat <code>sudo service tomcat7 restart</code></p>

<p>Open the your browser at the following URL: <a href="http://xxxxxxxx.cloudapp.net:8080/portal">http://xxxxxxxx.cloudapp.net:8080/portal</a></p>

<blockquote>
  <p>This kept me busy for 20 hours</p>
</blockquote>]]></content:encoded></item><item><title><![CDATA[Busy with Post and PlayStation Network]]></title><description><![CDATA[<p>This post is was written for users from Luxembourg with Post (post.lu) as their internet provider. The router used is Fritzbox.</p>

<p>Lately I wanted to play Diablo on my PlayStation4 with my friend via PlayStation Network. After buying a “PlayStation Plus” membership, I thought that I was ready to</p>]]></description><link>http://keepsbusy.azurewebsites.net/2015/08/29/busy-with-post-and-playstation-network/</link><guid isPermaLink="false">c79dc176-7227-446f-9d0a-b59be55a2f8a</guid><category><![CDATA[POST.LU]]></category><category><![CDATA[PlayStation4]]></category><category><![CDATA[Fritzbox]]></category><category><![CDATA[NAT Type 3]]></category><category><![CDATA[NAT 3]]></category><category><![CDATA[NAT 3 to NAT 2]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Sat, 29 Aug 2015 13:44:10 GMT</pubDate><content:encoded><![CDATA[<p>This post is was written for users from Luxembourg with Post (post.lu) as their internet provider. The router used is Fritzbox.</p>

<p>Lately I wanted to play Diablo on my PlayStation4 with my friend via PlayStation Network. After buying a “PlayStation Plus” membership, I thought that I was ready to go. Well, far from that. My friend and I were not able to join each other game. We spend quite some time configuring our PlayStation settings and modifying the router settings (I thought it was a firewall issue so I removed all firewall rules for the PlayStation).</p>

<p>On the internet there are a lot of posts describing this issue with different approaches to solve it. The first good hint was a guy how asked if the voice chat on PlayStation party works.</p>

<blockquote>
  <p>Quick Hint</p>
  
  <p>Create a PlayStation party with voice chat. If you cannot hear your friend, the problem is network related. PlayStation System should give you a hint on how to solve the issue.</p>
</blockquote>

<p>So we created a party and tried to voice chat with each other. Very soon after the creation of the party the PlayStation popped a notification citing that the communication cannot be established due to a NAT issue.</p>

<p>Now we had a track. I went to the PlayStation Settings, Network and executed a “Test Internet Connection”. After the test execution succeeded I had a screen similar to this one: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/08/NAT3.png" alt="">
There it is. NAT type 3. Here PlayStation Statement on NAT 3 connection: <br>
“With Type 3, communication with other PS4™ systems might be impossible, or the PS4™ system's network features might be limited.”</p>

<blockquote>
  <p>Quick Hint</p>
  
  <p>By testing your internet connection via PlayStation 4 you will get the NAT type. If the NAT type is 3, a connection with PlayStation Network is not possible. Thus, you cannot join your friend’s party.</p>
</blockquote>

<p>Now I knew what I have to search for. Very quickly I found a post in the PlayStation forum where a user has the exact same issue as my friend and I do.</p>

<p>The user Obiwan_Kenoby explained that the issue is network related. In fact, the Luxembourgish Post network is IPv6 while the connection to the PlayStation servers is still IPv4. The additional translation from IPv6 to IPv4 takes some time which leads to a NAT of type 3.</p>

<p>The user in the forum (ESCORT-RS2000) said that there is an additional modification which needs to be done on the Post.lu site. So I contacted a friend of mine asking if the “IPv6 to IPv4” translation really needs to be done. </p>

<p>He confirmed and told me that for changing the NAT Type from 3 to 2 a setting on the post network has to be changed. I should go to <a href="https://www.luxfibre.lu/portal">https://www.luxfibre.lu/portal</a> and from where I can change the setting. ATTENTION: This options costs 1.99€/month.</p>

<p>The setting is active within 10 minutes. The NAT Type should now by NAT 2 and you should be able play over the PlayStation network with your friend.</p>

<blockquote>
  <p>At A glance</p>
  
  <ul>
  <li><p>Check your NAT Type (Nat type 2 is needed)</p></li>
  <li><p>Go to <a href="https://www.luxfibre.lu/portal">https://www.luxfibre.lu/portal</a></p></li>
  <li><p>Activate the IPv4 setting (ATTENTION: 1.99 €/month)</p></li>
  </ul>
</blockquote>

<p>If you have any questions, just leave a comment.</p>

<blockquote>
  <p>This kept me busy: 150 minutes</p>
</blockquote>

<p>References <br>
Nat3 image from: <a href="http://www.ps3hax.net/tag/skfu/">http://www.ps3hax.net/tag/skfu/</a> <br>
PlayStation Statement: <a href="http://manuals.playstation.net/document/en/ps4/settings/nw_test.html">http://manuals.playstation.net/document/en/ps4/settings/nw_test.html</a> <br>
PlayStation forum: <a href="http://community.eu.playstation.com/t5/PS4-Support/Ps4-nat-typ-fritzbox-7390/td-p/22151521">http://community.eu.playstation.com/t5/PS4-Support/Ps4-nat-typ-fritzbox-7390/td-p/22151521</a></p>]]></content:encoded></item><item><title><![CDATA[Busy scription stored procedures and database role permissions]]></title><description><![CDATA[<p>This post provides an alternative script for exporting stored procedures with their dependencies. All you need to do is providing the role name, the destination database name and the destination username.</p>

<blockquote>
  <p>Techi Info</p>
  
  <p>I could have made the script way smaller using less cursors. But keeping the script on such</p></blockquote>]]></description><link>http://keepsbusy.azurewebsites.net/2015/08/03/busy-setting-up-permissions-on-sql-azure-stored-procedures/</link><guid isPermaLink="false">072deb11-15ea-4859-9e50-cf430b14379a</guid><category><![CDATA[T-SQL Security]]></category><category><![CDATA[T-SQL Dependencies]]></category><category><![CDATA[T-SQL Stored Procedures]]></category><category><![CDATA[T-SQL Database role]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Mon, 03 Aug 2015 18:35:05 GMT</pubDate><content:encoded><![CDATA[<p>This post provides an alternative script for exporting stored procedures with their dependencies. All you need to do is providing the role name, the destination database name and the destination username.</p>

<blockquote>
  <p>Techi Info</p>
  
  <p>I could have made the script way smaller using less cursors. But keeping the script on such a granular level will help you understanding and customizing it.</p>
</blockquote>

<pre><code>DECLARE @sSourceRoleName nvarchar(75)  
DECLARE @sDestinationUser nvarchar(75)  
DECLARE @sDestinationDBName nvarchar(50)


SET @sSourceRoleName = 'demoRole'  
SET @sDestinationUser = 'myUser'  
SET @sDestinationDBName = 'SCRIPT_TEST'  
------------------------------------------------------------------------
--hide the numbers
SET NOCOUNT ON  
----- Declarations
DECLARE @sSPName NVARCHAR(150)  
DECLARE @sCurrentLine NVARCHAR(150)  
--create temp tables to store the SPs
CREATE TABLE #tSPNames ( sSPName nvarchar(150), bDirect bit)  
CREATE TABLE #tSPData ( sSPLines nvarchar(250))  
-----------------------------------------------get the stored procedures to extract----------------------------------------
--insert the sps into the temp table
INSERT INTO #tSPNames  
SELECT DISTINCT spname.name, 1  
FROM   sys.database_principals prinicipals  
INNER JOIN sys.database_permissions db_perm ON db_perm.grantee_principal_id = prinicipals.principal_id  
LEFT JOIN sys.objects spname ON db_perm.[major_id] = spname.[object_id]  
WHERE  prinicipals.name = @sSourceRoleName  
AND spname.type = 'P' -- limit to stored procedures  
UNION  
SELECT DISTINCT referenced_entity_name, 0  
FROM sys.sql_expression_dependencies AS sed  
INNER JOIN sys.objects AS o ON sed.referencing_id = o.object_id  
WHERE referencing_id IN (SELECT DISTINCT OBJECT_ID(spname.name)  
                        FROM   sys.database_principals prinicipals 
                        INNER JOIN sys.database_permissions db_perm ON db_perm.grantee_principal_id = prinicipals.principal_id 
                        LEFT JOIN sys.objects spname ON db_perm.[major_id] = spname.[object_id] 
                        WHERE  prinicipals.name = @sSourceRoleName
                        AND spname.type = 'P') -- limit to stored procedures

-- *********************************************************************************************************************
--------------------------------------------- get the stored procedures content----------------------------------------
DECLARE c_spcursor CURSOR FOR  
SELECT sSPName  
FROM #tSPNames

OPEN c_spcursor  
FETCH NEXT FROM c_spcursor INTO @sSPName 

WHILE @@FETCH_STATUS = 0  
BEGIN  
    --storing the stored procedure content in a table
    INSERT INTO #tSPData
    exec sp_helptext @sSPName

    --insert new line and spaces
    INSERT INTO #tSPData
    SELECT 'GO'
    UNION
    SELECT ''
    UNION
    SELECT ''
    FETCH NEXT FROM c_spcursor INTO @sSPName  
END  

CLOSE c_spcursor  
DEALLOCATE c_spcursor  
-- *********************************************************************************************************************
PRINT 'USE '+@sDestinationDBName  
PRINT 'GO'  
PRINT ''  
-------------------------------------------- Produce the sp output----------------------------------------
DECLARE c_spcursor CURSOR FOR  
SELECT sSPLines  
FROM   #tSPData

OPEN c_spcursor  
FETCH NEXT FROM c_spcursor INTO @sCurrentLine 

WHILE @@FETCH_STATUS = 0  
BEGIN  
    PRINT @sCurrentLine 
    FETCH NEXT FROM c_spcursor INTO @sCurrentLine  
END  

CLOSE c_spcursor  
DEALLOCATE c_spcursor  
-- *********************************************************************************************************************
-------------------------------------------- Add the sp permissions----------------------------------------
PRINT 'CREATE ROLE '+@sSourceRoleName+' AUTHORIZATION '+@sDestinationUser+';'

DECLARE c_spcursor CURSOR FOR  
SELECT sSPName  
FROM #tSPNames  
WHERE bDirect = 1

OPEN c_spcursor  
FETCH NEXT FROM c_spcursor INTO @sSPName 

WHILE @@FETCH_STATUS = 0  
BEGIN  
    --storing the stored procedure content in a table
    PRINT 'GRANT EXECUTE ON '+@sSPName+ ' TO '+@sSourceRoleName
    PRINT 'GO'
    FETCH NEXT FROM c_spcursor INTO @sSPName  
END  

CLOSE c_spcursor  
DEALLOCATE c_spcursor  
-- *********************************************************************************************************************
--Cleanup
DROP TABLE #tSPData  
DROP TABLE #tSPNames  
</code></pre>

<blockquote>
  <p>This kept me busy for: 60 minutes</p>
</blockquote>

<p>Up next: Connecting from C# Windows App to SQL Azure</p>

<p>References <br>
Getting the stored procedures linked to database role: <a href="http://dba.stackexchange.com/questions/36618/list-all-permissions-for-a-given-role">http://dba.stackexchange.com/questions/36618/list-all-permissions-for-a-given-role</a> by elgabito <br>
Creating a cursor: <a href="https://www.mssqltips.com/sqlservertip/1599/sql-server-cursor-example/">https://www.mssqltips.com/sqlservertip/1599/sql-server-cursor-example/</a> <br>
Getting the sql dependencies: <a href="https://msdn.microsoft.com/en-us/library/ms345404.aspx">https://msdn.microsoft.com/en-us/library/ms345404.aspx</a></p>]]></content:encoded></item><item><title><![CDATA[Busy with importing database schema to Azure SQL]]></title><description><![CDATA[<p>This post explains how to export a local database and import it to SQL Azure.</p>

<p>Having setup the SQL Azure database and established a connection using “SQL Server Management Tool” (SSMS), I know want to import the database schema from my local database. The simplest way for me was to</p>]]></description><link>http://keepsbusy.azurewebsites.net/2015/07/25/busy-with-importing-database-schema-to-azure-sql/</link><guid isPermaLink="false">9848554b-d4b1-48f5-8df4-93a53054374c</guid><category><![CDATA[SQL Azure import]]></category><category><![CDATA[SQL Security]]></category><category><![CDATA[Database Roles]]></category><category><![CDATA[Stored Procedure Permissions]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Sat, 25 Jul 2015 16:14:22 GMT</pubDate><content:encoded><![CDATA[<p>This post explains how to export a local database and import it to SQL Azure.</p>

<p>Having setup the SQL Azure database and established a connection using “SQL Server Management Tool” (SSMS), I know want to import the database schema from my local database. The simplest way for me was to use the “Generate Scripts” option. But first, let's check one security model of Microsoft SQL. <br>
I manage all the security of my database objects with “Database Roles”.</p>

<p><img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/DatabaseRole.png" alt=""></p>

<p>All my applications which connect to a database have their dedicated “Database Role”. While creating the “Database role”, you grant permissions to one or more users (SQL Users or Active Directory Users).</p>

<pre><code>CREATE ROLE DiveApp AUTHORIZATION sqlUserDiver
</code></pre>

<p>I never give the user direct access to a table. Either create a view or a stored procedure. In this example I created a stored procedure called sp<em>getAllBoats</em>001.</p>

<pre><code>Grant exec ON sp_getAllBoats_001 TO DiveApp
</code></pre>

<p>The stored procedure sp<em>getAllBoats</em>001 performs a SELECT on the table “BOATS”. The user “sqlUserDiver” is now allowed to execute the stored procedure but he still doesn’t see the table “BOATS”.</p>

<p>Now let’s export the data from our local database and import it to SQL Azure. First thing to do is connecting via SSMS on our local SQL instance. Right-Click on the database you want to export and navigate to “Tasks” -> “Generate Scripts”: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/GenerateScripts.png" alt="">
On the “Introduction Screen” press “Next>”. <br>
In the “Choose Objects” Screen I selected all the available Objects and pressed “Next>”: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/AllObjects.png" alt="">
In the “Set Scripting Options” Screen press “Advanced”: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/ScriptAdvanced.png" alt="">
This screen gives you more advanced options to what to export. The modifications I made are in the red boxes: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/advancedselection.png" alt="">
What I usually do is exporting the script to a new query windows. This allows me to quickly check it. Select the option “Save to new query window” to do so: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/newQueryWindow.png" alt="">
When you press “Next>” you get a summary of the export. Pressing “Next>” again will then trigger the export. <br>
When the script generation completed a new query window opened. Press “Finish” to close the dialog.  </p>

<blockquote>
  <p>Always take your time to review the script before deploying them!</p>
</blockquote>

<p>Now comes the deployment to SQL Azure part. Here is how to proceed: <br>
1)    Copy the script you just created (Ctrl + A, Ctrl + C) <br>
2)    Open SSMS and connect to your Azure SQL Server Instance <br>
3)    Press “New Query” and select the database into which you want to deploy the script <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/scriptdeploy.png" alt="">
4)    Paste the script in the Query Window and Press “F5” (this will execute the script)</p>

<p>Now that you imported the data and schema to SQL Azure, we still need to adapt the permissions of the SQL Stored procedures. In the next blog I explain how to set the permissions for all the Stored Procedures via script.</p>

<blockquote>
  <p>This kept me busy for: 5 minutes</p>
</blockquote>

<p>Up next: <a href="http://www.keepsmebusy.net/2015/08/03/busy-setting-up-permissions-on-sql-azure-stored-procedures/">Busy setting SQL Permissions via Script</a></p>]]></content:encoded></item><item><title><![CDATA[Busy with Outlook and Post.lu]]></title><description><![CDATA[Configuration de Outlook avec Post.lu
POP.PT.LU SMTP.PT.LU
]]></description><link>http://keepsbusy.azurewebsites.net/2015/07/19/busy-with-outlook-and-post-lu/</link><guid isPermaLink="false">439eaafa-1df6-4d15-9ae1-a15668ae1861</guid><category><![CDATA[PT.LU]]></category><category><![CDATA[POST.LU]]></category><category><![CDATA[Outlook 2013]]></category><category><![CDATA[SMTP]]></category><category><![CDATA[POP3]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Sun, 19 Jul 2015 21:10:52 GMT</pubDate><content:encoded><![CDATA[<p>A few days ago I needed to configure Microsoft Outlook 2013 with Post.lu mail. So I started looking for the configuration using my friend Google but strangely I did not find a useful setup page (Maybe my googling skills are not as good as I think they are). I was busy for quite some time to configure it so I decided to provide a small guide.</p>

<p>First of all open Outlook and select the “Add a new account”. In the opening screen, please choose “Manual setup or additional server types” <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/landingpage.png" alt=""></p>

<p>Enter your username and your e-mail address. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/username.png" alt="">
Choose account type POP3 and provide the URLs listed below: <br>
POP3 server: pop.pt.lu <br>
SMTP server: smtp.pt.lu <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/ServerINfo.png" alt="">
Enter the logon information and tick “Remember password” <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/Logogn.png" alt=""></p>

<blockquote>
  <p>Please use the "Identifiant" provided by post.lu.</p>
</blockquote>

<p>In the new windows select the “Outgoing Server” tab and check the “My outgoing server (SMTP) requires authentication”. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/smtp.png" alt="">
Select the Advanced Tab and set the POP3 to 995 and check the box “This server requires an encrypted connection (SSL))”. <br>
Leave the SMTP to 25 but select “TLS” in “Use the following type of encrypted connections:”. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/2015-07-19-22_55_17-Post.png" alt="">
When done, Press “OK”.</p>

<p>Make sure everything works fine by pressing the “Test Account settings…” button: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/test.png" alt="">
The screen should look like this after a few moments: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/OK.png" alt=""></p>

<p>By pressing next you finish the setup. Well done.</p>

<blockquote>
  <p>This kept me busy for: 30 minutes</p>
</blockquote>]]></content:encoded></item><item><title><![CDATA[Busy with the Azure Database]]></title><description><![CDATA[This post explains how to setup a connection between SSMS and a SQL Azure Database]]></description><link>http://keepsbusy.azurewebsites.net/2015/07/18/busy-with-the-azure-database/</link><guid isPermaLink="false">c2fab775-98f0-4220-9e47-c57807a373fd</guid><category><![CDATA[SQL Azure Setup]]></category><category><![CDATA[Microsoft]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Sat, 18 Jul 2015 12:26:37 GMT</pubDate><content:encoded><![CDATA[<p>This post explains how to setup a SQL Azure database.</p>

<p>Being a complete newbie to Microsoft Azure, I wanted to see how long I will be busy to get my application to work with the new Azure Database.</p>

<p>First things first, let’s press the “+ New” button and search select "Data + Storage". Then select "SQL Database". From there, select "SQL Database".</p>

<p>The easiest part is the Name. Simply provide the Database name you would like. <br>
Now select the Server. If you haven’t created a server yet or you want an additional server, hit on “Create a new server”.  </p>

<blockquote>
  <p>Be careful with the server admin login and password. You will need it a lot afterwards.</p>
</blockquote>

<p><img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/newDBServer.png" alt=""></p>

<p>Select a blank data source and choose the Pricing Tier which suits your needs. When all done, press create: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/CreateDB.png" alt=""></p>

<p>Creating the SQL database will take a few minutes.</p>

<blockquote>
  <p>Techi Info</p>
  
  <p>When creating a new Database in SQL Azure the mighty Wizard asks for a “Server”. So what happens when you choose“New SQL Database Server”?</p>
  
  <p>First of all, a new SQL Server is created. Yes, you get your own <a href="http://azure.microsoft.com/blog/2012/06/26/data-series-sql-server-in-windows-azure-virtual-machine-vs-sql-database/">Logical DB server</a> and you don’t have any hardware maintenance. After the SQL Server has been created the database is created on your server.</p>
</blockquote>

<p>What is the best SQL server in the world when you do not know how to connect to it? <br>
At this point I want to point out the great job Microsoft did with Azure SQL. I use the same tool I’m using when working with my local SQL: SQL Server Management Studio (SSMS). <em>no additional tools/updates required</em></p>

<p>To connect to any database, you need a SQL connection string. To get yours go to “All Resources” and select the Database you just created. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/Allresources.png" alt="">
A new window will open to your right. In this window, copy the “Server Name” <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/ConnectionString.png" alt="">
Having the SQL connection string copied, open SSMS (SQL Server Management Studio). In SSMS, paste the SQL Connection String into the server name followed by “,1433” and choose “SQL Server Authentication”. Interesting fact is that you can simply add the port to the connection string. <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/SSMSCOnnect.png" alt=""></p>

<blockquote>
  <p>Login and password are those provided during the creation process.
  Do not forget to add the Port ",1433" to the server name.</p>
</blockquote>

<p>Now press “Connect” and BANG a wild error message appears: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/ErrorMessage.png" alt=""></p>

<blockquote>
  <p>Cannot open server 'mynewdemodbserver' requested by the login. Client with IP address 'xxx.xx.xx.xx.xx.’ is not allowed to access the server. To enable access, use the Windows Azure Management Portal or run sp<em>set</em>firewall_rule on the master database to create a firewall rule for this IP address or address range. It may take up to five minutes for this change to take effect. (Microsoft SQL Server, Error: 40615)</p>
</blockquote>

<p>To fix this, go back the Azure Portal and select “All Resources”. In the list, select the <strong>SERVER</strong> you created in the previous point. The server is marked with a little gearwheel in the database icon: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/dbconnect.png" alt="">
In the opening window to the right, press on “Show firewall settings”: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/ShowFirewallsettings.png" alt="">
A new window will again open to your right. On the Action Pane, press on the “Add Client IP” button: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/AddClientIP.png" alt="">
If you have a dynamic IP address (which is mostly always the case for home users), change the “Rule Name” to “Home”. This will help you identify the IP address to delete as soon as your IP address has changed. Now press <strong>Save</strong>: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/saveaddress.png" alt=""></p>

<blockquote>
  <p>Techi Info</p>
  
  <p>The “Allow access to Azure services” allows other applications hosted in Azure to connect to the database server.</p>
</blockquote>

<p>Now return to SSMS and press Connect. Your result should be similar to this one: <br>
<img src="http://keepsbusy.azurewebsites.net/content/images/2015/07/resultdb.png" alt=""></p>

<blockquote>
  <p>This kept me busy for: 15 minutes</p>
</blockquote>

<p>Up next: <a href="http://www.keepsmebusy.net/2015/07/25/busy-with-importing-database-schema-to-azure-sql/">Busy with importing database schema to Azure SQL</a></p>]]></content:encoded></item><item><title><![CDATA[First days Busy with Azure]]></title><description><![CDATA[Azure SQL Cloud Services ]]></description><link>http://keepsbusy.azurewebsites.net/2015/07/18/first-days-busy-with-azure/</link><guid isPermaLink="false">58b9544f-37b6-46b2-afd1-c7c4c891b7f0</guid><category><![CDATA[Azure]]></category><category><![CDATA[SQL]]></category><category><![CDATA[Cloud Services]]></category><category><![CDATA[Microsoft]]></category><dc:creator><![CDATA[Jeppen]]></dc:creator><pubDate>Sat, 18 Jul 2015 11:59:16 GMT</pubDate><content:encoded><![CDATA[<p>In this series of posts I describe how Azure initially kept me busy.</p>

<p>A friend of mine asked me to develop a small application which would help him creating dive plans. As usual, the deadline was very short (I would have about 3 days to develop the application) and the end user would be located 800 km away from my home. (So no quick drive to check on the user’s issue).</p>

<p>Due to the type of data the application processes and how the data is visualized, I decided to use a database. So after the 3 days, I proudly presented the STABLE (that kept me busy) application to my friend. You can imagine what happens next. The typical “Wouldn’t it be nice if…”. Or in other words, the application does what I requested, but now I want something “slightly” different.</p>

<p>My plan was to install the MS SQL Express edition on the end-users PC. Due to the last minute changes (and my good nature), I had to find a new solution. The most of have heard and read a lot about cloud services but maybe never used them. So I decided to try these “Cloud Services” and see where what they can do.</p>

<p>Being a Microsoft Developer, my choice of “Cloud Services” was Azure. My first impression after the signup was: “Well, there are a lot of possibilities”. My primary focus was getting an SQL database to work. At that precise moment I had my first WOW moment with Azure. Being a developer for 14 years and having installed/configured numerous SQL instances, I <strong>NEVER</strong> had an SQL instance this quick up and running.</p>

<p>But getting an instance up and running is only part of the cookie. I needed to get the SQL schema and data to the Azure SQL database. At that time I was a completely newbie to Azure so I chose my standard approach when working with new Technology: “Try and Error”.</p>

<blockquote>
  <p>This kept me busy for: 10 minutes</p>
</blockquote>

<p>Up next: <a href="http://www.keepsmebusy.net/2015/07/18/busy-with-the-azure-database/">Busy with the Azure Database</a></p>]]></content:encoded></item></channel></rss>