<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Dev notes</title>
    <description></description>
    <link>https://estarter.github.io/</link>
    <atom:link href="https://estarter.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Thu, 18 Oct 2018 09:17:29 +0000</pubDate>
    <lastBuildDate>Thu, 18 Oct 2018 09:17:29 +0000</lastBuildDate>
    <generator>Jekyll v3.7.4</generator>
    
      <item>
        <title>How to configure dark colorscheme for dev tools</title>
        <description>&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;Reconfigure environment in favor of dark (or night or drakula) colorscheme
My personal preference is a “drakula” schema. So in this post&lt;/p&gt;

&lt;h2 id=&quot;embedded-schemas&quot;&gt;Embedded schemas&lt;/h2&gt;

&lt;h3 id=&quot;intellij-idea&quot;&gt;IntelliJ Idea&lt;/h3&gt;

&lt;p&gt;Switch to drakula scheme.&lt;/p&gt;

&lt;h3 id=&quot;mac-os-x&quot;&gt;Mac OS X&lt;/h3&gt;

&lt;p&gt;System Preference -&amp;gt; General -&amp;gt; Use dark menu bar and Dock&lt;/p&gt;

&lt;h2 id=&quot;external-configurators&quot;&gt;External configurators&lt;/h2&gt;
&lt;h3 id=&quot;project-dracula&quot;&gt;Project Dracula&lt;/h3&gt;

&lt;p&gt;&lt;a href=&quot;https://draculatheme.com/&quot;&gt;Project Dracula&lt;/a&gt; supports 50+ different applications including Terminal.app&lt;/p&gt;

&lt;h3 id=&quot;gnome-terminal&quot;&gt;Gnome Terminal&lt;/h3&gt;

&lt;p&gt;Use &lt;a href=&quot;https://github.com/dracula/gnome-terminal&quot;&gt;dracula gnome terminal&lt;/a&gt; colorschema.&lt;/p&gt;
</description>
        <pubDate>Thu, 18 Oct 2018 11:04:00 +0000</pubDate>
        <link>https://estarter.github.io/env/2018/10/18/colorscheme.html</link>
        <guid isPermaLink="true">https://estarter.github.io/env/2018/10/18/colorscheme.html</guid>
        
        
        <category>env</category>
        
      </item>
    
      <item>
        <title>How to configure CI server for java projects doing encryption</title>
        <description>&lt;h2 id=&quot;problem&quot;&gt;Problem&lt;/h2&gt;
&lt;p&gt;You have an CI server building the java projects in encryption domain.
These projects use a java security libs and requires a lot of random data.
The server itself may run out of entropy for &lt;code class=&quot;highlighter-rouge&quot;&gt;/dev/random&lt;/code&gt; which caused of a nasty problems that processes are stuck on CI whereas they run smoothly on your dev machine.&lt;/p&gt;

&lt;h2 id=&quot;solution-part-1---securerandomsource&quot;&gt;Solution part 1 - securerandom.source&lt;/h2&gt;

&lt;p&gt;First thing you want to do is to switch from &lt;code class=&quot;highlighter-rouge&quot;&gt;/dev/random&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;/dev/urandom&lt;/code&gt;.
You can modify &lt;code class=&quot;highlighter-rouge&quot;&gt;$JAVA_HOME/jre/lib/security/java.security&lt;/code&gt; file to set the option &lt;code class=&quot;highlighter-rouge&quot;&gt;securerandom.source=file:/dev/urandom&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If for some reason you can’t modify this file, there’s another option for you - use special env variable that’s picked up by java:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nb&quot;&gt;export &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;_JAVA_OPTIONS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;-Djava.security.egd=file:///dev/urandom&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;solution-part-2---securerandomstrongalgorithms&quot;&gt;Solution part 2 - securerandom.strongAlgorithms&lt;/h2&gt;

&lt;p&gt;Even though random source is set to pseudo random generator, the process may still hang.
The reason can be that &lt;code class=&quot;highlighter-rouge&quot;&gt;SecureRandom.getInstanceStrong()&lt;/code&gt; is called, so the strongest crypto source is choosen regardless to &lt;code class=&quot;highlighter-rouge&quot;&gt;securerandom.source&lt;/code&gt;.
To change it modify &lt;code class=&quot;highlighter-rouge&quot;&gt;$JAVA_HOME/jre/lib/security/java.security&lt;/code&gt; as following:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;securerandom.strongAlgorithms=NativePRNGNonBlocking
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For Linux and MacOS, the available algorithms are(&lt;a href=&quot;https://docs.oracle.com/javase/8/docs/technotes/guides/security/SunProviders.html#SecureRandomImp&quot;&gt;full list&lt;/a&gt;):&lt;/p&gt;

&lt;table&gt;
  &lt;thead&gt;
    &lt;tr&gt;
      &lt;th&gt;Algorithm&lt;/th&gt;
      &lt;th&gt;nextBytes&lt;/th&gt;
      &lt;th&gt;generateSeed&lt;/th&gt;
    &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;SHA1PRNG&lt;/td&gt;
      &lt;td&gt;???&lt;/td&gt;
      &lt;td&gt;????&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;NativePRNG&lt;/td&gt;
      &lt;td&gt;/dev/urandom&lt;/td&gt;
      &lt;td&gt;/dev/random&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;NativePRNGBlocking&lt;/td&gt;
      &lt;td&gt;/dev/random&lt;/td&gt;
      &lt;td&gt;/dev/random&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;NativePRNGNonBlocking&lt;/td&gt;
      &lt;td&gt;/dev/urandom&lt;/td&gt;
      &lt;td&gt;/dev/urandom&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 id=&quot;it-still-doesnt-work---how-to-debug&quot;&gt;It still doesn’t work - how to debug?&lt;/h2&gt;

&lt;p&gt;If you want to see what your SecureRandom implementation is doing, then you can turn on debugging:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;-Djava.security.debug=&quot;provider,engine=SecureRandom&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;future-reading&quot;&gt;Future reading&lt;/h2&gt;
&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://tersesystems.com/blog/2015/12/17/the-right-way-to-use-securerandom/&quot;&gt;The Right Way to Use SecureRandom&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://www.2uo.de/myths-about-urandom/&quot;&gt;Myths about /dev/urandom&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 05 Jan 2018 18:07:00 +0000</pubDate>
        <link>https://estarter.github.io/java/ci/2018/01/05/configure-ci-for-java-doing-encryption.html</link>
        <guid isPermaLink="true">https://estarter.github.io/java/ci/2018/01/05/configure-ci-for-java-doing-encryption.html</guid>
        
        
        <category>java</category>
        
        <category>ci</category>
        
      </item>
    
      <item>
        <title>Enable docker remote api</title>
        <description>&lt;p&gt;This article describes how to configure a docker to be able to connect to it over tcp.&lt;/p&gt;

&lt;h2 id=&quot;enable-the-remote-api-on-a-new-socket&quot;&gt;Enable the remote API on a new socket&lt;/h2&gt;

&lt;p&gt;Create a file called &lt;code class=&quot;highlighter-rouge&quot;&gt;/etc/systemd/system/docker-tcp.socket&lt;/code&gt; to make Docker available on a TCP socket on port 2375.&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;[Unit]
Description=Docker Socket for the API

[Socket]
ListenStream=2375
BindIPv6Only=both
Service=docker.service

[Install]
WantedBy=sockets.target
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Then enable this new socket:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;systemctl &lt;span class=&quot;nb&quot;&gt;enable &lt;/span&gt;docker-tcp.socket
systemctl stop docker
systemctl start docker-tcp.socket
systemctl start docker
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Test that it’s working:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;docker &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; tcp://127.0.0.1:2375 ps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;connect-from-another-machine&quot;&gt;Connect from another machine&lt;/h2&gt;

&lt;p&gt;On another machine use DOCKER_HOST env variable (&lt;code class=&quot;highlighter-rouge&quot;&gt;docker-host&lt;/code&gt; is an address of a docker machine):&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;DOCKER_HOST&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;tcp://docker-host:2375 docker ps
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From https://coreos.com/os/docs/latest/customizing-docker.html&lt;/p&gt;
</description>
        <pubDate>Wed, 03 Jan 2018 11:17:07 +0000</pubDate>
        <link>https://estarter.github.io/linux/docker/2018/01/03/enable-docker-remote-api.html</link>
        <guid isPermaLink="true">https://estarter.github.io/linux/docker/2018/01/03/enable-docker-remote-api.html</guid>
        
        
        <category>linux</category>
        
        <category>docker</category>
        
      </item>
    
      <item>
        <title>git diff tricks</title>
        <description>&lt;h2 id=&quot;exclude-files-from-git-diff&quot;&gt;Exclude files from git diff&lt;/h2&gt;

&lt;p&gt;To remove pom.xml (or another) files from git diff output, use following command:&lt;/p&gt;
&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git diff COMMIT_TO_COMPARE  &lt;span class=&quot;nt&quot;&gt;--&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;.&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;:(exclude)*/pom.xml&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;:(exclude)pom.xml&quot;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h2 id=&quot;run-git-diff-in-gui&quot;&gt;Run git diff in GUI&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://git-scm.com/docs/git-difftool&quot;&gt;git difftool&lt;/a&gt; allows you to use different diff tools to review changes in the git repo.&lt;/p&gt;

&lt;p&gt;To see available tools run it as following:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;git difftool &lt;span class=&quot;nt&quot;&gt;--tool-help&lt;/span&gt;
&lt;span class=&quot;s1&quot;&gt;'git difftool --tool=&amp;lt;tool&amp;gt;'&lt;/span&gt; may be &lt;span class=&quot;nb&quot;&gt;set &lt;/span&gt;to one of the following:
    bc
    bc3
    emerge
    opendiff
    vimdiff
    vimdiff2
    vimdiff3

  user-defined:
    sourcetree.cmd opendiff &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$LOCAL&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$REMOTE&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;

The following tools are valid, but not currently available:
    araxis
    codecompare
    deltawalker
    diffmerge
    diffuse
    ecmerge
    examdiff
    gvimdiff
    gvimdiff2
    gvimdiff3
    kdiff3
    kompare
    meld
    p4merge
    tkdiff
    winmerge
    xxdiff

Some of the tools listed above only work &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;a windowed
environment. If run &lt;span class=&quot;k&quot;&gt;in &lt;/span&gt;a terminal-only session, they will fail.
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;From time to time I want to use &lt;a href=&quot;https://www.scootersoftware.com/&quot;&gt;beyond compare&lt;/a&gt; to review the changes:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;git difftool &lt;span class=&quot;nt&quot;&gt;--tool&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;bc3
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
</description>
        <pubDate>Tue, 17 Oct 2017 11:17:07 +0000</pubDate>
        <link>https://estarter.github.io/git/linux/mac/tips/2017/10/17/git-diff-tricks.html</link>
        <guid isPermaLink="true">https://estarter.github.io/git/linux/mac/tips/2017/10/17/git-diff-tricks.html</guid>
        
        
        <category>git</category>
        
        <category>linux</category>
        
        <category>mac</category>
        
        <category>tips</category>
        
      </item>
    
      <item>
        <title>Tooling: command-line mail client</title>
        <description>&lt;p&gt;&lt;a href=&quot;http://www.mutt.org/&quot;&gt;mutt&lt;/a&gt; allows you to access a mailbox via command line and it has a good-enough user interface.&lt;/p&gt;

&lt;p&gt;All configuration is kept in ~/.mutt folder. Here’s how I configured it to access different fodlers/accounts navigating via F-keys.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;Create a account file named like &lt;em&gt;~/.mutt/account.%accontname%&lt;/em&gt; , for example &lt;em&gt;account.com.gmail.test&lt;/em&gt; for &lt;em&gt;test@gmail.com&lt;/em&gt;. Here’s a template:&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; set my_server = %CHANGEME%
 set my_smtp_server = %CHANGEME%
 set my_user = %CHANGEME%
 set my_pass = %CHANGEME%
 # Account - SMTP
 set smtp_url = &quot;smtp://$my_user:$my_pass@$my_smtp_server:587&quot;
 set smtp_pass = $my_pass
 set imap_user = $my_user
 set imap_pass = $my_pass
 set ssl_force_tls = yes
 set ssl_starttls = no
 set ssl_verify_host = no
 set ssl_verify_dates = no
 #
 # Default inbox
 #
 set spoolfile=imaps://$my_server/INBOX
 #
 # Default location of mailboxes
 #
 set folder=imaps://$my_server/INBOX
 bind index G imap-fetch-mail
 #bind index d purge-message
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In ~/.mutt/muttrc file register folder-hook and add a macro for each account. In following example test@gmail.com account is registered and mapped to F2.&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; folder-hook 'account.com.gmail.test' 'source ~/.mutt/account.com.gmail.test'
 macro index  'source ~/.mutt/account.com.gmail.test!'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;In ~/.mutt/muttrc file define a default account:&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; # Default account
 source ~/.mutt/account.com.gmail.test
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Define a shortcut to fetch new emails (in ~/.mutt/muttrc):&lt;/p&gt;

    &lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; bind index G imap-fetch-mail
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Wed, 11 Oct 2017 11:53:57 +0000</pubDate>
        <link>https://estarter.github.io/linux/tips/2017/10/11/tooling-command-line-mail-client-2.html</link>
        <guid isPermaLink="true">https://estarter.github.io/linux/tips/2017/10/11/tooling-command-line-mail-client-2.html</guid>
        
        
        <category>linux</category>
        
        <category>tips</category>
        
      </item>
    
      <item>
        <title>SSL Debugging</title>
        <description>&lt;p&gt;Show server’s ssl certs:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl s_client &lt;span class=&quot;nt&quot;&gt;-showcerts&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-connect&lt;/span&gt; 127.0.0.1:8444
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Get certificate (from &lt;a href=&quot;https://confluence.atlassian.com/jira/connecting-to-ssl-services-117455.html&quot;&gt;here&lt;/a&gt;):&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;openssl s_client &lt;span class=&quot;nt&quot;&gt;-connect&lt;/span&gt; localhost:8443 &amp;lt; /dev/null | sed &lt;span class=&quot;nt&quot;&gt;-ne&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Save the content from &lt;code class=&quot;highlighter-rouge&quot;&gt;BEGIN CERTIFICATE&lt;/code&gt; to &lt;code class=&quot;highlighter-rouge&quot;&gt;END CERTIFICATE&lt;/code&gt; inclusive to the &lt;code class=&quot;highlighter-rouge&quot;&gt;server.crt&lt;/code&gt; file.
Then you can convert it to the jks file:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;cat &lt;/span&gt;server.crt &lt;span class=&quot;c&quot;&gt;# an example how the file should look like&lt;/span&gt;
&lt;span class=&quot;nt&quot;&gt;-----BEGIN&lt;/span&gt; CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIEEoaVPzANBgkqhkiG9w0BAQsFADBsMRAwDgYDVQQGEwdV
bmtub3duMRAwDgYDVQQIEwdVbmtub3duMRAwDgYDVQQHEwdVbmtub3duMRAwDgYD
VQQKEwdVbmtub3duMRAwDgYDVQQLEwdVbmtub3duMRAwDgYDVQQDEwdVbmtub3du
MB4XDTE4MDIyMTE1MDU0MFoXDTI4MDIxOTE1MDU0MFowbDEQMA4GA1UEBhMHVW5r
bm93bjEQMA4GA1UECBMHVW5rbm93bjEQMA4GA1UEBxMHVW5rbm93bjEQMA4GA1UE
ChMHVW5rbm93bjEQMA4GA1UECxMHVW5rbm93bjEQMA4GA1UEAxMHVW5rbm93bjCC
ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALykWgm+XOINMD8ZVYQbABj5
aJcRErGqmLIg2wLH3IL8kjjFSrslmc/QcoYN+/NUp1HtPcM+mGbn++h4MkUwiTJR
G92sgO+ZYoB/hwRL0uyXO5srBQ4r0Uv6lcQlcSBa3pJoHfM/LEF9nsGQjzHrnvtS
muwgUTb/lCTQyONg44WORVnTHS09yMliXpfKMTq5vkev5DXYGy/lzDFBJ6eHWN/x
SF0zWD2Yb1OylkBBghYl+/+WDWNUmeLeW+gACgKvhm13gED+RajEFIt3T9FVakJI
BE+jMdDkwh+sHwYBQey81fBc6MkcsJ/zzyrq3/lBhDH9XttROenIrPNrMwARZi8C
AwEAAaMhMB8wHQYDVR0OBBYEFAXzn1lYd1vW2FNCe+WQmc/utFbnMA0GCSqGSIb3
DQEBCwUAA4IBAQAJzC4vMt2fufbkPDSSqePSxgl3ddfAhEq4UdNyRriTbWJwFtdF
bDScrc3EbIS00duspKkMj2PbM/pM3mqRfXc1RavQpMBTSW/yR3fTjOy+RcoNSnVX
RXmnlE57hRfh+vALd5v2vrI51l+nOK3qn6nLY9+uJzJ/ZTb+JY+bWuU+0EST1Kyk
0Mi0GC9faXBEKZqJd/NLCuzFfE8fn2YN9FZC/1pxxPo0NoHGo1KX18t99GePIzzT
Ot4+kQZ7KhrYzcT3eO/9VryFVAbj+qRgu6yLU9U1mSX6/ZqaLr9FQma+P26jVsjC
CQS+77jHXzGTw/Yg5YWwkf47guhzJvk2GjAr
&lt;span class=&quot;nt&quot;&gt;-----END&lt;/span&gt; CERTIFICATE-----

&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;keytool &lt;span class=&quot;nt&quot;&gt;-genkey&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-keyalg&lt;/span&gt; RSA &lt;span class=&quot;nt&quot;&gt;-keysize&lt;/span&gt; 2048  &lt;span class=&quot;nt&quot;&gt;-alias&lt;/span&gt; localhost &lt;span class=&quot;nt&quot;&gt;-keypass&lt;/span&gt; CHANGEME &lt;span class=&quot;nt&quot;&gt;-dname&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;CN=Unknown, OU=truststore, O=Unknown, L=Unknown, ST=Unknown, C=Unknown&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; truststore.jks &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; CHANGEME
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;keytool &lt;span class=&quot;nt&quot;&gt;-list&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; truststore.jks &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; CHANGEME &lt;span class=&quot;c&quot;&gt;# shows content of jks -&amp;gt; original key is there&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;keytool &lt;span class=&quot;nt&quot;&gt;-delete&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-alias&lt;/span&gt; localhost &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; truststore.jks &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; CHANGEME
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;keytool &lt;span class=&quot;nt&quot;&gt;-list&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; truststore.jks &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; CHANGEME &lt;span class=&quot;c&quot;&gt;# jks is empty&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;keytool &lt;span class=&quot;nt&quot;&gt;-import&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-alias&lt;/span&gt; SERVER_NAME &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; truststore.jks &lt;span class=&quot;nt&quot;&gt;-file&lt;/span&gt; server.crt &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; CHANGEME &lt;span class=&quot;nt&quot;&gt;-noprompt&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ &lt;/span&gt;keytool &lt;span class=&quot;nt&quot;&gt;-list&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; truststore.jks &lt;span class=&quot;nt&quot;&gt;-storepass&lt;/span&gt; CHANGEME &lt;span class=&quot;c&quot;&gt;# jks contains server's certificate&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;UI for certs: &lt;a href=&quot;http://portecle.sourceforge.net/&quot;&gt;portecle&lt;/a&gt; (see also &lt;a href=&quot;https://shib.kuleuven.be/docs/ssl_commands.shtml&quot;&gt;frequently used ssl commands&lt;/a&gt;)&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;span class=&quot;c&quot;&gt;# show certs in jks&lt;/span&gt;
keytool &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; myks.jks &lt;span class=&quot;nt&quot;&gt;--list&lt;/span&gt;
&lt;span class=&quot;c&quot;&gt;# export cert from jdk&lt;/span&gt;
keytool &lt;span class=&quot;nt&quot;&gt;-keystore&lt;/span&gt; myks.jks &lt;span class=&quot;nt&quot;&gt;-exportcert&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-alias&lt;/span&gt; key &lt;span class=&quot;nt&quot;&gt;-file&lt;/span&gt; key.der
&lt;span class=&quot;c&quot;&gt;# show cert info&lt;/span&gt;
openssl x509 &lt;span class=&quot;nt&quot;&gt;-noout&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-text&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-in&lt;/span&gt; key.der &lt;span class=&quot;nt&quot;&gt;-inform&lt;/span&gt; der
&lt;span class=&quot;c&quot;&gt;# convert der to pem&lt;/span&gt;
openssl x509 &lt;span class=&quot;nt&quot;&gt;-inform&lt;/span&gt; der &lt;span class=&quot;nt&quot;&gt;-in&lt;/span&gt; key.der &lt;span class=&quot;nt&quot;&gt;-out&lt;/span&gt; key.pem
&lt;span class=&quot;c&quot;&gt;# test a server ssl&lt;/span&gt;
openssl s_client &lt;span class=&quot;nt&quot;&gt;-connect&lt;/span&gt; 172.17.0.1:8444 &lt;span class=&quot;nt&quot;&gt;-prexit&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-cert&lt;/span&gt; key.pem
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 id=&quot;troubleshooting&quot;&gt;Troubleshooting&lt;/h3&gt;

&lt;ol&gt;
  &lt;li&gt;The &lt;strong&gt;Signature does not match&lt;/strong&gt; error is the symptom that the server identity is unknown to the client, ie the client truststore does not have the server certificate.&lt;/li&gt;
  &lt;li&gt;Add &lt;strong&gt;-Djavax.net.debug=ssl&lt;/strong&gt; or &lt;strong&gt;-Djavax.net.debug=all&lt;/strong&gt; to debug the traffic&lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Add custom private certificate or truststore using java properties:&lt;/p&gt;

    &lt;p&gt;-Djavax.net.ssl.keyStoreType=pkcs12 -Djavax.net.ssl.keyStore=clientcertificate.p12 -Djavax.net.ssl.keyStorePassword=CHANGEME&lt;/p&gt;

    &lt;p&gt;-Djavax.net.ssl.trustStoreType=jks -Djavax.net.ssl.trustStore=gridserver.keystore -Djavax.net.ssl.trustStorePassword=CHANGEME&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;

</description>
        <pubDate>Wed, 11 Oct 2017 11:53:57 +0000</pubDate>
        <link>https://estarter.github.io/linux/mac/2017/10/11/ssl-debugging.html</link>
        <guid isPermaLink="true">https://estarter.github.io/linux/mac/2017/10/11/ssl-debugging.html</guid>
        
        
        <category>linux</category>
        
        <category>mac</category>
        
      </item>
    
      <item>
        <title>bash programming</title>
        <description>&lt;p&gt;Useful links&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;http://mywiki.wooledge.org/BashGuide/Practices&quot;&gt;BashGuide/Practices&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;http://mywiki.wooledge.org/BashFAQ/031&quot;&gt;BashFAQ/031&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/jlevy/the-art-of-command-line&quot;&gt;Master the command line, in one page&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://github.com/denysdovhan/bash-handbook&quot;&gt;bash handbook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
        <pubDate>Fri, 27 Jan 2017 00:03:58 +0000</pubDate>
        <link>https://estarter.github.io/linux/links/2017/01/27/bash-programming.html</link>
        <guid isPermaLink="true">https://estarter.github.io/linux/links/2017/01/27/bash-programming.html</guid>
        
        
        <category>linux</category>
        
        <category>links</category>
        
      </item>
    
      <item>
        <title>shortcut to toggle fn keys in macOS</title>
        <description>&lt;p&gt;Problem: create a shortcut to toggle “Use F1, F2, etc. keys as standard function keys” in macOS Sierra.&lt;/p&gt;

&lt;p&gt;Here’s the solution.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Download &lt;a href=&quot;https://github.com/nelsonjchen/fntoggle/releases&quot;&gt;fntoggle&lt;/a&gt; program and save it to /usr/local/bin, make it executable.&lt;/li&gt;
  &lt;li&gt;In Automator create a new Service.
    &lt;ol&gt;
      &lt;li&gt;Select “no input” for recieving&lt;/li&gt;
      &lt;li&gt;Add “Run Shell Script” action with command
&lt;code class=&quot;highlighter-rouge&quot;&gt;/usr/local/bin/fntoggle ; echo &quot;ok&quot;&lt;/code&gt;&lt;/li&gt;
      &lt;li&gt;Save it as “fntoggle”&lt;/li&gt;
    &lt;/ol&gt;
  &lt;/li&gt;
  &lt;li&gt;In System Preferences/Keyboard/Shortcuts find fntoggle under Services, sub-section General. Click on right column (with text none) to assign new shortcut.&lt;/li&gt;
&lt;/ol&gt;
</description>
        <pubDate>Tue, 10 Jan 2017 20:03:53 +0000</pubDate>
        <link>https://estarter.github.io/mac/2017/01/10/shortcut-to-toggle-fn-keys-in-macos.html</link>
        <guid isPermaLink="true">https://estarter.github.io/mac/2017/01/10/shortcut-to-toggle-fn-keys-in-macos.html</guid>
        
        
        <category>mac</category>
        
      </item>
    
      <item>
        <title>mail server for testing</title>
        <description>&lt;h3 id=&quot;set-up-a-mail-server&quot;&gt;Set up a mail server&lt;/h3&gt;

&lt;p&gt;Create a docker-compose.yml:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;version: '2'

services:
 mail:
 image: tvial/docker-mailserver:latest
 # build: .
 hostname: mail
 domainname: domain.com
 container_name: mail
 ports:
 - &quot;25:25&quot;
 - &quot;143:143&quot;
 - &quot;587:587&quot;
 - &quot;993:993&quot;
 volumes:
 - maildata:/var/mail
 - ./config/:/tmp/docker-mailserver/

volumes:
 maildata:
 driver: local
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Create your mail accounts&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;mkdir &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; config
docker run &lt;span class=&quot;nt&quot;&gt;--rm&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;MAIL_USER&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;user1@domain.tld &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-e&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;MAIL_PASS&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;mypassword &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 &lt;span class=&quot;nt&quot;&gt;-ti&lt;/span&gt; tvial/docker-mailserver:latest &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
 /bin/sh &lt;span class=&quot;nt&quot;&gt;-c&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'echo &quot;$MAIL_USER|$(doveadm pw -s SHA512-CRYPT -u $MAIL_USER -p $MAIL_PASS)&quot;'&lt;/span&gt; &amp;amp;gt&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;&amp;amp;gt&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; config/postfix-accounts.cf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Start the container:&lt;/p&gt;

&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;docker-compose up -d mail&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;https://github.com/tomav/docker-mailserver&quot;&gt;source&lt;/a&gt; or &lt;a href=&quot;https://poste.io/open&quot;&gt;alternative&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;send-a-mail-smtp&quot;&gt;Send a mail (SMTP)&lt;/h3&gt;

&lt;p&gt;Install &lt;a href=&quot;http://caspian.dotconf.net/menu/Software/SendEmail/&quot;&gt;sendemail&lt;/a&gt; to send a mail:&lt;/p&gt;

&lt;div class=&quot;language-bash highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;brew install sendemail
sendemail &lt;span class=&quot;nt&quot;&gt;-f&lt;/span&gt; user1@domain.tld &lt;span class=&quot;nt&quot;&gt;-t&lt;/span&gt; user1@domain.tld &lt;span class=&quot;nt&quot;&gt;-u&lt;/span&gt; test2 &lt;span class=&quot;nt&quot;&gt;-m&lt;/span&gt; content &lt;span class=&quot;nt&quot;&gt;-s&lt;/span&gt; 0.0.0.0:25 &lt;span class=&quot;nt&quot;&gt;-o&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;tls&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;no
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;* &lt;a href=&quot;http://tecadmin.net/ways-to-send-email-from-linux-command-line&quot;&gt;alternative approach&lt;/a&gt;&lt;/p&gt;

&lt;h3 id=&quot;read-amail-imap&quot;&gt;Read a mail (IMAP)&lt;/h3&gt;

&lt;p&gt;Install mutt (&lt;a href=&quot;http://www.lucianofiandesio.com/getting-started-with-mutt-on-osx&quot;&gt;howto&lt;/a&gt;) client. Create ~/.muttrc file as following:&lt;/p&gt;

&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;set my_server = 0.0.0.0
set my_smtp_server = 0.0.0.0
set my_user = user1@domain.tld
set my_pass = mypassword

# Account - SMTP

set smtp_url = &quot;smtp://$my_user:$my_pass@$my_smtp_server:587&quot;
set smtp_pass = $my_pass
set imap_user = $my_user
set imap_pass = $my_pass
set ssl_force_tls = yes
set ssl_starttls = no
set ssl_verify_host = no
set ssl_verify_dates = no


#
# Default inbox
#
set spoolfile=imaps://$my_server/INBOX

#
# Default location of mailboxes
#
set folder=imaps://$my_server/INBOX

bind index G imap-fetch-mail
#bind index d purge-message
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Start &lt;code class=&quot;highlighter-rouge&quot;&gt;mutt&lt;/code&gt; to retrieve the mails via smtp, press G to check for updates.&lt;/p&gt;
</description>
        <pubDate>Thu, 04 Aug 2016 01:12:51 +0000</pubDate>
        <link>https://estarter.github.io/2016/08/04/mail-server-for-testing.html</link>
        <guid isPermaLink="true">https://estarter.github.io/2016/08/04/mail-server-for-testing.html</guid>
        
        
      </item>
    
      <item>
        <title>renting a flat in Zurich</title>
        <description>&lt;p&gt;Here's the list of apartments available for rent in Zurich:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;http://www.immoscout24.ch/fr/recherche/appartement-louer-zuerich?s=2&amp;amp;t=1&amp;amp;l=4147&amp;amp;pt=15h&amp;amp;pty=1,6,99,21,127,24,55,57,62,94&quot;&gt;immo-scout&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.immostreet.ch/en/SearchEngine/Rent/Switzerland/Flat-House?InterfaceDistanceAroundLocation=5&amp;amp;LocationId=2b81e194-d6af-44ab-bb79-714b24f6f522&amp;amp;InterfaceLocationID=2b81e194-d6af-44ab-bb79-714b24f6f522&amp;amp;SearchCriteriaImmoId=78e21160-81d3-04e5-9acc-c00db2efb05a&quot;&gt;immo-street&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.homegate.ch/rent/real-estate/city-zurich/matching-list?ag=900&amp;amp;ah=2000&amp;amp;tab=list&quot;&gt;home gate&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://www.livit.ch/en/tenant/living/further-letting&quot;&gt;livit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.ums.ch/moeblierte-wohnungen/Z%C3%BCrich/47.376887/8.541694/&quot;&gt;ums&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.homegate.ch/homegate-war/mieten-oder-kaufen/alle-inserate/ort-zuerich/trefferliste?oa=false&amp;amp;a=wvb&amp;amp;ep=1&amp;amp;tab=list&amp;amp;incsubs=1&amp;amp;l=default&amp;amp;cid=147285&amp;amp;tid=2&quot;&gt;waldmann&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.anibis.ch/fr/immobilier-immobilier-locations-zurich--436/advertlist.aspx?loc=zurich&amp;amp;sct=zh&amp;amp;sdc=10&amp;amp;sf=pri&amp;amp;aral=834_800_2000&amp;amp;aidl=866&quot;&gt;anibis&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.bszimo.ch/wohnungsanzeiger/&quot;&gt;Baugenossenschaft der Strassenbahner Zürich&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;a href=&quot;https://docs.google.com/spreadsheets/d/1T27X32iyKHpE9kmoUzuTL1aQXZ4Ze5qGzff8gvvlgFw/edit#gid=0&quot;&gt;backlog&lt;/a&gt;&lt;/p&gt;
</description>
        <pubDate>Wed, 03 Aug 2016 07:05:27 +0000</pubDate>
        <link>https://estarter.github.io/swiss/2016/08/03/renting-a-flat-in-zurich.html</link>
        <guid isPermaLink="true">https://estarter.github.io/swiss/2016/08/03/renting-a-flat-in-zurich.html</guid>
        
        
        <category>swiss</category>
        
      </item>
    
  </channel>
</rss>
