<?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>Fahhem's Blog &#187; Uncategorized</title>
	<atom:link href="http://fahhem.com/blog/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://fahhem.com/blog</link>
	<description>An intermittent post of thoughts.</description>
	<lastBuildDate>Tue, 20 Jul 2010 06:29:02 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Berkeley Restaurant Hours</title>
		<link>http://fahhem.com/blog/2009/12/berkeley-restaurant-hours/</link>
		<comments>http://fahhem.com/blog/2009/12/berkeley-restaurant-hours/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 03:13:43 +0000</pubDate>
		<dc:creator>Fahhem</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fahhem.com/blog/?p=111</guid>
		<description><![CDATA[As a college student who eats out frequently (my cooking skills aren&#8217;t good enough for crunch time eating) and who is always up late, I&#8217;m always wondering what restaurants are still open in the area. In order to reduce crime, the City of Berkeley decided to make business close for most of the night. They [...]]]></description>
			<content:encoded><![CDATA[<p>As a college student who eats out frequently (my cooking skills aren&#8217;t good enough for crunch time eating) and who is always up late, I&#8217;m always wondering what restaurants are still open in the area. In order to reduce crime, the City of Berkeley decided to make business close for most of the night. They were successful, but this means that few places are still open when you&#8217;re up late studying.</p>
<p>So I&#8217;m listing restaurants that are open at the listed time and earlier:</p>
<p>12am midnight:</p>
<p style="padding-left: 30px;">Fred&#8217;s Deli</p>
<p style="padding-left: 30px;">Blondie&#8217;s Pizza</p>
<p>11pm:</p>
<p style="padding-left: 30px;">House of Curries</p>
<p>10pm:</p>
<p style="padding-left: 30px;">Tandor Kitchen</p>
<p>Note: This post is currently limited to the restaurants/stores that I frequent, but I&#8217;ll gladly add more restaurants if you comment with their names/hours. Also, if it closes before 10pm I&#8217;m not interested.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahhem.com/blog/2009/12/berkeley-restaurant-hours/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flatten scanned PDF</title>
		<link>http://fahhem.com/blog/2009/12/flatten-scanned-pdf/</link>
		<comments>http://fahhem.com/blog/2009/12/flatten-scanned-pdf/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 07:08:43 +0000</pubDate>
		<dc:creator>Fahhem</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fahhem.com/blog/?p=107</guid>
		<description><![CDATA[Recently I&#8217;ve been working for a website that has a lot of scanned PDFs. They need to make sure that they don&#8217;t have the same problem as the redacted PDFs of the FBI/CIA. You know, where you could copy-paste the words out from behind black boxes?
Yeah, we had that exact same problem. Except I&#8217;m not [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been working for a website that has a lot of scanned PDFs. They need to make sure that they don&#8217;t have the same problem as the redacted PDFs of the FBI/CIA. You know, where you could copy-paste the words out from behind black boxes?</p>
<p>Yeah, we had that exact same problem. Except I&#8217;m not working for the FBI.</p>
<p>Google didn&#8217;t help one bit, &#8220;flatten pdf&#8221; means something entirely different to most people, so I couldn&#8217;t find it. Anyway, I chose to use the awesome tool ImageMagick.</p>
<p>I tried converting from PDF to PDF, but what happens is the filesize blows up if I want any sort of quality. Instead, I convert to PNG and then back to PDF.</p>
<p>So below is the shell script, with the only dependency being ImageMagick:</p>
<p><code>LINES=$(cat files.txt)<br />
COUNT=0</code></p>
<p><code>for LINE in $LINES<br />
do</code></p>
<p><code>COUNT=$(echo "$COUNT + 1"|bc)<br />
echo -n "Working on $LINE.."</code></p>
<p><code>if [ -f fixed/$LINE ]; then<br />
echo ". already done"<br />
continue<br />
fi</code></p>
<p><code>mkdir fixed/imgs-$LINE<br />
convert -density 400 broken/$LINE fixed/imgs-$LINE/out.png<br />
echo -n ".."<br />
convert -density 400 fixed/imgs-$LINE/out*.png fixed/$LINE<br />
rm -r fixed/imgs-$LINE<br />
echo ". done"</code></p>
<p><code>done</code></p>
<p>It takes files in the file &#8220;files.txt&#8221; from the broken/ folder and outputs fixed ones to fixed/.</p>
<p>I did this to make sure the files were good and then let me upload them later. The broken/ folder is an sshfs mount to the original server mounted read-only.</p>
<p>Once they&#8217;re all fixed, I tested a bunch out and they were no longer copy-paste vulnerable and the info was completely boxed out with a similarly sized PDF</p>
]]></content:encoded>
			<wfw:commentRss>http://fahhem.com/blog/2009/12/flatten-scanned-pdf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wind, water and sun beat other energy alternatives, study finds</title>
		<link>http://fahhem.com/blog/2008/12/wind-water-and-sun-beat-other-energy-alternatives-study-finds/</link>
		<comments>http://fahhem.com/blog/2008/12/wind-water-and-sun-beat-other-energy-alternatives-study-finds/#comments</comments>
		<pubDate>Sat, 13 Dec 2008 03:26:52 +0000</pubDate>
		<dc:creator>Fahhem</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://fahhem.com/blog/?p=60</guid>
		<description><![CDATA[Wind, water and sun beat other energy alternatives, study finds.
Looks like something the world should listen to. Well, at least the most polluting country in the world (the USA). If anyone knows the candidate of hope&#8217;s number, please let him know about wind energy&#8217;s superiority over everything he&#8217;s proposing.
If you don&#8217;t know his number, I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://news-service.stanford.edu/news/2009/january7/power-010709.html">Wind, water and sun beat other energy alternatives, study finds</a>.</p>
<p>Looks like something the world should listen to. Well, at least the most polluting country in the world (the USA). If anyone knows the candidate of hope&#8217;s number, please let him know about wind energy&#8217;s superiority over everything he&#8217;s proposing.</p>
<p>If you don&#8217;t know his number, I recommend commenting this link to him here:</p>
<p>Link: <a href="http://news-service.stanford.edu/news/2009/january7/power-010709.html">http://news-service.stanford.edu/news/2009/january7/power-010709.html</a><br />
Candidate of Hope: <a href="http://change.gov/page/content/discussservice">http://change.gov/page/content/discussservice</a></p>
<p>You can find a place to post the comment at the VERY bottom of the page.</p>
]]></content:encoded>
			<wfw:commentRss>http://fahhem.com/blog/2008/12/wind-water-and-sun-beat-other-energy-alternatives-study-finds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
