master
Raw Download raw file
  1
  2<!DOCTYPE HTML>
  3<html>
  4<head>
  5	<meta charset="utf-8">
  6	<title>BryFry</title>
  7    <meta name="author" content="bryfry">
  8    
  9	<meta name="description" content="The setup for this post is that in a vanilla Minecraft server there
 10isn&#8217;t a way to set the protection size to 0 (yes, I know bukkit can do &hellip;">
 11	
 12	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
 13
 14	<link href="/atom.xml" rel="alternate" title="BryFry" type="application/atom+xml">
 15	<link rel="canonical" href="">
 16	<link href="/favicon.ico" rel="shortcut icon">
 17    <link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
 18
 19<!-- Fonts -->
 20    <link href='http://fonts.googleapis.com/css?family=Slackey' rel='stylesheet' type='text/css'>
 21    <link href='http://fonts.googleapis.com/css?family=Fjalla+One' rel='stylesheet' type='text/css'>
 22    <link href='http://fonts.googleapis.com/css?family=Amethysta' rel='stylesheet' type='text/css'>
 23    <link href='http://fonts.googleapis.com/css?family=Exo' rel='stylesheet' type='text/css'>    
 24    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
 25    <!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
 26
 27    <script type="text/javascript" src="/javascripts/jquery-tapir.js"></script>
 28
 29    <!-- remove or comment it to disable ajaxification -->   
 30    <script src="/javascripts/ajaxify.js"></script>
 31   
 32    
 33</head>
 34
 35
 36<body>
 37    <div id="wrapper">
 38    <header id="header" class="inner"><!-- for more effects see _animate.scss -->
 39<h1>
 40    <a href="">
 41        <div id="headerbg">
 42            BryFry
 43        </div>
 44    </a>
 45</h1>
 46
 47<!-- use full url including 'index.html' for navigation bar if you are using ajax -->
 48<ul id="nav">
 49	<li id="ajax"><a href="/index.html">Home</a></li>
 50	<li id="ajax"><a href="/blog/archives/index.html">Archives</a></li>
 51    <li><a href="/atom.xml">RSS</a></li>
 52        
 53</ul>
 54
 55
 56
 57
 58</header>
 59
 60<div id="toload">
 61<!-- begin toload --> 
 62    <div id="content" class="inner">
 63        
 64
 65
 66    <article class="post">
 67	<h2 class="title">
 68		
 69		<a href="/blog/2012/04/29/move-minecraft-spawn-with-python/">
 70		
 71			Move Minecraft Spawn with Python</a>
 72	</h2>
 73    <div class="entry-content">
 74		<p><img class="right" src="http://i.imgur.com/uubl0.png" width="150" height="150" title="Minecraft" ></p>
 75
 76<p>The setup for this post is that in a vanilla Minecraft server there
 77isn&#8217;t a way to set the protection size to <code>0</code> (yes, I know bukkit can do
 78this but, meh).  This makes having the spawn in the middle of a nice
 79area with shared chests, smelting, etc. a pain.  So I wanted to move the
 80spawn but I didn’t want to have to download the whole world, open it
 81with a map editor, and then re-upload the whole thing again.  Especially
 82since I know the values are just stored inside the level.dat.  So, below
 83is how I used twoolie’s python NBT interface to move the spawn on our
 84server.</p>
 85
 86<p>To install NBT, grab it from either <a
 87href='https://github.com/twoolie/NBT'>github</a> or <a
 88href='http://pypi.python.org/pypi/NBT'>pypi</a></p>
 89
 90<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>
 91<span class='line-number'>2</span>
 92<span class='line-number'>3</span>
 93<span class='line-number'>4</span>
 94<span class='line-number'>5</span>
 95<span class='line-number'>6</span>
 96<span class='line-number'>7</span>
 97<span class='line-number'>8</span>
 98</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>
 99</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>
100</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>
101</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>
102</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>
103</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>
104</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>
105</span><span class='line'><span class="nb">exit</span><span class="p">()</span>
106</span></code></pre></td></tr></table></div></figure>
107
108
109		
110		
111	</div>
112
113<div class="meta">
114	
115</div>
116</article>
117
118
119    <article class="post">
120	<h2 class="title">
121		
122		<a href="/blog/2011/12/07/on-hacking-larssons-folly/">
123		
124			On Hacking: Larsson&#8217;s Folly</a>
125	</h2>
126    <div class="entry-content">
127		<p><img class="right" src="http://i.imgur.com/a7jUo.jpg"></p>
128
129<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>
130
131<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>
132
133<p>The take away nugget is this, summarized by Kelly McBride of The Poynter Institute:</p>
134
135<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>
136
137
138<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>
139
140<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>
141
142		
143		
144	</div>
145
146<div class="meta">
147	
148</div>
149</article>
150
151
152    <article class="post">
153	<h2 class="title">
154		
155		<a href="/blog/2011/11/26/namecoind-on-ubuntu-11-10-x64/">
156		
157			Namecoin on Ubuntu 11.10</a>
158	</h2>
159    <div class="entry-content">
160		<p><img class="right" src="http://i.imgur.com/RJTsK.jpg" width="150" height="150" title="dot-bit" ></p>
161
162<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>
163
164<ul>
165<li>Setup: namecoin version 0.3.24.64-beta</li>
166<li>Target: Ubuntu 11.10 (x64), Amazon EC2 (Server) and Desktop</li>
167</ul>
168
169
170<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>
171<span class='line-number'>2</span>
172<span class='line-number'>3</span>
173<span class='line-number'>4</span>
174<span class='line-number'>5</span>
175<span class='line-number'>6</span>
176<span class='line-number'>7</span>
177</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>
178</span><span class='line'>libdb4.7++-dev libboost-dev libboost-system-dev <span class="se">\</span>
179</span><span class='line'>libboost-filesystem-dev libboost-program-options-dev <span class="se">\</span>
180</span><span class='line'>libboost-thread-dev libglibmm-2.4-dev
181</span><span class='line'>git clone git://github.com/vinced/namecoin.git
182</span><span class='line'><span class="nb">cd </span>namecoin/src
183</span><span class='line'>make -f makefile.unix <span class="nv">USE_UPNP</span><span class="o">=</span>
184</span></code></pre></td></tr></table></div></figure>
185
186
187<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>
188
189<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>
190
191<p>If you have compilation errors you can read more after the jump.</p>
192
193
194		
195		<a href="/blog/2011/11/26/namecoind-on-ubuntu-11-10-x64/" class="more-link">Read on &rarr;</a>
196	</div>
197
198<div class="meta">
199	
200</div>
201</article>
202
203
204    <article class="post">
205	<h2 class="title">
206		
207		<a href="/blog/2011/06/10/moving-window-buttons-ubuntu/">
208		
209			Moving Window Buttons back to the right in Ubuntu 10.04+</a>
210	</h2>
211    <div class="entry-content">
212		<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>
213
214<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>
215<span class='line-number'>2</span>
216</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>
217</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
218</span></code></pre></td></tr></table></div></figure>
219
220
221<p>Update: I have confirmed that this does also work with all Ubuntu distros up through 12.04</p>
222
223		
224		
225	</div>
226
227<div class="meta">
228	
229</div>
230</article>
231
232
233    <article class="post">
234	<h2 class="title">
235		
236		<a href="/blog/2011/06/01/eff-tor-challenge-amazon-ec2-free-usage-tier/">
237		
238			EFF Tor Challenge + Amazon EC2 Free Usage Tier</a>
239	</h2>
240    <div class="entry-content">
241		<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>
242
243<p>What you&#8217;ll need:</p>
244
245<ul>
246<li>Amazon AWS Account</li>
247<li>Some basic Linux know-how</li>
248</ul>
249
250
251<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>
252
253<p>AMI: Micro (free usage tier) - Ubuntu 10.10 - x86_64 - EBS - (ami-cef405a7)</p>
254
255<ul>
256<li>Use the default Instance Properties</li>
257<li>Create a new Key Pair</li>
258<li>Create new Security Group (name it something recognizable, like tor)</li>
259<li>Add SSH + 9001 ports to the security group.</li>
260</ul>
261
262
263<p>Now that the VPS is up and running login to it, run some updates, install and configure Tor.</p>
264
265<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>
266<span class='line-number'>2</span>
267<span class='line-number'>3</span>
268<span class='line-number'>4</span>
269<span class='line-number'>5</span>
270<span class='line-number'>6</span>
271<span class='line-number'>7</span>
272<span class='line-number'>8</span>
273<span class='line-number'>9</span>
274<span class='line-number'>10</span>
275<span class='line-number'>11</span>
276<span class='line-number'>12</span>
277<span class='line-number'>13</span>
278<span class='line-number'>14</span>
279<span class='line-number'>15</span>
280</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>
281</span><span class='line'>ssh -i yournewkey.pem ubuntu@ec2-xxx-xxx-xxx-xxx.yyyyyyyy.amazonaws.com
282</span><span class='line'>sudo apt-get update
283</span><span class='line'>sudo apt-get upgrade
284</span><span class='line'>
285</span><span class='line'><span class="c"># add the tor project repository</span>
286</span><span class='line'>sudo apt-add-repository <span class="se">\</span>
287</span><span class='line'>     <span class="s1">&#39;deb http://deb.torproject.org/torproject.org maverick main&#39;</span>
288</span><span class='line'>sudo apt-get update
289</span><span class='line'>
290</span><span class='line'><span class="c"># install tor</span>
291</span><span class='line'>sudo apt-get install tor tor-geoipdb
292</span><span class='line'>
293</span><span class='line'><span class="c"># make a backup of the standard config file</span>
294</span><span class='line'>sudo mv /etc/tor/torrc /etc/tor/torrc.bak
295</span></code></pre></td></tr></table></div></figure>
296
297
298<p>Edit /etc/tor/torrc or create a new config from scratch and make it look like this</p>
299
300<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>
301<span class='line-number'>2</span>
302<span class='line-number'>3</span>
303<span class='line-number'>4</span>
304<span class='line-number'>5</span>
305<span class='line-number'>6</span>
306<span class='line-number'>7</span>
307</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
308</span><span class='line'>ORPort 9001 # what port to advertise for incoming Tor connections
309</span><span class='line'>Nickname xxxxxxxxxxxxx # Give your node a nickname for the EFF Tor Challange
310</span><span class='line'>BandwidthRate 300 KB
311</span><span class='line'>BandwidthBurst 350 KB
312</span><span class='line'>AccountingStart month 1 00:00
313</span><span class='line'>AccountingMax 3 GB
314</span></code></pre></td></tr></table></div></figure>
315
316
317<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>
318
319<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>
320<span class='line-number'>2</span>
321</pre></td><td class='code'><pre><code class='bash'><span class='line'>screen -S tor
322</span><span class='line'>/usr/sbin/tor
323</span></code></pre></td></tr></table></div></figure>
324
325
326<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>
327
328<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>
329
330<p>Resources Used:</p>
331
332<ul>
333<li><a href="https://www.eff.org/torchallenge">https://www.eff.org/torchallenge</a></li>
334<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>
335<li><a href="http://cloud.ubuntu.com/ami/">http://cloud.ubuntu.com/ami/</a></li>
336<li><a href="https://help.ubuntu.com/community/EC2StartersGuide">https://help.ubuntu.com/community/EC2StartersGuide</a></li>
337<li><a href="http://aws.amazon.com/free/">http://aws.amazon.com/free/</a></li>
338</ul>
339
340
341		
342		
343	</div>
344
345<div class="meta">
346	
347</div>
348</article>
349
350<nav id="pagenavi">
351    
352    
353    <div class="center"><a href="/blog/archives">Blog Archives</a></div>
354</nav>
355
356    </div>
357    <footer id="footer">
358    <div style="display:inline">
359    Copyright &copy; 2013
360
361    bryfry
362. Powered by <a href="http://octopress.org">Octopress</a> | 
363    Theme adapted from <a href="http://github.com/panks/fabric">fabric</a> by <a href="http://panks.me">Pankaj Kumar</a>
364</div>
365
366
367    </footer>
368    <script src="/javascripts/fabric.js"></script>
369<script src="/javascripts/jquery.fancybox.pack.js"></script>
370<script type="text/javascript">
371(function($){
372	$('.fancybox').fancybox();
373})(jQuery);
374</script> <!-- Delete or comment this line to disable Fancybox -->
375
376
377<script type="text/javascript">
378      var disqus_shortname = 'bryfry';
379      
380        
381        var disqus_script = 'count.js';
382      
383    (function () {
384      var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
385      dsq.src = 'http://' + disqus_shortname + '.disqus.com/' + disqus_script;
386      (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
387    }());
388</script>
389
390
391
392	<script type="text/javascript">
393		var _gaq = _gaq || [];
394		_gaq.push(['_setAccount', 'UA-31317111-1']);
395		_gaq.push(['_trackPageview']);
396
397		(function() {
398			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
399			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
400			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
401		})();
402	</script>
403
404
405
406
407
408<!-- end toload --> 
409</div>
410</div>
411<script src="/javascripts/jquery.ui.totop.js" type="text/javascript"></script>
412<script type="text/javascript">
413/*<![CDATA[*/
414;(function($){$().UItoTop({easingType:'easeOutCirc'});})(jQuery); 
415/*]]>*/
416</script><!-- remove it to remove the scroll to top button -->
417</body>
418</html>