snipt

Ctrl+h for KB shortcuts

Bash

generar passwords

 < /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c10
https://snipt.net/embed/c0e47c099d30110912c064f69245f23b/
/raw/c0e47c099d30110912c064f69245f23b/
c0e47c099d30110912c064f69245f23b
bash
Bash
1
2019-07-22T11:50:50
True
False
False
/api/public/snipt/25002/
generar-passwords
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> &lt; /dev/urandom tr -dc _A-Z-a-z-0-9 <span class="p">|</span> head -c10 </span></pre></div> </td></tr></table>
linux, passwords, security

Bash

Renombrar de [1-9].jpg a [01-09].jpg

for a in [1-9].jpg;do mv $a `printf %02d.%s ${a%.*} ${a##*.}`; done
https://snipt.net/embed/8812d182bee590adb4f43b998e6a54bd/
/raw/8812d182bee590adb4f43b998e6a54bd/
8812d182bee590adb4f43b998e6a54bd
bash
Bash
1
2019-07-22T11:45:54
True
False
False
/api/public/snipt/20406/
renombrar-de-1-9jpg-a-01-09jpg
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">for</span> a in <span class="o">[</span>1-9<span class="o">]</span>.jpg<span class="p">;</span><span class="k">do</span> mv <span class="nv">$a</span> <span class="sb">`</span><span class="nb">printf</span> %02d.%s <span class="si">${</span><span class="nv">a</span><span class="p">%.*</span><span class="si">}</span> <span class="si">${</span><span class="nv">a</span><span class="p">##*.</span><span class="si">}</span><span class="sb">`</span><span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
bash, linux, rename