snipt

Ctrl+h for KB shortcuts

Bash

Switch between 32 bit and 64 bit

1
2
3
4
5
6
7
#Switching between Lion 64-bit and 32-bit

#To check which mode you?re currently in, run this command on the terminal: systemsetup -getkernelbootarchitecturesetting

#To set your machine to boot into 64-bit mode, enter this command and reboot: sudo systemsetup -setkernelbootarchitecture x86_64

#To set your machine to boot into 32-bit mode, enter this command and reboot: sudo systemsetup -setkernelbootarchitecture i386
https://snippets.siftie.com/embed/5976098fec37ee87d1e5572a54d961cd/
/raw/5976098fec37ee87d1e5572a54d961cd/
5976098fec37ee87d1e5572a54d961cd
bash
Bash
7
2019-03-01T01:21:57
True
False
False
/api/public/snipt/29824/
switch-between-32-bit-and-64-bit
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="c1">#Switching between Lion 64-bit and 32-bit</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="c1">#To check which mode you?re currently in, run this command on the terminal: systemsetup -getkernelbootarchitecturesetting</span> </span><span id="L-4"><a name="L-4"></a> </span><span id="L-5"><a name="L-5"></a><span class="c1">#To set your machine to boot into 64-bit mode, enter this command and reboot: sudo systemsetup -setkernelbootarchitecture x86_64</span> </span><span id="L-6"><a name="L-6"></a> </span><span id="L-7"><a name="L-7"></a><span class="c1">#To set your machine to boot into 32-bit mode, enter this command and reboot: sudo systemsetup -setkernelbootarchitecture i386</span> </span></pre></div> </td></tr></table>
mac

Bash

Re-show Lion's hidden Library folder

chflags nohidden ~/Library/
https://snippets.siftie.com/embed/a1b5f94c399c34b7cbae4e2409054254/
/raw/a1b5f94c399c34b7cbae4e2409054254/
a1b5f94c399c34b7cbae4e2409054254
bash
Bash
1
2019-03-20T21:24:28
True
False
False
/api/public/snipt/29823/
re-show-lions-hidden-library-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>chflags nohidden ~/Library/ </span></pre></div> </td></tr></table>
mac

Bash

Prevent auto-start of SecuRemote

1
2
3
tcsh 
source /opt/CPsrsc-50/.cshrc 
sudo StartupItemsMgr remove /opt/CPsrsc-50/bin/SecureClient.app
https://snippets.siftie.com/embed/67bd527b51b8b6c4f4c5c31c9d4b6b60/
/raw/67bd527b51b8b6c4f4c5c31c9d4b6b60/
67bd527b51b8b6c4f4c5c31c9d4b6b60
bash
Bash
3
2019-03-06T10:07:48
True
False
False
/api/public/snipt/29822/
prevent-auto-start-of-securemote
<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>tcsh </span><span id="L-2"><a name="L-2"></a><span class="nb">source</span> /opt/CPsrsc-50/.cshrc </span><span id="L-3"><a name="L-3"></a>sudo StartupItemsMgr remove /opt/CPsrsc-50/bin/SecureClient.app </span></pre></div> </td></tr></table>
mac

Bash

find and delete

find . -name "FILE-TO-FIND"-exec rm -rf {} \;
https://snippets.siftie.com/embed/1967e81f57d8cda3f1740bc4d75ea360/
/raw/1967e81f57d8cda3f1740bc4d75ea360/
1967e81f57d8cda3f1740bc4d75ea360
bash
Bash
1
2019-03-17T17:15:10
True
False
False
/api/public/snipt/12527/
find-and-delete
<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>find . -name <span class="s2">&quot;FILE-TO-FIND&quot;</span>-exec rm -rf <span class="o">{}</span> <span class="se">\;</span> </span></pre></div> </td></tr></table>
bash, unix

Text only

Windows registry key for virus scan manual schedule override

1
2
3
4
#Reg key to allow config of virus scan time:

[HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Prescheduled Scan Configuration]
"AllowCfg"=dword:00000001
https://snippets.siftie.com/embed/c4bb89cf5c3245805dab166369fd78eb/
/raw/c4bb89cf5c3245805dab166369fd78eb/
c4bb89cf5c3245805dab166369fd78eb
text
Text only
4
2019-03-04T16:37:37
True
False
False
/api/public/snipt/10594/
windows-registry-key-for-virus-scan-manual-schedule-override
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>#Reg key to allow config of virus scan time: </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>[HKEY_LOCAL_MACHINE\SOFTWARE\TrendMicro\PC-cillinNTCorp\CurrentVersion\Prescheduled Scan Configuration] </span><span id="L-4"><a name="L-4"></a>&quot;AllowCfg&quot;=dword:00000001 </span></pre></div> </td></tr></table>
registry, windows

Bash

Find with grep

 find ./ -name *.* -exec grep -i "something" '{}' \; -print
https://snippets.siftie.com/embed/5211293736ee91788e2826c567cc7b15/
/raw/5211293736ee91788e2826c567cc7b15/
5211293736ee91788e2826c567cc7b15
bash
Bash
1
2019-02-22T14:08:41
True
False
False
/api/public/snipt/6421/
find-with-grep
<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> find ./ -name *.* -exec grep -i <span class="s2">&quot;something&quot;</span> <span class="s1">&#39;{}&#39;</span> <span class="se">\;</span> -print </span></pre></div> </td></tr></table>
unix

Perl

CPAN for proxy

1
2
3
#Configure CPAN for proxy
cpan> o conf init /proxy/
#and then follow the prompts
https://snippets.siftie.com/embed/298172733eee72bcda1acfcad146819d/
/raw/298172733eee72bcda1acfcad146819d/
298172733eee72bcda1acfcad146819d
perl
Perl
3
2019-03-17T21:04:19
True
False
False
/api/public/snipt/3812/
cpan-for-proxy
<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="c1">#Configure CPAN for proxy</span> </span><span id="L-2"><a name="L-2"></a><span class="n">cpan</span><span class="o">&gt;</span> <span class="n">o</span> <span class="n">conf</span> <span class="n">init</span> <span class="sr">/proxy/</span> </span><span id="L-3"><a name="L-3"></a><span class="c1">#and then follow the prompts</span> </span></pre></div> </td></tr></table>
cpan, perl

Perl

Log messages based on debug level in log4perl

1
2
3
4
5
6
# Cheap in non-debug mode!
if($logger->is_debug()) {
    for (@super_long_array) {
        $logger->debug("Element: $_\n");
    }
}
https://snippets.siftie.com/embed/9a99084454f780a291db54dacc334011/
/raw/9a99084454f780a291db54dacc334011/
9a99084454f780a291db54dacc334011
perl
Perl
6
2019-02-27T17:37:02
True
False
False
/api/public/snipt/3810/
log-messages-based-on-debug-level-in-log4perl
<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="c1"># Cheap in non-debug mode!</span> </span><span id="L-2"><a name="L-2"></a><span class="k">if</span><span class="p">(</span><span class="nv">$logger</span><span class="o">-&gt;</span><span class="n">is_debug</span><span class="p">())</span> <span class="p">{</span> </span><span id="L-3"><a name="L-3"></a> <span class="k">for</span> <span class="p">(</span><span class="nv">@super_long_array</span><span class="p">)</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="nv">$logger</span><span class="o">-&gt;</span><span class="n">debug</span><span class="p">(</span><span class="s">&quot;Element: $_\n&quot;</span><span class="p">);</span> </span><span id="L-5"><a name="L-5"></a> <span class="p">}</span> </span><span id="L-6"><a name="L-6"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
perl