<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5326101330412373483</id><updated>2012-01-15T17:07:23.538-08:00</updated><category term='hgsubversion debian'/><category term='teensy usb'/><category term='mercurial'/><title type='text'>One Bad Website</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://onebadwebsite.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://onebadwebsite.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Karl</name><uri>http://www.blogger.com/profile/11596310104734053780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>4</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5326101330412373483.post-7725868524385065873</id><published>2012-01-15T17:07:00.000-08:00</published><updated>2012-01-15T17:07:23.551-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='teensy usb'/><title type='text'>Teensy hacking</title><content type='html'>&lt;div&gt;The &lt;a href="http://www.pjrc.com/teensy/"&gt;Teensy&lt;/a&gt; is "a complete USB-based microcontroller development system, in a very small footprint, capable of implementing &lt;a href="http://www.pjrc.com/teensy/projects.html"&gt;many types of projects&lt;/a&gt;".  I'm using it as an intro to USB.  I see USB protocol as my white whale.  I'm comfortable with other lower level protocols, but those are going away.  Most computers do not even come with a RS232 port, so if you want to create any device that is configured by plugging it into a computer, USB is the way to go.  I'm hoping to get some of the basics of implementing a USB profile with the Teensy.  I know very little about this, so I'm hoping to write this article to learn the USB stack.  Any thing said here should be understood that I might have no idea what I'm talking about.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;USB consists of 4 wires, 5V+, GND, D+ and D-. &amp;nbsp;The USB spec talks about these in detail, but in general, D+ and D- are what send data between devices, and is referred to as the bus.  On an established USB bus, their is one node (master) that controls all data flowing on the bus and no device can send data without the master node allowing it.  I would call this a poll based architecture.&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Well, that was rather brief, but layout out a few things.  I'm going to be diving into &lt;a href="http://www.beyondlogic.org/usbnutshell/usb1.shtml"&gt;this tutorial&lt;/a&gt;,  in hopes to have some C code posted that will do something fancy with a Teensy, outside of the stock examples.&lt;/div&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5326101330412373483-7725868524385065873?l=onebadwebsite.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://onebadwebsite.blogspot.com/feeds/7725868524385065873/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5326101330412373483&amp;postID=7725868524385065873' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/7725868524385065873'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/7725868524385065873'/><link rel='alternate' type='text/html' href='http://onebadwebsite.blogspot.com/2012/01/teensy-hacking.html' title='Teensy hacking'/><author><name>Karl</name><uri>http://www.blogger.com/profile/11596310104734053780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5326101330412373483.post-7568232191187824675</id><published>2011-12-07T18:19:00.001-08:00</published><updated>2011-12-07T18:46:25.133-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='mercurial'/><title type='text'>Shelve in Mercurial</title><content type='html'>I've been using Mercurial, specifically TortoiseHg, and I very much like the ability to shelve changes in my working set.  The interface in TortoiseHg allows you to move chunks of a file into your shelf.  I'm a little upset that I've been using a GUI for this, but it's spoiled me.  Before I learned about shelving, I would try to work on small bugs in branches, but I didn't want to push those branches to my "central" repo.  I then looked into the &lt;a href="http://mercurial.selenic.com/wiki/LocalbranchExtension"&gt;local branch extension&lt;/a&gt;, but it seemed like over kill.  The &lt;a href="http://mercurial.selenic.com/wiki/ShelveExtension"&gt;shelve extension&lt;/a&gt; comes with TortoiseHg and , as I said before, the UI is very pretty.  I think I need to get back to the CLI. &amp;nbsp;Maybe I'll do a follow up post on using the shelve extension from the command line.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5326101330412373483-7568232191187824675?l=onebadwebsite.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://onebadwebsite.blogspot.com/feeds/7568232191187824675/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5326101330412373483&amp;postID=7568232191187824675' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/7568232191187824675'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/7568232191187824675'/><link rel='alternate' type='text/html' href='http://onebadwebsite.blogspot.com/2011/12/shelve-in-mercurial.html' title='Shelve in Mercurial'/><author><name>Karl</name><uri>http://www.blogger.com/profile/11596310104734053780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5326101330412373483.post-4709263610411215110</id><published>2011-05-26T17:47:00.000-07:00</published><updated>2011-05-26T18:21:00.822-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='hgsubversion debian'/><title type='text'>Installing hgsubversion on Debian</title><content type='html'>&lt;blockquote&gt;&lt;/blockquote&gt;I was digging around the interwebs for quite some time, and I would like to post my struggles, in hopes that someone won't bang their head against a wall as long as I did.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So what I was trying to do was use mercurial with svn, and the hgsubversion plugin seemed like the best way to do this.  Now following the instructions, I see I just need to clone the plugin to my local machine, using:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: sans-serif; "&gt;&lt;pre style="border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(174, 189, 204); border-right-color: rgb(174, 189, 204); border-bottom-color: rgb(174, 189, 204); border-left-color: rgb(174, 189, 204); background-color: rgb(243, 245, 247); padding-top: 5pt; padding-right: 5pt; padding-bottom: 5pt; padding-left: 5pt; font-family: courier, monospace; white-space: pre-wrap; word-wrap: break-word; "&gt;hg clone -u 1.2.1 http://bitbucket.org/durin42/hgsubversion/ ~/hgsubversion&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote&gt;&lt;/blockquote&gt;I then added the plugin to my .hg file in my home directory&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" style="font-family: sans-serif; "&gt;&lt;pre style="border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; border-left-width: 1pt; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(174, 189, 204); border-right-color: rgb(174, 189, 204); border-bottom-color: rgb(174, 189, 204); border-left-color: rgb(174, 189, 204); background-color: rgb(243, 245, 247); padding-top: 5pt; padding-right: 5pt; padding-bottom: 5pt; padding-left: 5pt; font-family: courier, monospace; white-space: pre-wrap; word-wrap: break-word; "&gt;[extensions] hgsubversion = ~/hgsubversion/hgsubversion&lt;/pre&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;Now, all the tutorials that I saw, said that was it!  Your all done ... lies.  Try to clone an svn repo, and I got the following message:&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;abort: no compatible bindings available:&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Subversion 1.5.0 or later required, but no bindings were found&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Subvertpy 0.7.4 or later required, but 0.7.3 found&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;Please install either Subvertpy or the Subversion Python SWIG bindings!&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;Googling the phrases in the above message, didn't really give me too much info on how to get this working on my Debian machine.  I won't bore you with the details, here is what I had to do to get the bindings installed:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span class="Apple-style-span" &gt;#:apt-get install python-subversion&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Duh.  Hope this helps someone.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5326101330412373483-4709263610411215110?l=onebadwebsite.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://onebadwebsite.blogspot.com/feeds/4709263610411215110/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5326101330412373483&amp;postID=4709263610411215110' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/4709263610411215110'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/4709263610411215110'/><link rel='alternate' type='text/html' href='http://onebadwebsite.blogspot.com/2011/05/installing-hgsubversion-on-debian.html' title='Installing hgsubversion on Debian'/><author><name>Karl</name><uri>http://www.blogger.com/profile/11596310104734053780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5326101330412373483.post-8142899357982285505</id><published>2011-04-12T16:57:00.000-07:00</published><updated>2011-04-13T04:41:18.817-07:00</updated><title type='text'>Hooks in Genati</title><content type='html'>At my current job, we have a few servers that are running virtualization software.  We were originally using &lt;a href="http://www.xen.org/"&gt;Xen&lt;/a&gt;, but with the latest version of Debian Squeeze, we were force to upgrade and in doing so, found that &lt;a href="http://www.linux-kvm.org/page/Main_Page"&gt;KVM&lt;/a&gt; seem to work a bit better in our system.  I did not set up our cluster, so I'm not going to go into detail about our setup, but I can go into how to set up hooks.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hooks allow you to run a custom script right before a new instance is setup.  You can do things like set up your network interfaces, firewalls and apt-get new programs.  First thing is first, where the hell do you put the script?  Here:&lt;/div&gt;&lt;pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; $ /etc/ganeti/instance-debootstrap/hooks/&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;In this directory, I have a file called "clear-root-password".  I uses this as the basis for my files.  The things that I needed to do when I setup a new instance:&lt;div&gt;&lt;ul&gt;&lt;li&gt;set up my network interface&lt;/li&gt;&lt;li&gt;download some standard programs&lt;/li&gt;&lt;li&gt;set up my firewall&lt;/li&gt;&lt;/ul&gt;&lt;div&gt;Now that I have my goals, how the hell do I get it working?  So the first thing that I learned, was the Ganeti documentation is ... ok.  I can't say that the things that I did will work for you, but it worked for me.  To run the bash scripts, you have to make Ganeti run your script, make the file executable.  When the hook script is running, there is no output to standard output.  If everything works correctly, it just tells you everything is ok.  If there is an error, the tail of the log file for that operation is printed to the screen.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;You can add an network interface by adding the following line to your hook file:&lt;/div&gt;&lt;pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt;echo "iface eth0 inet static" &amp;gt;&amp;gt; "$TARGET"/etc/network/interface&lt;br /&gt;echo "address $NIC_0_IP" &amp;gt;&amp;gt; "$TARGET"/etc/network/interface&lt;br /&gt;echo "netmask 255.255.255.0" &amp;gt;&amp;gt; "$TARGET"/etc/network/interface&lt;br /&gt;echo "gateway 192.168.1.254" &amp;gt;&amp;gt; "$TARGET"/etc/network/interface &lt;/code&gt;&lt;/pre&gt;&lt;div&gt;The idea behind this is that the $TARGET variable is the temporary path that is the file system of your new instance.  You can copy files from the node's filesystem to the new instance too.  It's just like a normal file.  Pretty sweet if you ask me.  Also, the $NIC_0_IP is the ip address that I passed into --net parameter when running gnt-instance add.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Next, what about apt-get?  I want to run a command on this new instance and install vim.  You can do this by issuing the following command:&lt;/div&gt;&lt;pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; chroot "$TARGET" apt-get install vim&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;If you don't know about chroot, now you do.  It's freaking sweet.  You can now run a command as if "$TARGET" was your root directory ( / ), so apt-get will install vim on your new instance.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Finally, when setting up a firewall file, you want to make sure that it can only be read by root.  To do this on your new instance, you can issue the following command:&lt;/div&gt;&lt;pre style="font-family:arial;font-size:12px;border:1px dashed #CCCCCC;width:99%;height:auto;overflow:auto;background:#f0f0f0;;background-image:URL(http://2.bp.blogspot.com/_z5ltvMQPaa8/SjJXr_U2YBI/AAAAAAAAAAM/46OqEP32CJ8/s320/codebg.gif);padding:0px;color:#000000;text-align:left;line-height:20px;"&gt;&lt;code style="color:#000000;word-wrap:normal;"&gt; cp /etc/firewall.sh "$TARGET"/root/&lt;br /&gt;chmod 600 "$TARGET"/root/firewall.sh&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;When changing the permissions on the instance, just issue the chmod command as normal.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Using "printenv" bash command allowed me to see the variables that were given to me by Ganeti in the bash script, as the documentation didn't seem to match up exactly with what I was getting in my environment. &lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Hope this helps someone, leave a comment if you have a question or some point to make.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5326101330412373483-8142899357982285505?l=onebadwebsite.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://onebadwebsite.blogspot.com/feeds/8142899357982285505/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5326101330412373483&amp;postID=8142899357982285505' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/8142899357982285505'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5326101330412373483/posts/default/8142899357982285505'/><link rel='alternate' type='text/html' href='http://onebadwebsite.blogspot.com/2011/04/hooks-in-genati.html' title='Hooks in Genati'/><author><name>Karl</name><uri>http://www.blogger.com/profile/11596310104734053780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry></feed>
