snipt

Ctrl+h for KB shortcuts

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-08-11T12:18:17
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

Python

Get platform information

1
2
3
4
5
6
7
8
# Get platform information
import platform
platform.uname()
platform.platform()
platform.release()
platform.version()   
platform.system()    
dir(platform)        
https://snipt.net/embed/052a322b93023f96e15542a287f04a67/
/raw/052a322b93023f96e15542a287f04a67/
052a322b93023f96e15542a287f04a67
python
Python
8
2019-08-24T04:48:46
True
False
False
/api/public/snipt/28017/
get-platform-information
<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> <a href="#L-7">7</a> <a href="#L-8">8</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1"># Get platform information</span> </span><span id="L-2"><a name="L-2"></a><span class="kn">import</span> <span class="nn">platform</span> </span><span id="L-3"><a name="L-3"></a><span class="n">platform</span><span class="o">.</span><span class="n">uname</span><span class="p">()</span> </span><span id="L-4"><a name="L-4"></a><span class="n">platform</span><span class="o">.</span><span class="n">platform</span><span class="p">()</span> </span><span id="L-5"><a name="L-5"></a><span class="n">platform</span><span class="o">.</span><span class="n">release</span><span class="p">()</span> </span><span id="L-6"><a name="L-6"></a><span class="n">platform</span><span class="o">.</span><span class="n">version</span><span class="p">()</span> </span><span id="L-7"><a name="L-7"></a><span class="n">platform</span><span class="o">.</span><span class="n">system</span><span class="p">()</span> </span><span id="L-8"><a name="L-8"></a><span class="nb">dir</span><span class="p">(</span><span class="n">platform</span><span class="p">)</span> </span></pre></div> </td></tr></table>
os, platform, python, system

ActionScript 3

as3 check operating system

1
2
3
var OS:String = Capabilities.os;
var isMac:Boolean = OS.indexOf("Mac") == 0;
trace("isMac: " + isMac);
https://snipt.net/embed/18b103e8c039e68b76d2d5cbf488aa9e/
/raw/18b103e8c039e68b76d2d5cbf488aa9e/
18b103e8c039e68b76d2d5cbf488aa9e
as3
ActionScript 3
3
2019-08-17T08:16:52
True
False
False
/api/public/snipt/4811/
as3-check-operating-system
<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="kd">var</span> <span class="n">OS</span><span class="p">:</span><span class="kt">String</span> <span class="o">=</span> <span class="n">Capabilities</span><span class="o">.</span><span class="na">os</span><span class="o">;</span> </span><span id="L-2"><a name="L-2"></a><span class="kd">var</span> <span class="n">isMac</span><span class="p">:</span><span class="kt">Boolean</span> <span class="o">=</span> <span class="n">OS</span><span class="o">.</span><span class="na">indexOf</span><span class="o">(</span><span class="s2">&quot;Mac&quot;</span><span class="o">)</span> <span class="o">==</span> <span class="mi">0</span><span class="o">;</span> </span><span id="L-3"><a name="L-3"></a><span class="nf">trace</span><span class="o">(</span><span class="s2">&quot;isMac: &quot;</span> <span class="o">+</span> <span class="n">isMac</span><span class="o">);</span> </span></pre></div> </td></tr></table>
"operating system", as, capabilities, os