<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
>

<channel>
<title><![CDATA[Dobrica Pavlinušić's random unstructured stuff: Shell]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?shell</link>
<description></description>
<pubDate>Wed, 30 Dec 2009 22:08:01 -0000</pubDate>
<webMaster>root@saturn.ffzg.hr</webMaster>
<generator>Socialtext Workspace v2.19.0.2</generator>

<item>
<title><![CDATA[Shell]]></title>
<link>https://saturn.ffzg.hr/rot13/index.cgi?shell</link>
<description><![CDATA[<div>Creator: Dobrica Pavlinušić</div><hr/><div>Tags: howto, shell</div><hr/><div class="wiki">
<p>
Welcome to scratch pad of usefull shell snippets</p>
<div class="nlw_phrase"><table class="wafl_container">
  <tr>
    <td>
      <div class="wafl_box">
        
          <div class="wafl_titlebox">
            <div class="wafl_title">
              
                Contents: [Dobrica Pavlinušić's random unstructured stuff]
              
            </div>
          </div>
          <div class="wafl_items">
            
              <div class="wiki">
<ul>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#remove_all_php4_packages_with_apt_get">Dobrica Pavlinušić's random unstructured stuff (remove all php4 packages with apt-get)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] remove all php4 packages with apt-=get} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#use_socat_as_simple_serial_program">Dobrica Pavlinušić's random unstructured stuff (use socat as simple serial program)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] use socat as simple serial program} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#list_first_ten_files_from_srchives">Dobrica Pavlinušić's random unstructured stuff (list first ten files from srchives)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] list first ten files from srchives} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#tail_recent_logs_and_put_output_in_file">Dobrica Pavlinušić's random unstructured stuff (tail recent logs and put output in file)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] tail recent logs and put output in file} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#port_forwarder_using_socat">Dobrica Pavlinušić's random unstructured stuff (port forwarder using socat)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] port forwarder using socat} --></span></li>
<li><span class="nlw_phrase"><a title="section link" href="https://saturn.ffzg.hr/rot13/index.cgi?dobrica_pavlinu%C5%A1i%C4%87_s_random_unstructured_stuff#remove_all_filesystem_cache">Dobrica Pavlinušić's random unstructured stuff (remove all filesystem cache)</a><!-- wiki: {link: [Dobrica Pavlinušić's random unstructured stuff] remove all filesystem cache} --></span></li>
</ul>
</div>

            
            
          </div>
        
      </div>
    </td>
  </tr>
</table>
<!-- wiki: {toc: }
--></div><br /><br /><h1 id="remove_all_php4_packages_with_apt_get">remove all php4 packages with apt-get</h1>
<pre>
dpkg -l | grep php4 | awk '{ print $2 }' | xargs apt-get remove -y
</pre>
<br /><h1 id="use_socat_as_simple_serial_program">use socat as simple serial program</h1>
<pre>
socat - /dev/ttyS0,b9600,echo=0,raw
</pre>
<br /><h1 id="list_first_ten_files_from_srchives">list first ten files from srchives</h1>
<pre>
ls *.tar.gz *.tgz | xargs -i sh -c &quot;ls -hs '{}' ; echo ; tar tvfz '{}' | head -10 ; echo&quot;

ls *.tar.bz2 *.tbz | xargs -i sh -c &quot;ls -hs '{}' ; echo ; tar tvfj '{}' | head -10 ; echo&quot;
</pre>
<br /><blockquote>
Yes, it sucks that <tt>tar</tt> doesn't know how to handle compression formats automatically...</blockquote>
<br /><h1 id="tail_recent_logs_and_put_output_in_file">tail recent logs and put output in file</h1>
<p>
Useful to take a quick view into last lines, reload page (and capture newly created errors/infos) and store that in single file for easy review (in vim :-)</p>
<pre>
tail -f /var/log/apache2/*.log | tee ~/log
</pre>
<br /><h1 id="port_forwarder_using_socat">port forwarder using socat</h1>
<pre>
socat -d -d TCP4-LISTEN:1280,fork TCP4:192.168.212.5:80
</pre>
<br /><h1 id="remove_all_filesystem_cache">remove all filesystem cache</h1>
<pre>
echo 3 &gt; /proc/sys/vm/drop_caches
</pre>
</div>
]]></description>
<author>Dobrica Pavlinu&#x161;i&#x107;</author>
<category>howto, shell</category>
<guid isPermaLink="true">https://saturn.ffzg.hr/rot13/index.cgi?shell</guid>
<pubDate>Wed, 30 Dec 2009 22:08:01 -0000</pubDate>
</item>
</channel>
</rss>