<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog.Project13.pl &#187; trick</title>
	<atom:link href="http://www.blog.project13.pl/index.php/tag/trick/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.blog.project13.pl</link>
	<description>The Blog of a Coder</description>
	<lastBuildDate>Sun, 05 Feb 2012 02:28:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>(Almost) Automatically convert files into PDF</title>
		<link>http://www.blog.project13.pl/index.php/fun/285/almost-automatically-convert-files-into-pdf/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/285/almost-automatically-convert-files-into-pdf/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 00:56:55 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[cool]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[tip]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[wget]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=285</guid>
		<description><![CDATA[I&#8217;m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( http://www.icsr.agh.edu.pl/~mownit/mownit.html ). I was really happy to see some *.ps but some people from my fellow students started complaining that they&#8217;d rather have pdf&#8217;s and not ghostscript files (who knows why they&#8217;d do..?). [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m learning Numerical Analysis right now and a friend of mine found some really nice PS files by dr Marian Bubek ( <a href="http://www.icsr.agh.edu.pl/~mownit/mownit.html" onclick="urchinTracker('/outgoing/www.icsr.agh.edu.pl/_mownit/mownit.html?referer=');">http://www.icsr.agh.edu.pl/~mownit/mownit.html</a> ). I was really happy to see some *.ps but some people from my fellow students started complaining that they&#8217;d rather have pdf&#8217;s and not ghostscript files <em>(who knows why they&#8217;d do..?)</em>. Anyways, they all had &#8220;manual&#8221; repetitious methods for converting the files &#8211; even uploading to somewebsite to have them converted over there &#8220;in the cloud&#8221;&#8230; I though of a slightly quicker and more efficient way, here it is, hope you&#8217;ll like it. Ah, there is One &#8220;non standard&#8221; requirement for this to work, you have to install <strong>cups-pdf</strong> :-)</p>
<div class="geshi no bash">
<div class="head">wget http://www.icsr.agh.edu.pl/~mownit/mownit.html -r &#8211;level 1 -A.ps &#8211;cut-dirs 4</div>
<ol>
<li class="li1">
<div class="de1"><span class="kw2">mv</span> www.icsr.agh.edu.pl<span class="sy0">/*</span> .</div>
</li>
<li class="li1">
<div class="de1"><span class="kw2">rm</span> -rf www.icsr.agh.edu.pl<span class="sy0">/</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">for</span> <span class="kw2">file</span> <span class="kw1">in</span> `<span class="kw2">dir</span> -f <span class="sy0">*</span>` ; <span class="kw1">do</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw2">lpr</span> -P <span class="st0">&#39;cups-PDF&#39;</span> <span class="re1">$file</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw3">echo</span> <span class="st0">&quot;press enter when cups is done printing&#8230;&quot;</span> <span class="co0">#yeah, i got lazy here, one could watch lpq for changes etc.</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw2">read</span> oczekiwanie;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw2">mv</span> <span class="sy0">/</span>home<span class="sy0">/</span>ktoso<span class="sy0">/</span>Pulpit<span class="sy0">/</span>cups-pdf<span class="sy0">/</span>template.pdf .<span class="sy0">/</span><span class="re1">$file</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">done</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># ________________ </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#&lt; Happy hacking! &gt;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &#8212;&#8212;&#8212;&#8212;&#8212;- </span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; ^__^</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp;(oo)\_______</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(__)\ &nbsp; &nbsp; &nbsp; )\/\</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;||&#8212;-w |</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|| &nbsp; &nbsp; ||</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/285/almost-automatically-convert-files-into-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Terminal Heroes &#8211; 5 &#8211; List internet active apps</title>
		<link>http://www.blog.project13.pl/index.php/fun/224/terminal-heroes-5-list-internet-active-apps/</link>
		<comments>http://www.blog.project13.pl/index.php/fun/224/terminal-heroes-5-list-internet-active-apps/#comments</comments>
		<pubDate>Sat, 19 Sep 2009 14:59:01 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[fun]]></category>
		<category><![CDATA[terminal heroes]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[gnu/linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=224</guid>
		<description><![CDATA[A simple yet usefull command-line-fu I made up: #list all internet active apps $ netstat -lantp &#124; grep -i establ &#124; awk -F/ &#39;{print $2}&#39; &#124; sort &#124; uniq &#160; firefox java pidgin thunderbird-b Lookup this command at CommandLineFu Thanks to HarimaKenji for fixing a little issue with this command. &#8212;update&#8212; CommandLineFu user submited a [...]]]></description>
			<content:encoded><![CDATA[<p>A simple yet usefull command-line-fu I made up:</p>
<div class="geshi no bash">
<div class="head">#list all internet active apps</div>
<ol>
<li class="li1">
<div class="de1">$ <span class="kw2">netstat</span> -lantp <span class="sy0">|</span> <span class="kw2">grep</span> -i establ <span class="sy0">|</span> <span class="kw2">awk</span> -F<span class="sy0">/</span> <span class="st0">&#39;{print $2}&#39;</span> <span class="sy0">|</span> <span class="kw2">sort</span> <span class="sy0">|</span> <span class="kw2">uniq</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">firefox</div>
</li>
<li class="li1">
<div class="de1">java</div>
</li>
<li class="li1">
<div class="de1">pidgin</div>
</li>
<li class="li1">
<div class="de1">thunderbird-b</div>
</li>
</ol>
</div>
<p><a href="http://www.commandlinefu.com/commands/view/3537/show-apps-that-use-internet-connection-at-the-moment." onclick="urchinTracker('/outgoing/www.commandlinefu.com/commands/view/3537/show-apps-that-use-internet-connection-at-the-moment.?referer=');">Lookup this command at CommandLineFu</a><br />
<em>Thanks to <a href="http://www.commandlinefu.com/commands/by/HarimaKenji" onclick="urchinTracker('/outgoing/www.commandlinefu.com/commands/by/HarimaKenji?referer=');">HarimaKenji</a> for fixing a little issue with this command.</em><br />
&#8212;update&#8212;<br />
CommandLineFu user submited a super short version for this:<code>lsof -P -i -n</code><em>ComandLineFu ownz!</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/fun/224/terminal-heroes-5-list-internet-active-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Smart webpage migration</title>
		<link>http://www.blog.project13.pl/index.php/coding/163/smart-webpage-mirgating/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/163/smart-webpage-mirgating/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 18:15:15 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[freedom]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[terminal]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[web dev]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=163</guid>
		<description><![CDATA[I recently had to migrate a big website &#8211; about 5GB &#8211; to a new server. That could take a while to do, right? Well, maybe if you did it like that (the not smart way): Thanks goodness I&#8217;m not really keen on doing stuff the slow &#8220;not_smart&#8221; way, and the new server is a [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had to migrate a big website &#8211; about 5GB &#8211; to a new server. That could take a while to do, right? Well, maybe if you did it like that (the not smart way):</p>
<div class="wp-caption aligncenter" style="width: 335px"><img class=" " title="not smart way" src="http://farm3.static.flickr.com/2491/3862842718_76b41e0cf2.jpg" alt="Oh man, that would take sooo much time..." width="325" height="118" /><p class="wp-caption-text">Oh man, that would take sooo much time...</p></div>
<p>Thanks goodness I&#8217;m not really keen on doing stuff the slow &#8220;not_smart&#8221; way, and the new server is a dedicated CentOS machine! :-) So, what did I do?</p>
<div class="wp-caption aligncenter" style="width: 335px"><img class=" " title="the SMART way" src="http://farm3.static.flickr.com/2522/3862839920_37aeabf31a.jpg" alt="Yeah, no time wasted here!" width="325" height="132" /><p class="wp-caption-text">Yeah, no time wasted here!</p></div>
<p>There&#8217;s a lot of ways to accomplish this if you have shell access. You could:</p>
<ol>
<li>
<pre>wget -r --user=login --password='pass' ftp://admin:example.com/folder/</pre>
</li>
<li>
<pre>ncftp #normal ftp should also work the same way
open ftp://example.com
login
pass
mget -r folder</pre>
</li>
<li>Yes, SCP is a great tool for this kind of situation, but i couldn&#8217;t use it since the old server didn&#8217;t have ssh acces :-( Here is how it could be used in such a situation:
<pre>scp -r login@old.example.com:/home/folder login@new.example.com:/home/folder</pre>
</li>
</ol>
<p>I used the second method and am quite satisvied with it, as the servers did all the migrating i set up the database and did some other project related stuff&#8230; :-)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/163/smart-webpage-mirgating/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mencoder mastery &#8211; part 2</title>
		<link>http://www.blog.project13.pl/index.php/coding/103/mencoder-mastery-part-2/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/103/mencoder-mastery-part-2/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 15:07:23 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[trick]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=103</guid>
		<description><![CDATA[Tym razem małe polecenie włączające zewnątrzny plik mp3 (z ogg zadziała tak samo): #poniższe polecenie bierze plik old.avi, i łącząc go z sound.mp3 (zachowując jego codec audio) tworzy plik new.avi mencoder old.avi -o new.avi -ovc copy -oac copy -audiofile sound.mp3 #analogicznie możemy wziąć plik audio w innym formacie i przetworzyć go np na mp3, wtedy [...]]]></description>
			<content:encoded><![CDATA[<p>Tym razem małe polecenie włączające zewnątrzny plik mp3 (z ogg zadziała tak samo):</p>
<div class="geshi no bash">
<div class="head">#poniższe polecenie bierze plik old.avi, i łącząc go z sound.mp3 (zachowując jego codec audio) tworzy plik new.avi</div>
<ol>
<li class="li1">
<div class="de1">mencoder old.avi -o new.avi -ovc copy -oac copy -audiofile sound.mp3</div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#analogicznie możemy wziąć plik audio w innym formacie i przetworzyć go np na mp3, wtedy skorzystamy zamiast z copy z mp3lame</span></div>
</li>
<li class="li1">
<div class="de1">mencoder old.avi -o new.avi -ovc copy -oac mp3lame -audiofile sound.wav <span class="co0">#czy inny format</span></div>
</li>
</ol>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/103/mencoder-mastery-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>mencoder mastery &#8211; part 1</title>
		<link>http://www.blog.project13.pl/index.php/coding/98/mencoder-mastery-part-1/</link>
		<comments>http://www.blog.project13.pl/index.php/coding/98/mencoder-mastery-part-1/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 14:46:32 +0000</pubDate>
		<dc:creator>Ktoso</dc:creator>
				<category><![CDATA[coding]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mencoder]]></category>
		<category><![CDATA[trick]]></category>

		<guid isPermaLink="false">http://www.blog.project13.pl/?p=98</guid>
		<description><![CDATA[Skoro była taka seria z wgetem, to przyszedł czas na to samo z mencoderem. mencoder to program do ogólnie pojętej obróbki plików video. Jeżeli korzystasz z jakiegoś okienkowego programu do modyfikowania wideo pod linuksem, z dużym prawdopodobieństwem jest on nakładką na mencodera :&#62; Dzisiejszy temat to obracanie całego filmu: mencoder -ovc lavc -vf rotate=1 -oac [...]]]></description>
			<content:encoded><![CDATA[<p>Skoro była taka seria z wgetem, to przyszedł czas na to samo z mencoderem. mencoder to program do ogólnie pojętej obróbki plików video. Jeżeli korzystasz z jakiegoś okienkowego programu do modyfikowania wideo pod linuksem, z dużym prawdopodobieństwem jest on nakładką na mencodera :&gt;</p>
<p>Dzisiejszy temat to <strong>obracanie całego filmu</strong>:</p>
<div class="geshi no bash">
<div class="head">mencoder -ovc lavc -vf rotate=1 -oac copy input.mpg -o output.mpg</div>
<ol>
<li class="li1">
<div class="de1"><span class="co0">#Objaśnienia:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#-ovc = output video codec</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#-oac = output audio codec</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#-vf = video filters, pozwala na zakolejkowanie różnych filtrów do wykonania, my korzystamy tylko z jednego:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0">#rotate=X = obraca cały materiał video przy czym X należy do:</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp;0 Rotate by 90 degrees clockwise and flip (default).</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp;1 Rotate by 90 degrees clockwise.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp;2 Rotate by 90 degrees counterclockwise.</span></div>
</li>
<li class="li1">
<div class="de1"><span class="co0"># &nbsp; &nbsp;3 Rotate by 90 degrees counterclockwise and flip.</span></div>
</li>
</ol>
</div>
<p>Masowe obrócenie filmików z wakacji teraz nagle stało się proste czyż nie? :-) Czemu się tym zainteresowałem można by się spytać&#8230; otóż obracałem filmik nagrania mojej nowej popierdółki w j2me: Xplode. ale to już materiał na kolejny wpis.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.blog.project13.pl/index.php/coding/98/mencoder-mastery-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

