snipt

Ctrl+h for KB shortcuts

Bash

SSH con certificato (pem) e utente

ssh -l USERNAME_HERE -i PTAH_TO_KEY.pem HOSTNAME
https://snipt.net/embed/cf64844c99b8fcc2bc30c0507241c5c2/
/raw/cf64844c99b8fcc2bc30c0507241c5c2/
cf64844c99b8fcc2bc30c0507241c5c2
bash
Bash
1
2019-07-10T03:50:13
True
False
False
Jun 19, 2013 at 07:33 AM
/api/public/snipt/64882/
ssh-con-certificato-pem-e-utente
<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>ssh -l USERNAME_HERE -i PTAH_TO_KEY.pem HOSTNAME </span></pre></div> </td></tr></table>
conn, ssh, utils

Text only

mvn package without test

mvn -Dmaven.test.skip=true package
https://snipt.net/embed/594938291496d07e416b9ada971e565e/
/raw/594938291496d07e416b9ada971e565e/
594938291496d07e416b9ada971e565e
text
Text only
1
2019-07-19T14:25:36
True
False
False
Oct 04, 2012 at 12:54 PM
/api/public/snipt/48054/
mvn-package-without-test
<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>mvn -Dmaven.test.skip=true package </span></pre></div> </td></tr></table>
java, maven, mvn, tools

Bash

list all crontab of all users. Need to be root

for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
https://snipt.net/embed/0f351e6fccd37e2340b7df8b8ea2c973/
/raw/0f351e6fccd37e2340b7df8b8ea2c973/
0f351e6fccd37e2340b7df8b8ea2c973
bash
Bash
1
2019-06-26T00:48:28
True
False
False
/api/public/snipt/38213/
list-all-crontab-of-all-users-need-to-be-root
<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> user in <span class="k">$(</span>cut -f1 -d: /etc/passwd<span class="k">)</span><span class="p">;</span> <span class="k">do</span> <span class="nb">echo</span> <span class="nv">$user</span><span class="p">;</span> crontab -u <span class="nv">$user</span> -l<span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
admin, os

Bash

dump specific tables from mysql

mysqldump -h <host> -u <user> -p <dbname> <tables, space separated> > <destinationfile>
https://snipt.net/embed/6a0ac75cab46bb16d8205b5937c3a3b7/
/raw/6a0ac75cab46bb16d8205b5937c3a3b7/
6a0ac75cab46bb16d8205b5937c3a3b7
bash
Bash
1
2019-06-14T12:05:56
True
False
False
/api/public/snipt/29534/
dump-specific-tables-from-mysql
<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>mysqldump -h &lt;host&gt; -u &lt;user&gt; -p &lt;dbname&gt; &lt;tables, space separated&gt; &gt; &lt;destinationfile&gt; </span></pre></div> </td></tr></table>
bash, mysql

Bash

how to mount a shared win folder

1
2
3
4
5
 sudo mount -ousername=login,password=password  -t cifs \\\\IPoNomeMacchina\\SharedName percorsodelmount

example:

sudo mount -ousername=pippo,password=pippo123  -t cifs \\\\192.168.1.52\\logs /mnt/tmpmnt
https://snipt.net/embed/3429850a25dbabfebb0f8fb8393ed869/
/raw/3429850a25dbabfebb0f8fb8393ed869/
3429850a25dbabfebb0f8fb8393ed869
bash
Bash
5
2019-07-15T05:31:20
True
False
False
/api/public/snipt/26698/
how-to-mount-a-shared-win-folder
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a> sudo mount -ousername<span class="o">=</span>login,password<span class="o">=</span>password -t cifs <span class="se">\\\\</span>IPoNomeMacchina<span class="se">\\</span>SharedName percorsodelmount </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>example: </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a>sudo mount -ousername<span class="o">=</span>pippo,password<span class="o">=</span>pippo123 -t cifs <span class="se">\\\\</span>192.168.1.52<span class="se">\\</span>logs /mnt/tmpmnt </span></pre></div> </td></tr></table>
bash, clientside, samba

XML

configurazione di .project di eclipse per associare java a un progetto

1
2
3
<nature>
   org.eclipse.jdt.core.javanature
</nature>
https://snipt.net/embed/16520fdf5d1709317d6eb00359b5d11d/
/raw/16520fdf5d1709317d6eb00359b5d11d/
16520fdf5d1709317d6eb00359b5d11d
xml
XML
3
2019-07-09T23:58:06
True
False
False
/api/public/snipt/25244/
configurazione-di-project-di-eclipse-per-associare-java-a-un-progetto
<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="nt">&lt;nature&gt;</span> </span><span id="L-2"><a name="L-2"></a> org.eclipse.jdt.core.javanature </span><span id="L-3"><a name="L-3"></a><span class="nt">&lt;/nature&gt;</span> </span></pre></div> </td></tr></table>
"common task", conf, eclipse

Batchfile

unregister and re-register all dll in current folder

for %A in (*.dll) do regsvr32 /u /s %A && regsvr32 /s %A
https://snipt.net/embed/22a6b08e2b788712f0c00efe0d939133/
/raw/22a6b08e2b788712f0c00efe0d939133/
22a6b08e2b788712f0c00efe0d939133
bat
Batchfile
1
2019-07-18T08:59:40
True
False
False
/api/public/snipt/20833/
unregister-and-re-register-all-dll-in-current-folder
<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> <span class="nv">%A in (*.dll) do regsvr32 /u /s %</span>A <span class="p">&amp;&amp;</span> regsvr32 /s %A </span></pre></div> </td></tr></table>
dos