tag:blogger.com,1999:blog-43580929929209342582024-02-19T07:38:42.390+01:00Il PredellinoWindows, Linux e sicurezza informaticaUnknownnoreply@blogger.comBlogger27125tag:blogger.com,1999:blog-4358092992920934258.post-8447353010390945902021-05-08T14:03:00.015+02:002022-07-01T15:55:56.182+02:00Il mio nuovo BLOG su Python e Ubuntu<meta name="description" content="nuovo blog di predellino">
<h3 style="text-align: center;">
<span style="font-size: large;">Presentazione nuovo Blog</span>
</h3>
<p style="text-align: left;">
<span style="font-family: arial; font-size: large;"
>Per i più fedeli lettori vi comunico che ho creato un nuovo blog
concernente Python, il linguaggio di programmazione, Ubuntu e sicurezza
informatica.</span
>
</p>
<p style="text-align: left;">
<span style="font-family: arial; font-size: large;"
>Ecco l'indirizzo:
<a href="http://leucalipto.blogspot.com" target="_blank"
>https://leucalipto.blogspot.com</a
></span
>
</p>
<p style="text-align: left;">
<span style="font-family: arial; font-size: large;"
>Vi elenco qualche articolo che ritengo interessante:</span
>
</p>
<p></p>
<ul style="text-align: left;">
<li style="text-align: left;">
<a
href="https://leucalipto.blogspot.com/2021/01/firejail-tutorial-creare-un-profilo.html"
target="_blank"
><span style="font-family: arial; font-size: large;"
>Firejail tutorial: creare un profilo custom</span
></a
>
</li>
<li style="text-align: left;">
<a
href="https://leucalipto.blogspot.com/2021/06/sicurezza-decriptare-il-traffico-per.html"
target="_blank"
><span style="font-family: arial; font-size: large;"
>Sicurezza di rete lato server: decrittare il traffico per passarlo a
snort</span
></a
>
</li>
<li style="text-align: left;">
<a
href="https://leucalipto.blogspot.com/2020/12/guida-snap-su-ubuntu.html"
target="_blank"
><span style="font-family: arial; font-size: large;"
>Guida a Snap su Ubuntu</span
></a
>
</li>
<li style="text-align: left;">
<a
href="https://leucalipto.blogspot.com/2021/05/ubuntu-come-salvo-loutput-di-un-comando.html"
target="_blank"
><span style="font-family: arial; font-size: large;"
>Ubuntu: come salvo l'output di un comando ?</span
></a
>
</li>
</ul>
<p></p>
<p style="text-align: left;"><br /></p>
<p><br /></p>
<p><br /></p>
Unknownnoreply@blogger.com0Italia41.87194 12.56738-7.3907127512855126 -57.74512 90 82.87988tag:blogger.com,1999:blog-4358092992920934258.post-87738114496261379582012-05-22T09:54:00.000+02:002022-07-11T02:14:15.437+02:00mount di dischi vmware sotto linuxÈ possibile montare dischi vmware sotto linux. Ecco la procedura:<br />
# losetup /dev/loop0 /home/username/vostra_immagine_vmware-flat.vmdk<br />
# losetup -o 32256 /dev/loop1 /dev/loop0<br />
# mount /dev/loop1 /mnt/vmware<br />
<br />Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-56804777412562508412012-04-03T15:57:00.001+02:002012-04-03T17:50:59.131+02:00vim completionQuesto è solo un memo, vim completion:<br />
<div>
<C-x> <C-o></div>
<div>
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-24419520559475138572012-03-23T15:51:00.000+01:002012-03-23T15:51:00.470+01:00analisi di /var/spool/atNell'ultimo periodo lavoro con il comando AT (atd,atq) e una delle difficoltà è stata associare il job id che si ha come out di atq al nome del file presente nella directory /var/spool/at.<div>
Esempio:</div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">[root@ftp at]# atq</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">204<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-15 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">227<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-06-18 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">201<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-02 11:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">214<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-12 10:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">175<span class="Apple-tab-span" style="white-space: pre;"> </span>2013-02-06 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">218<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-03-29 10:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">200<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-12 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">223<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-19 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">206<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-09 10:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">193<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-03-23 11:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">195<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-03-26 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">179<span class="Apple-tab-span" style="white-space: pre;"> </span>2013-02-07 23:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">194<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-03-26 10:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">189<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-03-23 11:00 a root</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">190<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-03-26 10:00 a root</span></div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><span style="color: lime;">202</span><span class="Apple-tab-span" style="white-space: pre;"> </span><span style="background-color: red;">2012-04-05 10:00 a root</span></span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
</div>
<div>
In verità la lista è molto più lunga. E nella directory di at abbiamo:</div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">......</span></div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3729 24 feb 11:01 a000bd0152df18</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3352 24 feb 11:01 a000be0152ef80</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2679 24 feb 11:01 a000bf0152f28c</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2632 24 feb 11:01 a000c001532acc</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3723 24 feb 12:11 a000c10152df18</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3346 24 feb 12:11 a000c20152ef80</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2675 24 feb 12:11 a000c30152f28c</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2630 24 feb 12:11 a000c401532acc</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3719 2 mar 18:55 a000c50153063c</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3341 2 mar 18:55 a000c6015316e0</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2669 2 mar 18:55 a000c7015319ec</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2625 2 mar 18:55 a000c80153522c</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3735 6 mar 16:57 a000c90153171c</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"><span style="background-color: red;">-rwx------. 1 root root 3356 6 mar 16:57</span> <span style="color: magenta;">a0</span><span style="color: lime;">00ca</span><span style="color: yellow;">015327c0</span></span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2693 6 mar 16:57 a000cb01532acc</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 2637 6 mar 16:57 a000cc0153630c</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">-rwx------. 1 root root 3734 8 mar 09:30 a000cd01532d9c</span></div>
</div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">.....</span></div>
<div>
<br /></div>
<div>
Per esempio vorrei sapere il job id 194 a che job corrisponde.</div>
<div>
Non ho trovato info relativamente ai nomi dei file relativi ai job quindi ho dovuto cercare di indovinarli.</div>
<div>
Quello che segue è quello a cui sono arrivato.</div>
<div>
Prendiamo come esempio il file a000ca015327c0</div>
<div>
<span style="color: magenta;">a0</span> = la queue</div>
<div>
<span style="color: lime;">00ca</span> = il job id in hex, quindi convertito --> <span style="color: lime;">202</span></div>
<div>
<span style="color: yellow;">015327c0</span> = ore trascorse da epoch in hex. Ossia l'ora di partenza del job. Quindi: </div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"># converto in decimale e moltiplico per 60 (minuti) per ottenere i minuti da epoc.</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"># echo $((<span style="color: yellow;">0x015327c0</span>*0x3c))</span></div>
<div>
<span style="color: yellow; font-family: 'Courier New', Courier, monospace; font-size: x-small;">1333612800</span></div>
</div>
<div>
<br /></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"># poi converto epoch in un formato leggibile</span></div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"># python -c "import time; print time.ctime(1333612800)"</span></div>
<div>
<span style="color: yellow; font-family: 'Courier New', Courier, monospace; font-size: x-small;">Thu Apr 5 10:00:00 2012</span></div>
</div>
<div>
<br /></div>
<div>
In unica riga:</div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"># A=`echo a000ca015327c0 | cut -b7-` && B=$((0x$A*0x3c)) && echo $B && python -c "import time;print time.ctime($B)"</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">1333612800</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">Thu Apr 5 10:00:00 2012</span></div>
</div>
<div>
<br /></div>
<div>
Per riassumere, il file /var/spool/at/a000ca015327c0 corrisponde al job 202 che parte il 05/04/2012.</div>
<div>
Quindi:</div>
<div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;"># atq|grep 202</span></div>
<div>
<span style="font-family: 'Courier New', Courier, monospace; font-size: x-small;">202<span class="Apple-tab-span" style="white-space: pre;"> </span>2012-04-05 10:00 a root</span></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-72358022652869322292012-03-11T18:51:00.000+01:002012-03-13T18:59:49.876+01:00Appunti veloci su apt.<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">#1<br /># apt-get install localepurge<br />scegliere le proprie lingue, quindi:<br /># localepurge<br />per rimuovere le lingue in eccesso.<br /><br />#2<br /># dpkg -l<br />mostra la lista dei pacchetti installati, o anche:<br /># dpkg --get-selections <br /><br />#3<br /># auto-apt run ./configure<br />con questo posso autorizzare apt ad installare automaticamente pacchetti di file mancanti.<br />Così lanciando il ./configure verranno individuati e installati i file necessari. <br />#4<br /># apt-get check<br />fa un semplice check di integrità<br /> <br />#5<br />altra cosa interessante:<br /># less /usr/share/doc/apt-transport-https/apt-transport-https.README<br />e qui <a href="https://wiki.ubuntu.com/AptHTTPS">AptHTTPS</a><br /> <br />#6 <br />qualche chicca anche qui:<br /><a href="http://wiki.yobi.be/wiki/Debian_Commands">APTcommands</a> <br />--> spudoratamente <a href="http://www.altertux.org/www/apt.html">scopiazzato</a><br /># dpkg --get-selections "*" > lista.txt <br /># dselect update # dpkg --set-selections < lista.txt # apt-get -u dselect-upgrade<br /> <br />#7</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">Se non usato i sorgenti (io mai usati) potete pure eliminare i deb-src da source.list. È utile a velocizzare gli aggiornamenti</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">#8</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;">trova dipendenze inverse di un pacchetto</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"># apt-get install apt-rdepends</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"># apt-rdepends -r tuo_pkg</span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br /></span><br />
<span style="font-family: Arial, Helvetica, sans-serif; font-size: x-small;"><br />ciao<br />luigi</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-8758386063041301452012-01-19T13:21:00.002+01:002012-01-19T13:22:52.899+01:00Abilitare SELinux su centos 5.7<br />
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif; text-align: justify;">
Ciao,</div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif; text-align: justify;">
ho acquistato (ovviamente non io ma l'azienda per cui lavoro) un vps (Virtual Private Server) con centos 5.7 presso <a href="http://www.serverplan.com/" target="_blank">ServerPlan</a> (che secondo me è un ottimo provider ;-)). E però mi sono trovato SELinux disabilitato.</div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif;">
Per riabilitarlo da shell:</div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif; text-align: justify;">
<br /></div>
<div style="color: #999999; font-family: Georgia,"Times New Roman",serif;">
<span style="font-size: small;"># genhomedircon</span></div>
<div style="color: #999999; font-family: Georgia,"Times New Roman",serif;">
<span style="font-size: small;"># touch /.autorelabel</span></div>
<div style="color: #999999; font-family: Georgia,"Times New Roman",serif;">
<span style="font-size: small;"># reboot</span></div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif;">
<span style="font-size: small;"><br /></span></div>
<div style="color: #999999; font-family: Georgia,"Times New Roman",serif;">
<span style="font-size: small;"># setenforce 1</span></div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif;">
<br /></div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif;">
Poi controllate che l'enforcing sia persistente anche al reboot</div>
<div style="color: #999999; font-family: Arial,Helvetica,sans-serif;">
<br /></div>
<div style="color: #999999; font-family: Georgia,"Times New Roman",serif;">
# cat /etc/selinux/config</div>
<div style="color: #999999; font-family: Georgia,"Times New Roman",serif;">
</div>
<pre class="ini" style="color: #999999; font-family: Arial,Helvetica,sans-serif;"><span style="font-family: Georgia,"Times New Roman",serif;">SELINUX</span><span style="font-family: Georgia,"Times New Roman",serif;">=</span><span style="font-family: Georgia,"Times New Roman",serif;">enforcing</span><span style="font-family: Georgia,"Times New Roman",serif;">
</span><span style="font-family: Georgia,"Times New Roman",serif;">SELINUXTYPE</span><span style="font-family: Georgia,"Times New Roman",serif;">=</span><span style="font-family: Georgia,"Times New Roman",serif;">targeted </span></pre>
<pre class="ini" style="color: #999999; font-family: Arial,Helvetica,sans-serif;"> </pre>
<pre class="ini" style="color: #999999; font-family: Arial,Helvetica,sans-serif;"><span style="font-family: Arial,Helvetica,sans-serif; font-size: small;">In caso contrario modificate la configurazione con <a href="http://www.vim.org/" target="_blank">VIM</a></span></pre>
<pre class="ini" style="color: #999999;"></pre>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-8790844634206177322011-07-22T00:11:00.003+02:002022-07-02T04:06:09.737+02:00Exchange 2007: vedere la versione.<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizc6HiMaWaVrssK746zE-imDF6fA_Z4tZerPDU8dGgTPNrCjlAAd12xAzeo8EiGEiY8gf1h6BzSQfQsT_nFSHeigo6d9oNI17jt4BuYXiOZ4QAsrGB0BbCaymCwCgfYpD6wKoAru1k5U8/s1600/ExchangeVersionShell.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="110" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizc6HiMaWaVrssK746zE-imDF6fA_Z4tZerPDU8dGgTPNrCjlAAd12xAzeo8EiGEiY8gf1h6BzSQfQsT_nFSHeigo6d9oNI17jt4BuYXiOZ4QAsrGB0BbCaymCwCgfYpD6wKoAru1k5U8/s400/ExchangeVersionShell.png" width="400" /></a></div>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
Per avere la versione di Exchange da command line è sufficiente un:<br />
<code>c:\>Get-ExchangeServer | Select AdminDisplayVersion<br />
<br />
AdminDisplayVersion<br />
-------------------<br />
Version 8.1 (Build 240.6)<br />
</code><br />
<br />
Ciao Lewis!Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-55072748438682814962011-07-16T20:00:00.002+02:002011-07-18T22:23:05.703+02:00Exchange 2007: spostare gli account disabilitati da un db all'altro.<p>Adesso vi mostrerò come risparmiare tempo e lavoro con la Shell di Exchange. Quello che voglio fare è spostare tutte le mailbox con account AD disabilitato da uno <strong>StorageGroup</strong> all'altro. Questo per alleggerire le dimensioni del db che notariamente in exchange talvolta possono portare a dei problemi. Ok, la prima cosa che ci serve è sapere il nome esatto del <strong>MailBoxDatabase</strong>. E questo lo si ottiene col comando:</p>
<code>[PS] C:\>Get-MailboxDatabase</code><br /><br />
<table border=0>
<tr>
<td>
<code>Name</code>
</td>
<td>
<code>Server</code>
</td>
<td>
<code>StorageGroup</code>
</td>
<td>
<code>Recovery</code>
</td>
</tr>
<tr>
<td>
<code>----</code>
</td>
<td>
<code>------</code>
</td>
<td>
<code>------------</code>
</td>
<td>
<code>--------</code>
</td>
</tr>
<tr>
<td>
<code>Mailbox Database</code>
</td>
<td>
<code>SRV-MAIL</code>
</td>
<td>
<code>First Storage Group</code>
</td>
<td>
<code>False</code>
</td>
</tr>
<tr>
<td>
<code>Mailbox Database SG3</code>
</td>
<td>
<code>SRV-MAIL</code>
</td>
<td>
<code>Third Storage Group</code>
</td>
<td>
<code>False</code>
</td>
</tr>
</table>
<p>Adesso bisogna selezionare tutte le mailbox con account disabilitato e redirigerle verso il comando <strong>Move-MailBox</strong> così:</p>
<p><code>[PS] C:\>Get-Mailbox -database "Mailbox Database" | where {$_.UserAccountControl -eq "AccountDisabled, NormalAccount"} | Move-Mailbox -targetdatabase "mailbox database sg3"</code></p>
<p>Ecco con questo semplice comando spostiamo tutte le mailbox contenute nel DB <strong>Mailbox Database</strong> e che hanno il campo <strong>UserAccountControl</strong> impostato come <strong>"AccountDisabled, NormalAccount"</strong> nel DB con nome <strong>Mailbox Database SG3</strong></p>
<p>Ciao a tutti, lewis.</p>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-43630950134781588302011-07-16T17:31:00.002+02:002011-07-19T00:48:12.099+02:00Exchange 2007: statistiche sulle mailbox.<hr />
<p>Oggi vedremo come avere delle statistiche sulle mailbox degli utenti in modo da rendersi conto delle spazio occupato da ogni utente e del numero di email accumulate.</p>
<p>Il comando principale per ottenere delle statistiche è <strong>Get-MailboxStatistics</strong> il quale restituisce una tabella formata dai campi: <em>DisplayName</em> (il nome utente), <em>StorageLimitStatus</em> (gli eventuali limiti di storage) e <em>LastLogonTime</em> (il<br /> momento dell'ultimo LogOn).<br /> Nel seguente esempio utilizzeremo anche il comando <strong>select</strong><br /> per selezzionare (in unix si utilizzerebbe <strong>tail</strong> o <strong>grep</strong> a seconda di quello che dobbiamo fare) le ultime 5 linee dell'output. Ma ecco l'esempio:</p>
<p><code>[PS] C:\>Get-MailboxStatistics | select -last 5</code></p>
<code>
<table border=1>
<thead>
<tr>
<th>
DisplayName
</th>
<th>
ItemCount
</th>
<th>
StorageLimitStatus
</th>
<th>
LastLogonTime
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Luaaaa Aaaaaa
</td>
<td>
40964
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 9.23.05
</td>
</tr>
<tr>
<td>
Monbbb Bbbbb
</td>
<td>
959
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 17.59.09
</td>
</tr>
<tr>
<td>
Fcccc Ccccc
</td>
<td>
8843
</td>
<td>
NoChecking
</td>
<td>
28/06/2011 11.31.16
</td>
</tr>
<tr>
<td>
Dddd Dddddd
</td>
<td>
16
</td>
<td>
NoChecking
</td>
<td>
28/06/2011 11.48.46
</td>
</tr>
<tr>
<td>
Eeeea Feeee
</td>
<td>
54
</td>
<td>
NoChecking
</td>
<td>
28/06/2011 11.42.16
</td>
</tr>
</tbody>
</table>
</code>
<p>Ok, a questo punto vogliamo capire quale utente ha il numero più elevato di email, dunque utilizzeremo sempre il comando <strong>Get-MailboxStatistics</strong> combinato con <strong>sort</strong> per ordinare l'output e con <strong>select</strong> per selezionare le righe che ci interessano:</p>
<p><code>[PS] C:\> Get-MailboxStatistics | sort -property itemcount -descending | select -first 5</code></p>
<code>
<table border=1>
<thead>
<tr>
<th>
DisplayName
</th>
<th>
ItemCount
</th>
<th>
StorageLimitStatus
</th>
<th>
LastLogonTime
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Lisa Saaeevvkkss
</td>
<td>
49662
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 9.41.08
</td>
</tr>
<tr>
<td>
Luigi Vaakoyu
</td>
<td>
40966
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 9.23.05
</td>
</tr>
<tr>
<td>
Lodeini Dilede
</td>
<td>
36446
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 13.45.33
</td>
</tr>
<tr>
<td>
Leila Skywolk
</td>
<td>
33403
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 20.06.30
</td>
</tr>
<tr>
<td>
Ideale Bertee
</td>
<td>
29140
</td>
<td>
NoChecking
</td>
<td>
15/07/2011 22.25.39
</td>
</tr>
</tbody>
</table>
</code>
<p>in questo modo avremo i primi 5 utenti che hanno il maggior numero di email. Adesso introduciamo il comando <strong>ft</strong> (format-table) per avere un output maggiormente raffinato. Ossiamo vogliamo avere un elenco di mailbox ordinate per dimensione ma che venga mostrato anche il numero di email.</p>
<p><code>[PS] C:\>Get-MailboxStatistics | sort -property TotalItemSize -descending | ft -property DisplayName,TotalItemSize,ItemCount | select -first 7</code></p>
<code>
<table border=1>
<thead>
<tr>
<th>
DisplayName
</th>
<th>
TotalItemSize
</th>
<th>
ItemCount
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Pizzail Tinikske
</td>
<td>
14706614387B
</td>
<td>
22633
</td>
</tr>
<tr>
<td>
Lisa Saaeevvkkss
</td>
<td>
11793742821B
</td>
<td>
49662
</td>
</tr>
<tr>
<td>
Fedele Bartoe
</td>
<td>
10035695559B
</td>
<td>
23511
</td>
</tr>
<tr>
<td>
Leila Skywolk
</td>
<td>
9969973020B
</td>
<td>
33403
</td>
</tr>
<tr>
<td>
Ideale Bertee
</td>
<td>
9187185934B
</td>
<td>
29140
</td>
</tr>
</tbody>
</table>
</code>
<p><code>[PS] C:\></code></p>
<p>Alla prossima. Lewis.</p>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-28221560690713719922011-07-16T16:19:00.002+02:002011-07-16T20:02:46.611+02:00Exchange 2007: semplice esempio di regola di trasporto.<p>Ecco di seguito una semplice regola di trasporto per exchange 2007. Serve a porre un MARK sul subject di ogni mail che matcha su un certo dominio. Per esempio ho un exchange con un pop connector che scarica le mail da 2 differenti domini ma voglio che uno dei due venga individuato a colpo d'occhio dagli utenti, inserendo una specifica stringa sull'oggetto dell'email. Nel caso seguente inserisco la stringa <em>PIPPO</em> come prefisso dell'oggetto di tutte le email che hanno come destinatiri *@miodom.com Ecco la regola:</p><p><code>C:\> $condition = Get-TransportRulePredicate HeaderContains</code><br />
<code>C:\> $condition.MessageHeader = "To"</code><br />
<code>C:\> $condition.Words = @("miodom.com")</code><br />
<code>C:\> $action = Get-TransportRuleAction prependsubject</code><br />
<code>C:\> $Action.Prefix = "PIPPO "</code><br />
<code>C:\> New-TransportRule -name "MIODOM" -condition @($condition) -action @($Action) -enabled: $true</code></p><p><code>Name State Priority Comments</code><br />
<code>---- ----- -------- --------</code><br />
<code>MIODOM Enabled 1</code></p><p><code>C:\> Get-TransportRule | format-list</code></p><p><code>Priority : 1</code><br />
<code>Comments :</code><br />
<code>ManuallyModified : False</code><br />
<code>Conditions : {HeaderContains}</code><br />
<code>Exceptions :</code><br />
<code>Actions : {PrependSubject}</code><br />
<code>State : Enabled</code><br />
<code>Identity : MIODOM</code><br />
<code>Guid : 404acf8f-b9fd-463c-9127-f1c6717ced52</code><br />
<code>Name : MIODOM</code><br />
<code>IsValid : True</code><br />
<code>WhenChanged : 15/07/2011 16.50.10</code><br />
<code>ExchangeVersion : 0.1 (8.0.535.0)</code></p><p>A questo punto tutte le email dirette a @miodom.com avranno nel subject il prefisso "PIPPO ". A presto Lewis</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-43382832781888307322011-06-08T00:16:00.000+02:002022-07-02T04:06:31.571+02:00Elencare le mailbox su Exchange 2007 da Command Line<hr />
<p>Ecco come listare o elencare le mailbox su <a href="https://secure.wikimedia.org/wikipedia/it/wiki/Microsoft_Exchange">Exchange 2007</a> da linea di comando. Dalla Exchange Management Shell useremo il comando <strong>get-mailbox</strong>, così:<br /></p>
<p><code>[PS] C:\> get-mailbox | select-object DisplayName,SamAccountName</code> </p>
<code>
<table border=1>
<thead>
<tr>
<th>
DisplayName
</th>
<th>
SamAccountName
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Administrator
</td>
<td>
Administrator
</td>
</tr>
<tr>
<td>
Andrea Bianchi
</td>
<td>
abianchi
</td>
</tr>
<tr>
<td>
Andrea Rossi
</td>
<td>
arossi
</td>
</tr>
<tr>
<td>
Andrea Rosa
</td>
<td>
arosa
</td>
</tr>
<tr>
<td>
Andrea Verdi
</td>
<td>
averdi
</td>
</tr>
<tr>
<td>
Andrea Gialli
</td>
<td>
agialli
</td>
</tr>
<tr>
<td>
Andrea Marroni
</td>
<td>
amarroni
</td>
</tr>
</tbody>
</table>
</code>
<p>Adesso esportiamo in un file in questo caso si tratta di un <a href="https://secure.wikimedia.org/wikipedia/it/wiki/Comma-separated_values">CSV</a></p>
<p><code>[PS] C:\> get-mailbox | select-object DisplayName,SamAccountName | export-csv elenco\_mailbox.csv</code> </p>
<p>Oppure anche un semplice <strong>Get-MailBox</strong> senza nulla puo' essere sufficiente anche se i nomi lunghi vengono troncati.</p>
<p>ciao Lewis.</p>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-31226763702659666152011-06-07T10:03:00.007+02:002022-07-04T22:55:52.751+02:00IP Scan<p>Per creare una lista delle macchine e/o periferiche collegate alla propria rete locale dalla vostra linuxbox è sufficiente il comando <a href="http://www.nta-monitor.com/tools/arp-scan/">arp-scan</a>.<br />
Da fedora/centos/redhat è sufficiente il classico:<br /></p>
<span style="font-family: inherit; font-size: small; background-color: #f3f3f3; color: black;"># yum install arp-scan</span><br />
<p>su altre distro come ubuntu credo che un semplice:<br /></p>
<span style="font-size: small;background-color: #f3f3f3; color: black;"># apt-get install arp-scan</span><br />
<p>possa essere sufficiente.<br />
Una volta installato il software basta usare il flag -l per crearsi una lista di host collegati alla lan in modo molto veloce. Così:</p><br />
<div style="background-color: #f3f3f3; color: black; font-family: Arial, Helvetica, sans-serif;font-size: small;"># arp-scan -l</div><div style="background-color: #f3f3f3; color: black; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: small;">Interface: eth0, datalink type: EN10MB (Ethernet)<br />
Starting arp-scan 1.7 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)<br />
192.168.1.1 00:21:29:7a:3e:70 Cisco-Linksys, LLC<br />
1 packets received by filter, 0 packets dropped by kernel<br />
Ending arp-scan 1.7: 256 hosts scanned in 1.460 seconds (175.34 hosts/sec). 1 responded<br />
# </span></div><br />
<p>ciao, alla prossima.<br />
lewis</p>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-15912662897173085582011-05-21T20:16:00.005+02:002011-07-02T02:15:38.558+02:00Cambio permessi di una cartella windows da command line<div style="text-align: justify;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF41H-p5NzJx8XP39KMyNnZeFJ9VSPXTlnRQgmt_w9BdZqWZTENBxEm8GuRb679SMtAlBSznXeYKinoEgL9tQLhdnCAlODsm7ELbygMUzI1rLUeB3zWOAzWy0SRm2kVZ6-p-fzmPTQ3Tc/s1600/Schermata.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" height="88" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF41H-p5NzJx8XP39KMyNnZeFJ9VSPXTlnRQgmt_w9BdZqWZTENBxEm8GuRb679SMtAlBSznXeYKinoEgL9tQLhdnCAlODsm7ELbygMUzI1rLUeB3zWOAzWy0SRm2kVZ6-p-fzmPTQ3Tc/s400/Schermata.png" width="400" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Permessi Full su cartella</td></tr>
</tbody></table><br />
</div><div style="text-align: justify;">Oggi vedremo come utilizzare SetACL.exe per cambiare i permessi di una qualsia cartella.</div><div style="text-align: justify;">Prelevate subito <a href="http://sourceforge.net/projects/setacl/files/">SetACL</a> e scompattatelo in una qualsiasi cartella.</div><div style="text-align: justify;">All'interno oltre trovare l'eseguibile ci saranno anche vari esempi per l'utilizzo all'interno di script vbs,perl ecc.</div><div style="text-align: justify;">Mentre eccovi alcuni esempi per l'utilizzo nella shell:</div><span style="background-color: #f3f3f3; color: black; font-family: "Courier New",Courier,monospace;">c:\> \\jupiter\wpkg\bin\SetACL.exe" -on "%ProgramFiles%\Ars Edizioni Informatiche" -ot file -actn ace -ace n:users;p:full' </span><br />
<div style="text-align: justify;">Questo esempio l'ho preso da un semplice bat che utilizzo per l'installazione automatica o anche detta silent install o software deployment di un'applicazione che abitualmente viene installata sulle workstation aziendali.</div><div style="text-align: justify;">In questo caso vengono impostati i permessi "Full Access" per il gruppo "users".</div><div style="text-align: justify;">Ecco il significato degli argomenti:</div><span style="background-color: #f3f3f3;"><span style="color: black;">-on "c:\nomecartella" </span></span> on sta per ObjectName e significa il nome della cartella<br />
<span style="background-color: #f3f3f3;"><span style="color: black;">-ot file</span></span> ot sta per ObjectType ossia tipo dell'oggetto, in questo caso si tratta di file<br />
<span style="background-color: #f3f3f3; color: black; font-family: "Courier New",Courier,monospace;">-actn ace</span> actn sta per Action ossia azione mentre ace sta per "Access Control Entry" quindi accessi<br />
<span style="background-color: #f3f3f3; color: black; font-family: "Courier New",Courier,monospace;">-ace n:users;p:full</span> ace quindi sta per accessi, n è l'utente o il gruppo mentre p è il permesso. Quindi al gruppo users full access.<br />
<div style="text-align: justify;">Una piccola parentesi finale sul software deployment anche se sarebbe più corretto dire automated software deployment. Quando hai diverse decine di pc su cui devi spesso installare/disinstallare software, stampanti,chiavi di registro ecc il procedimento manuale può diventare davvero noioso ma soprattutto oneroso in termini di tempo. Quindi la migliore cosa che possiamo fare è implementare una soluzione di deploy automatico. Io personalmente uso <a href="http://wpkg.org/">wpkg</a> e devo dire che mi trovo abbastanza bene. Si tratta di uno script in javascript molto leggero e flessibile che ti permette di gestire il tuo parco software e stampanti molto semplicemente. Esiste un <a href="http://wpkg.org/Category:Silent_Installers">database</a> di pacchetti e penso che questo progetto diverrà via via sempre più interessante. </div><div style="text-align: justify;">Vabbè questo sarà l'argomento del prossimo post.</div><div style="text-align: justify;">ciao</div><div style="text-align: justify;">luigi</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-63255621429803855982011-05-15T20:56:00.002+02:002011-05-15T21:04:41.104+02:00Bloccare una lista di siti.<div style="text-align: left;">Ciao,</div><div style="text-align: left;">approfitto di una domanda letta su un forum per scrivere questo post. Ossia come bloccare una lista di siti indesiderati in modo da realizzare una semplice parental controll.</div><div style="text-align: left;">La soluzione che propongo è molto semplice e non comporta l'addentrarsi in tecnicismi quali l'utilizzo di proxy più o meno avanzati o l'uso di iptables. Questo tipo di blocco è ovviamente circoscritto all'utilizzo di Firefox, quindi al di fuori del browser tutte le altre applicazioni non avranno questa restrizione.</div><div style="text-align: left;">Quindi scarichiamo ed installiamo il <a href="https://addons.mozilla.org/it/firefox/addon/blocksite/?src=api">seguente addon</a> per firefox clicckando "vai al download" e quindi "download ora". Infine una volta installato l'addon riavviate firefox.</div><div style="text-align: left;"><br />
</div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-left: 0px; margin-right: auto; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMiNWYE1Wv-r2jRXgea2WHTzPXJL4PF3HmoV6TZDbtL6DZ16JLznfWFZQhcmqCT8JecspXEQjDGLa50_VuLwD9yz1J8MyAFhHoZSYszwZH_cUho4ylNNqxXhn1tGqw5QG15ztiFoaxug0/s1600/blocksite.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="115" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMiNWYE1Wv-r2jRXgea2WHTzPXJL4PF3HmoV6TZDbtL6DZ16JLznfWFZQhcmqCT8JecspXEQjDGLa50_VuLwD9yz1J8MyAFhHoZSYszwZH_cUho4ylNNqxXhn1tGqw5QG15ztiFoaxug0/s320/blocksite.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Clicca su prefenze di BlockSite</td></tr>
</tbody></table><div style="text-align: left;">A questo punto andando nella finestra dei "componenti aggiuntivi" sotto "strumenti" cliccate sulle preferenze dell'estensione "blocksite". Vedi figura.</div><div style="text-align: left;">Una volta fatta questa operazione vi ritroverete dentro una nuova finestra dove potrete facilmente aggiungere tutti i siti che volete bloccare. Non solo i siti che voi inserite verranno bloccati ma anche tutti i link a quei siti che troverete sul web verranno disattivati.</div><table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-left: 0px; margin-right: auto; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh09699Sgiuigi1mwH_v4CayBtvrX5l3L1eq2OiBoCL51JDpwbec5ene1I0MrtDWXWltwv_JL1E73vRmzZURxdPa1rcQry3cqmDeYyooBubD2bLlHkUJ_i_8c4DEiqPUsT89LSVQQu03Go/s1600/blocksite2.png" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="219" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh09699Sgiuigi1mwH_v4CayBtvrX5l3L1eq2OiBoCL51JDpwbec5ene1I0MrtDWXWltwv_JL1E73vRmzZURxdPa1rcQry3cqmDeYyooBubD2bLlHkUJ_i_8c4DEiqPUsT89LSVQQu03Go/s320/blocksite2.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Ecco come filtrare siti pericolosi.</td><td class="tr-caption" style="text-align: center;"><br />
</td><td class="tr-caption" style="text-align: center;"><br />
</td></tr>
</tbody></table><div style="text-align: left;">Quindi ora vi si è aperta la finestra delle preferenze di "blocksite". Mettiamo che vogliate impedire ai vostri pargoli di passare al lato oscuro della forza... bene una volta cliccato sul tasto "add" inserite il seguente indirizzo web http://www.microsoft.com e quindi cliccate su OK.</div><div style="text-align: left;">A questo punto mettiamo che i vostri figli entrino in contatto con personaggi loschi e poco raccomandabili e che venga loro la curiosità di sapere cos'è MICROSOFT... quindi andranno su google e digiteranno l'immonda parola..</div><div class="separator" style="clear: both; text-align: left;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9VGe6Erwu3-KkJy0nd-I_An95dLOMSnL_PuJ4kLHC-_5hC0CJxOpne6eYPf5eahX-WW_X6FTdtXEhnL2adYHJ_y21LEKDOfpkbC4p-0EKDEdGClicn_Od4lkzVZMi3oVOCLS_z7skw7k/s1600/blocksite3.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" height="242" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9VGe6Erwu3-KkJy0nd-I_An95dLOMSnL_PuJ4kLHC-_5hC0CJxOpne6eYPf5eahX-WW_X6FTdtXEhnL2adYHJ_y21LEKDOfpkbC4p-0EKDEdGClicn_Od4lkzVZMi3oVOCLS_z7skw7k/s400/blocksite3.png" width="400" /></a></div><div style="text-align: left;"> </div><div style="text-align: left;">Ed ecco cosa otterranno!!</div><div style="text-align: left;">Però se noterete tutti i sotto domini di microsoft.com saranno accessibili e i link cliccabili. Questo semplicemente perché la gramigna è dura a morire e deve essere estirpata con cura per potersene liberare. Quindi la cosa migliore che possiamo fare è aggiungere ai siti bloccati l'intero dominio microsoft.com inserendo la seguente stringa: http://*.microsoft.com</div><div style="text-align: left;">Ecco adesso avremo fatto un lavoro come si deve e potremo dormire sonni tranquilli.</div><div style="text-align: left;">La cosa interessante di questa estensione è che possibile inserire una password per poter accedere all'estensione stessa. Per fare ciò basterà cliccare sul flag "Enable Authentication" nelle prefenze di BlockSite e quindi e inserire una password di accesso. Una volta dato l'OK, per rientrare nelle preferenze ,sarà necessario digitare la password segreta. Questo ovviamente per evitare che chicchessia possa alterare o disattivare la lista di siti bloccati.</div><div style="text-align: justify;"></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-57780260680875232922011-04-02T16:49:00.011+02:002011-05-19T00:25:58.663+02:00Lanciare applicazioni su pc windows remoti<div style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">psexec è una utility a linea di comando per windows molto nota e che potete trovare al seguente link....<a href="http://technet.microsoft.com/en-us/sysinternals/bb897553" style="background-color: cyan;">qui</a><span style="background-color: cyan;">.</span></span></div><div style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">Viene utilizzata per lanciare applicazioni in remoto su pc windows. La sintassi da cmd è molto semplice:</span></div><div style="background-color: white; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: small;">c:\ > psexec \\mypc cmd</span></div><div style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">Con l'esempio qui sopra è possibile aprire una shell dos sul pc remoto... quasi come in ssh.</span></div><div style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">Il corrispettivo di psexec in linux si chiama winexe e potete scaricarlo da <a href="http://sourceforge.net/projects/winexe/" style="background-color: cyan;">qui su SF</a></span></div><div style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">ecco la sintassi ed un esempio per cambiare la password di administrator:</span></div><div style="background-color: white; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: small;">./winexe -U Administrator%oldpass //mypc 'net user administrator newpass'</span></div><div style="font-family: Georgia,"Times New Roman",serif;"><span style="font-size: small;">molto semplice..</span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-73662321751459648832011-02-18T00:05:00.001+01:002011-07-19T00:51:22.525+02:00dump del BIOS<p>Parliamo ancora di dump, questa volta effettuiamo un dump del bios di un pc, sempre da linux ovviamente:</p>
<p><code>dd if=/dev/mem of=BIOS.dump bs=1 count=65536 seek=983040</code></p>
<p>successivamente possiamo analizzare il dump con objdump: <code>objdump -b binary -m i8086 -D BIOS.dump</code></p>
<p>vostro lewis</p>
Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-85201747642247956652011-02-17T23:46:00.001+01:002011-04-02T16:26:09.370+02:00Spostare file con una estensione specifica<div style="font-family: "Courier New",Courier,monospace;">Ecco una nuova linea di comando per spostare i file di backup di autocad con estensione .bak in una zona specifica del disco:</div><br />
<span style="font-family: Arial,Helvetica,sans-serif;"># find . -iname "*.bak" -exec mv -v -b --backup=t '{}' /srv2/samba/bak/ ';'</span><br />
<br />
<div style="font-family: "Courier New",Courier,monospace;">gli argomenti:</div><div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-iname "*.bak"</span> indica di trovare tutti i file con estensione .bak o .BAK o .Bak ecc</div><div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-exec mv -v -b --backup=t '{}' /srv2/samba/bak/ ';'</span> questa opzione indica di spostare (mv) tutti i file trovate dall'argomento precedente sotto la directory /srv2/samba/bak gli altri argomenti relativi al move: -v sta per verbose mentre il resto serve per effettuare un backup del file nel caso ci siano file differenti con nomi identici.</div><div style="font-family: "Courier New",Courier,monospace;"><br />
</div><div style="font-family: "Courier New",Courier,monospace;">Volendo è possibile anche aggiungere <span style="font-family: Arial,Helvetica,sans-serif;">-mtime +30</span> <span style="font-family: "Courier New",Courier,monospace;">per selezionare i file che sono stati modificati da più di 30 giorni ossia i file più vecchi di 1 mese.</span></div><div style="font-family: "Courier New",Courier,monospace;"></div><span style="font-family: "Courier New",Courier,monospace;">Divertitevi!</span>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-22046596328182795632011-02-17T23:34:00.001+01:002011-04-02T16:26:35.599+02:00un dump ldap di active directory da LINUX<div style="font-family: "Courier New",Courier,monospace;">Ecco una semplice linea di comando per effettuare un dump ldap di un albero active directory:</div><br />
<div style="color: black;"><span style="background-color: white; font-family: Arial,Helvetica,sans-serif;"># ldapsearch -x -b "dc=example,dc=local" -D "cn=mio utente,ou=Users,ou=MiaAzienda,dc=example,dc=local" -h 192.168.1.X -W</span></div><br />
<div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-x </span>serve ad utilizzare un autenticazione semplice SASL</div><div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-b "argomento"</span> è il bind di autenticazione ossia l'utente ldap necessario ad autenticarsi su AD</div><div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-D "argomento"</span> è l'ou o il ramo AD di cui vogliamo il dump</div><div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-h ip</span> è l'indirizzo del server</div><div style="font-family: "Courier New",Courier,monospace;"><span style="font-family: Arial,Helvetica,sans-serif;">-W </span>serve per avere una richiesta della password</div><div style="font-family: "Courier New",Courier,monospace;"><br />
</div><div style="font-family: "Courier New",Courier,monospace;">Buon Divertimento!</div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-33498008058488677722011-01-14T01:21:00.003+01:002011-04-02T16:23:35.592+02:00Autodesk Autocad 2011 e la qualità del supporto<div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Negli ultimi tempi l'azienda per la quale lavoro ha acquistato alcune licenze di rete per Autocad 2011. Grazie a ciò ho potuto sperimentare la qualità del supporto fornito da autodesk a sysadmin e/o utenti.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Sono partito già abbastanza prevenuto in quanto i costi di licenza di Autocad NET sono a dir poco scandalosi. Non solo i progettisti sono costretti a rimanere schiavi e prigionieri di un formato proprietario e vittime di un monopolio che sembra più un regime che altro. Ma le singole licenze di rete hanno costi fuori da qualunque logica. C'è da dire che molti progettisti in qualche modo se la tirano... perché non fanno nessuno sforzo per cercare di uscire dal tunnel. A tutto ciò si aggiunge la totale ignoranza di certi manager che per paura di sbagliare si affidano al detto "così fan tutti".</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Ad ogni modo vengo al punto.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Il supporto di autodesk è davvero pessimo. Ho avuto qualche problema nel deploy dell'applicazione sulla rete e quello che ho trovato è stata maleducazione, scortesia e menefreghismo. Però a dirla tutta le mie richieste in taluni casi esulavano dal mio diritto in quanto riguardavano più il software di deploy (wpkg) che non l'installazione nuda e cruda di autocad2011. Ma anche nel caso di domande specifiche sulle licenze e il loro uso autodesk si è dimostrata reticente a volte dimostrando persino di NON comprendere bene la domande fatte.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Insomma sono stati spesi diverse migliaia di euro per 4 dvd e un supporto quasi inesistente. Le problematiche di deploy delle *loro* specifiche directx 9.0c me lo sono dovute risolvere da solo. Mentre le domande sulle licenze hanno avuto come risposta la ricerca sul sito di autodesk.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Addirittura sulla questione del deploy del pacchetto sulla lan si percepiva la sensazione che dall'altra parte non si compredessero nemmeno termini tecnici quali fork o deploy stesso.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;"><br />
</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">La cosa veramente buffa è stata la seguente:</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">apro un ticket perché un utente mi segnala che appena installato, autocad crasha con "memoria insufficiente" e qualche info di debug.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Quindi insieme al ticket allego un file odt con all'interno gli shot dell'errore. Ebbene il tecnico mi chiede di rimandare il file perché risulta ... *corrotto*.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Mi è davvero venuto il dubbio che il file fosse corrotto .. ma ehmm no.. probabilmente non si potevano permettere openoffice. ROTFL.</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;"><br />
</span></div><div style="font-family: "Courier New",Courier,monospace; text-align: justify;"><span style="font-size: small;">Quindi per terminare .. questo autocad è un furto in piena regola, il prodotto non vale il prezzo, il supporto non è all'altezza (almeno per quanto riguarda licenze e installazione) e a dirla tutta anche dal punto di vista di un admin l'immagine di deploy non è il massimo.</span></div>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-90633424676120213572010-11-12T01:16:00.002+01:002011-04-02T16:26:49.032+02:00Aprire un file di testo in remoto con gvim.gvim scp://root@mioserver//mio/path/wpkg/file.xml<br />
<a href="http://www.wpkg.org/">wpkg</a>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-61764018931070609012010-10-28T00:10:00.005+02:002011-04-02T16:25:10.770+02:00Time server in 2003: sincronizzare l'ora da fonte esterna<div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">Ultimamente ho avuto qualche problema per via del fatto che il mio dc nonostante cambiassi il server di sincronizzazione dell'ora dopo qualche decina di secondi tornava all'ora non corretta.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">I seguenti sono gli appunti su questo argomento.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;"><br />
</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">1) Il valore contenuto in:</span></div><div style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">determina se la fonte di sincronizzazione deve essere un sntp esterno oppure la cmos. Il valore di default dovrebbe essere 10 (cmos). Mentre inserendo il valore 5 si indica all'so di sincronizzare con una fonte esterna.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">2) Per settare l'sntp server esterno per la sincronizzazione si puo' fare in 2 modi, o andando ad editare il registro oppure più semplicemente con:</span></div><div style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">net time /setsntp:"ntp1.inrim.it,0x1 ntp2.inrim.it,0x1"</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">3) il valore ",0x1" in coda all'indirizzo dell'sntp serve a forzare la sincronizzazione secondo un intervallo preciso indicato in:</span></div><div style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">HKLM\SYSTEM\CurrentControlSet\Services\W32Time\TimeProviders\NtpClient\SpecialPollInterval</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">senza questa stringa windows si attiene alle specifiche ntp.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">4) riavviare il servizio con:</span></div><div style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">net stop w32time && net start w32time</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">5) aprire il firewall su udp:123</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">6) eventualmente provare a forzare la sincronizzazione con:</span></div><div style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace;"><span style="font-size: x-small;">w32tm /resync /rediscover</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;"><br />
</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">Regole.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">a) tutti i client di un dominio e tutti i server membri usano il dc come server orario.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">b) tutti i dc nominano il pdc come server orario.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">c) tutti pdc nominano il capo della foresta come server orario.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;"><br />
</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">P.S. se non viene cambiata la key del registro al punto 1 il server tornerà ad avere l'ora della cmos dopo alcune decine di secondi.</span></div><div style="font-family: Verdana,sans-serif;"><span style="font-size: small;">Per trovare il PDC emulator a cui fa riferimento il DC è necessario installare i "support tools" per xp o per 2003 ed eseguire il seguente comando:</span><br />
<span style="font-size: small;"><code> </code></span></div><div style="background-color: #999999; color: black;"><span style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace; font-size: x-small;"><code>C:\Programmi\Support Tools>netdom.exe query /domain:MIODOMINIO fsmo </code></span></div><span style="background-color: #999999; color: black; font-family: "Courier New",Courier,monospace; font-size: x-small;"><code><br />
</code></span><br />
<style type="text/css">
p { margin-bottom: 0.21cm; }
</style>Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-52561236311960248372010-09-30T01:27:00.001+02:002011-04-02T16:24:53.225+02:00Exchange 2007 tricks<i>ottenere la lista delle public folder:</i><br />
C:\Documents and Settings\sysadmin\Desktop>Get-PublicFolder \ -Recurse<br />
<br />
<span style="font-size: x-small;">Name Parent Path<br />
---- -----------<br />
IPM_SUBTREE<br />
Calendario Condiviso Pippo \<br />
Contatti aziendali TOPOLINO \<br />
Contatti Gruppo Paperini \</span><br />
<span style="font-size: x-small;"><br />
</span><br />
<div><i><span style="font-size: small;">ottenere i permessi su una data cartella pubblica:</span></i></div><div><span style="font-size: x-small;">C:\Documents and Settings\sysadmin\Desktop>Get-PublicFolderClientPermission -id '\Contatti aziendali TOPOLINO'</span></div><br />
Identity User AccessRights<br />
-------------- --------- -----------------------<br />
\Contatti TOPOLINO Predefinito {None}<br />
\Contatti TOPOLINO example.local/disney/Users/ppape {Owner}<br />
\Contatti TOPOLINO example.local/disney/Users/ttopo {Owner}<br />
\Contatti TOPOLINO Anonimo {CreateItems}Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-74603810871240157982010-09-30T00:51:00.003+02:002011-04-02T16:27:03.078+02:00Concatenare ssh o ssh chainssh -t -L 8000:localhost:8000 jumpbox.example.com 'ssh -L 8000:splunk.inside.example.com:8000 splunk01'Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-58954901833471592822010-09-30T00:49:00.000+02:002022-07-02T04:06:47.028+02:00Sapere se Windows 2003 è a 32 o a 64 bitcmd -> sysdm.cpl -> se è a 64 bit è indicato, se no è a 32<br />
oppure<br />
cmd -> winmsd.exe -> dettagli tipo di processore -> x86 (32bit), EM64T o ia64 (64bit)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4358092992920934258.post-67794469745311016982010-09-30T00:47:00.001+02:002011-04-02T16:24:29.182+02:00AD e utentiuna query per avere l'utenteldap <br />
<b>c:\ > dsquery user -name esempioUtente</b>Unknownnoreply@blogger.com0