snipt

Ctrl+h for KB shortcuts

Bash

Find size of all but few directories

du -sh `ls -1 | grep -v -e atf_runs -e exploration`
https://snipt.net/embed/4c5e9758e35335ae45b5df5c3adff3fe/
/raw/4c5e9758e35335ae45b5df5c3adff3fe/
4c5e9758e35335ae45b5df5c3adff3fe
bash
Bash
1
2019-07-21T17:20:44
True
False
False
/api/public/snipt/30373/
find-size-of-all-but-few-directories
<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>du -sh <span class="sb">`</span>ls -1 <span class="p">|</span> grep -v -e atf_runs -e exploration<span class="sb">`</span> </span></pre></div> </td></tr></table>
bash, negation, wildcard

Text only

Find feature in given license server/file

$XILINX/bin/lin64/lmutil lmdiag <feature> -c <server/file>
https://snipt.net/embed/e6d1cac487c2bc9ee47d0c83ecb1e3bd/
/raw/e6d1cac487c2bc9ee47d0c83ecb1e3bd/
e6d1cac487c2bc9ee47d0c83ecb1e3bd
text
Text only
1
2019-07-16T05:24:27
True
False
False
/api/public/snipt/30178/
find-feature-in-given-license-serverfile
<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>$XILINX/bin/lin64/lmutil lmdiag &lt;feature&gt; -c &lt;server/file&gt; </span></pre></div> </td></tr></table>
licensing

Python

print function name and arguments

1
2
3
4
5
6
def f_info():
	print "Running function: '%s' Argument: %s"%(sys._getframe(1).f_code.co_name,sys._getframe(1).f_locals)

def check_for_dir(d):
	f_info()
	return os.path.isdir(dir)
https://snipt.net/embed/28085d8da3a6df4888a66b85c8c2e1cf/
/raw/28085d8da3a6df4888a66b85c8c2e1cf/
28085d8da3a6df4888a66b85c8c2e1cf
python
Python
6
2019-07-07T06:49:22
True
False
False
/api/public/snipt/29834/
print-function-name-and-arguments
<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="k">def</span> <span class="nf">f_info</span><span class="p">():</span> </span><span id="L-2"><a name="L-2"></a> <span class="k">print</span> <span class="s2">&quot;Running function: &#39;</span><span class="si">%s</span><span class="s2">&#39; Argument: </span><span class="si">%s</span><span class="s2">&quot;</span><span class="o">%</span><span class="p">(</span><span class="n">sys</span><span class="o">.</span><span class="n">_getframe</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">f_code</span><span class="o">.</span><span class="n">co_name</span><span class="p">,</span><span class="n">sys</span><span class="o">.</span><span class="n">_getframe</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">.</span><span class="n">f_locals</span><span class="p">)</span> </span><span id="L-3"><a name="L-3"></a> </span><span id="L-4"><a name="L-4"></a><span class="k">def</span> <span class="nf">check_for_dir</span><span class="p">(</span><span class="n">d</span><span class="p">):</span> </span><span id="L-5"><a name="L-5"></a> <span class="n">f_info</span><span class="p">()</span> </span><span id="L-6"><a name="L-6"></a> <span class="k">return</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">isdir</span><span class="p">(</span><span class="nb">dir</span><span class="p">)</span> </span></pre></div> </td></tr></table>
function, python