snipt

Ctrl+h for KB shortcuts

Bash

bugfix "Could not load host key /etc/ssh/ssh_host_..."

1
2
3
# error: Could not load host key: /etc/ssh/ssh_host_ed25519_key
# Regenerates any missing keys:
$ ssh-keygen -A
https://snipt.net/embed/6ac532ae5b57a28cfd810f876f7bb91f/
/raw/6ac532ae5b57a28cfd810f876f7bb91f/
6ac532ae5b57a28cfd810f876f7bb91f
bash
Bash
4
2019-06-26T21:55:19
True
False
False
Feb 03, 2015 at 11:54 PM
/api/public/snipt/138107/
bugfix-could-not-load-host-key-etcsshssh_host_-7f87c683
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># error: Could not load host key: /etc/ssh/ssh_host_ed25519_key</span> </span><span id="L-2"><a name="L-2"></a><span class="c1"># Regenerates any missing keys:</span> </span><span id="L-3"><a name="L-3"></a>$ ssh-keygen -A </span></pre></div> </td></tr></table>
aws, linux, ssh, ssh-keygen, ubuntu

Python

Timestamp for AWS policy

1
2
3
4
5
6
# To get a GMT timestamp of now:
from datetime import datetime
d = datetime.now()
d = d.replace(microsecond=0)
d.isoformat() + 'Z'
# -> '2008-12-19T03:21:18Z'
https://snipt.net/embed/abb540fff366a6d2e7fe490202795b2b/
/raw/abb540fff366a6d2e7fe490202795b2b/
abb540fff366a6d2e7fe490202795b2b
python
Python
6
2019-06-24T22:28:57
True
False
False
/api/public/snipt/877/
timestamp-for-aws-policy
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># To get a GMT timestamp of now:</span> </span><span id="L-2"><a name="L-2"></a><span class="kn">from</span> <span class="nn">datetime</span> <span class="kn">import</span> <span class="n">datetime</span> </span><span id="L-3"><a name="L-3"></a><span class="n">d</span> <span class="o">=</span> <span class="n">datetime</span><span class="o">.</span><span class="n">now</span><span class="p">()</span> </span><span id="L-4"><a name="L-4"></a><span class="n">d</span> <span class="o">=</span> <span class="n">d</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">microsecond</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> </span><span id="L-5"><a name="L-5"></a><span class="n">d</span><span class="o">.</span><span class="n">isoformat</span><span class="p">()</span> <span class="o">+</span> <span class="s1">&#39;Z&#39;</span> </span><span id="L-6"><a name="L-6"></a><span class="c1"># -&gt; &#39;2008-12-19T03:21:18Z&#39;</span> </span></pre></div> </td></tr></table>
aws, time