<?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>Wojciech Jamrozy blog &#187; Linux</title>
	<atom:link href="http://www.wojtekrj.net/tag/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wojtekrj.net</link>
	<description>Blog about computer science, programming and linux</description>
	<lastBuildDate>Sun, 23 Oct 2011 21:57:23 +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>[Bash,Linux] Very fast disk shredding/data erasure script</title>
		<link>http://www.wojtekrj.net/2009/09/bashlinux-very-fast-disk-shredingdata-erasure-script/</link>
		<comments>http://www.wojtekrj.net/2009/09/bashlinux-very-fast-disk-shredingdata-erasure-script/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 14:28:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[data erasure]]></category>
		<category><![CDATA[disk shreding]]></category>

		<guid isPermaLink="false">http://www.wojtekrj.net/?p=309</guid>
		<description><![CDATA[Before I have setted up my encrypted partitions I had to fill them with random sequention of data. I&#8217;ve noticed that dd if=/dev/urandom of=DEVICE is very slow. It has 3-4 MB/second on my computer. I wanted to make it faster. Here is my solution: 1. Create in tmpfs located in RAM memory large file (about [...]]]></description>
			<content:encoded><![CDATA[<p>Before I have setted up my encrypted partitions I had to fill them with random sequention of data.<br />
I&#8217;ve noticed that dd if=/dev/urandom of=DEVICE is very slow. It has 3-4 MB/second on my computer.<br />
I wanted to make it faster. Here is my solution:<br />
1. Create in tmpfs located in RAM memory large file (about 100 MB) made of pseudo-random sequence (/dev/urandom).<br />
2. Write this file from memory sequentially to the disk.<br />
Speed of this approach is even 34 MB/s &#8211; 10 times faster!!.<br />
Unfortunately, this aproach might not be as secure as dd if=/dev/urandom of=DEVICE<br />
Before you do anything backup your data and be sure what are you doing!!!<br />
My implementation:<span id="more-309"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #666666; font-style: italic;"># Author: Wojtek Jamrozy (www.wojtekrj.net)</span>
<span style="color: #666666; font-style: italic;"># BE SURE WHAT ARE YOU DOING - YOU CAN LOST IMPORTANT DATA</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;usage: $0 &lt;name of device&gt;&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;You choose $1 device to shred&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Are you sure (it will destroy ALL data on this device)? Type upercase yes:&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #c20cb9; font-weight: bold;">yes</span>
<span style="color: #007800;">TMP_DIR</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>_tmpfs
<span style="color: #007800;">SIZE</span>=<span style="color: #000000;">100</span> <span style="color: #666666; font-style: italic;"># size of pattern in megabytes</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$yes</span>&quot;</span> = <span style="color: #ff0000;">&quot;YES&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Generating random pattern...&quot;</span>
	<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$TMP_DIR</span>
	<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-t</span> tmpfs  tmp <span style="color: #007800;">$TMP_DIR</span>
	<span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>urandom <span style="color: #007800;">of</span>=<span style="color: #007800;">$TMP_DIR</span><span style="color: #000000; font-weight: bold;">/</span>plik <span style="color: #007800;">bs</span>=<span style="color: #800000;">${SIZE}</span>MB <span style="color: #007800;">count</span>=<span style="color: #000000;">1</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Generating random pattern finished...&quot;</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting shreding $1&quot;</span>
	<span style="color: #007800;">before</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #007800;">i</span>=<span style="color: #000000;">0</span>
	<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">do</span>	
		<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">dd</span> <span style="color: #007800;">if</span>=<span style="color: #007800;">$TMP_DIR</span><span style="color: #000000; font-weight: bold;">/</span>plik <span style="color: #007800;">of</span>=<span style="color: #007800;">$1</span> <span style="color: #007800;">bs</span>=<span style="color: #800000;">${SIZE}</span>MB <span style="color: #007800;">seek</span>=<span style="color: #007800;">$i</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>null
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
		<span style="color: #000000; font-weight: bold;">then</span>
			<span style="color: #7a0874; font-weight: bold;">break</span>
		<span style="color: #000000; font-weight: bold;">fi</span>
		<span style="color: #007800;">i</span>=$<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>i+<span style="color: #000000;">1</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
		<span style="color: #007800;">after</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #000000; font-weight: bold;">`</span>
		<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$((i*SIZE)</span>)MB have been copied<span style="color: #000099; font-weight: bold;">\n</span>Average speed: <span style="color: #007800;">$((i*SIZE/(after-before+1)</span>)) MB/s&quot;</span>
	<span style="color: #000000; font-weight: bold;">done</span>
	<span style="color: #007800;">after</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>s<span style="color: #000000; font-weight: bold;">`</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Average speed: <span style="color: #007800;">$(((i+1)</span>*SIZE/(after-before+1))) MB/s&quot;</span>
	<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$TMP_DIR</span><span style="color: #000000; font-weight: bold;">/</span>plik
	<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">umount</span> <span style="color: #007800;">$TMP_DIR</span>
	<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-R</span> <span style="color: #007800;">$TMP_DIR</span>
<span style="color: #000000; font-weight: bold;">else</span>
	<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;You haven't typed <span style="color: #000099; font-weight: bold;">\&quot;</span>YES<span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\n</span>Exiting...&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p><a class="a2a_button_wykop" href="http://www.addtoany.com/add_to/wykop?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Wykop" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/wykop.png" width="16" height="16" alt="Wykop"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Digg" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_msdn" href="http://www.addtoany.com/add_to/msdn?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="MSDN" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/msdn.png" width="16" height="16" alt="MSDN"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technotizie" href="http://www.addtoany.com/add_to/technotizie?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="Technotizie" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technotizie.png" width="16" height="16" alt="Technotizie"/></a><a class="a2a_button_technet" href="http://www.addtoany.com/add_to/technet?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;linkname=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" title="TechNet" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technet.png" width="16" height="16" alt="TechNet"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F09%2Fbashlinux-very-fast-disk-shredingdata-erasure-script%2F&amp;title=%5BBash%2CLinux%5D%20Very%20fast%20disk%20shredding%2Fdata%20erasure%20script" id="wpa2a_2">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wojtekrj.net/2009/09/bashlinux-very-fast-disk-shredingdata-erasure-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Ubuntu] Nice Amarok-like music Player</title>
		<link>http://www.wojtekrj.net/2009/07/ubuntu-nice-amarok-like-music-player/</link>
		<comments>http://www.wojtekrj.net/2009/07/ubuntu-nice-amarok-like-music-player/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 20:26:49 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[exaile]]></category>

		<guid isPermaLink="false">http://www.wojtekrj.net/?p=194</guid>
		<description><![CDATA[I&#8217;ve used Amarok for a long time. Unfortunately, interface of Amarok 2 has  been remarkably changed.  I like &#8220;old&#8221; Amarok&#8217;s interface so I&#8217;ve found Exaile &#8211; Amarok like music player for Gnome written in Python. Here is a screenshot: You can find more in: www.exaile.org]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve used Amarok for a long time. Unfortunately, interface of Amarok 2 has  been <span id="dict102_hidden" style="display: block;"><span>remarkably changed.  I like &#8220;old&#8221; Amarok&#8217;s interface so I&#8217;ve found Exaile &#8211; Amarok like music player for Gnome written in Python. <span id="more-194"></span>Here is a screenshot:</span></span></p>
<p><span style="display: block;"><span></p>
<div id="attachment_199" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-199" title="exaile_large" src="http://www.wojtekrj.net/wp-content/uploads/2009/07/exaile_large-300x212.jpg" alt="Exaile screenshot" width="300" height="212" /><p class="wp-caption-text">Exaile screenshot</p></div>
<p></span></span></p>
<p><span style="display: block;"><span> </span></span></p>
<p>You can find more in: <a title="www.exaile.org" href="http://www.exaile.org" target="_blank">www.exaile.org</a></p>
<p><a class="a2a_button_wykop" href="http://www.addtoany.com/add_to/wykop?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Wykop" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/wykop.png" width="16" height="16" alt="Wykop"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Digg" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_msdn" href="http://www.addtoany.com/add_to/msdn?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="MSDN" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/msdn.png" width="16" height="16" alt="MSDN"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technotizie" href="http://www.addtoany.com/add_to/technotizie?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="Technotizie" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technotizie.png" width="16" height="16" alt="Technotizie"/></a><a class="a2a_button_technet" href="http://www.addtoany.com/add_to/technet?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;linkname=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" title="TechNet" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technet.png" width="16" height="16" alt="TechNet"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F07%2Fubuntu-nice-amarok-like-music-player%2F&amp;title=%5BUbuntu%5D%20Nice%20Amarok-like%20music%20Player" id="wpa2a_4">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wojtekrj.net/2009/07/ubuntu-nice-amarok-like-music-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Linux] How to execute SQL query on Firefox history</title>
		<link>http://www.wojtekrj.net/2009/04/linux-how/</link>
		<comments>http://www.wojtekrj.net/2009/04/linux-how/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 17:37:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Ubuntu]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://www.wojtekrj.net/?p=176</guid>
		<description><![CDATA[1. If you don&#8217;t know anything about SQLite, please read: http://en.wikipedia.org/wiki/SQLite 2. Install sqlitebrowser: sudo apt-get install sqlitebrowser 3. Run sqlitebrowser 4. Open file: /home/your username/.mozilla/firefox/your profile/places.sqlite It&#8217;s a SQLite database where firefox stores information about history. 5. Execute following command: SELECT url FROM moz_places WHERE url LIKE &#34;%wojtekrj.net%&#34; 6. You should have list of [...]]]></description>
			<content:encoded><![CDATA[<p>1. If you don&#8217;t know anything about SQLite, please read:</p>
<p>http://en.wikipedia.org/wiki/SQLite</p>
<p>2. Install sqlitebrowser:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> sqlitebrowser</pre></div></div>

<p>3. Run sqlitebrowser<br />
4. Open file:<br />
/home/your username/.mozilla/firefox/your profile/places.sqlite<br />
It&#8217;s a SQLite database where firefox stores information about history.<br />
5. Execute following command:</p>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> url <span style="color: #993333; font-weight: bold;">FROM</span> moz_places <span style="color: #993333; font-weight: bold;">WHERE</span> url <span style="color: #993333; font-weight: bold;">LIKE</span> <span style="color: #ff0000;">&quot;%wojtekrj.net%&quot;</span></pre></div></div>

<p>6. You should have list of all vistied by you pages from my blog.</p>
<p><a class="a2a_button_wykop" href="http://www.addtoany.com/add_to/wykop?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Wykop" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/wykop.png" width="16" height="16" alt="Wykop"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Digg" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_msdn" href="http://www.addtoany.com/add_to/msdn?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="MSDN" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/msdn.png" width="16" height="16" alt="MSDN"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technotizie" href="http://www.addtoany.com/add_to/technotizie?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="Technotizie" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technotizie.png" width="16" height="16" alt="Technotizie"/></a><a class="a2a_button_technet" href="http://www.addtoany.com/add_to/technet?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;linkname=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" title="TechNet" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technet.png" width="16" height="16" alt="TechNet"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how%2F&amp;title=%5BLinux%5D%20How%20to%20execute%20SQL%20query%20on%20Firefox%20history" id="wpa2a_6">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wojtekrj.net/2009/04/linux-how/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Linux] How to check if program has memory leaks</title>
		<link>http://www.wojtekrj.net/2009/04/linux-how-to-check-if-program-has-memory-leaks/</link>
		<comments>http://www.wojtekrj.net/2009/04/linux-how-to-check-if-program-has-memory-leaks/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 16:56:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.wojtekrj.net/?p=168</guid>
		<description><![CDATA[You can check your program using command: valgrind your_program Example of usage: We have following C++ program (tst.cpp): int main&#40;&#41; &#123; int * tab = new int&#91;1000000&#93;; return 0; &#125; Obviously it generates memory leak. We compile it to tst file and execute: valgrind tst ==20777== Memcheck, a memory error detector. ==20777== Copyright (C) 2002-2008, [...]]]></description>
			<content:encoded><![CDATA[<p>You can check your program using command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">valgrind</span> your_program</pre></div></div>

<p>Example of usage:<br />
We have following C++ program (tst.cpp):</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">int</span> main<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
	<span style="color: #0000ff;">int</span> <span style="color: #000040;">*</span> tab <span style="color: #000080;">=</span> <span style="color: #0000dd;">new</span> <span style="color: #0000ff;">int</span><span style="color: #008000;">&#91;</span><span style="color: #0000dd;">1000000</span><span style="color: #008000;">&#93;</span><span style="color: #008080;">;</span>
	<span style="color: #0000ff;">return</span> <span style="color: #0000dd;">0</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Obviously it generates memory leak. We compile it to <em>tst</em> file and execute:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">valgrind</span> tst</pre></div></div>

<p><span id="more-168"></span></p>
<pre>==20777== Memcheck, a memory error detector.
==20777== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==20777== Using LibVEX rev 1884, a library for dynamic binary translation.
==20777== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==20777== Using valgrind-3.4.1-Debian, a dynamic binary instrumentation framework.
==20777== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==20777== For more details, rerun with: -v
==20777==
==20777==
==20777== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==20777== malloc/free: in use at exit: 4,000,000 bytes in 1 blocks.
==20777== malloc/free: 1 allocs, 0 frees, 4,000,000 bytes allocated.
==20777== For counts of detected errors, rerun with: -v
==20777== searching for pointers to 1 not-freed blocks.
==20777== checked 93,180 bytes.
==20777==
==20777== LEAK SUMMARY:
==20777==    definitely lost: 0 bytes in 0 blocks.
==20777==      possibly lost: 4,000,000 bytes in 1 blocks.
==20777==    still reachable: 0 bytes in 0 blocks.
==20777==         suppressed: 0 bytes in 0 blocks.
==20777== Rerun with --leak-check=full to see details of leaked memory.</pre>
<p><a class="a2a_button_wykop" href="http://www.addtoany.com/add_to/wykop?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Wykop" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/wykop.png" width="16" height="16" alt="Wykop"/></a><a class="a2a_button_delicious" href="http://www.addtoany.com/add_to/delicious?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Delicious" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/delicious.png" width="16" height="16" alt="Delicious"/></a><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Facebook" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/facebook.png" width="16" height="16" alt="Facebook"/></a><a class="a2a_button_technorati_favorites" href="http://www.addtoany.com/add_to/technorati_favorites?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Technorati Favorites" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technorati.png" width="16" height="16" alt="Technorati Favorites"/></a><a class="a2a_button_digg" href="http://www.addtoany.com/add_to/digg?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Digg" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/digg.png" width="16" height="16" alt="Digg"/></a><a class="a2a_button_google_bookmarks" href="http://www.addtoany.com/add_to/google_bookmarks?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Google Bookmarks" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/google.png" width="16" height="16" alt="Google Bookmarks"/></a><a class="a2a_button_msdn" href="http://www.addtoany.com/add_to/msdn?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="MSDN" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/msdn.png" width="16" height="16" alt="MSDN"/></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Twitter" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/twitter.png" width="16" height="16" alt="Twitter"/></a><a class="a2a_button_technotizie" href="http://www.addtoany.com/add_to/technotizie?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="Technotizie" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technotizie.png" width="16" height="16" alt="Technotizie"/></a><a class="a2a_button_technet" href="http://www.addtoany.com/add_to/technet?linkurl=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;linkname=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" title="TechNet" rel="nofollow" target="_blank"><img src="http://www.wojtekrj.net/wp-content/plugins/add-to-any/icons/technet.png" width="16" height="16" alt="TechNet"/></a><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.wojtekrj.net%2F2009%2F04%2Flinux-how-to-check-if-program-has-memory-leaks%2F&amp;title=%5BLinux%5D%20How%20to%20check%20if%20program%20has%20memory%20leaks" id="wpa2a_8">Share/Save</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.wojtekrj.net/2009/04/linux-how-to-check-if-program-has-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

