<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Ridiculous Open Source Software</title>
    <link>http://rossdylan.club/</link>
    <description>Recent content on Ridiculous Open Source Software</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 28 Mar 2016 19:21:38 -0400</lastBuildDate>
    <atom:link href="http://rossdylan.club/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
      <title>libgit2 Debug Allocator</title>
      <link>http://rossdylan.club/projects/libgit2-debug-allocator/</link>
      <pubDate>Mon, 28 Mar 2016 19:21:38 -0400</pubDate>
      
      <guid>http://rossdylan.club/projects/libgit2-debug-allocator/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://github.com/libgit2/libgit2&#34;&gt;libgit2&lt;/a&gt; is a fabulous library for working
with git programatically. Earlier in the year during my winter break I was
looking around for a project to work on. I decided to take a stab at fixing an
issue in libgit2. The issue in question was &lt;a href=&#34;https://github.com/libgit2/libgit2/issues/3543&#34;&gt;The pool allocator should support being deactivated for debug&lt;/a&gt;.
The crux of the issue was that internal to libgit2 there is a pool allocator
which is used to speed up allocation of large numbers of tiny objects. However
with this pool allocator enabled it was hard to track down memory leaks. To
address this the issue requested a compile time flag be added to disable the
pool allocator.&lt;/p&gt;

&lt;p&gt;The pool allocator works by allocating a single large chunk of memory and then
handing out bits of it on request. This cuts down on the number of actual calls
to the OS for more memory, and can help speed up allocation intensive
activities.&lt;/p&gt;

&lt;p&gt;My solution was pretty simple. I added a flag to cmake, and then gated the debug
allocator using ifdef&amp;rsquo;s. The actual debug allocator was also simple. In order
to keep the existing interface of the pool allocator I kept track of every
allocation using a &lt;code&gt;git_vector&lt;/code&gt;. &lt;code&gt;git_vector&lt;/code&gt; is a structure provided by libgit2
which acts as an expandable list. The actual allocation is passed to libgit2&amp;rsquo;s
internal malloc wrapper. When a deallocation of the pool is requested the
debug allocator traverses the vector and does a free.&lt;/p&gt;

&lt;p&gt;My changes were all together pretty small, they can be viewed on the closed
pull request, &lt;a href=&#34;https://github.com/libgit2/libgit2/pull/3577&#34;&gt;Add a new build flag to disable the pool allocator&lt;/a&gt;.
My actual work is a bit less than shown there due to having to move some code
around to work within the ifdefs I added. It was a fun little project, and a
nice way to give back to a library I use.&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>ClusterTop</title>
      <link>http://rossdylan.club/projects/clustertop/</link>
      <pubDate>Tue, 02 Feb 2016 19:56:40 -0500</pubDate>
      
      <guid>http://rossdylan.club/projects/clustertop/</guid>
      <description>

&lt;p&gt;&lt;img src=&#34;http://rossdylan.club/images/clustertop-graphite.png&#34; alt=&#34;Grafana Powered by Clustertop&#34; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;I work for &lt;a href=&#34;http://rc.rit.edu&#34;&gt;Research Computing&lt;/a&gt; at RIT. When I first came on
board I was tasked with extracting data from our monitoring solution, Zabbix,
and pushing into graphite. So I wrote &lt;a href=&#34;https://github.com/rossdylan/clustertop&#34;&gt;Clustertop&lt;/a&gt;.
Clustertop works by periodically polling zabbix for data and then pushing that
data somewhere else using plugins. Its completely configured using a simple
config file which looks something like this.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-ini&#34;&gt;[main]
zabbix_host=http://some.host.some.where/zabbix
zabbix_user=guest
zabbix_pass=
item_keys=system.cpu.load[|avg1],vm.memory.size.available
update_interval=15
hosts=interlagos-01,interlagos-02,overkill

poller=clustertop.poller:GraphitePoller

[special:ion]
slurm.jobs.running=system.run[squeue -t R --noheader | wc -l]
slurm.jobs.pending=system.run[squeue -t PD --noheader | wc -l]
slurm.jobs.suspended=system.run[squeue -t S --noheader | wc -l]

[graphite]
host = localhost
port = 2004
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;It uses a simple ini file. You can configure how to talk to zabbix, as well as
what keys/hosts to grab data for. The poller option allows for the usage of
customer pollers. In the above example the GraphitePoller is used. Below that
there is another example of how to specify what data to grab from zabbix.
&lt;code&gt;[special:&amp;lt;hostname&amp;gt;]&lt;/code&gt; blocks allow you to do one off checks for a specific host.
In the above case it is used to get special data off of a cluster head node.
The rest of the config can be used to configure the custom pollers. Here
the graphite poller is told how to contact the graphite server.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&#34;technology:b5a6dff1f8ec24e2a556ffdd24f275c6&#34;&gt;Technology&lt;/h2&gt;

&lt;p&gt;Clustertop is built on python 2.7 and its dependencies are listed below.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/gevent/gevent&#34;&gt;Gevent&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://github.com/lukecyca/pyzabbix&#34;&gt;pyzabbix&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;http://docs.python-requests.org/en/master/&#34;&gt;Requests&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By default clustertop only comes with 2 different pollers. The first is the
default poller, &lt;code&gt;clustertop.poller:Poller&lt;/code&gt;. This poller prints out the data
it grabbed from zabbix. It is useful for debugging, and is also the base on
which all custom pollers are built. The other builtin poller is &lt;code&gt;clustertop.poller:GraphitePoller&lt;/code&gt;. This is also a pretty simple poller, it just pushes data into graphite.&lt;/p&gt;

&lt;hr /&gt;

&lt;h2 id=&#34;running-it:b5a6dff1f8ec24e2a556ffdd24f275c6&#34;&gt;Running it&lt;/h2&gt;

&lt;p&gt;Clustertop has two commands, check and run. check does the same thing as run,
except instead of executing in a loop, it does it once and exists. Useful for
debugging and verifying the configuration.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$&amp;gt; clustertop check --config /etc/clustertop
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;$&amp;gt; clustertop run --config /etc/clustertop
&lt;/code&gt;&lt;/pre&gt;
</description>
    </item>
    
    <item>
      <title>BF Interpreter on The PCJr</title>
      <link>http://rossdylan.club/projects/pcjunior-bf/</link>
      <pubDate>Fri, 22 Jan 2016 14:02:56 -0500</pubDate>
      
      <guid>http://rossdylan.club/projects/pcjunior-bf/</guid>
      <description>

&lt;p&gt;&lt;img src=&#34;http://rossdylan.club/images/IMG_0092.png&#34; alt=&#34;old school computing&#34; /&gt;&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;The &lt;a href=&#34;https://en.wikipedia.org/wiki/IBM_PCjr&#34;&gt;PCJr&lt;/a&gt; was a failure of a computer
created by IBM in the 80&amp;rsquo;s. At its heart is the Intel 8088 CPU. &lt;a href=&#34;https://csh.rit.edu&#34;&gt;CSH&lt;/a&gt;
happened to acquire one back in the day, and another more recently after a
member interned at IBM. For a hackathon a few friends and I decided to try and
write an OS for the machine. Our original goal was to get a lisp interpreter
running on it, and try and emulate a TCP stack using the PCJunior&amp;rsquo;s serial
port. We fell short on all our goals, so in a last ditch effort I used the base
kernel we developed and wrote a small BF interpreter.&lt;/p&gt;

&lt;p&gt;&lt;img src=&#34;http://rossdylan.club/images/IMG_0094.png&#34; alt=&#34;CSH BrainFuck&#34; /&gt;&lt;/p&gt;

&lt;h2 id=&#34;the-bf-language:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;The BF Language&lt;/h2&gt;

&lt;p&gt;BF is a very simple language. The easiest way to think about BF is as a series
of operations on a pointer into an array. The simplest specification for bf is
below.&lt;/p&gt;

&lt;h3 id=&#34;state:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;State&lt;/h3&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Variable&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;array&lt;/td&gt;
&lt;td&gt;An array of 30K bytes&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;ptr&lt;/td&gt;
&lt;td&gt;The pointer into the array&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;iptr&lt;/td&gt;
&lt;td&gt;The current instruction being executed&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h3 id=&#34;instructions:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;Instructions&lt;/h3&gt;

&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Instruction&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&amp;lt;&lt;/td&gt;
&lt;td&gt;Decrement the pointer&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;&amp;gt;&lt;/td&gt;
&lt;td&gt;Increment the pointer&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;-&lt;/td&gt;
&lt;td&gt;Decrement the value at the pointer&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;+&lt;/td&gt;
&lt;td&gt;Increment the value at the pointer&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;.&lt;/td&gt;
&lt;td&gt;Print out the value at the pointer&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;,&lt;/td&gt;
&lt;td&gt;Set the value at the pointer to a single character from input&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;[&lt;/td&gt;
&lt;td&gt;Loop start, skip to matching &lt;code&gt;]&lt;/code&gt; if value at pointer is 0&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;[&lt;/td&gt;
&lt;td&gt;Loop end, jump to matching &lt;code&gt;[&lt;/code&gt; if value at pointer is not 0&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;A full, but simple BF program looks like this.&lt;/p&gt;

&lt;pre&gt;&lt;code class=&#34;language-brainfuck&#34;&gt;    ,&amp;gt;,&amp;lt;[&amp;gt;[-&amp;gt;+&amp;gt;+&amp;lt;&amp;lt;]&amp;gt;&amp;gt;[-&amp;lt;&amp;lt;+&amp;gt;&amp;gt;]&amp;lt;&amp;lt;&amp;lt;-]&amp;gt;&amp;gt;.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This program takes 2 numbers in cells 1 and 2 and multiplies them together and
puts the result in cell 3. BF programs are very verbose, but the core concepts
are pretty simple.&lt;/p&gt;

&lt;h2 id=&#34;the-interpreter-implementation:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;The Interpreter Implementation&lt;/h2&gt;

&lt;p&gt;The interpreter is pretty simple, and is only &lt;a href=&#34;https://github.com/csssuf/bobbyjunior/blob/master/kernel/src/brainfuck.s&#34;&gt;346 lines total.&lt;/a&gt;
The main loop of the reads key presses using an interrupt, and uses them to fill
a buffer. When enter is pressed the entire program is then parsed and executed.&lt;/p&gt;

&lt;h3 id=&#34;building-the-loop-table:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;Building the Loop Table&lt;/h3&gt;

&lt;p&gt;The interpreter goes through two phases in order to execute the brainfuck code.
The first phase is the loop phase which looks for loop statements within the
input code and builds a table of jump offsets so it can make the actual looping
logic easier to write. Instead of making a complex stack during run time we do
our loop test and then if we need to exit the loop we just lookup the jump
position in our jump table.&lt;/p&gt;

&lt;h3 id=&#34;running-the-code:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;Running the Code&lt;/h3&gt;

&lt;p&gt;To actually run through the code the interpreter starts at the first address
in the input buffer and moves forward, keeping track of its position using an
instruction pointer. Actual evaluation is done by a big long chain of &lt;a href=&#34;https://github.com/csssuf/bobbyjunior/blob/master/kernel/src/brainfuck.s#L229&#34;&gt;cmp
statements.&lt;/a&gt;&lt;/p&gt;

&lt;h2 id=&#34;future-work:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;Future Work&lt;/h2&gt;

&lt;p&gt;I&amp;rsquo;m currently working on a &lt;a href=&#34;https://github.com/csssuf/bobbyjunior/blob/rossdylan/malloc/kernel/src/mm.s&#34;&gt;memory allocator&lt;/a&gt; and scheduler for the kernel. Once
those are finished I plan on making a more complete operation system including
a shell of some kind.&lt;/p&gt;

&lt;h2 id=&#34;shout-outs:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;Shout Outs&lt;/h2&gt;

&lt;p&gt;&lt;a href=&#34;https://github.com/robgssp&#34;&gt;Rob Glossop&lt;/a&gt; and &lt;a href=&#34;https://github.com/csssuf&#34;&gt;James Forcier&lt;/a&gt;
are also working on the OS with me, and contributed significant parts.&lt;/p&gt;

&lt;h2 id=&#34;more-pictures:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;More Pictures&lt;/h2&gt;

&lt;h3 id=&#34;example-of-bf-running-on-actual-hardware:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;Example of BF Running on actual hardware&lt;/h3&gt;

&lt;p&gt;&lt;blockquote class=&#34;imgur-embed-pub&#34; lang=&#34;en&#34; data-id=&#34;UDkcRCv&#34;&gt;&lt;a href=&#34;//imgur.com/UDkcRCv&#34;&gt;View post on imgur.com&lt;/a&gt;&lt;/blockquote&gt;&lt;script async src=&#34;//s.imgur.com/min/embed.js&#34; charset=&#34;utf-8&#34;&gt;&lt;/script&gt;&lt;/p&gt;

&lt;h3 id=&#34;x86-compatible-to-the-ends-of-the-universe:cf85ae74b681fdfec44b5ee810cd6f1d&#34;&gt;X86: Compatible To the Ends of the Universe&lt;/h3&gt;

&lt;p&gt;&lt;img src=&#34;http://rossdylan.club/images/IMG_0275.png&#34; alt=&#34;backwards compatibility!&#34; /&gt;&lt;/p&gt;
</description>
    </item>
    
    <item>
      <title>About</title>
      <link>http://rossdylan.club/about/</link>
      <pubDate>Thu, 21 Jan 2016 16:26:31 -0500</pubDate>
      
      <guid>http://rossdylan.club/about/</guid>
      <description>&lt;p&gt;I&amp;rsquo;m Ross Delinger, A 5th year CS student at &lt;a href=&#34;https://rit.edu&#34;&gt;RIT&lt;/a&gt;. I&amp;rsquo;m an
eboard member of &lt;a href=&#34;https://csh.rit.edu&#34;&gt;Computer Science House&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I helped build &lt;a href=&#34;https://badges.fedoraproject.org/&#34;&gt;Fedora Badges&lt;/a&gt; while at
&lt;a href=&#34;https://redhat.com&#34;&gt;Redhat&lt;/a&gt;. While at &lt;a href=&#34;https://exablox.com&#34;&gt;Exablox&lt;/a&gt; I
developed a system for automated load testing. My latest internship was at
&lt;a href=&#34;https://linkedin.com&#34;&gt;LinkedIn&lt;/a&gt; where I helped to develop an analytics tool to
determine the cost of downtime.&lt;/p&gt;

&lt;p&gt;Recently I&amp;rsquo;ve been focusing on system programming and distributed systems. See
the &lt;a href=&#34;http://rossdylan.club/projects&#34;&gt;projects page&lt;/a&gt; for more details on what I&amp;rsquo;m working on.&lt;/p&gt;
</description>
    </item>
    
  </channel>
</rss>