<div dir="ltr"><div>These should all be posix compliant sh(1) FreeBSD compatible. Not sure about other systems.</div><div><br></div><div># Kill or list some stopped processes</div><div>alias stopkill='kill `ps a -o stat,pid |awk '\''/^T /{print $2}'\''`'</div>
<div>alias stoplist='ps -p `ps a -o stat,pid |awk '\''/^T /{print $2}'\''` 2>/dev/null'</div><div><div><br></div><div># Kill or list some zombies</div><div>alias zomkill='kill `ps a -o stat,pid |awk '\''/^Z /{print $2}'\''`'</div>
<div>alias zomlist='ps -p `ps a -o stat,pid |awk '\''/^Z /{print $2}'\''` 2>/dev/null'</div></div><div><div><br></div><div># Need a new 10 char[] password ?</div><div>alias newpass='LANG=C tr -ucd [:alnum:][:punct:] </dev/urandom |tr -ud OZkl |tr -us [:alnum:][:punct:] |head -c 10 && echo'</div>
</div><div><br></div><div># cisco Systems like ping(1)</div><div>alias cping='sudo /sbin/ping -n -c 5 -t 2 -i 0.1 -s 72'<br></div><div><br></div><div># Sweep through sizes when ping'ing a host</div><div>alias sweep='ping -D -G 56 -h 7'<br>
</div><div><br></div><div># Need some specific permissions of files devices or directories ?</div><div>alias permof='stat -f "%p %Sp %Su %Sg %N"'<br></div><div><br></div><div># List major minor and type of a device ?</div>
<div>alias lsdev='stat -f "%nName:%t%N%nType:%t%HT%nMajor:%t%Hr%nMinor:%t%Lr%n%n"'<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Mar 14, 2014 at 11:29 AM, Marc Spitzer <span dir="ltr"><<a href="mailto:mspitzer@gmail.com" target="_blank">mspitzer@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">We need to share our not so stupid unix tricks. Here is one:<div><br></div><div>ssh key access audit script:</div>
<div>for i in $(seq 254) ; do x="192.168.49.$i"; echo -n "$x: " ; ssh -o PasswordAuthentication=no -o NumberOfPasswordPrompts=0 $x hostname ;</div>
<div><br></div><div>this will give you one of 3 things:</div><div>1: hostname</div><div>2: failed login</div><div>3: unreachable error</div><div><br></div><div>Easy way to find out where your keys work, who's next?<span class="HOEnZb"><font color="#888888"><br>
</font></span></div><span class="HOEnZb"><font color="#888888"><div><div><br></div><div>Marc</div>-- <br>Freedom is nothing but a chance to be better.<br>--Albert Camus<br><br>The inherent vice of capitalism is the unequal sharing of blessings; the inherent virtue of socialism is the equal sharing of miseries. <br>
-- Winston Churchill<br><br>Do the arithmetic or be doomed to talk nonsense.<br>--John McCarthy
</div></font></span></div>
<br>_______________________________________________<br>
talk mailing list<br>
<a href="mailto:talk@lists.nycbug.org">talk@lists.nycbug.org</a><br>
<a href="http://www.nycbug.org/mailman/listinfo/talk" target="_blank">http://www.nycbug.org/mailman/listinfo/talk</a><br></blockquote></div><br></div>