<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Tips on Wojciech Programming Blog</title>
    <link>https://www.wlangiewicz.com/categories/tips/</link>
    <description>Recent content in Tips on Wojciech Programming Blog</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Wed, 20 Mar 2019 10:05:54 +0100</lastBuildDate>
    <atom:link href="https://www.wlangiewicz.com/categories/tips/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Guide How to Use Consul DNS Locally on macOS</title>
      <link>https://www.wlangiewicz.com/2019/03/20/guide-how-to-use-consul-dns-locally-on-macos/</link>
      <pubDate>Wed, 20 Mar 2019 10:05:54 +0100</pubDate>
      <guid>https://www.wlangiewicz.com/2019/03/20/guide-how-to-use-consul-dns-locally-on-macos/</guid>
      <description>This is a guide how to use Consul&amp;rsquo;s DNS service from your local macOS machine.&#xA;Test resolution by hand Run this command to see if you can communicate with consul correctly and it resolves domain names for you:&#xA;dig vault.service.consul @$CONSUL_IP -p 8600 As response you should get the A record that will look similar to this (look for ANSWER SECTION):&#xA;;; ANSWER SECTION: vault.service.consul.&#x9;0&#x9;IN&#x9;A&#x9;123.123.123.123 (the IP address will be different in your case)</description>
    </item>
    <item>
      <title>QNAP NAS: Create Backup of TimeMachine Directory</title>
      <link>https://www.wlangiewicz.com/2018/12/28/qnap-nas-create-backup-of-timemachine-directory/</link>
      <pubDate>Fri, 28 Dec 2018 21:03:22 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2018/12/28/qnap-nas-create-backup-of-timemachine-directory/</guid>
      <description>I was recently setting up remote backups for my QNAP NAS and came across a problem.&#xA;QNAP NAS by default doesn&amp;rsquo;t seem to be able to create backups of the TMBackup directory it uses to store TimeMachine backups. You are unable to sync this directory with remote server or cloud storage/backup service.&#xA;I was googling around and noticed that few people had this problem, for example here and I have found a solution.</description>
    </item>
    <item>
      <title>How to use Trezor Wallet with Bitcoin Testnet</title>
      <link>https://www.wlangiewicz.com/2018/08/31/how-to-use-trezor-wallet-with-bitcoin-testnet/</link>
      <pubDate>Fri, 31 Aug 2018 12:18:48 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2018/08/31/how-to-use-trezor-wallet-with-bitcoin-testnet/</guid>
      <description>The following post is a quick tutorial how to use Trezor hardware wallet with Bitcoin Testnet.&#xA;Connect your Trezor like you normally would Click on &amp;ldquo;Wallet settings&amp;rdquo; Delete contents of this field and enter &amp;ldquo;https://testnet-bitcore1.trezor.io/&amp;quot; instead Click &amp;ldquo;Save &amp;amp; Reload&amp;rdquo; This is how the wallet page should look Notice that in the right left corner it says &amp;ldquo;Custom backend&amp;rdquo;, this is expected. I already have 0.20 testnet BTC there.&#xA;This is how &amp;ldquo;Receive&amp;rdquo; tab looks like, there is information that you are running on testnet This is how &amp;ldquo;Send&amp;rdquo; tab looks like, there is information that you are running on testnet Unfortunately there&amp;rsquo;s no way for the Trezor wallet to remember this setting and you are required to repeat those steps every time you plug in your wallet into computer.</description>
    </item>
    <item>
      <title>Using Swagger UI For Local Development</title>
      <link>https://www.wlangiewicz.com/2018/07/04/using-swagger-ui-for-local-development/</link>
      <pubDate>Wed, 04 Jul 2018 19:32:47 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2018/07/04/using-swagger-ui-for-local-development/</guid>
      <description>When working on the swagger documentation, several different tools can be used.&#xA;The &amp;lsquo;official&amp;rsquo; editor developed by the Swagger community is Swagger Editor, live preview: https://editor.swagger.io/, I have found it quite quick and easy to use, but for larger project it gets cumbersome. Additionally it doesn&amp;rsquo;t support ability to have multiple files that will reference each other.&#xA;This post is a quick demonstration of the workflow I&amp;rsquo;m using when working on the large, multi-file swagger documentations.</description>
    </item>
    <item>
      <title>Scala Patterns To Avoid: Implicit Arguments With Default Values</title>
      <link>https://www.wlangiewicz.com/2017/09/24/scala-patterns-to-avoid-implicit-arguments-with-default-values/</link>
      <pubDate>Sun, 24 Sep 2017 11:48:26 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2017/09/24/scala-patterns-to-avoid-implicit-arguments-with-default-values/</guid>
      <description>There is a tendency for the Scala projects to prefer more explicit programming style. The biggest aspect of that is in my opinion the type system of the Scala language, programmers often start writing their functions by defining types of the arguments and type of the result, only to write the body of the function as last step. That&amp;rsquo;s also because we have the Scala compiler to help us.&#xA;I recently stumbled on a snippet that contradicts this rule and can be a source of hard to spot bugs for the person unfamiliar with the code.</description>
    </item>
    <item>
      <title>JSON in Play Framework - Advanced Libraries</title>
      <link>https://www.wlangiewicz.com/2016/03/25/json-in-play-framework-advanced-libraries/</link>
      <pubDate>Fri, 25 Mar 2016 12:51:16 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2016/03/25/json-in-play-framework-advanced-libraries/</guid>
      <description>This is a followup post to my previous one covering JSON in Play framework. I&amp;rsquo;d like to show how the manual work I did before in trying to make JSON mapping compatible with external API can be done by using 2 small but useful libraries:&#xA;[play-json-naming](https://github.com/tototoshi/play-json-naming)&#xA;[play-json-extensions](https://github.com/xdotai/play-json-extensions)&#xA;play-json-naming This is a very simple library that can be used to convert from camelCase formatting (the default one that we use in Scala) to snake_case formatting that is common in various different languages (for example PHP or Ruby).</description>
    </item>
    <item>
      <title>JSON in Play Framework - Techniques For Making Compatible Mappings</title>
      <link>https://www.wlangiewicz.com/2016/03/23/json-in-play-framework-techniques-for-making-compatible-mappings/</link>
      <pubDate>Wed, 23 Mar 2016 20:21:06 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2016/03/23/json-in-play-framework-techniques-for-making-compatible-mappings/</guid>
      <description>I&amp;rsquo;ll show 2 slightly advanced techniques for working with JSON in Play Framework (play-json) that are useful especially when you need to control the mappings yourself. For example when you have to make sure that your API is compatible with existing applications. The examples are based on my project Game Arena (which is in very early stages of development)&#xA;One suggestion, before we start, take a look at Play Framework JSON documentation which is truly quite comprehensive and provides a very good introduction to JSON usage in Play.</description>
    </item>
    <item>
      <title>Recommended Resources For Learning Bitcoin</title>
      <link>https://www.wlangiewicz.com/2015/03/22/recommended-resources-for-learning-bitcoin/</link>
      <pubDate>Sun, 22 Mar 2015 12:49:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2015/03/22/recommended-resources-for-learning-bitcoin/</guid>
      <description>In the recent weeks I did have many people asking me for recommender resources for learning Bitcoin from the techology side.&#xA;Here is a list of learning resources that I can recommend:&#xA;“Mastering Bitcoin” by Andreas M. Antonopoulos, purchase link: http://shop.oreilly.com/product/0636920032281.do, free version online: https://github.com/aantonop/bitcoinbook This is a very approachable for anyone wanting to learn details of how Bitcoin works under the hood, so far I have read it twice 🙂</description>
    </item>
    <item>
      <title>How to setup a Litecoin node</title>
      <link>https://www.wlangiewicz.com/2014/05/24/how-to-setup-a-litecoin-node/</link>
      <pubDate>Sat, 24 May 2014 11:40:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2014/05/24/how-to-setup-a-litecoin-node/</guid>
      <description>Note: Setting up Litecoin and Bitcoin nodes is very similar, you can check my previous post on how to setup a Bitcoin node. This tutorial describes how to setup a new Litecoin relay node on Linux server - this node will be used as relay node in the Litecoin network and it’s not recommended to store anything in it’s wallet.&#xA;Download Litecoin from official website: https://litecoin.org/&amp;quot;&amp;gt;https://litecoin.org/ At the moment the most recent version can be downloaded using this direct link: https://download.</description>
    </item>
    <item>
      <title>How to verify that SSL certificate matches key</title>
      <link>https://www.wlangiewicz.com/2014/05/11/how-to-verify-that-ssl-certificate-matches-key/</link>
      <pubDate>Sun, 11 May 2014 11:38:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2014/05/11/how-to-verify-that-ssl-certificate-matches-key/</guid>
      <description>In order to verify that OpenSSL key matches certificate you can run following command: For key:&#xA;openssl rsa -noout -modulus -in yourdomain.key | openssl md5 and for certificate:&#xA;openssl x509 -noout -modulus -in yourdomain.crt | openssl md5 and for CSR (Certificate Signing Request):&#xA;openssl req -noout -modulus -in yourdomain.csr &amp;lt;span style=&amp;#34;box-sizing: border-box; color: #2aa198;&amp;#34;&amp;gt;| openssl md5&amp;lt;/span&amp;gt; In all cases you should get the same output, for example:&#xA;(stdin)=d41d8cd98f00b204e9800998ecf8427e If the output is the same in all cases this means that keys match certificate.</description>
    </item>
    <item>
      <title>Running Playframework! on Raspberry Pi</title>
      <link>https://www.wlangiewicz.com/2014/01/11/running-playframework-on-raspberry-pi/</link>
      <pubDate>Sat, 11 Jan 2014 12:35:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2014/01/11/running-playframework-on-raspberry-pi/</guid>
      <description>Recently I wanted to see if it’s possible to run applications written in Scala and Playframework! on my Raspberry Pi&#xA;1. Java installation My Raspi was installed from raspbian image which had java already installed, if you need to install it yourself you can either do that manually (remember to choose ARM package) or use automated script like, OAB-Java ( https://github.com/flexiondotorg/oab-java6 )&#xA;2. Build application locally This step doesn’t differ on raspi, the command is the same</description>
    </item>
    <item>
      <title>Mosh: when your ssh connection breaks frequently</title>
      <link>https://www.wlangiewicz.com/2013/08/28/mosh-when-your-ssh-connection-breaks-frequently/</link>
      <pubDate>Wed, 28 Aug 2013 11:34:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/08/28/mosh-when-your-ssh-connection-breaks-frequently/</guid>
      <description>Mosh is a ssh-like tool that is really a drop-in replacement for a lot of SSH problems.&#xA;It works:&#xA;&amp;lt;span style=“line-height: 14px;”&amp;gt;when you switch networks: connecting or disconnecting from VPN, using mobile networks&#xA;when your connection frequently breaks / halts without unknown reason&#xA;when you have to login to servers on the other side of the world&#xA;etc….&#xA;All of this is achieved thanks to using UDP instead of TCP.</description>
    </item>
    <item>
      <title>Linux: remove files created before or after date</title>
      <link>https://www.wlangiewicz.com/2013/03/22/linux-remove-files-created-before-or-after-date/</link>
      <pubDate>Fri, 22 Mar 2013 12:28:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/03/22/linux-remove-files-created-before-or-after-date/</guid>
      <description>Very useful command if you want to remove files from current directory created between certain dates, in this case files will be older than 3 days and newer than 35 days, we also filter out only files with “-type f parameter”&#xA;find . -mtime +3 -mtime -35 -type f | grep -v ‘/.’ | xargs rm If you only want to list those files without removing them use this:&#xA;find .</description>
    </item>
    <item>
      <title>Max Java String Length</title>
      <link>https://www.wlangiewicz.com/2013/03/03/max-java-string-length/</link>
      <pubDate>Sun, 03 Mar 2013 12:25:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/03/03/max-java-string-length/</guid>
      <description>I was wondering about what would be the maximum String length in Java, and the funny thing is that Java’s Strings are Arrays that are indexed by int.&#xA;So the maximum String length is&#xA;And this is true for any Java Array:&#xA;http://stackoverflow.com/questions/1179983/how-many-characters-can-a-java-string-have&#xA;http://stackoverflow.com/questions/816142/strings-maximum-length-in-java-calling-length-method&#xA;http://stackoverflow.com/questions/3038392/do-java-arrays-have-a-maximum-size</description>
    </item>
    <item>
      <title>What is kjournald and why it&#39;s using 99% of IO? What about noatime?</title>
      <link>https://www.wlangiewicz.com/2013/02/18/what-is-kjournald-and-why-its-using-99-of-io-what-about-noatime/</link>
      <pubDate>Mon, 18 Feb 2013 12:24:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/02/18/what-is-kjournald-and-why-its-using-99-of-io-what-about-noatime/</guid>
      <description>I have noticed this process in iotop using a lot of CPU/IO time and I started to wonder what is it doing. It turns out this is a journaling process of ext3 partitions: http://serverfault.com/questions/236836/kjournald-reasons-for-high-usage Very often it’s related to not using noatime mount option. Generally this mount attribute is used to lower the IO load, but it prevents kernel from setting last access time to a file (which is rarely needed):</description>
    </item>
    <item>
      <title>My .screenrc Configuration</title>
      <link>https://www.wlangiewicz.com/2013/02/08/my-.screenrc-configuration/</link>
      <pubDate>Fri, 08 Feb 2013 12:22:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/02/08/my-.screenrc-configuration/</guid>
      <description>This is my .screenrc file that I always use and copy it everywhere I login.&#xA;autodetach on shell -${SHELL} defscrollback 2024 startup_message off hardstatus on vbell off hardstatus alwayslastline hardstatus string &amp;#39;%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B} %d/%m %{W}%c %{g}]&amp;#39; </description>
    </item>
    <item>
      <title>Fixing MySQL replication that is stuck</title>
      <link>https://www.wlangiewicz.com/2013/02/02/fixing-mysql-replication-that-is-stuck/</link>
      <pubDate>Sat, 02 Feb 2013 12:20:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/02/02/fixing-mysql-replication-that-is-stuck/</guid>
      <description>If your MySQL replication is stuck for example on&#xA;CREATE / ALTER TABLE ... (or few others) because for example for the tables that already exist on the slave, there’s quick fix that can be applied on MySQL slave:&#xA;SET GLOBAL SQL_SLAVE_SKIP_COUNTER=1; START SLAVE; This will force slave to skip one command (that is causing it to stop) and then replication is started back again.&#xA;Depending on the root cause of the problem of stopped replication there are other solutions – but this works in the case described above.</description>
    </item>
    <item>
      <title>Attaching to BOINC project from Linux console</title>
      <link>https://www.wlangiewicz.com/2013/02/02/attaching-to-boinc-project-from-linux-console/</link>
      <pubDate>Sat, 02 Feb 2013 12:16:00 +0000</pubDate>
      <guid>https://www.wlangiewicz.com/2013/02/02/attaching-to-boinc-project-from-linux-console/</guid>
      <description>So my AWS EC2 free instance is running, for now I’ll use it as a Boinc maching, what is boinc?&#xA;This is the summary from wikipedia:&#xA;The Berkeley Open Infrastructure for Network Computing (BOINC) is an open sourcemiddleware system for volunteer and grid computing. It was originally developed to support the SETI@home project before it became useful as a platform for other distributed applications in areas as diverse as mathematics, medicine, molecular biology, climatology, and astrophysics.</description>
    </item>
  </channel>
</rss>
