snipt

Ctrl+h for KB shortcuts

Bash

Rails SVN:Ignore DB setup (destructive to the DB!)

1
2
3
4
5
svn remove db/*.sqlite3
svn commit -m 'removing all tmp artifacts from subversion'
svn propset svn:ignore "*.sqlite3" db/
svn update db/
svn commit -m "ignore db/*.sqlite3 content from now on" 
https://snipt.net/embed/482f20fb52b09f6cc7971459b269733b/
/raw/482f20fb52b09f6cc7971459b269733b/
482f20fb52b09f6cc7971459b269733b
bash
Bash
5
2019-08-22T19:58:06
True
False
False
/api/public/snipt/6728/
rails-svnignore-db-setup-destructive-to-the-db
<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></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn remove db/*.sqlite3 </span><span id="L-2"><a name="L-2"></a>svn commit -m <span class="s1">&#39;removing all tmp artifacts from subversion&#39;</span> </span><span id="L-3"><a name="L-3"></a>svn propset svn:ignore <span class="s2">&quot;*.sqlite3&quot;</span> db/ </span><span id="L-4"><a name="L-4"></a>svn update db/ </span><span id="L-5"><a name="L-5"></a>svn commit -m <span class="s2">&quot;ignore db/*.sqlite3 content from now on&quot;</span> </span></pre></div> </td></tr></table>
bash, rails, svn

Bash

Zips up each subdir into its own archive.

for f in `find . \( ! -name . -prune \) -type d -print`; do zip $f.zip $f; done
https://snipt.net/embed/440e8655eed928b8228af5de2d290ed6/
/raw/440e8655eed928b8228af5de2d290ed6/
440e8655eed928b8228af5de2d290ed6
bash
Bash
1
2019-08-20T09:04:23
True
False
False
/api/public/snipt/4242/
zips-up-each-subdir-into-its-own-archive
<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> f in <span class="sb">`</span>find . <span class="se">\(</span> ! -name . -prune <span class="se">\)</span> -type d -print<span class="sb">`</span><span class="p">;</span> <span class="k">do</span> zip <span class="nv">$f</span>.zip <span class="nv">$f</span><span class="p">;</span> <span class="k">done</span> </span></pre></div> </td></tr></table>
bash, directory, find, zip