<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: jeromesch</title>
    <description>The latest articles on DEV Community by jeromesch (@jeromesch).</description>
    <link>https://dev.to/jeromesch</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F646428%2F423eec35-8205-44cd-9910-001e75093cf8.jpeg</url>
      <title>DEV Community: jeromesch</title>
      <link>https://dev.to/jeromesch</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jeromesch"/>
    <language>en</language>
    <item>
      <title>How to set up Postman to troubleshoot Google API</title>
      <dc:creator>jeromesch</dc:creator>
      <pubDate>Thu, 20 Jan 2022 15:38:33 +0000</pubDate>
      <link>https://dev.to/jeromesch/how-to-set-up-postman-to-troubleshoot-google-api-2a10</link>
      <guid>https://dev.to/jeromesch/how-to-set-up-postman-to-troubleshoot-google-api-2a10</guid>
      <description>&lt;p&gt;&lt;strong&gt;FAQ:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;&lt;em&gt;Why are we using the Google API?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We're trying to automate the Usermanagment such as Roles in the Company, Calendar Events, Groups, Chatrooms&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;In which cases does it make sense to use the Google API?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In every case the Google API offers a solution (and you want to automate)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;What is an Oauth 2.0 Token?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;OAuth 2.0 is an authorization protocol and NOT an authentication protocol. As such, it is designed primarily as a means of granting access to a set of resources, for example, remote APIs or user’s data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Starting off with POSTMAN &lt;/p&gt;

&lt;p&gt;How to generate an OAuth 2.0 token:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Ensure that the Google APIs are enabled
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Go to the API Console.
Select a project or create a new one.
Select APIs &amp;amp; services
Select Library
Click the API you want to enable
Click ENABLE.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create an OAuth 2.0 client ID
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Go to Google Console 
-&amp;gt; API 
-&amp;gt; OAuth consent screen
Add `getpostman.com` to the Authorized domains.
Click Save.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Go to Google Console 
-&amp;gt; API 
-&amp;gt; Credentials
Click 'Create credentials' 
-&amp;gt; OAuth client ID 
-&amp;gt; Web application
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Name: 'getpostman'&lt;/code&gt;&lt;br&gt;
Authorized redirect URIs: &lt;a href="https://www.getpostman.com/oauth2/callback" rel="noopener noreferrer"&gt;https://www.getpostman.com/oauth2/callback&lt;/a&gt;&lt;br&gt;
Copy the generated Client ID and Client secret fields for later use&lt;br&gt;
In Postman select Authorization tab and select "OAuth 2.0" type. &lt;br&gt;
Click 'Get New Access Token'&lt;/p&gt;

&lt;p&gt;Fill the GET NEW ACCESS TOKEN form as following&lt;br&gt;
&lt;code&gt;Token Name: 'Google OAuth getpostman'&lt;/code&gt;&lt;br&gt;
Grant Type: 'Authorization Code'&lt;br&gt;
Callback URL: &lt;code&gt;https://www.getpostman.com/oauth2/callback&lt;/code&gt;&lt;br&gt;
Auth URL: &lt;code&gt;https://accounts.google.com/o/oauth2/auth&lt;/code&gt;&lt;br&gt;
Access Token URL: &lt;code&gt;https://accounts.google.com/o/oauth2/token&lt;/code&gt;&lt;br&gt;
Client ID: &lt;code&gt;Client ID generated in the step 2 (also shown in downloadable JSON)&lt;/code&gt;&lt;br&gt;
Client Secret: &lt;code&gt;Client secret generated in the step 2 (also shown in downloadable JSON)&lt;/code&gt;&lt;br&gt;
Scope: see the Google docs for the required OAuth scope (e.g., &lt;code&gt;https://www.googleapis.com/auth/cloud-platform&lt;/code&gt;)&lt;br&gt;
State: -&lt;br&gt;
Client Authentication: &lt;code&gt;"Send as Basic Auth header"&lt;/code&gt;&lt;br&gt;
Click &lt;code&gt;'Request Token' and 'Use Token'&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The generated Token is only usable for the Scope you intended it to be. If you need another Scope you might want to Request another token. Otherwise you might face access right problems.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Far6wc7zpwd3cm42ks9q1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Far6wc7zpwd3cm42ks9q1.png" alt="Picture of the inserted Data in Postman"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Usefull Links for API Documentations:&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Google Projects and Userroles (GCP):&lt;br&gt;
&lt;a href="https://cloud.google.com/iam/docs/viewing-grantable-roles" rel="noopener noreferrer"&gt;https://cloud.google.com/iam/docs/viewing-grantable-roles&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Manage Google Users (GW):&lt;br&gt;
&lt;a href="https://developers.google.com/admin-sdk/directory/v1/guides/manage-users" rel="noopener noreferrer"&gt;https://developers.google.com/admin-sdk/directory/v1/guides/manage-users&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Add Members to Groups:&lt;br&gt;
&lt;a href="https://developers.google.com/admin-sdk/directory/v1/guides/manage-group-members" rel="noopener noreferrer"&gt;https://developers.google.com/admin-sdk/directory/v1/guides/manage-group-members&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>googlecloud</category>
      <category>webdev</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to recover the firmware of a NAS</title>
      <dc:creator>jeromesch</dc:creator>
      <pubDate>Wed, 01 Dec 2021 11:46:53 +0000</pubDate>
      <link>https://dev.to/jeromesch/how-to-recover-the-firmware-of-a-nas-4nb</link>
      <guid>https://dev.to/jeromesch/how-to-recover-the-firmware-of-a-nas-4nb</guid>
      <description>&lt;h1&gt;
  
  
  QNAP Firmware Recovery
&lt;/h1&gt;

&lt;h2&gt;
  
  
  Check Hardware
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Turn Off NAS.&lt;/li&gt;
&lt;li&gt;Unplug Harddrives.&lt;/li&gt;
&lt;li&gt;Use HDMI / USB plugs to control the nas manualy. 
(Keyboard / Mouse / Monitor)&lt;/li&gt;
&lt;li&gt;Turn On NAS.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If the Bios won't boot without Harddrives the internal storage most likely has a Problem. &lt;/p&gt;

&lt;p&gt;A.) This might be the case if you just updated the Firmware Version&lt;/p&gt;

&lt;p&gt;B.) or the Hardware might be broken.&lt;/p&gt;

&lt;p&gt;In Case B you can just send in the NAS and get a new one since the internal Storage is soldered. (Sh*t happens)&lt;/p&gt;

&lt;p&gt;If the BIOS boots up, check the Harddrives.&lt;br&gt;
Unusual that both Harddrives break at the same time, but &lt;em&gt;just in case..&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;If the BIOS shows &lt;code&gt;"Uncompressing Linux..."&lt;/code&gt; tries to bring up the DOM. &lt;/p&gt;

&lt;p&gt;In general thats a good sign, if it keeps beeing stuck there thats a bid sign. Means we need to fix the DOM.&lt;/p&gt;
&lt;h2&gt;
  
  
  Recover DOM
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Make a bootable USB Stick
&lt;/h3&gt;

&lt;p&gt;Download unetbootin utility &amp;amp; the matching iso for your NAS&lt;/p&gt;

&lt;p&gt;Unetbootin: &lt;a href="http://unetbootin.sourceforge.net/"&gt;http://unetbootin.sourceforge.net/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;DSL: &lt;a href="http://distro.ibiblio.org/damnsmall/current/dsl-4.4.10-initrd.iso"&gt;http://distro.ibiblio.org/damnsmall/current/dsl-4.4.10-initrd.iso&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DSL = "DAMN SMALL LINUX"&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Plug in USB Stick and format (Min. 1 GB / Fat32)&lt;/p&gt;

&lt;p&gt;Install Software (unetbootin) and pick "Damn Small Linux" in Distro.&lt;/p&gt;

&lt;p&gt;Flash the USB Stick the System/Distro&lt;/p&gt;

&lt;p&gt;&lt;em&gt;little excourse&lt;/em&gt;&lt;br&gt;
Download the &lt;strong&gt;right&lt;/strong&gt; System Image&lt;/p&gt;

&lt;p&gt;in my case:&lt;br&gt;
System Image (TS-251+)&lt;br&gt;
TS-x51+ Series&lt;br&gt;
(where the 'X' stands for the amount of installable hard drives)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://eu1.qnap.com/Storage/tsd/fullimage/F_TS-X51_20150605-1.3.0.img&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Copy the image to the &lt;code&gt;root&lt;/code&gt; folder of the usb stick and rename the file to &lt;code&gt;dom.img&lt;/code&gt;.&lt;/p&gt;
&lt;h3&gt;
  
  
  Use USB Stick to repair the DOM
&lt;/h3&gt;

&lt;p&gt;1.Turn Off NAS.&lt;br&gt;
2.Unplug Harddrives.&lt;br&gt;
3.Use HDMI / USB plugs to control the nas manualy. &lt;br&gt;
(Keyboard / Mouse / Monitor)&lt;br&gt;
4.Turn On NAS &amp;amp; Press &lt;code&gt;F2&lt;/code&gt; or &lt;code&gt;DEL&lt;/code&gt; on StartUp&lt;br&gt;
5.Choose the USB flash drive as boot device &lt;br&gt;
(If there are 2 USB Boot devices, &lt;em&gt;dont choose&lt;/em&gt; “USB DISK MODULE PMAP”)&lt;/p&gt;

&lt;p&gt;Open Command Line &lt;code&gt;Ctrl + Alt + Del&lt;/code&gt;&lt;br&gt;
and enter the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo su
fdisk –l
/dev/sda (should be your flash drive)
/dev/sdb or /dev/hda (should be your DOM drive)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Size should be 128 MB or 512 MB&lt;/p&gt;

&lt;p&gt;after understanding that, we follow with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir usbdrive
mount /dev/sda1 /home/dsl/usbdrive
cd /home/dsl/usbdrive
cp dom.img /dev/sdb
"dom.img" (as mentioned earlier, is your firmware image)
reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that the NAS should boot normaly.&lt;br&gt;
If the Firmware Version is at &lt;code&gt;1.x.x&lt;/code&gt; the firmware need to run updates, otherwise the Hard drives cant be recognized.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If None of this helped, your harddrive might be broken.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Change Harddrive
&lt;/h2&gt;

&lt;p&gt;If only one Harddrive is broken you can simply unplug the broken one and get a new one (in the same storage size)&lt;/p&gt;

&lt;p&gt;At the moment you plug in the new one the NAS automaticly starts to synchrosize the Data from the First Harddrive to the new one.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Raid Magic&lt;/em&gt;&lt;/p&gt;

</description>
      <category>nas</category>
      <category>recovery</category>
      <category>backup</category>
      <category>homeserver</category>
    </item>
    <item>
      <title>Learn to secure your app while coding it ...</title>
      <dc:creator>jeromesch</dc:creator>
      <pubDate>Fri, 17 Sep 2021 10:05:29 +0000</pubDate>
      <link>https://dev.to/cloudogu/learn-to-secure-your-app-while-coding-it-2bdd</link>
      <guid>https://dev.to/cloudogu/learn-to-secure-your-app-while-coding-it-2bdd</guid>
      <description>&lt;p&gt;Every Dev considers his Application as "safe" until he get's proven wrong.&lt;br&gt;
Look up at the OWASP Top10 and tell me what you can check as "done" in your current project state:&lt;br&gt;
-Broken Access Control &lt;br&gt;
-Cryptographic Failures&lt;br&gt;
-Injection &lt;br&gt;
-Insecure Design&lt;br&gt;
-Security Misconfiguration&lt;br&gt;
-Vulnerable and Outdated Components&lt;br&gt;
-Identification and Authentication Failures&lt;br&gt;
-Software and Data Integrity Failures&lt;br&gt;
-Security Logging and Monitoring Failures&lt;br&gt;
-Server-Side Request Forgery &lt;/p&gt;

&lt;p&gt;If you want to test your "secure coding skills", there's currently an tournament about exactly that:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://community.cloudogu.com/t/secure-coding-tournament-how-to-take-part/189"&gt;https://community.cloudogu.com/t/secure-coding-tournament-how-to-take-part/189&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SCW is reviewing your written Code automaticly against the (listed above) vulnerabilities, rates your overall score and shows where and how you can improve your skills.&lt;/p&gt;

&lt;p&gt;Languages:&lt;br&gt;
Kubernetes&lt;br&gt;
Java&lt;br&gt;
C# / MVC&lt;br&gt;
JavaScript / React&lt;br&gt;
Go&lt;br&gt;
PHP&lt;br&gt;
Python&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>cybersecurity</category>
      <category>javascript</category>
      <category>react</category>
    </item>
  </channel>
</rss>
