master
Raw Download raw file
  1<?xml version="1.0" encoding="utf-8"?>
  2<feed xmlns="http://www.w3.org/2005/Atom">
  3
  4  <title><![CDATA[BryFry]]></title>
  5  <link href="http://bryfry.github.com/atom.xml" rel="self"/>
  6  <link href="http://bryfry.github.com/"/>
  7  <updated>2013-03-05T07:22:42-05:00</updated>
  8  <id>http://bryfry.github.com/</id>
  9  <author>
 10    <name><![CDATA[bryfry]]></name>
 11    
 12  </author>
 13  <generator uri="http://octopress.org/">Octopress</generator>
 14
 15  
 16  <entry>
 17    <title type="html"><![CDATA[Move Minecraft Spawn with Python]]></title>
 18    <link href="http://bryfry.github.com/blog/2012/04/29/move-minecraft-spawn-with-python/"/>
 19    <updated>2012-04-29T21:54:00-04:00</updated>
 20    <id>http://bryfry.github.com/blog/2012/04/29/move-minecraft-spawn-with-python</id>
 21    <content type="html"><![CDATA[<p><img class="right" src="http://i.imgur.com/uubl0.png" width="150" height="150" title="Minecraft" ></p>
 22
 23<p>The setup for this post is that in a vanilla Minecraft server there
 24isn&#8217;t a way to set the protection size to <code>0</code> (yes, I know bukkit can do
 25this but, meh).  This makes having the spawn in the middle of a nice
 26area with shared chests, smelting, etc. a pain.  So I wanted to move the
 27spawn but I didn’t want to have to download the whole world, open it
 28with a map editor, and then re-upload the whole thing again.  Especially
 29since I know the values are just stored inside the level.dat.  So, below
 30is how I used twoolie’s python NBT interface to move the spawn on our
 31server.</p>
 32
 33<p>To install NBT, grab it from either <a
 34href='https://github.com/twoolie/NBT'>github</a> or <a
 35href='http://pypi.python.org/pypi/NBT'>pypi</a></p>
 36
 37<figure class='code'><figcaption><span>spawn-move.py</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
 38<span class='line-number'>2</span>
 39<span class='line-number'>3</span>
 40<span class='line-number'>4</span>
 41<span class='line-number'>5</span>
 42<span class='line-number'>6</span>
 43<span class='line-number'>7</span>
 44<span class='line-number'>8</span>
 45</pre></td><td class='code'><pre><code class='python'><span class='line'><span class="kn">from</span> <span class="nn">nbt</span> <span class="kn">import</span> <span class="o">*</span>
 46</span><span class='line'><span class="n">level</span> <span class="o">=</span> <span class="n">nbt</span><span class="o">.</span><span class="n">NBTFile</span><span class="p">(</span><span class="s">&#39;/&lt;insert.path.here&gt;/world/level.dat&#39;</span><span class="p">,</span><span class="s">&#39;rb&#39;</span><span class="p">)</span>
 47</span><span class='line'><span class="n">level</span><span class="p">[</span><span class="s">&quot;Data&quot;</span><span class="p">][</span><span class="s">&quot;SpawnX&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">newx</span>
 48</span><span class='line'><span class="n">level</span><span class="p">[</span><span class="s">&quot;Data&quot;</span><span class="p">][</span><span class="s">&quot;SpawnY&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">newy</span>
 49</span><span class='line'><span class="n">level</span><span class="p">[</span><span class="s">&quot;Data&quot;</span><span class="p">][</span><span class="s">&quot;SpawnZ&quot;</span><span class="p">]</span><span class="o">.</span><span class="n">value</span> <span class="o">=</span> <span class="n">newz</span>
 50</span><span class='line'><span class="k">print</span><span class="p">(</span><span class="n">level</span><span class="o">.</span><span class="n">pretty_tree</span><span class="p">())</span>  <span class="c"># show changes</span>
 51</span><span class='line'><span class="n">level</span><span class="o">.</span><span class="n">write_file</span><span class="p">(</span><span class="s">&#39;/&lt;insert.path.here&gt;/world/level.dat&#39;</span><span class="p">)</span>
 52</span><span class='line'><span class="nb">exit</span><span class="p">()</span>
 53</span></code></pre></td></tr></table></div></figure>
 54
 55]]></content>
 56  </entry>
 57  
 58  <entry>
 59    <title type="html"><![CDATA[On Hacking: Larsson's Folly]]></title>
 60    <link href="http://bryfry.github.com/blog/2011/12/07/on-hacking-larssons-folly/"/>
 61    <updated>2011-12-07T00:00:00-05:00</updated>
 62    <id>http://bryfry.github.com/blog/2011/12/07/on-hacking-larssons-folly</id>
 63    <content type="html"><![CDATA[<p><img class="right" src="http://i.imgur.com/a7jUo.jpg"></p>
 64
 65<p>This post is a tangent that I was thinking about this past week when I was listening to <a href="http://www.npr.org/">NPR&#8217;s</a> <a href="http://www.onthemedia.org/">On The Media</a>.  The specific segment, <a href="http://www.onthemedia.org/2011/nov/25/chiquita-phone-hacking-scandal/">The Chiquita Phone Hacking Scandal</a>, examines the current News of the World phone &#8216;hacking&#8217; case and illegal and unethical journalistic practices in the light of the historic &#8220;Chiquita Phone Hacking Scandal&#8221;.  The segment is worth while and I highly recommend listening to it if you have a few minutes (or you can read the transcript <a href="http://www.onthemedia.org/2011/nov/25/chiquita-phone-hacking-scandal/transcript/">here</a>).</p>
 66
 67<p>At any rate here is a nice little synopses: Chiquita was doing bad things and the Enquirer published the findings of reporter Mike Gallagher.  Unbeknownst to the Enquirer, Gallagher had &#8216;hacked&#8217; Chiquita&#8217;s phone systems and this fact was revealed after the publication.  The result, &#8220;The Enquirer fired Gallagher, relocated its editor, agreed to pay Chiquita millions of dollars, apologized repeatedly and recanted the stories.&#8221;</p>
 68
 69<p>The take away nugget is this, summarized by Kelly McBride of The Poynter Institute:</p>
 70
 71<blockquote><p>The lesson is when your methods for gathering information are dishonest, the information you gather is suspect. And that case is the perfect lesson in that. No one has challenged the findings of the newspaper. Yet, nobody talks about that as a great investigative piece. They talk about it as an ethical scandal.</p></blockquote>
 72
 73
 74<p>Okay, so that all makes sense.  But then I had a secondary thought and which gave me flashbacks to Steig Larssons Milenium Trilogy (The Girl With the Dragon Tattoo, The Girl Who Played With Fire and The Girl Who Kicked the Hornets&#8217; Nest): In each book, the main character hacks into the antagonists machines and the information she gathers almost becomes a deus ex machina saving her and the rest of the journalist protagonists.  This is great for a fictional story and it draws attention to the ease and power of information gathering.  However, I do not think Mr. Larsson addressed the seriousness of how screwed they all would be if their &#8216;informant&#8217; was actually revealed to be a hacker, illegally gaining access to the information.</p>
 75
 76<p>If there were one take away it would be this: All fiction aside, hacking will never save your ass, it will burn it.</p>
 77]]></content>
 78  </entry>
 79  
 80  <entry>
 81    <title type="html"><![CDATA[Namecoin on Ubuntu 11.10]]></title>
 82    <link href="http://bryfry.github.com/blog/2011/11/26/namecoind-on-ubuntu-11-10-x64/"/>
 83    <updated>2011-11-26T00:00:00-05:00</updated>
 84    <id>http://bryfry.github.com/blog/2011/11/26/namecoind-on-ubuntu-11-10-x64</id>
 85    <content type="html"><![CDATA[<p><img class="right" src="http://i.imgur.com/RJTsK.jpg" width="150" height="150" title="dot-bit" ></p>
 86
 87<p>So I setout to try a setup of <a href="https://github.com/vinced/namecoin">Namecoin</a>, the sibling to <a href="http://bitcoin.org/">Bitcoin</a> that is used for <a href="https://bitcointalk.org/?topic=6017.0">name/value storage</a> and is the foundation for the <a href="http://dot-bit.org/Main_Page">dot-bit project</a>.  The dependencies were not explicitly laid out in the README so I wrote up the things I found I needed.  Hopefully someone else doing the same thing will not have to do as much searching as I did.</p>
 88
 89<ul>
 90<li>Setup: namecoin version 0.3.24.64-beta</li>
 91<li>Target: Ubuntu 11.10 (x64), Amazon EC2 (Server) and Desktop</li>
 92</ul>
 93
 94
 95<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
 96<span class='line-number'>2</span>
 97<span class='line-number'>3</span>
 98<span class='line-number'>4</span>
 99<span class='line-number'>5</span>
100<span class='line-number'>6</span>
101<span class='line-number'>7</span>
102</pre></td><td class='code'><pre><code class='bash'><span class='line'>sudo apt-get install git build-essential libssl-dev <span class="se">\</span>
103</span><span class='line'>libdb4.7++-dev libboost-dev libboost-system-dev <span class="se">\</span>
104</span><span class='line'>libboost-filesystem-dev libboost-program-options-dev <span class="se">\</span>
105</span><span class='line'>libboost-thread-dev libglibmm-2.4-dev
106</span><span class='line'>git clone git://github.com/vinced/namecoin.git
107</span><span class='line'><span class="nb">cd </span>namecoin/src
108</span><span class='line'>make -f makefile.unix <span class="nv">USE_UPNP</span><span class="o">=</span>
109</span></code></pre></td></tr></table></div></figure>
110
111
112<p>I built my install list from the headers that were missing from a mostly generic 11.10 install. The list of the errors I came across are below. Shoot me a line if anyone comes across other packages that need added to the list.</p>
113
114<p>If you get this far you can start running namecoind which is well documented here: <a href="http://www.bluishcoder.co.nz/2011/05/12/namecoin-a-dns-alternative-based-on-bitcoin.html">Post Install</a></p>
115
116<p>If you have compilation errors you can read more after the jump.</p>
117
118<!--more-->
119
120
121
122
123<figure class='code'><figcaption><span>Compilation error - libssl</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
124<span class='line-number'>2</span>
125<span class='line-number'>3</span>
126</pre></td><td class='code'><pre><code class='text'><span class='line'>In file included from auxpow.cpp:4:0:
127</span><span class='line'>headers.h:37:28: fatal error: openssl/buffer.h: No such file or directoy
128</span><span class='line'>compilation terminated.
129</span></code></pre></td></tr></table></div></figure>
130
131
132
133
134<figure class='code'><figcaption><span>Solution - libssl</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
135</pre></td><td class='code'><pre><code class='bash'><span class='line'>sudo apt-get install libssl-dev
136</span></code></pre></td></tr></table></div></figure>
137
138
139
140
141<figure class='code'><figcaption><span>Compilation error - libdb</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
142<span class='line-number'>2</span>
143<span class='line-number'>3</span>
144</pre></td><td class='code'><pre><code class='text'><span class='line'>In file included from auxpow.cpp:4:0:
145</span><span class='line'>headers.h:43:20: fatal error: db_cxx.h: No such file or directory
146</span><span class='line'>compilation terminated.
147</span></code></pre></td></tr></table></div></figure>
148
149
150
151
152<figure class='code'><figcaption><span>Solution - libdb</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
153</pre></td><td class='code'><pre><code class='bash'><span class='line'>sudo apt-get install  libdb4.7++-dev
154</span></code></pre></td></tr></table></div></figure>
155
156
157<p>If that fails &#8230;
158For some reason libdb4.7++-dev is not in the 11.10 server repositories, probably because the 4.7 and 4.7++ dev libraries have some conflicts. My workaround was to get 4.7++ and then manually install the 4.7++-dev.deb from launchpad. This is unstable and apt-get -f install will remove 4.7++-dev but for the compilation I didn&#8217;t have any extra issues. When I ran the install on my desktop 11.10 libdb4.7++-dev was in the repositories so you only get this error 11.10 server :|.</p>
159
160<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
161<span class='line-number'>2</span>
162</pre></td><td class='code'><pre><code class='bash'><span class='line'>wget http://launchpadlibrarian.net/66419156/libdb4.7%2B%2B-dev_4.7.25-10ubuntu1_amd64.deb
163</span><span class='line'>sudo dpkg -i --force-all libdb4.7++-dev_4.7.25-10ubuntu1_amd64.deb
164</span></code></pre></td></tr></table></div></figure>
165
166
167
168
169<figure class='code'><figcaption><span>Compilation error - libboost</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
170<span class='line-number'>2</span>
171<span class='line-number'>3</span>
172<span class='line-number'>4</span>
173<span class='line-number'>5</span>
174</pre></td><td class='code'><pre><code class='text'><span class='line'>/usr/bin/ld: cannot find -lboost_system
175</span><span class='line'>/usr/bin/ld: cannot find -lboost_filesystem
176</span><span class='line'>/usr/bin/ld: cannot find -lboost_program_options
177</span><span class='line'>/usr/bin/ld: cannot find -lboost_thread
178</span><span class='line'>/usr/bin/ld: cannot find -lgthread-2.0
179</span></code></pre></td></tr></table></div></figure>
180
181
182
183
184<figure class='code'><figcaption><span>Solution - libbost</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
185<span class='line-number'>2</span>
186<span class='line-number'>3</span>
187<span class='line-number'>4</span>
188<span class='line-number'>5</span>
189</pre></td><td class='code'><pre><code class='bash'><span class='line'>sudo apt-get install libboost-system-dev
190</span><span class='line'>sudo apt-get install libboost-filesystem-dev
191</span><span class='line'>sudo apt-get install libboost-program-options-dev
192</span><span class='line'>sudo apt-get install libboost-thread-dev
193</span><span class='line'>sudo apt-get install libglibmm-2.4-dev
194</span></code></pre></td></tr></table></div></figure>
195
196
197<p>Resources used:
198<a
199href="http://www.bluishcoder.co.nz/2011/05/12/namecoin-a-dns-alternative-based-on-bitcoin.html">Bluish Coder</a></p>
200]]></content>
201  </entry>
202  
203  <entry>
204    <title type="html"><![CDATA[Moving Window Buttons back to the right in Ubuntu 10.04+]]></title>
205    <link href="http://bryfry.github.com/blog/2011/06/10/moving-window-buttons-ubuntu/"/>
206    <updated>2011-06-10T00:00:00-04:00</updated>
207    <id>http://bryfry.github.com/blog/2011/06/10/moving-window-buttons-ubuntu</id>
208    <content type="html"><![CDATA[<p>I have gone and looked this up too many times.  So for you and me both here is the long and short of it.  The simple command that will move the windows buttons (minimize, maximize, and close) back to the right side, where all proper window buttons should be.</p>
209
210<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
211<span class='line-number'>2</span>
212</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="c"># move windows back to the right side in Ubuntu 10.04+</span>
213</span><span class='line'><span class="nv">$ </span>gconftool-2 --set /apps/metacity/general/button_layout <span class="nb">type </span>string menu:minimize,maximize,close
214</span></code></pre></td></tr></table></div></figure>
215
216
217<p>Update: I have confirmed that this does also work with all Ubuntu distros up through 12.04</p>
218]]></content>
219  </entry>
220  
221  <entry>
222    <title type="html"><![CDATA[EFF Tor Challenge + Amazon EC2 Free Usage Tier]]></title>
223    <link href="http://bryfry.github.com/blog/2011/06/01/eff-tor-challenge-amazon-ec2-free-usage-tier/"/>
224    <updated>2011-06-01T00:00:00-04:00</updated>
225    <id>http://bryfry.github.com/blog/2011/06/01/eff-tor-challenge-amazon-ec2-free-usage-tier</id>
226    <content type="html"><![CDATA[<p>Goal: Setup a Tor Node (Exit) on a <a href="http://aws.amazon.com/free/">Free Usage Tier</a> Amazon VPS Image (EC2).  This and easy and free way to join the EFF in their annonced <a href=”https://www.eff.org/torchallenge”>TOR Challenge</a>.</p>
227
228<p>What you&#8217;ll need:</p>
229
230<ul>
231<li>Amazon AWS Account</li>
232<li>Some basic Linux know-how</li>
233</ul>
234
235
236<p>First setup your new instance with the below specs.  Check the <a href="https://help.ubuntu.com/community/EC2StartersGuide">EC2StarterGuide</a> and the <a href="http://cloud.ubuntu.com/ami/">Ubuntu Cloud AMI Finder</a> for help.</p>
237
238<p>AMI: Micro (free usage tier) - Ubuntu 10.10 - x86_64 - EBS - (ami-cef405a7)</p>
239
240<ul>
241<li>Use the default Instance Properties</li>
242<li>Create a new Key Pair</li>
243<li>Create new Security Group (name it something recognizable, like tor)</li>
244<li>Add SSH + 9001 ports to the security group.</li>
245</ul>
246
247
248<p>Now that the VPS is up and running login to it, run some updates, install and configure Tor.</p>
249
250<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
251<span class='line-number'>2</span>
252<span class='line-number'>3</span>
253<span class='line-number'>4</span>
254<span class='line-number'>5</span>
255<span class='line-number'>6</span>
256<span class='line-number'>7</span>
257<span class='line-number'>8</span>
258<span class='line-number'>9</span>
259<span class='line-number'>10</span>
260<span class='line-number'>11</span>
261<span class='line-number'>12</span>
262<span class='line-number'>13</span>
263<span class='line-number'>14</span>
264<span class='line-number'>15</span>
265</pre></td><td class='code'><pre><code class='bash'><span class='line'><span class="c"># replace with your new key name and ec2 address.</span>
266</span><span class='line'>ssh -i yournewkey.pem ubuntu@ec2-xxx-xxx-xxx-xxx.yyyyyyyy.amazonaws.com
267</span><span class='line'>sudo apt-get update
268</span><span class='line'>sudo apt-get upgrade
269</span><span class='line'>
270</span><span class='line'><span class="c"># add the tor project repository</span>
271</span><span class='line'>sudo apt-add-repository <span class="se">\</span>
272</span><span class='line'>     <span class="s1">&#39;deb http://deb.torproject.org/torproject.org maverick main&#39;</span>
273</span><span class='line'>sudo apt-get update
274</span><span class='line'>
275</span><span class='line'><span class="c"># install tor</span>
276</span><span class='line'>sudo apt-get install tor tor-geoipdb
277</span><span class='line'>
278</span><span class='line'><span class="c"># make a backup of the standard config file</span>
279</span><span class='line'>sudo mv /etc/tor/torrc /etc/tor/torrc.bak
280</span></code></pre></td></tr></table></div></figure>
281
282
283<p>Edit /etc/tor/torrc or create a new config from scratch and make it look like this</p>
284
285<figure class='code'><figcaption><span>/etc/tor/torrc</span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
286<span class='line-number'>2</span>
287<span class='line-number'>3</span>
288<span class='line-number'>4</span>
289<span class='line-number'>5</span>
290<span class='line-number'>6</span>
291<span class='line-number'>7</span>
292</pre></td><td class='code'><pre><code class='text'><span class='line'>SocksPort 0 # we are not going to make local connections, aka a simple relay
293</span><span class='line'>ORPort 9001 # what port to advertise for incoming Tor connections
294</span><span class='line'>Nickname xxxxxxxxxxxxx # Give your node a nickname for the EFF Tor Challange
295</span><span class='line'>BandwidthRate 300 KB
296</span><span class='line'>BandwidthBurst 350 KB
297</span><span class='line'>AccountingStart month 1 00:00
298</span><span class='line'>AccountingMax 3 GB
299</span></code></pre></td></tr></table></div></figure>
300
301
302<p>The last two lines of this is important.  We want to make sure our node does not use enough traffic to use up the entire allowed free bandwidth that a free image is allotted because then you will have to start paying for those bits.  You could up it to around 15 GB which is where you start paying but we can start low for now.  Finally, we can startup Tor.  I like to use screen to run it so startup a new screen and run tor.</p>
303
304<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
305<span class='line-number'>2</span>
306</pre></td><td class='code'><pre><code class='bash'><span class='line'>screen -S tor
307</span><span class='line'>/usr/sbin/tor
308</span></code></pre></td></tr></table></div></figure>
309
310
311<p>Watch for errors, if none show up, head over to <a href="http://metrics.torproject.org/relay-search.html">http://metrics.torproject.org/relay-search.html</a> and after an hour or so you should be able to search for your node&#8217;s nickname.</p>
312
313<p>When your done don&#8217;t forget to submit your new node&#8217;s nickname to the <a href="https://www.eff.org/torchallenge/report/">EFF&#8217;s Tor Challenge</a>!</p>
314
315<p>Resources Used:</p>
316
317<ul>
318<li><a href="https://www.eff.org/torchallenge">https://www.eff.org/torchallenge</a></li>
319<li><a href="http://en.wikibooks.org/wiki/How_to_Protect_your_Internet_Anonymity_and_Privacy/Your_own_TOR_node_on_Amazon_EC2">http://en.wikibooks.org/wiki/How_to_Protect_your_Internet_Anonymity_and_Privacy</a></li>
320<li><a href="http://cloud.ubuntu.com/ami/">http://cloud.ubuntu.com/ami/</a></li>
321<li><a href="https://help.ubuntu.com/community/EC2StartersGuide">https://help.ubuntu.com/community/EC2StartersGuide</a></li>
322<li><a href="http://aws.amazon.com/free/">http://aws.amazon.com/free/</a></li>
323</ul>
324
325]]></content>
326  </entry>
327  
328</feed>